From 1cd75cd78f73483f4485e6ef5dcde457dcbee5b7 Mon Sep 17 00:00:00 2001 From: Sven Heidemann Date: Wed, 16 Aug 2023 00:02:04 +0200 Subject: [PATCH] Hide feature flags in server config for non technicians #334 --- kdb-web/package.json | 2 +- kdb-web/src/app/base/component-with-table.ts | 7 ++++++- .../multi-select-columns.component.html | 3 ++- .../server/config/components/config/config.component.html | 2 +- .../server/config/components/config/config.component.ts | 5 +++++ kdb-web/src/assets/version.json | 2 +- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/kdb-web/package.json b/kdb-web/package.json index 998a4411..24908690 100644 --- a/kdb-web/package.json +++ b/kdb-web/package.json @@ -1,6 +1,6 @@ { "name": "kdb-web", - "version": "1.1.dev79_hide_table_columns", + "version": "1.1.dev334_feature_flags_in_wi", "scripts": { "ng": "ng", "update-version": "ts-node-esm update-version.ts", diff --git a/kdb-web/src/app/base/component-with-table.ts b/kdb-web/src/app/base/component-with-table.ts index ae39c2b3..b8550644 100644 --- a/kdb-web/src/app/base/component-with-table.ts +++ b/kdb-web/src/app/base/component-with-table.ts @@ -26,7 +26,12 @@ export class ComponentWithTable { this.columns = columns.map(column => { return { key: this.getKey(column), name: column }; }); - this._hiddenColumns = JSON.parse(localStorage.getItem("hiddenColumns") ?? ""); + let hiddenColumns = localStorage.getItem("hiddenColumns"); + if (!hiddenColumns) { + localStorage.setItem("hiddenColumns", JSON.stringify([{}])); + hiddenColumns = localStorage.getItem("hiddenColumns") ?? JSON.stringify([{}]); + } + this._hiddenColumns = JSON.parse(hiddenColumns); } private getKey(column: string): string { diff --git a/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.html b/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.html index d26b948b..248a5dbc 100644 --- a/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.html +++ b/kdb-web/src/app/modules/shared/base/multi-select-columns/multi-select-columns.component.html @@ -2,9 +2,10 @@
-
+
{{'common.' + item.name | translate}},
+
{{'common.hidden_columns' | translate}}
{{'common.hidden_columns' | translate}}
diff --git a/kdb-web/src/app/modules/view/server/config/components/config/config.component.html b/kdb-web/src/app/modules/view/server/config/components/config/config.component.html index 7f0fadb0..405dbe26 100644 --- a/kdb-web/src/app/modules/view/server/config/components/config/config.component.html +++ b/kdb-web/src/app/modules/view/server/config/components/config/config.component.html @@ -113,7 +113,7 @@ - +