Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporarily disable custom labels #1170

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading