From 393d4a50635d77b98c6bdd8df31222a98a1d1ebd Mon Sep 17 00:00:00 2001 From: Keith Becker Date: Mon, 1 Mar 2021 10:03:54 -0700 Subject: [PATCH 1/6] removing usage of lodash --- package.json | 2 -- src/api/services/status.js | 4 +--- src/store/modules/userPreferences.js | 3 +-- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f1ed8f7..71f8060 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "axios": "^0.21.1", "core-js": "^3.6.4", "downloadjs": "^1.4.7", - "lodash": "^4.17.20", "vue": "^2.6.11", "vue-analytics": "^5.22.1", "vue-body-class": "^3.0.2", @@ -149,7 +148,6 @@ "faye-websocket": "^0.11.3", "sockjs": "^0.3.21", "http-proxy": "^1.18.1", - "lodash": "^4.17.20", "minimist": "^1.2.5", "serialize-javascript": "^3.1.0", "y18n": "^5.0.5", diff --git a/src/api/services/status.js b/src/api/services/status.js index 4f620b2..e0bc750 100644 --- a/src/api/services/status.js +++ b/src/api/services/status.js @@ -1,9 +1,7 @@ -import get from "lodash/get"; import { HTTP } from "@/api/mock-http-common"; export default { async getStatusSummary() { - const response = await HTTP.get(`status.json`); - return get(response, "data.result"); + return await HTTP.get(`status.json`); }, }; diff --git a/src/store/modules/userPreferences.js b/src/store/modules/userPreferences.js index e1cd4ee..6a0469c 100644 --- a/src/store/modules/userPreferences.js +++ b/src/store/modules/userPreferences.js @@ -1,4 +1,3 @@ -import isNil from "lodash/isNil"; import { SET_USER_PREFERENCE } from "@/store/mutation-types"; import { GET_USER_PREFERENCE } from "@/store/getter-types"; import { CALL_SET_USER_PREFERENCE } from "@/store/action-types"; @@ -31,7 +30,7 @@ const actions = { // mutations const mutations = { [SET_USER_PREFERENCE](_state, userPreference = {}) { - if (isNil(userPreference.darkMode)) { + if (!(userPreference.darkMode)) { userPreference.darkMode = true; } _state.userPreference = userPreference; -- GitLab From a7c2a2876328bd016caeec448ed1ff4f2c9cd95c Mon Sep 17 00:00:00 2001 From: Keith Becker Date: Mon, 1 Mar 2021 10:35:12 -0700 Subject: [PATCH 2/6] remove lodash --- src/components/AddTeam.vue | 3 +-- src/components/PersonnelTable.vue | 21 ++++++++------------- src/components/UserSelect.vue | 9 ++++++++- src/store/modules/userPreferences.js | 2 +- src/views/super-admin/Personnel.vue | 3 +-- src/views/super-admin/Teams.vue | 3 +-- src/views/super-admin/Training.vue | 5 ++--- 7 files changed, 22 insertions(+), 24 deletions(-) diff --git a/src/components/AddTeam.vue b/src/components/AddTeam.vue index aa062d1..2160b62 100644 --- a/src/components/AddTeam.vue +++ b/src/components/AddTeam.vue @@ -97,7 +97,6 @@