{"version":3,"file":"OverviewPage.vue.mjs","sources":["../../../lib/data-provider-interface/views/OverviewPage.vue"],"sourcesContent":["<template>\n  <div ref=\"overview-page\" class=\"col-12\">\n    <!-- LANGUAGE SELECTOR -->\n    <div class=\"mt-5 mb-0\">\n      <div class=\"row\">\n        <div class=\"col-10 \">\n          {{ $t('message.dataupload.info.selectDisplayLanguage') }}:\n          <LanguageSelector class=\"ml-1\" v-model=\"dpiLocale\"></LanguageSelector>\n        </div>\n      </div>\n    </div>\n    <div class=\"mb-3\" v-if=\"showDatasetsOverview && overviewPageIsVisible\">\n      <DatasetOverview :dpiLocale=\"dpiLocale\" :key=\"dpiLocale\" />\n    </div>\n    <div class=\"mb-3\" v-if=\"showCatalogsOverview && overviewPageIsVisible\">\n      <CatalogueOverview :dpiLocale=\"dpiLocale\" :key=\"dpiLocale\" />\n    </div>\n  </div>\n<!-- Legal notice *** Checks for ANNIF to determine that this UI is DEU -->\n  <div v-if=\"instance.content.dataProviderInterface.annifIntegration\" class=\"legalnotice py-5\" style=\"width: 90%; margin: 0 auto;\">\n    <div class=\"d-flex align-items-start\">\n      <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30px\" height=\"30px\" fill=\"currentColor\"\n        class=\"bi bi-info-circle mx-3 mb-3 mt-1 infoboxI\" viewBox=\"0 0 16 16\">\n        <path d=\"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16\" />\n        <path\n          d=\"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0\" />\n      </svg>\n      <div class=\"w-80\">\n        <p>For <strong>European</strong>&nbsp;<strong>Commission's datasets</strong>, bear in mind that&nbsp;<a\n            class=\"external-link\" href=\"https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32011D0833\"\n            target=\"_blank\" rel=\"nofollow noopener\"><ins>Decision 2011/833/EU</ins></a> allows for their commercial\n          reuse\n          without prior authorisation, except for the material subject to the third party intellectual property rights.\n          This\n          Decision has been implemented under the&nbsp;<a class=\"external-link\"\n            href=\"https://ec.europa.eu/transparency/documents-register/detail?ref=C(2019)1655&amp;lang=en\"\n            target=\"_blank\" rel=\"nofollow noopener\"><ins>Decision C(2019) 1655 final</ins></a> by which Creative Commons\n          Attribution 4.0\n          International Public License (CC BY 4.0) is adopted as an open licence for the Commission's reuse policy.\n          Additionally, raw data, metadata or other documents of comparable nature may alternatively be distributed\n          under\n          the provisions of the Creative Commons Universal Public Domain Dedication deed (CC0 1.0).</p>\n        <p>The&nbsp;<strong>Council</strong>&nbsp;and the&nbsp;<strong>European Court of Auditors</strong>&nbsp;have\n          approved similar decisions on reuse. It is advisable that you check&nbsp;<strong>the reuse policy of your\n            organisation</strong>&nbsp;before publishing or submitting your dataset.</p>\n      </div>\n    </div>\n    <!-- <p>&nbsp;</p>\n     <hr />\n    <p>&nbsp;</p> -->\n\n    <div class=\"d-flex align-items-start mt-4\">\n      <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30px\" height=\"30px\" fill=\"currentColor\"\n        class=\"bi bi-info-circle mx-3 mb-3 mt-1 infoboxI \" viewBox=\"0 0 16 16\">\n        <path d=\"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16\" />\n        <path\n          d=\"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0\" />\n      </svg>\n      <div class=\"w-80\">\n        <p>As owner of your dataset, you guarantee that it does not violate the copyright, other intellectual property\n          or\n          privacy rights of any third party. In particular, if third party material is included in the dataset, you must\n          ensure that all necessary permissions have been obtained and appropriate acknowledgment is given, if\n          necessary.\n        </p>\n        <p>If you need further information regarding <strong>licenses or copyright</strong> issues, please contact us\n          at&nbsp;<span class=\"nobr\"><a class=\"external-link\" href=\"mailto:op-copyright@publications.europa.eu\"\n              target=\"_blank\" rel=\"nofollow noopener\">op-copyright@publications.europa.eu</a></span></p>\n      </div>\n    </div>\n  </div>\n\n</template>\n\n<script>\n/* eslint-disable no-restricted-syntax,guard-for-in */\nimport axios from 'axios';\nimport { mapActions, mapGetters } from 'vuex';\n\nimport LanguageSelector from '../components/LanguageSelector';\nimport DatasetOverview from './OverviewPage/DatasetOverview.vue';\nimport CatalogueOverview from './OverviewPage/CatalogueOverview.vue';\n\nimport { useIntersectionObserver } from '@vueuse/core'\nimport { ref, useTemplateRef } from 'vue'\nimport { getCurrentInstance } from \"vue\";\n\nexport default {\n  components: {\n    LanguageSelector,\n    DatasetOverview,\n    CatalogueOverview,\n  },\n  props: {\n    property: {\n      type: String\n    },\n    context: {\n      type: Object,\n    },\n  },\n  data() {\n    return {\n      instance : getCurrentInstance().appContext.app.config.globalProperties.$env,\n      dpiLocale: this.$route.query?.locale || this.$i18n.locale || this.$i18n.fallbackLocale || 'en',\n    }\n  },\n  computed: {\n    ...mapGetters('auth', [\n      'getIsEditMode',\n    ]),\n    ...mapGetters('dpiStore', [\n      'getData',\n    ]),\n    showDatasetsOverview() {\n      return this.property === 'datasets';\n    },\n    showCatalogsOverview() {\n      return this.property === 'catalogues';\n    }\n  },\n  methods: {\n    ...mapActions('dpiStore', [\n      'clearAll',\n      'saveLocalstorageValues',\n    ]),\n    clear() {\n      this.clearAll();\n    },\n    /*** Overview Page checker functionality ***/\n    // checkDatasetMandatory() {\n    //   if (!JSON.parse(localStorage.getItem('dpi_mandatory'))['datasets']) {\n    //     this.$router.push({ \n    //       name: 'DataProviderInterface-Input', \n    //       params: { \n    //         property: 'datasets', \n    //         page: 'step1' \n    //       }, \n    //       query: { \n    //         error: 'mandatoryDataset', \n    //         locale: this.$route.query.locale \n    //       } \n    //     });\n    //   }\n    // },\n    // checkDistributionMandatory() {\n    //   if (!JSON.parse(localStorage.getItem('dpi_mandatory'))['distributions'].length > 0 && !JSON.parse(localStorage.getItem('dpi_mandatory'))['distributions'].every(el => el === true)) {\n    //     this.$router.push({\n    //       name: 'DataProviderInterface-Input',\n    //       path: '/dpi/datasets/distoverview',\n    //       params: {\n    //         property: 'datasets',\n    //         page: 'distoverview',\n    //       },\n    //       query: {\n    //         error: 'mandatoryDistribution',\n    //         locale: this.$route.query.locale\n    //       },\n    //     });\n    //   }\n    // },\n    // checkCatalogueMandatory() {\n    //   if (!JSON.parse(localStorage.getItem('dpi_mandatory'))['catalogues']) {\n    //     this.$router.push({ \n    //       name: 'DataProviderInterface-Input', \n    //       params: { \n    //         property: 'catalogues', \n    //         page: 'step1' \n    //       }, \n    //       query: { \n    //         error: 'mandatoryCatalog', \n    //         locale: this.$route.query.locale\n    //       } \n    //     });\n    //   }\n    // },\n    checkID(property) {\n      // Check uniqueness of Dataset ID\n      if (!this.getIsEditMode) {\n        this.checkUniqueID(property)\n          .then((isUniqueID) => {\n            if (!isUniqueID) {\n              // Dataset ID not unique / taken in meantime --> Redirect to step1 where the user can choose a new ID\n              this.$router.push({\n                name: 'DataProviderInterface-Input',\n                params: {\n                  property: property,\n                  page: 'step1'\n                },\n                query: {\n                  error: 'id',\n                  locale: this.$route.query.locale\n                }\n              });\n            }\n          });\n      }\n    },\n    checkUniqueID(property) {\n      return new Promise((resolve) => {\n        if (this.getData(property)['@id'] !== '') {\n          const request = `${this.$env.api.hubUrl}${property}/${this.getData(property)['@id']}?useNormalizedId=true`;\n          axios.head(request)\n            .then(() => {\n              resolve(false);\n            })\n            .catch(() => {\n              resolve(true);\n            });\n        }\n      });\n    },\n  },\n  created() {\n    this.$nextTick(() => {\n      if (this.property === 'datasets') {\n        // this.checkID('datasets');\n        // this.checkDatasetMandatory();\n        // this.checkDistributionMandatory();\n      }\n\n      if (this.property === 'catalogues') {\n        // this.checkID('catalogues')\n        // this.checkCatalogueMandatory();\n      }\n    });\n  },\n  setup() {\n    const target = useTemplateRef('overview-page')\n    const overviewPageIsVisible = ref(false)\n\n    // Workaround.\n    // Ensure the individual overview pages are only mounted whenever this overview page is visible.\n    // For some reason, the form values are not reactive so on initial load, the distribution values are not displayed properly.\n    // This workaround delays the initial mount of the overview page until the overview page is visible.\n    // We use the IntersectionObserver to check if the overview page is visible, but we could also use more proper datamodels to determine this.\n    // todo: figure out why the form values are not reactive on initial load\n    useIntersectionObserver(\n      target,\n      ([{ isIntersecting }]) => {\n        overviewPageIsVisible.value = isIntersecting\n      },\n      {\n        rootMargin: '999999px 999999px 999999px 999999px'\n      }\n    )\n\n    return {overviewPageIsVisible}\n  }\n};\n</script>\n\n<style lang=\"scss\" scoped>\n.heading,\n.description,\n.arrow {\n  cursor: pointer;\n}\n\n.options,\n.download {\n  .dropdown-menu {\n    min-width: 300px;\n\n    .dropdown-item {\n      &:hover {\n        color: initial;\n        background-color: initial;\n      }\n    }\n  }\n}\n\n.legalnotice {\n  a {\n    color: blue;\n  }\n\n  padding: 1rem;\n  background-color: rgb(171, 225, 165)\n}\n\n.infoboxI {\n  width: 5%;\n}\n\n.w-80 {\n  width: 80%;\n}\n\n</style>\n"],"names":["_sfc_main","LanguageSelector","DatasetOverview","CatalogueOverview","getCurrentInstance","_a","mapGetters","mapActions","property","isUniqueID","resolve","request","axios","target","useTemplateRef","overviewPageIsVisible","ref","useIntersectionObserver","isIntersecting","_hoisted_2","_hoisted_3","_hoisted_4","_createElementVNode","_hoisted_1","_createTextVNode","_toDisplayString","_ctx","_createVNode","_component_LanguageSelector","$data","$event","$options","$setup","_openBlock","_createElementBlock","_hoisted_5","_createBlock","_component_DatasetOverview","_hoisted_6","_component_CatalogueOverview","_hoisted_7","_cache"],"mappings":";;;;;;;;;AAuFA,MAAKA,IAAU;AAAA,EACb,YAAY;AAAA,IAC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