changeset 2402:7600bb49e158 staging_consolidation

wip
author Thomas Junk <thomas.junk@intevation.de>
date Wed, 27 Feb 2019 15:20:00 +0100
parents 598b0c262475
children a4f36c481f4b
files client/src/store/imports.js
diffstat 1 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/store/imports.js	Wed Feb 27 14:27:10 2019 +0100
+++ b/client/src/store/imports.js	Wed Feb 27 15:20:00 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 };
@@ -166,7 +186,7 @@
           });
       });
     },
-    confirmReview({ commit }, reviewResults) {
+    confirmReview({ state }, reviewResults) {
       return new Promise((resolve, reject) => {
         HTTP.patch("/imports", reviewResults, {
           headers: {