aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-15 18:45:44 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-15 18:45:44 -0700
commit85a3576f3046f5bcf3bbac6ad952ef180762fd51 (patch)
tree2bf4f2ed43848ea5f1ec49fcfeb48a277bfe0436 /modern/src/common
parent09e1e536aea906ae62f2a361df07d4b4532e62c2 (diff)
downloadtrackermap-web-85a3576f3046f5bcf3bbac6ad952ef180762fd51.tar.gz
trackermap-web-85a3576f3046f5bcf3bbac6ad952ef180762fd51.tar.bz2
trackermap-web-85a3576f3046f5bcf3bbac6ad952ef180762fd51.zip
Option to hide attributes
Diffstat (limited to 'modern/src/common')
-rw-r--r--modern/src/common/attributes/useCommonUserAttributes.js4
-rw-r--r--modern/src/common/util/useFeatures.js2
2 files changed, 6 insertions, 0 deletions
diff --git a/modern/src/common/attributes/useCommonUserAttributes.js b/modern/src/common/attributes/useCommonUserAttributes.js
index 81ceaca7..791f46d4 100644
--- a/modern/src/common/attributes/useCommonUserAttributes.js
+++ b/modern/src/common/attributes/useCommonUserAttributes.js
@@ -37,6 +37,10 @@ export default (t) => useMemo(() => ({
name: t('attributeUiDisableGroups'),
type: 'boolean',
},
+ 'ui.disableAttributes': {
+ name: t('attributeUiDisableAttributes'),
+ type: 'boolean',
+ },
'ui.disableEvents': {
name: t('attributeUiDisableEvents'),
type: 'boolean',
diff --git a/modern/src/common/util/useFeatures.js b/modern/src/common/util/useFeatures.js
index 995fbf86..58c1bbf1 100644
--- a/modern/src/common/util/useFeatures.js
+++ b/modern/src/common/util/useFeatures.js
@@ -16,6 +16,7 @@ const get = (server, user, key) => {
export default () => useSelector((state) => {
const { server, user } = state.session;
+ const disableAttributes = get(server, user, 'ui.disableAttributes');
const disableVehicleFetures = get(server, user, 'ui.disableVehicleFetures');
const disableDrivers = disableVehicleFetures || get(server, user, 'ui.disableDrivers');
const disableMaintenance = disableVehicleFetures || get(server, user, 'ui.disableMaintenance');
@@ -25,6 +26,7 @@ export default () => useSelector((state) => {
const disableCalendars = get(server, user, 'ui.disableCalendars');
return {
+ disableAttributes,
disableDrivers,
disableMaintenance,
disableGroups,