view client/src/components/App.vue @ 5629:84d01a536bec 729-node-js-newer-version

Transformed scss and sass styles into css
author Luisa Beerboom <lbeerboom@intevation.de>
date Thu, 11 May 2023 13:23:52 +0200
parents 62caee603217
children
line wrap: on
line source

<template>
  <div id="app" class="main" style="overflow-x:scroll">
    <div v-if="isAuthenticated" class="d-flex flex-column userinterface">
      <div class="boxes d-flex p-2">
        <div class="d-flex">
          <Sidebar />
          <div :class="searchContainer">
            <Search v-if="isMapVisible" />
            <Contextbox v-if="isMapVisible" />
          </div>
        </div>
        <div class="ml-auto d-flex">
          <div class="d-flex flex-column align-items-end">
            <Profiles v-if="isMapVisible" />
            <Gauges v-if="isMapVisible" />
            <Pdftool v-if="isMapVisible" />
            <AvailableFairwayDepthDialogue v-if="isMapVisible" />
          </div>
          <div class="d-flex flex-column align-items-end">
            <keep-alive>
              <Identify v-if="isMapVisible" />
            </keep-alive>
            <Layers v-if="isMapVisible" />
          </div>
          <Toolbar v-if="isMapVisible" />
        </div>
      </div>
      <MapPopup />
      <TimeSlider v-if="isMapVisible" />
    </div>
    <router-view />
    <vue-snotify />
    <Popup />
    <KeyboardHandler />
    <div
      id="offScreen"
      style="position: absolute; z-index: -1; top: 600px;"
    ></div>
  </div>
</template>

<style scoped>
#app {
  height: 100%;
  width: 100%;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

#app .userinterface {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  pointer-events: none;
}

#app .userinterface .boxes {
  position: relative;
  z-index: 10;
}
</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):
 * Thomas Junk <thomas.junk@intevation.de>
 * Markus Kottländer <markus.kottlaender@intevation.de>
 */
import { mapState } from "vuex";
import { displayError } from "@/lib/errors";

export default {
  name: "app",
  computed: {
    ...mapState("user", ["isAuthenticated"]),
    ...mapState("application", [
      "contextBoxContent",
      "showSearchbar",
      "backendError"
    ]),
    isMapVisible() {
      return /importconfiguration|importoverview|stretches|sections|review|bottlenecks|mainview/.test(
        this.$route.name
      );
    },
    searchContainer() {
      return [
        "ml-1",
        {
          wide: this.showSearchbar
        }
      ];
    }
  },
  components: {
    Profiles: () => import("./fairway/BottleneckDialogue"),
    Gauges: () => import("./gauge/Gauges"),
    Pdftool: () => import("./Pdftool"),
    Identify: () => import("./identify/Identify"),
    Layers: () => import("./layers/Layers"),
    Sidebar: () => import("./Sidebar"),
    Search: () => import("./Search"),
    TimeSlider: () => import("./TimeSlider"),
    Contextbox: () => import("./Contextbox"),
    Toolbar: () => import("./toolbar/Toolbar"),
    Popup: () => import("./Popup"),
    AvailableFairwayDepthDialogue: () =>
      import("./fairway/AvailableFairwayDepthDialogue.vue"),
    MapPopup: () => import("./map/MapPopup"),
    KeyboardHandler: () => import("./KeyboardHandler")
  },
  watch: {
    backendError() {
      if (this.backendError) {
        displayError({
          title: this.$gettext("Backend Error"),
          message: this.$gettext(
            "The Map information may be corrupted due to a backend error. Please contact your system operator"
          ),
          options: {
            timeout: 0,
            showProgressBar: false,
            closeOnClick: true,
            pauseOnHover: true,
            oneAtTime: true,
            bodyMaxLength: 1024
          }
        });
      }
    }
  }
};
</script>