changeset 3182:77fc44ad05e3

client: removed old splitscreen code
author Markus Kottlaender <markus@intevation.de>
date Tue, 07 May 2019 16:20:15 +0200
parents c122a064fd5e
children f64cc98746a1
files client/src/components/App.vue client/src/components/Bottlenecks.vue client/src/components/fairway/Profiles.vue client/src/components/map/Map.vue client/src/components/splitscreen/MinimizedSplitscreens.vue client/src/components/splitscreen/Splitscreen.vue client/src/store/application.js
diffstat 7 files changed, 3 insertions(+), 196 deletions(-) [+]
line wrap: on
line diff
--- a/client/src/components/App.vue	Tue May 07 14:54:16 2019 +0200
+++ b/client/src/components/App.vue	Tue May 07 16:20:15 2019 +0200
@@ -23,8 +23,6 @@
           <Toolbar v-if="isMapVisible" />
         </div>
       </div>
-      <Splitscreen v-if="isMapVisible" />
-      <MinimizedSplitscreens v-if="isMapVisible" />
     </div>
     <router-view />
     <vue-snotify />
@@ -103,8 +101,6 @@
     Contextbox: () => import("./Contextbox"),
     Toolbar: () => import("./toolbar/Toolbar"),
     Popup: () => import("./Popup"),
-    Splitscreen: () => import("./splitscreen/Splitscreen"),
-    MinimizedSplitscreens: () => import("./splitscreen/MinimizedSplitscreens"),
     Statistics: () => import("./Statistics")
   }
 };
--- a/client/src/components/Bottlenecks.vue	Tue May 07 14:54:16 2019 +0200
+++ b/client/src/components/Bottlenecks.vue	Tue May 07 16:20:15 2019 +0200
@@ -23,7 +23,7 @@
     />
     <UITableBody
       :data="filteredBottlenecks() | sortTable(sortColumn, sortDirection)"
-      :maxHeight="(showSplitscreen ? 18 : 35) + 'rem'"
+      maxHeight="35rem"
       :isActive="item => item === this.openBottleneck"
     >
       <template v-slot:row="{ item: bottleneck }">
@@ -101,11 +101,7 @@
     };
   },
   computed: {
-    ...mapState("application", [
-      "searchQuery",
-      "showSearchbarLastState",
-      "showSplitscreen"
-    ]),
+    ...mapState("application", ["searchQuery", "showSearchbarLastState"]),
     ...mapState("bottlenecks", ["bottlenecksList"]),
     bottlenecksLabel() {
       return this.$gettext("Bottlenecks");
--- a/client/src/components/fairway/Profiles.vue	Tue May 07 14:54:16 2019 +0200
+++ b/client/src/components/fairway/Profiles.vue	Tue May 07 16:20:15 2019 +0200
@@ -377,7 +377,6 @@
         this.$store.commit("fairwayprofile/selectedCut", cut);
         if (!cut) {
           this.$store.commit("fairwayprofile/clearCurrentProfile");
-          this.$store.commit("application/showSplitscreen", false);
           this.openLayersMaps.forEach(m => {
             m.getLayer("CUTTOOL")
               .getSource()
--- a/client/src/components/map/Map.vue	Tue May 07 14:54:16 2019 +0200
+++ b/client/src/components/map/Map.vue	Tue May 07 16:20:15 2019 +0200
@@ -55,8 +55,7 @@
   },
   data() {
     return {
-      map: null,
-      splitscreen: false
+      map: null
     };
   },
   computed: {
--- a/client/src/components/splitscreen/MinimizedSplitscreens.vue	Tue May 07 14:54:16 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-<template>
-  <transition-group
-    name="fade"
-    tag="div"
-    class="minimizedSplitscreens ui-element"
-  >
-    <UIBoxHeader
-      v-for="splitscreen in splitscreens"
-      :key="splitscreen.id"
-      :icon="splitscreen.icon"
-      :title="splitscreen.title"
-      :closeCallback="close(splitscreen)"
-      :expandCallback="expand(splitscreen)"
-      :collapsed="true"
-      class="mt-2"
-    />
-  </transition-group>
-</template>
-
-<style lang="sass" scoped>
-.minimizedSplitscreens
-  position: absolute
-  bottom: $small-offset
-  right: $small-offset
-</style>
-
-<script>
-/* This is Free Software under GNU Affero General Public License v >= 3.0
- * without warranty, see README.md and license for details.
- *
- * SPDX-License-Identifier: AGPL-3.0-or-later
- * License-Filename: LICENSES/AGPL-3.0.txt
- *
- * Copyright (C) 2018 by via donau
- *   – Österreichische Wasserstraßen-Gesellschaft mbH
- * Software engineering by Intevation GmbH
- *
- * Author(s):
- * Markus Kottländer <markus@intevation.de>
- */
-
-import { mapState } from "vuex";
-
-export default {
-  computed: {
-    ...mapState("application", ["splitscreens"])
-  },
-  methods: {
-    close(splitscreen) {
-      return () => {
-        if (splitscreen.closeCallback) splitscreen.closeCallback();
-        this.$store.commit("application/removeSplitscreen", splitscreen.id);
-      };
-    },
-    expand(splitscreen) {
-      return () => {
-        if (splitscreen.expandCallback) splitscreen.expandCallback();
-        this.$store.commit("application/activeSplitscreenId", splitscreen.id);
-        this.$store.commit("application/showSplitscreen", true);
-      };
-    }
-  }
-};
-</script>
--- a/client/src/components/splitscreen/Splitscreen.vue	Tue May 07 14:54:16 2019 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-<template>
-  <div>
-    <div
-      :class="[
-        'splitscreen bg-white d-flex flex-column ui-element',
-        { show: showSplitscreen }
-      ]"
-    >
-      <UIBoxHeader
-        :icon="activeSplitscreen.icon"
-        :title="activeSplitscreen.title"
-        :closeCallback="close"
-        :collapseCallback="collapse"
-        v-if="activeSplitscreen"
-      />
-      <div class="d-flex flex-fill">
-        <UISpinnerOverlay v-if="splitscreenLoading" />
-        <transition name="fade" mode="out-in">
-          <component
-            :is="activeSplitscreen.component"
-            v-if="activeSplitscreen"
-          />
-        </transition>
-      </div>
-    </div>
-  </div>
-</template>
-
-<style lang="sass" scoped>
-.splitscreen
-  position: absolute
-  bottom: -50vh
-  left: 0
-  right: 0
-  height: 50vh
-  overflow: hidden
-  z-index: 1
-  box-shadow: 0 -.125rem .25rem rgba(0, 0, 0, 0.075)
-  transition: bottom 0.3s
-  &.show
-    bottom: 0
-
-  .loading
-    top: 34px
-</style>
-
-<script>
-/* This is Free Software under GNU Affero General Public License v >= 3.0
- * without warranty, see README.md and license for details.
- *
- * SPDX-License-Identifier: AGPL-3.0-or-later
- * License-Filename: LICENSES/AGPL-3.0.txt
- *
- * Copyright (C) 2018 by via donau
- *   – Österreichische Wasserstraßen-Gesellschaft mbH
- * Software engineering by Intevation GmbH
- *
- * Author(s):
- * Markus Kottländer <markus.kottlaender@intevation.de>
- */
-
-import { mapState, mapGetters } from "vuex";
-
-export default {
-  components: {
-    Fairwayprofile: () => import("@/components/fairway/Fairwayprofile"),
-    Waterlevel: () => import("@/components/gauge/Waterlevel"),
-    HydrologicalConditions: () =>
-      import("@/components/gauge/HydrologicalConditions")
-  },
-  computed: {
-    ...mapState("application", ["showSplitscreen", "splitscreenLoading"]),
-    ...mapGetters("application", ["activeSplitscreen"])
-  },
-  methods: {
-    collapse() {
-      if (this.activeSplitscreen.collapseCallback)
-        this.activeSplitscreen.collapseCallback();
-      this.$store.commit("application/showSplitscreen", false);
-    },
-    close() {
-      this.$store.commit("application/showSplitscreen", false);
-      setTimeout(() => {
-        let removeId = this.activeSplitscreen.id;
-        let callback = this.activeSplitscreen.closeCallback;
-        this.$store.commit("application/activeSplitscreenId", null);
-        if (callback) callback();
-        this.$store.commit("application/removeSplitscreen", removeId);
-      }, 350);
-    }
-  }
-};
-</script>
--- a/client/src/store/application.js	Tue May 07 14:54:16 2019 +0200
+++ b/client/src/store/application.js	Tue May 07 16:20:15 2019 +0200
@@ -14,7 +14,6 @@
  *   Bernhard E. Reiter <bernhard.reiter@intevation.de>
  */
 
-import Vue from "vue";
 import { version } from "../../package.json";
 
 // initial state
@@ -26,10 +25,6 @@
     popup: null,
     paneSetup: "DEFAULT",
     paneRotate: 1,
-    splitscreens: [],
-    splitscreenLoading: false,
-    activeSplitscreenId: null,
-    showSplitscreen: false,
     showSidebar: false,
     showUsermenu: false,
     showSearchbar: false,
@@ -72,9 +67,6 @@
         versionStr += "+" + process.env.VUE_APP_HGREV;
 
       return versionStr;
-    },
-    activeSplitscreen: state => {
-      return state.splitscreens.find(s => s.id === state.activeSplitscreenId);
     }
   },
   mutations: {
@@ -98,24 +90,6 @@
     showSidebar: (state, show) => {
       state.showSidebar = show;
     },
-    showSplitscreen: (state, show) => {
-      state.showSplitscreen = show;
-    },
-    splitscreenLoading: (state, loading) => {
-      state.splitscreenLoading = loading;
-    },
-    activeSplitscreenId: (state, id) => {
-      state.activeSplitscreenId = id;
-    },
-    addSplitscreen: (state, config) => {
-      let index = state.splitscreens.findIndex(s => s.id === config.id);
-      if (index !== -1) Vue.set(state.splitscreens, index, config);
-      else state.splitscreens.push(config);
-    },
-    removeSplitscreen: (state, id) => {
-      let index = state.splitscreens.findIndex(s => s.id === id);
-      if (index !== -1) state.splitscreens.splice(index, 1);
-    },
     showUsermenu: (state, show) => {
       state.showUsermenu = show;
     },