From bc5610e907bdd272fef2c3b44b5f22bb79635a5e Mon Sep 17 00:00:00 2001 From: jetzable Date: Mon, 7 Jan 2019 12:13:14 -0600 Subject: [PATCH] Refactoring --- src/components/BranchPicker.vue | 7 --- src/components/CompanyList.vue | 6 +-- .../{ListItem.vue => ListCompany.vue} | 6 +-- src/components/ListLocation.vue | 52 ------------------- src/components/ListStore.vue | 14 ++--- src/components/LocationList.vue | 25 --------- src/components/__tests__/CompanyList.test.js | 1 - src/store.js | 17 +----- 8 files changed, 12 insertions(+), 116 deletions(-) rename src/components/{ListItem.vue => ListCompany.vue} (91%) delete mode 100644 src/components/ListLocation.vue delete mode 100644 src/components/LocationList.vue diff --git a/src/components/BranchPicker.vue b/src/components/BranchPicker.vue index 2ece102..88f3a05 100644 --- a/src/components/BranchPicker.vue +++ b/src/components/BranchPicker.vue @@ -1,11 +1,5 @@ \ No newline at end of file diff --git a/src/components/ListItem.vue b/src/components/ListCompany.vue similarity index 91% rename from src/components/ListItem.vue rename to src/components/ListCompany.vue index eb214f7..159a356 100644 --- a/src/components/ListItem.vue +++ b/src/components/ListCompany.vue @@ -2,7 +2,7 @@
- + + /> --> diff --git a/src/components/ListStore.vue b/src/components/ListStore.vue index 24a6904..aa92fb8 100644 --- a/src/components/ListStore.vue +++ b/src/components/ListStore.vue @@ -13,15 +13,11 @@
{{company.name}} -
- -
-

- No tienes - permiso para modificar la información -

-
-
+
+
+

No tienes permiso para acceder a esta ubicación, solicítalo aquí.

+
+
RFC: {{ company.branch_id}}
diff --git a/src/components/LocationList.vue b/src/components/LocationList.vue deleted file mode 100644 index bf77ef6..0000000 --- a/src/components/LocationList.vue +++ /dev/null @@ -1,25 +0,0 @@ - - diff --git a/src/components/__tests__/CompanyList.test.js b/src/components/__tests__/CompanyList.test.js index e08d01e..5a0d8c1 100644 --- a/src/components/__tests__/CompanyList.test.js +++ b/src/components/__tests__/CompanyList.test.js @@ -71,7 +71,6 @@ describe("CompanyList", () => { } } ], - showRequest: () => false, branchList: () => branches, showStoreColumn: () => true }; diff --git a/src/store.js b/src/store.js index bf59c18..3ccabb8 100644 --- a/src/store.js +++ b/src/store.js @@ -11,15 +11,9 @@ export const mutations = { setBranchList: (state, payload) => { state.branchList = payload; }, - setLocationList: (state, payload) => { - state.locationList = payload; - }, setShowStoreColumn: (state, payload) => { state.showStoreColumn = payload; }, - setshowLocationColumn: (state, payload) => { - state.showLocationColumn = payload; - }, setRequestId: (state, payload) => { state.requestId = payload; }, @@ -69,16 +63,11 @@ export const actions = { return { ...store, ...{ - status: store.branch_id === payload + active: store.branch_id === payload } } }); commit("setBranchList", stores); - const locations = state.branchList.filter(location => { - return location.branch_id === payload - }); - commit('setLocationList', locations); - commit('setshowLocationColumn', !state.showLocationColumn); }, getCompaniesFromServer: ({ commit @@ -107,9 +96,7 @@ export const actions = { export const state = { companiesFromServer: [], branchList: [], - locationList: [], showStoreColumn: true, - showLocationColumn: true, showRequest: false, requestId: "", }; @@ -117,9 +104,7 @@ export const state = { export const getters = { companiesFromServer: state => state.companiesFromServer, branchList: state => state.branchList, - locationList: state => state.locationList, showStoreColumn: state => state.showStoreColumn, - showLocationColumn: state => state.showLocationColumn, requestId: state => state.requestId, showRequest: state => state.showRequest };