Skip to content

Frontend for the OrganisatiePortaal application

License

Notifications You must be signed in to change notification settings

lblod/frontend-organization-portal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frontend-organization-portal

This ember application provides endpoints to visualize linked data exposed by the Contact Hub Backend.

Prerequisites

You will need the following things properly installed on your computer.

Installation

  • git clone <repository-url> this repository
  • cd frontend-organization-portal
  • npm install

Running / Development

Code Generators

Make use of the many generators for code, try ember help generate for more details

Running Tests

  • npm run test
  • npm run test:ember -- --server

Linting

  • npm run lint
  • npm run lint:fix

Building

  • npm exec ember build (development)
  • npm run build (production)

Deploying

Specify what it takes to deploy your app.

Further Reading / Useful Links

Docker

Build the image: docker build -t lblod/frontend-organization-portal -f Dockerfile.fastboot .

Reference

Feature flags

Feature flags are used to enable/disable features in the application. They are defined in config/environment.js.

// in config/environment.js
let ENV = {
  // Other configuration settings...
  features: {
    "new-feature": true, // Enable the 'new-feature' by default
    "beta-feature": false, // Disable the 'beta-feature' by default
  },
};

The configuration can be manually overridden by adding a query parameter to the URL:

  • ?feature-new-feature=false to disable the 'new-feature'
  • ?feature-beta-feature=true to enable the 'beta-feature'

The overriding will be saved in a cookie, so it will persist across page reloads. The cookie can be cleared by adding ?clear-feature-overrides=true to the URL.

The feature flags can be used in the application by injecting the features service and calling the isEnabled method.

import { inject as service } from "@ember/service";

export default class ExampleComponent extends Component {
  @service features;

  doSomething() {
    if (this.features.isEnabled("new-feature")) {
      // Implement the logic for the new feature
      console.log("New feature is enabled!");
    } else {
      // Implement the logic for the default behavior without the new feature
      console.log("New feature is disabled!");
    }
  }
}

Or in template files by using the is-feature-enabled helper:

{{#if (is-feature-enabled "new-feature")}}
  <p>New feature is enabled!</p>
{{else}}
  <p>New feature is disabled!</p>
{{/if}}

List of feature flags

| Name | Description | | edit-contact-data | Enable the edition of contact site |

Releasing a new version

We use release-it to handle our release flow.

Generating the changelog

We use lerna-changelog to generate a basic changelog based on the merged PRs. Make sure all relevant PRs have a label, otherwise they will not be included in the changelog.

lerna-changelog requires a Github personal access token to work properly.

The following command can be used to generate the changelog:

GITHUB_AUTH=your-access-token npx lerna-changelog

Creating a new release

Simply run GITHUB_AUTH=your-access-token npm run release and follow the prompts.

If you generated the changelog using lerna-changelog you can add it to the changelog file and add it to the staged changes when release-it asks if you want to commit the changes. This will ensure that the changelog change is part of the release commit.

After the new tag is created and pushed CI will take care of building the docker image.