# HG changeset patch # User Thomas Junk # Date 1551359045 -3600 # Node ID e61ca8310dc97bb72b2e413eb12ca6aa3bc45a5d # Parent 4625ae70f076bdc6292f732585c5d6ae319e6776# Parent cef666846f6b7b4735a27a1e7724e6c67ce6fc63 merging with staging_consolidation diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/App.vue --- a/client/src/components/App.vue Thu Feb 28 12:45:40 2019 +0100 +++ b/client/src/components/App.vue Thu Feb 28 14:04:05 2019 +0100 @@ -90,7 +90,9 @@ ...mapState("user", ["isAuthenticated"]), ...mapState("application", ["contextBoxContent", "showSearchbar"]), isMapVisible() { - return /stretches|review|bottlenecks|mainview/.test(this.routeName); + return /importoverview|stretches|review|bottlenecks|mainview/.test( + this.routeName + ); }, routeName() { const routeName = this.$route.name; diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/Contextbox.vue --- a/client/src/components/Contextbox.vue Thu Feb 28 12:45:40 2019 +0100 +++ b/client/src/components/Contextbox.vue Thu Feb 28 14:04:05 2019 +0100 @@ -3,6 +3,9 @@ + @@ -25,9 +28,10 @@ export default { name: "contextbox", components: { - Bottlenecks: () => import("./Bottlenecks"), - Staging: () => import("./staging/Staging.vue"), - Stretches: () => import("./ImportStretches.vue") + Bottlenecks: () => import("@/components/Bottlenecks"), + Stretches: () => import("@/components/ImportStretches.vue"), + ImportOverview: () => + import("@/components/importoverview/ImportOverview.vue") }, computed: { ...mapState("application", [ diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/Sidebar.vue --- a/client/src/components/Sidebar.vue Thu Feb 28 12:45:40 2019 +0100 +++ b/client/src/components/Sidebar.vue Thu Feb 28 14:04:05 2019 +0100 @@ -28,7 +28,7 @@ Bottlenecks
- + Logs
-
- - - Importqueue - -

+
+ +
+ +
+
+ + + +
Staging
+
+
+ + + +
Logs
+
+
+ + + + + diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/importoverview/staging/Staging.vue --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/components/importoverview/staging/Staging.vue Thu Feb 28 14:04:05 2019 +0100 @@ -0,0 +1,94 @@ + + + + + diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/importoverview/staging/StagingDetail.vue --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/src/components/importoverview/staging/StagingDetail.vue Thu Feb 28 14:04:05 2019 +0100 @@ -0,0 +1,518 @@ + + + + + diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/importqueue/Importqueue.vue --- a/client/src/components/importqueue/Importqueue.vue Thu Feb 28 12:45:40 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,351 +0,0 @@ - - - - - diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/importqueue/Importqueuedetail.vue --- a/client/src/components/importqueue/Importqueuedetail.vue Thu Feb 28 12:45:40 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,359 +0,0 @@ - - - - - diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/staging/Staging.vue --- a/client/src/components/staging/Staging.vue Thu Feb 28 12:45:40 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,193 +0,0 @@ - - - - - diff -r 4625ae70f076 -r e61ca8310dc9 client/src/components/staging/StagingDetail.vue --- a/client/src/components/staging/StagingDetail.vue Thu Feb 28 12:45:40 2019 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,583 +0,0 @@ - - - - - diff -r 4625ae70f076 -r e61ca8310dc9 client/src/router.js --- a/client/src/router.js Thu Feb 28 12:45:40 2019 +0100 +++ b/client/src/router.js Thu Feb 28 14:04:05 2019 +0100 @@ -81,22 +81,6 @@ } }, { - path: "/importqueue/:id?", - name: "importqueue", - component: () => import("./components/importqueue/Importqueue.vue"), - meta: { - requiresAuth: true - }, - beforeEnter: (to, from, next) => { - const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"]; - if (!isWaterwayAdmin) { - next("/"); - } else { - next(); - } - } - }, - { path: "/importsoundingresults", name: "importsoundingresults", component: () => import("./components/ImportSoundingresults.vue"), @@ -191,8 +175,8 @@ } }, { - path: "/review/:id?", - name: "review", + path: "/imports/overview/:id?", + name: "importoverview", component: Main, meta: { requiresAuth: true @@ -202,9 +186,8 @@ if (!isWaterwayAdmin) { next("/"); } else { - store.commit("application/searchQuery", ""); store.commit("application/showContextBox", true); - store.commit("application/contextBoxContent", "staging"); + store.commit("application/contextBoxContent", "importoverview"); store.commit("application/showSearchbar", true); next(); } diff -r 4625ae70f076 -r e61ca8310dc9 client/src/store/imports.js --- a/client/src/store/imports.js Thu Feb 28 12:45:40 2019 +0100 +++ b/client/src/store/imports.js Thu Feb 28 14:04:05 2019 +0100 @@ -30,7 +30,9 @@ stretches: [], imports: [], staging: [], - importToReview: null + importToReview: null, + stagingVisible: true, + logsVisible: true }; }; @@ -67,6 +69,18 @@ init, namespaced: true, state: init(), + getters: { + processedReviews: state => { + return state.staging + .filter(x => x.status !== STATES.NEEDSAPPROVAL) + .map(r => { + return { + id: r.id, + state: r.status + }; + }); + } + }, mutations: { setStretches: (state, stretches) => { state.stretches = stretches; @@ -74,6 +88,12 @@ setImports: (state, imports) => { state.imports = imports; }, + setStagingVisibility: (state, visibility) => { + state.stagingVisible = visibility; + }, + setLogsVisibility: (state, visibility) => { + state.logsVisible = visibility; + }, setStaging: (state, staging) => { const enriched = staging.map(x => { return { ...x, status: STATES.NEEDSAPPROVAL }; @@ -138,9 +158,11 @@ }); }); }, - getImports({ commit }) { + getImports({ commit }, filter) { + let queryParams = ""; + if (filter) queryParams = "?states=" + filter.join(","); return new Promise((resolve, reject) => { - HTTP.get("/imports", { + HTTP.get("/imports" + queryParams, { headers: { "X-Gemma-Auth": localStorage.getItem("token") } }) .then(response => { @@ -165,6 +187,22 @@ reject(error); }); }); + }, + confirmReview({ state }, reviewResults) { + return new Promise((resolve, reject) => { + HTTP.patch("/imports", reviewResults, { + headers: { + "X-Gemma-Auth": localStorage.getItem("token"), + "Content-type": "application/json" + } + }) + .then(response => { + resolve(response); + }) + .catch(error => { + reject(error); + }); + }); } } };