Skip to content

Commit

Permalink
remove KVStore / ngStorage.js
Browse files Browse the repository at this point in the history
Rewritten into storage.ts, this Angular service is not needed anymore. We can remove the file, remove it from index.js, and remove it as a dependency from all of the Angular modules that previously used it.
  • Loading branch information
JGreenlee committed Sep 27, 2023
1 parent b99e001 commit 6ffbf18
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 236 deletions.
1 change: 0 additions & 1 deletion www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ import './js/control/uploadService.js';
import './js/metrics-factory.js';
import './js/metrics-mappings.js';
import './js/plugin/logger.ts';
import './js/plugin/ngStorage.js';
5 changes: 2 additions & 3 deletions www/js/metrics-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { labelOptions } from './survey/multilabel/confirmHelper';
import { storageGet, storageRemove, storageSet } from './plugin/storage';

angular.module('emission.main.metrics.factory',
['emission.main.metrics.mappings',
'emission.plugin.kvstore'])
['emission.main.metrics.mappings'])

.factory('FootprintHelper', function(CarbonDatasetHelper, CustomDatasetHelper) {
var fh = {};
Expand Down Expand Up @@ -145,7 +144,7 @@ angular.module('emission.main.metrics.factory',
return fh;
})

.factory('CalorieCal', function(KVStore, METDatasetHelper, CustomDatasetHelper) {
.factory('CalorieCal', function(METDatasetHelper, CustomDatasetHelper) {

var cc = {};
var highestMET = 0;
Expand Down
7 changes: 3 additions & 4 deletions www/js/metrics-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ import { getLabelOptions } from './survey/multilabel/confirmHelper';
import { getConfig } from './config/dynamicConfig';
import { storageGet, storageSet } from './plugin/storage';

angular.module('emission.main.metrics.mappings', ['emission.plugin.logger',
'emission.plugin.kvstore'])
angular.module('emission.main.metrics.mappings', ['emission.plugin.logger'])

.service('CarbonDatasetHelper', function(KVStore) {
.service('CarbonDatasetHelper', function() {
var CARBON_DATASET_KEY = 'carbon_dataset_locale';

// Values are in Kg/PKm (kilograms per passenger-kilometer)
Expand Down Expand Up @@ -182,7 +181,7 @@ angular.module('emission.main.metrics.mappings', ['emission.plugin.logger',
return carbonDatasets[currentCarbonDatasetCode].footprintData;
};
})
.service('METDatasetHelper', function(KVStore) {
.service('METDatasetHelper', function() {
var standardMETs = {
"WALKING": {
"VERY_SLOW": {
Expand Down
221 changes: 0 additions & 221 deletions www/js/plugin/ngStorage.js

This file was deleted.

3 changes: 1 addition & 2 deletions www/js/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

import angular from 'angular';

angular.module('emission.services', ['emission.plugin.logger',
'emission.plugin.kvstore'])
angular.module('emission.services', ['emission.plugin.logger'])

.service('CommHelper', function($rootScope) {
var getConnectURL = function(successCallback, errorCallback) {
Expand Down
4 changes: 2 additions & 2 deletions www/js/splash/referral.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import angular from 'angular';
import { storageGetDirect, storageRemove, storageSet } from '../plugin/storage';

angular.module('emission.splash.referral', ['emission.plugin.kvstore'])
angular.module('emission.splash.referral', [])

.factory('ReferralHandler', function($window, KVStore) {
.factory('ReferralHandler', function($window) {
var referralHandler = {};

var REFERRAL_NAVIGATION_KEY = 'referral_navigation';
Expand Down
5 changes: 2 additions & 3 deletions www/js/splash/startprefs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ import { getConfig } from '../config/dynamicConfig';
import { storageGet, storageSet } from '../plugin/storage';

angular.module('emission.splash.startprefs', ['emission.plugin.logger',
'emission.splash.referral',
'emission.plugin.kvstore'])
'emission.splash.referral'])

.factory('StartPrefs', function($window, $state, $interval, $rootScope, $ionicPlatform,
$ionicPopup, KVStore, $http, Logger, ReferralHandler) {
$ionicPopup, $http, Logger, ReferralHandler) {
var logger = Logger;
var startprefs = {};
// Boolean: represents that the "intro" - the one page summary
Expand Down

0 comments on commit 6ffbf18

Please sign in to comment.