Feature Flags Dialog
The FeatureFlagsDialogComponent is a developer/QA tool that lists the application's boolean feature flags and lets an administrator toggle them live. Each toggle rewrites the effective general.features map on the AppStore, so the rest of the application — which reads features through appStore.general()?.features — reacts immediately, with no customization-JSON edit and no reload.
Access is gated inside the component: the dialog always opens, but a non-administrator only sees an "admin only" notice. There is no content to leak and no caller-side check to maintain.
Features
- Lists the known boolean feature flags (from the
CFeaturestype) with human-readable labels, plus any extra boolean flag found in the live configuration. - Live toggling — changes are written straight to the
AppStoreand observed by the whole app. - A search filter and a Reset action that restores the snapshot taken when the dialog was opened.
- Admin gate built into the component (
isAdministratororisDelegatedAdminon thePrincipalStore); the mutators are no-ops for non-admins as a defensive guard. - Safe writes: rewrites the whole
featuresmap into the exact sourcegeneral()reads from (thegeneralcustomJSON if present, otherwise inlinedata.general), soAppStore.update()'s shallow merge never clobbers the rest ofdata.
Usage
Opened programmatically through the DialogService. It is typically bound to a global keyboard shortcut (e.g. Ctrl+Shift+F in the host application).
import { Component, inject } from "@angular/core";
import { FeatureFlagsDialogComponent } from "@sinequa/atomic-angular";
import { DialogService } from "@sinequa/ui";
@Component({
selector: "sample-component",
template: `<button (click)="openFeatureFlags()">Feature flags</button>`
})
export class SampleComponent {
private readonly dialogService = inject(DialogService);
openFeatureFlags(): void {
this.dialogService.open(FeatureFlagsDialogComponent);
}
}
API Reference
Inputs
None — the dialog is opened programmatically via DialogService.open() and reads its data from the stores.
Outputs
| Name | Payload | Description |
|---|---|---|
closed | DialogEvent | Emitted when the dialog closes ('dialog-close', 'dialog-cancel', …). Consumed by DialogService to tear down the dynamically created component. |
Methods
| Name | Signature | Description |
|---|---|---|
open | open(): void | Snapshots the current features (for reset) and shows the modal. Always opens, regardless of admin status. |
Schemas
Component Interaction
Store Interaction
Notes
- "Admin" means
isAdministratororisDelegatedAdminon thePrincipalStore, aligned with the application's administration section. - Only boolean feature flags are toggled. Object-valued features (
assistant,filters,userProfile, …) are intentionally excluded from the list. - Toggles apply live and are not persisted to the backend customization JSON — they affect the current session only, which is what makes the tool suitable for testing feature behaviour.
Resetrestores the features as they were when the dialog was opened, not a hard-coded default.