/frontend-organization-portal

Frontend for the OrganisatiePortaal application

Primary LanguageJavaScriptMIT LicenseMIT

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

  • ember test
  • ember test --server

Linting

  • npm run lint
  • npm run lint:fix

Building

  • ember build (development)
  • ember build --environment production (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