diff --git a/www/__tests__/commHelper.test.ts b/www/__tests__/commHelper.test.ts index 2e2dfc6af..ec8d8b4ff 100644 --- a/www/__tests__/commHelper.test.ts +++ b/www/__tests__/commHelper.test.ts @@ -1,5 +1,5 @@ import { mockLogger } from '../__mocks__/globalMocks'; -import { fetchUrlCached } from '../js/commHelper'; +import { fetchUrlCached } from '../js/services/commHelper'; mockLogger(); diff --git a/www/__tests__/unifiedDataLoader.test.ts b/www/__tests__/unifiedDataLoader.test.ts index 34f98bcd1..6e1c41316 100644 --- a/www/__tests__/unifiedDataLoader.test.ts +++ b/www/__tests__/unifiedDataLoader.test.ts @@ -1,5 +1,5 @@ import { mockLogger } from '../__mocks__/globalMocks'; -import { combineWithDedup, combinedPromises } from '../js/unifiedDataLoader'; +import { combineWithDedup, combinedPromises } from '../js/services/unifiedDataLoader'; import { ServerData } from '../js/types/serverData'; mockLogger(); diff --git a/www/js/config/dynamicConfig.ts b/www/js/config/dynamicConfig.ts index 7994391a4..049b0343f 100644 --- a/www/js/config/dynamicConfig.ts +++ b/www/js/config/dynamicConfig.ts @@ -1,7 +1,7 @@ import i18next from "i18next"; import { displayError, logDebug, logWarn } from "../plugin/logger"; import { getAngularService } from "../angular-react-helper"; -import { fetchUrlCached } from "../commHelper"; +import { fetchUrlCached } from "../services/commHelper"; import { storageClear, storageGet, storageSet } from "../plugin/storage"; export const CONFIG_PHONE_UI="config/app_ui_config"; diff --git a/www/js/control/ControlSyncHelper.tsx b/www/js/control/ControlSyncHelper.tsx index edc0e7470..44bc661b2 100644 --- a/www/js/control/ControlSyncHelper.tsx +++ b/www/js/control/ControlSyncHelper.tsx @@ -9,7 +9,7 @@ import SettingRow from "./SettingRow"; import AlertBar from "./AlertBar"; import moment from "moment"; import { addStatEvent, statKeys } from "../plugin/clientStats"; -import { updateUser } from "../commHelper"; +import { updateUser } from "../services/commHelper"; /* * BEGIN: Simple read/write wrappers diff --git a/www/js/diary/LabelTab.tsx b/www/js/diary/LabelTab.tsx index bb2430481..b98c0eb6a 100644 --- a/www/js/diary/LabelTab.tsx +++ b/www/js/diary/LabelTab.tsx @@ -22,7 +22,7 @@ import { SurveyOptions } from "../survey/survey"; import { getLabelOptions } from "../survey/multilabel/confirmHelper"; import { displayError } from "../plugin/logger"; import { useTheme } from "react-native-paper"; -import { getPipelineRangeTs } from "../commHelper"; +import { getPipelineRangeTs } from "../services/commHelper"; let labelPopulateFactory, labelsResultMap, notesResultMap, showPlaces; const ONE_DAY = 24 * 60 * 60; // seconds diff --git a/www/js/diary/services.js b/www/js/diary/services.js index e0f1b5349..04136ccc3 100644 --- a/www/js/diary/services.js +++ b/www/js/diary/services.js @@ -3,8 +3,8 @@ import angular from 'angular'; import { SurveyOptions } from '../survey/survey'; import { getConfig } from '../config/dynamicConfig'; -import { getRawEntries } from '../commHelper'; -import { getUnifiedDataForInterval } from '../unifiedDataLoader' +import { getRawEntries } from '../services/commHelper'; +import { getUnifiedDataForInterval } from '../services/unifiedDataLoader' angular.module('emission.main.diary.services', ['emission.plugin.logger', 'emission.services']) diff --git a/www/js/diary/timelineHelper.ts b/www/js/diary/timelineHelper.ts index 287484a7a..d760148aa 100644 --- a/www/js/diary/timelineHelper.ts +++ b/www/js/diary/timelineHelper.ts @@ -1,7 +1,7 @@ import moment from "moment"; import { displayError, logDebug } from "../plugin/logger"; import { getBaseModeByKey, getBaseModeOfLabeledTrip } from "./diaryHelper"; -import { getUnifiedDataForInterval} from "../unifiedDataLoader"; +import { getUnifiedDataForInterval } from "../services/unifiedDataLoader"; import i18next from "i18next"; const cachedGeojsons = new Map(); diff --git a/www/js/metrics/MetricsTab.tsx b/www/js/metrics/MetricsTab.tsx index 450155622..8c9e2faee 100644 --- a/www/js/metrics/MetricsTab.tsx +++ b/www/js/metrics/MetricsTab.tsx @@ -16,7 +16,7 @@ import Carousel from "../components/Carousel"; import DailyActiveMinutesCard from "./DailyActiveMinutesCard"; import CarbonTextCard from "./CarbonTextCard"; import ActiveMinutesTableCard from "./ActiveMinutesTableCard"; -import { getAggregateData, getMetrics } from "../commHelper"; +import { getAggregateData, getMetrics } from "../services/commHelper"; export const METRIC_LIST = ['duration', 'mean_speed', 'count', 'distance'] as const; diff --git a/www/js/onboarding/SaveQrPage.tsx b/www/js/onboarding/SaveQrPage.tsx index d8b555f14..f73b3ac49 100644 --- a/www/js/onboarding/SaveQrPage.tsx +++ b/www/js/onboarding/SaveQrPage.tsx @@ -11,7 +11,7 @@ import QrCode, { shareQR } from "../components/QrCode"; import { onboardingStyles } from "./OnboardingStack"; import { preloadDemoSurveyResponse } from "./SurveyPage"; import { storageSet } from "../plugin/storage"; -import { registerUser } from "../commHelper"; +import { registerUser } from "../services/commHelper"; const SaveQrPage = ({ }) => { diff --git a/www/js/services.js b/www/js/services.js index 118e98811..eff5cc340 100644 --- a/www/js/services.js +++ b/www/js/services.js @@ -1,7 +1,7 @@ 'use strict'; import angular from 'angular'; -import { getRawEntries } from './commHelper'; +import { getRawEntries } from './services/commHelper'; angular.module('emission.services', ['emission.plugin.logger']) .service('ControlHelper', function($window, diff --git a/www/js/commHelper.ts b/www/js/services/commHelper.ts similarity index 99% rename from www/js/commHelper.ts rename to www/js/services/commHelper.ts index 259677090..d62cf576d 100644 --- a/www/js/commHelper.ts +++ b/www/js/services/commHelper.ts @@ -1,5 +1,5 @@ import { DateTime } from "luxon"; -import { logDebug } from "./plugin/logger"; +import { logDebug } from "../plugin/logger"; /** * @param url URL endpoint for the request diff --git a/www/js/unifiedDataLoader.ts b/www/js/services/unifiedDataLoader.ts similarity index 96% rename from www/js/unifiedDataLoader.ts rename to www/js/services/unifiedDataLoader.ts index 15bcd341d..359109619 100644 --- a/www/js/unifiedDataLoader.ts +++ b/www/js/services/unifiedDataLoader.ts @@ -1,6 +1,6 @@ -import { logDebug } from './plugin/logger' +import { logDebug } from '../plugin/logger' import { getRawEntries } from './commHelper'; -import { ServerResponse, ServerData, TimeQuery } from './types/serverData'; +import { ServerResponse, ServerData, TimeQuery } from '../types/serverData'; /** * combineWithDedup is a helper function for combinedPromises diff --git a/www/js/splash/notifScheduler.js b/www/js/splash/notifScheduler.js index 22f8407ee..0b7721c38 100644 --- a/www/js/splash/notifScheduler.js +++ b/www/js/splash/notifScheduler.js @@ -3,7 +3,7 @@ import angular from 'angular'; import { getConfig } from '../config/dynamicConfig'; import { addStatReading, statKeys } from '../plugin/clientStats'; -import { getUser, updateUser } from '../commHelper'; +import { getUser, updateUser } from '../services/commHelper'; angular.module('emission.splash.notifscheduler', ['emission.services', diff --git a/www/js/splash/pushnotify.js b/www/js/splash/pushnotify.js index 40d859f09..d38f66755 100644 --- a/www/js/splash/pushnotify.js +++ b/www/js/splash/pushnotify.js @@ -14,7 +14,7 @@ */ import angular from 'angular'; -import { updateUser } from '../commHelper'; +import { updateUser } from '../services/commHelper'; angular.module('emission.splash.pushnotify', ['emission.plugin.logger', 'emission.services', diff --git a/www/js/splash/storedevicesettings.js b/www/js/splash/storedevicesettings.js index d307feaa7..5fb3f8513 100644 --- a/www/js/splash/storedevicesettings.js +++ b/www/js/splash/storedevicesettings.js @@ -1,5 +1,5 @@ import angular from 'angular'; -import { updateUser } from '../commHelper'; +import { updateUser } from '../services/commHelper'; angular.module('emission.splash.storedevicesettings', ['emission.plugin.logger', 'emission.services', diff --git a/www/js/survey/enketo/EnketoModal.tsx b/www/js/survey/enketo/EnketoModal.tsx index 8b80b6dfe..82a1cef7e 100644 --- a/www/js/survey/enketo/EnketoModal.tsx +++ b/www/js/survey/enketo/EnketoModal.tsx @@ -5,7 +5,7 @@ import { ModalProps } from 'react-native-paper'; import useAppConfig from '../../useAppConfig'; import { useTranslation } from 'react-i18next'; import { SurveyOptions, getInstanceStr, saveResponse } from './enketoHelper'; -import { fetchUrlCached } from '../../commHelper'; +import { fetchUrlCached } from '../../services/commHelper'; import { displayError, displayErrorMsg } from '../../plugin/logger'; // import { transform } from 'enketo-transformer/web'; diff --git a/www/js/survey/enketo/enketoHelper.ts b/www/js/survey/enketo/enketoHelper.ts index c35dd03a3..17846f28c 100644 --- a/www/js/survey/enketo/enketoHelper.ts +++ b/www/js/survey/enketo/enketoHelper.ts @@ -3,7 +3,7 @@ import { Form } from 'enketo-core'; import { XMLParser } from 'fast-xml-parser'; import i18next from 'i18next'; import { logDebug } from "../../plugin/logger"; -import { getUnifiedDataForInterval} from "../../unifiedDataLoader"; +import { getUnifiedDataForInterval} from "../../services/unifiedDataLoader"; export type PrefillFields = {[key: string]: string}; diff --git a/www/js/survey/multilabel/confirmHelper.ts b/www/js/survey/multilabel/confirmHelper.ts index 6350745eb..329b660e9 100644 --- a/www/js/survey/multilabel/confirmHelper.ts +++ b/www/js/survey/multilabel/confirmHelper.ts @@ -1,7 +1,7 @@ // may refactor this into a React hook once it's no longer used by any Angular screens import { getAngularService } from "../../angular-react-helper"; -import { fetchUrlCached } from "../../commHelper"; +import { fetchUrlCached } from "../../services/commHelper"; import i18next from "i18next"; import { logDebug } from "../../plugin/logger";