From 2eb0a9159e8d257bfcec448a54a2fe361e2508f4 Mon Sep 17 00:00:00 2001 From: Birk Johansson Date: Tue, 22 Jun 2021 12:58:57 +0200 Subject: [PATCH] fix: hide channels filter from index-page (#518) * fix: hide channels filter * refactor: change channels feature to positive --- client/default.config.js | 3 +++ client/src/pages/Apps/Apps.js | 3 ++- client/src/pages/Apps/Filters/Filters.js | 19 +++++++++++-------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/client/default.config.js b/client/default.config.js index 3f728b9a5..f7731b6e9 100644 --- a/client/default.config.js +++ b/client/default.config.js @@ -40,5 +40,8 @@ module.exports = { canary: 'Canary', }, defaultAppChannel: 'stable', + feature: { + channels: false, + }, }, } diff --git a/client/src/pages/Apps/Apps.js b/client/src/pages/Apps/Apps.js index 2c00b91a8..13db8bb96 100644 --- a/client/src/pages/Apps/Apps.js +++ b/client/src/pages/Apps/Apps.js @@ -20,6 +20,7 @@ const { appChannelToDisplayName, appTypeToDisplayName, dhisVersions, + feature, } = config.ui const defaultChannelsFilter = new Set([defaultAppChannel]) @@ -66,7 +67,7 @@ const Apps = () => { const params = useMemo( () => ({ - channels, + channels: feature.channels ? channels : undefined, types, dhis_version: dhisVersion, query, diff --git a/client/src/pages/Apps/Filters/Filters.js b/client/src/pages/Apps/Filters/Filters.js index cd4e13b6d..85401c69d 100644 --- a/client/src/pages/Apps/Filters/Filters.js +++ b/client/src/pages/Apps/Filters/Filters.js @@ -7,6 +7,7 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import styles from './Filters.module.css' +import config from 'config' const CheckboxList = ({ checkboxes, selected, onChange }) => Object.entries(checkboxes).map(([value, label]) => ( @@ -67,14 +68,16 @@ const Filters = ({ onChange={onTypesFilterChange} /> -
-

Release Channels

- -
+ {config.ui.feature.channels && ( +
+

Release Channels

+ +
+ )}

DHIS2 Version