From 967bd82feba3041a49184f68ea26069d6d7e022b Mon Sep 17 00:00:00 2001 From: Jack Greenlee Date: Wed, 28 Aug 2024 15:39:11 -0400 Subject: [PATCH] Temporarily disable custom labels This implementation has bugs (it makes a network call every time a label is input) There will be a new implementation next release; disabling this one for now --- www/js/App.tsx | 4 ++-- www/js/control/ProfileSettings.tsx | 4 ++-- .../multilabel/MultiLabelButtonGroup.tsx | 24 +++++++++---------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/www/js/App.tsx b/www/js/App.tsx index 0d45ebeca..c9593f3ad 100644 --- a/www/js/App.tsx +++ b/www/js/App.tsx @@ -13,7 +13,7 @@ import usePermissionStatus from './usePermissionStatus'; import { initPushNotify } from './splash/pushNotifySettings'; import { initStoreDeviceSettings } from './splash/storeDeviceSettings'; import { initRemoteNotifyHandler } from './splash/remoteNotifyHandler'; -import { getUserCustomLabels } from './services/commHelper'; +// import { getUserCustomLabels } from './services/commHelper'; import { initCustomDatasetHelper } from './metrics/customMetricsHelper'; import AlertBar from './components/AlertBar'; import Main from './Main'; @@ -45,7 +45,7 @@ const App = () => { initPushNotify(); initStoreDeviceSettings(); initRemoteNotifyHandler(); - getUserCustomLabels(CUSTOM_LABEL_KEYS_IN_DATABASE).then((res) => setCustomLabelMap(res)); + // getUserCustomLabels(CUSTOM_LABEL_KEYS_IN_DATABASE).then((res) => setCustomLabelMap(res)); initCustomDatasetHelper(appConfig); }, [appConfig]); diff --git a/www/js/control/ProfileSettings.tsx b/www/js/control/ProfileSettings.tsx index ef61e0a24..1ea3631fa 100644 --- a/www/js/control/ProfileSettings.tsx +++ b/www/js/control/ProfileSettings.tsx @@ -37,7 +37,7 @@ import { storageClear } from '../plugin/storage'; import { getAppVersion } from '../plugin/clientStats'; import { getConsentDocument } from '../splash/startprefs'; import { displayError, displayErrorMsg, logDebug, logWarn } from '../plugin/logger'; -import CustomLabelSettingRow from './CustomLabelSettingRow'; +// import CustomLabelSettingRow from './CustomLabelSettingRow'; import { fetchOPCode, getSettings } from '../services/controlHelper'; import { updateScheduledNotifs, @@ -426,7 +426,7 @@ const ProfileSettings = () => { desc={authSettings.opcode} descStyle={settingStyles.monoDesc}> - {appConfig?.survey_info?.['trip-labels'] == 'MULTILABEL' && } + {/* {appConfig?.survey_info?.['trip-labels'] == 'MULTILABEL' && } */} { @@ -97,17 +97,17 @@ const MultilabelButtonGroup = ({ trip, buttonsInline = false }) => { (initialLabel && customLabelMap[key].indexOf(initialLabel) > -1) || (newLabel && customLabelMap[key].indexOf(newLabel) > -1) ) { - updateUserCustomLabel(key, initialLabel ?? '', newLabel, isOther ?? false) - .then((res) => { - setCustomLabelMap({ - ...customLabelMap, - [key]: res['label'], - }); - logDebug('Successfuly stored custom label ' + JSON.stringify(res)); - }) - .catch((e) => { - displayErrorMsg(e, 'Create Label Error'); - }); + // updateUserCustomLabel(key, initialLabel ?? '', newLabel, isOther ?? false) + // .then((res) => { + // setCustomLabelMap({ + // ...customLabelMap, + // [key]: res['label'], + // }); + // logDebug('Successfuly stored custom label ' + JSON.stringify(res)); + // }) + // .catch((e) => { + // displayErrorMsg(e, 'Create Label Error'); + // }); } const inputDataToStore = { start_ts: trip.start_ts,