Skip to content

Commit

Permalink
Merge pull request #1170 from JGreenlee/disable-custom-labels
Browse files Browse the repository at this point in the history
Temporarily disable custom labels
  • Loading branch information
shankari authored Aug 28, 2024
2 parents adb7cf2 + 967bd82 commit 428ea55
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions www/js/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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]);

Expand Down
4 changes: 2 additions & 2 deletions www/js/control/ProfileSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -426,7 +426,7 @@ const ProfileSettings = () => {
desc={authSettings.opcode}
descStyle={settingStyles.monoDesc}></SettingRow>
<DemographicsSettingRow></DemographicsSettingRow>
{appConfig?.survey_info?.['trip-labels'] == 'MULTILABEL' && <CustomLabelSettingRow />}
{/* {appConfig?.survey_info?.['trip-labels'] == 'MULTILABEL' && <CustomLabelSettingRow />} */}
<SettingRow
textKey="control.view-privacy"
iconName="eye"
Expand Down
24 changes: 12 additions & 12 deletions www/js/survey/multilabel/MultiLabelButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
} from './confirmHelper';
import useAppConfig from '../../useAppConfig';
import { MultilabelKey } from '../../types/labelTypes';
import { updateUserCustomLabel } from '../../services/commHelper';
// import { updateUserCustomLabel } from '../../services/commHelper';
import { AppContext } from '../../App';

const MultilabelButtonGroup = ({ trip, buttonsInline = false }) => {
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 428ea55

Please sign in to comment.