From b418d001a498b5a5108bb13983b4f3aba6c60dbc Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 3 Jun 2022 16:22:21 -0700 Subject: Support feature disabling --- modern/src/settings/GroupPage.js | 59 +++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 25 deletions(-) (limited to 'modern/src/settings/GroupPage.js') diff --git a/modern/src/settings/GroupPage.js b/modern/src/settings/GroupPage.js index b817ba7e..c4c0fa5c 100644 --- a/modern/src/settings/GroupPage.js +++ b/modern/src/settings/GroupPage.js @@ -15,6 +15,7 @@ import SettingsMenu from './components/SettingsMenu'; import useCommonDeviceAttributes from '../common/attributes/useCommonDeviceAttributes'; import useGroupAttributes from '../common/attributes/useGroupAttributes'; import { prefixString } from '../common/util/stringUtils'; +import useFeatures from '../common/util/useFeatures'; const useStyles = makeStyles((theme) => ({ details: { @@ -32,6 +33,8 @@ const GroupPage = () => { const commonDeviceAttributes = useCommonDeviceAttributes(t); const groupAttributes = useGroupAttributes(t); + const features = useFeatures(); + const [item, setItem] = useState(); const validate = () => item && item.name; @@ -115,23 +118,27 @@ const GroupPage = () => { titleGetter={(it) => t(prefixString('event', it.type))} label={t('sharedNotifications')} /> - - it.description} - label={t('sharedComputedAttributes')} - /> + {!features.disableDrivers && ( + + )} + {!features.disableComputedAttributes && ( + it.description} + label={t('sharedComputedAttributes')} + /> + )} { titleGetter={(it) => it.description} label={t('sharedSavedCommands')} /> - + {!features.disableMaintenance && ( + + )} )} -- cgit v1.2.3