From 805b234c99c3c94a2a2483a4dcf6d417c2d4048b Mon Sep 17 00:00:00 2001 From: faouziH21 <2004homsani@gmail.com> Date: Tue, 13 Aug 2024 14:34:20 +0200 Subject: [PATCH] feat: adds a config for documentation button --- resources/config/gis-client-config.js | 1 + src/components/UserMenu/index.tsx | 15 ++++++--------- src/global.d.ts | 1 + 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/resources/config/gis-client-config.js b/resources/config/gis-client-config.js index 64be9fd89..0bfe2147c 100644 --- a/resources/config/gis-client-config.js +++ b/resources/config/gis-client-config.js @@ -45,5 +45,6 @@ var clientConfig = { authorizedRolesForDelete: [] }, wfsLockFeatureEnabled: false, + documentationButtonVisible: true, enableFallbackConfig: true }; diff --git a/src/components/UserMenu/index.tsx b/src/components/UserMenu/index.tsx index a0d42cfff..6832eb899 100644 --- a/src/components/UserMenu/index.tsx +++ b/src/components/UserMenu/index.tsx @@ -193,19 +193,16 @@ export const UserMenu: React.FC = (): JSX.Element => { username, divider, settings, - info, - docs, - divider, - logout + info ] : [ username, divider, - info, - docs, - divider, - logout + info ]; - + if (ClientConfiguration.documentationButtonVisible) { + itemsForLoggedInUser.push(docs); + } + itemsForLoggedInUser.push(divider, logout); items.push(...itemsForLoggedInUser); } diff --git a/src/global.d.ts b/src/global.d.ts index 7e063ecbd..4f6a5158d 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -60,6 +60,7 @@ declare module 'clientConfig' { search?: SearchConfiguration; featureEditRoles?: FeatureEditConfiguration; wfsLockFeatureEnabled?: boolean; + documentationButtonVisible?: boolean; enableFallbackConfig?: boolean; staticAppConfigUrl?: string; layerConfigUrl?: string;