changeset 1797:67340ceecc5f

feat: define sections and stretches etd
author Thomas Junk <thomas.junk@intevation.de>
date Mon, 14 Jan 2019 17:12:12 +0100
parents 904c7e853adc
children 40cbfd268aa9
files client/src/components/Contextbox.vue client/src/components/ImportStretches.vue client/src/components/Search.vue client/src/components/Sidebar.vue client/src/main.js client/src/router.js
diffstat 6 files changed, 31 insertions(+), 85 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/Contextbox.vue	Mon Jan 14 16:21:31 2019 +0100
+++ b/client/src/components/Contextbox.vue	Mon Jan 14 17:12:12 2019 +0100
@@ -5,6 +5,7 @@
     </div>
     <Bottlenecks v-if="contextBoxContent === 'bottlenecks'"></Bottlenecks>
     <Staging v-if="contextBoxContent === 'staging'"></Staging>
+    <Stretches v-if="contextBoxContent === 'stretches'"></Stretches>
   </div>
 </template>
 
@@ -28,7 +29,8 @@
   name: "contextbox",
   components: {
     Bottlenecks: () => import("./Bottlenecks"),
-    Staging: () => import("./staging/Staging.vue")
+    Staging: () => import("./staging/Staging.vue"),
+    Stretches: () => import("./ImportStretches.vue")
   },
   computed: {
     ...mapState("application", [
--- a/client/src/components/ImportStretches.vue	Mon Jan 14 16:21:31 2019 +0100
+++ b/client/src/components/ImportStretches.vue	Mon Jan 14 17:12:12 2019 +0100
@@ -1,44 +1,9 @@
 <template>
-  <div class="d-flex flex-row">
-    <Spacer></Spacer>
-    <div class="card sysconfig mt-3 shadow-xs w-100 h-100 mr-3">
-      <h6
-        class="mb-0 py-2 px-3 border-bottom d-flex text-info align-items-center"
-      >
-        <font-awesome-icon
-          icon="cloud-upload-alt"
-          class="mr-2"
-        ></font-awesome-icon>
-        <translate class="headline">Import streches</translate>
-      </h6>
-      <div class="card-body stretches-card">
-        <div class="w-95 ml-auto mr-auto mt-4 mb-4">
-          <div class="d-flex flex-row input-group mb-4">
-            <div class="flex-column w-100">
-              <div class="flex-row text-left">
-                <small class="text-muted"> <translate>URL</translate> </small>
-              </div>
-              <div><input class="form-control" type="url" /></div>
-            </div>
-          </div>
-          <div class="buttons text-right">
-            <button
-              :disabled="disableUploadButton"
-              @click="submit"
-              class="btn btn-info mt-4"
-              type="button"
-            >
-              <font-awesome-icon
-                class="fa-fw mr-2"
-                fixed-width
-                icon="play"
-              ></font-awesome-icon>
-              <translate>Trigger import</translate>
-            </button>
-          </div>
-        </div>
-      </div>
-    </div>
+  <div>
+    <h6 class="mb-0 py-2 px-3 border-bottom d-flex align-items-center">
+      <font-awesome-icon icon="road" class="mr-2"></font-awesome-icon>
+      <translate>Define section and stretches</translate>
+    </h6>
   </div>
 </template>
 
@@ -57,28 +22,12 @@
  * Thomas Junk <thomas.junk@intevation.de>
  */
 
-import { displayInfo } from "@/lib/errors.js";
-
 export default {
   name: "importstretches",
   data() {
-    return {
-      disableUploadButton: false,
-      uploadLabel: "",
-      uploadFile: null
-    };
+    return {};
   },
-  methods: {
-    submit() {
-      displayInfo({
-        title: this.$gettext("Import stretches"),
-        message: this.$gettext("under construction")
-      });
-    }
-  },
-  components: {
-    Spacer: () => import("./Spacer")
-  }
+  methods: {}
 };
 </script>
 
--- a/client/src/components/Search.vue	Mon Jan 14 16:21:31 2019 +0100
+++ b/client/src/components/Search.vue	Mon Jan 14 17:12:12 2019 +0100
@@ -12,7 +12,9 @@
           'searchgroup-collapsed': !showSearchbar,
           big:
             showContextBox &&
-            ['bottlenecks', 'staging'].indexOf(contextBoxContent) !== -1
+            ['bottlenecks', 'staging', 'stretches'].indexOf(
+              contextBoxContent
+            ) !== -1
         }
       ]"
     >
--- a/client/src/components/Sidebar.vue	Mon Jan 14 16:21:31 2019 +0100
+++ b/client/src/components/Sidebar.vue	Mon Jan 14 17:12:12 2019 +0100
@@ -40,6 +40,20 @@
           ></font-awesome-icon>
           <span class="fix-trans-space" v-translate>Staging area</span>
         </a>
+        <a
+          :class="['secondary', { active: isActive('stretches') }]"
+          @click="toggleContextBox('stretches')"
+          href="#"
+        >
+          <font-awesome-icon
+            class="fa-fw mr-2"
+            fixed-width
+            icon="road"
+          ></font-awesome-icon>
+          <span class="fix-trans-space" v-translate
+            >Define sections and stretches</span
+          >
+        </a>
         <small class="text-muted pl-3"> <translate>Import</translate> </small>
         <hr class="m-0" />
         <router-link to="/importsoundingresults">
@@ -72,14 +86,6 @@
             >Import waterway profiles</span
           >
         </router-link>
-        <router-link to="/importstretches" v-if="this.$options.IMPORTSTRETCHES">
-          <font-awesome-icon
-            class="fa-fw mr-2"
-            fixed-width
-            icon="cloud-upload-alt"
-          ></font-awesome-icon>
-          <span class="fix-trans-space" v-translate>Import stretches</span>
-        </router-link>
         <router-link to="importschedule">
           <font-awesome-icon
             class="fa-fw mr-2"
@@ -196,7 +202,6 @@
       ];
     }
   },
-  IMPORTSTRETCHES: process.env.VUE_APP_FEATURE_IMPORTSTRETCHES,
   methods: {
     logoff() {
       logOff();
--- a/client/src/main.js	Mon Jan 14 16:21:31 2019 +0100
+++ b/client/src/main.js	Mon Jan 14 17:12:12 2019 +0100
@@ -35,6 +35,7 @@
   faAngleUp,
   faBars,
   faBook,
+  faBullsExe,
   faChartArea,
   faCheck,
   faCity,
@@ -57,6 +58,7 @@
   faPlay,
   faPlus,
   faPowerOff,
+  faRoad,
   faRuler,
   faSearch,
   faShip,
@@ -85,6 +87,7 @@
   faAngleUp,
   faBars,
   faBook,
+  faBullsExe,
   faChartArea,
   faCheck,
   faCity,
@@ -107,6 +110,7 @@
   faPlay,
   faPlus,
   faPowerOff,
+  faRoad,
   faRuler,
   faSearch,
   faShip,
--- a/client/src/router.js	Mon Jan 14 16:21:31 2019 +0100
+++ b/client/src/router.js	Mon Jan 14 17:12:12 2019 +0100
@@ -127,22 +127,6 @@
       }
     },
     {
-      path: "/importstretches",
-      name: "importstretches",
-      component: () => import("./components/ImportStretches.vue"),
-      meta: {
-        requiresAuth: true
-      },
-      beforeEnter: (to, from, next) => {
-        const isWaterwayAdmin = store.getters["user/isWaterwayAdmin"];
-        if (!isWaterwayAdmin) {
-          next("/");
-        } else {
-          next();
-        }
-      }
-    },
-    {
       path: "/importwaterwayprofiles",
       name: "waterwayprofiles",
       component: () => import("./components/ImportWaterwayProfiles"),