{"version":3,"file":"FileUpload.vue.mjs","sources":["../../../lib/data-provider-interface/components/FileUpload.vue"],"sourcesContent":["<template>\n  <div class=\"position-relative w-100 \">\n    <FormKit name=\"mode\" validation=\"required\" type=\"text\" class=\"selectInputField formkit-inner \" readonly=\"readonly\"\n      @click=\"triggerDropdown()\" :placeholder=\"t('message.dataupload.info.preferredInput')\" v-model=\"inputChoice\" :validation-messages=\"{\n        required: t('message.dataupload.info.preferredInput'),\n      }\" />\n    <ul ref=\"fLoad\" v-if=\"drop.active\" class=\"selectListUpload fileuploadList\">\n      <li @click=\"uploadFileSwitch = true; toggleUploadUrl()\"\n        class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{$t('message.dataupload.datasets.conditional.fileupload')}}</li>\n      <li @click=\"uploadURL = true; toggleUploadFileSwitch()\"\n        class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{$t('message.dataupload.datasets.conditional.URL')}}</li>\n    </ul>\n  </div>\n  <div class=\"w-100 position-relative\" v-if=\"uploadURL && !uploadFileSwitch\">\n\n    <FormKit id=\"aUrlLink\" v-model=\"URLValue\" class=\"selectInputField formkit-inner\" type=\"url\" name=\"@id\" :placeholder=\"context.attrs.placeholder\"\n      @input=\"saveUrl\" validation=\"required|url\" validation-visibility=\"live\" :validation-messages=\"{\n        required: t('message.dataupload.datasets.conditional.URL'),\n        url: t('message.dataupload.info.urlFormat')\n      }\" />\n\n  </div>\n  <div v-if=\"uploadFileSwitch\" ref=\"fileupload\" class=\"p-3 w-100\"\n    :class=\"`formkit-input-element formkit-input-element--${context.type}`\" :data-type=\"context.type\" v-bind=\"$attrs\">\n    <input type=\"text\" v-model=\"context.model\" @blur=\"context.blurHandler\" hidden />\n    <div class=\"file-div position-relative\">\n      <input class=\"mt-3\" type=\"file\" id=\"aUrlFL\" name=\"fileUpload\" @change=\"validateFile($event)\"\n        :accept=\"validExtensions\" :disabled=\"isLoading || !catalogId\">\n      <div class=\"upload-feedback position-absolute d-flex\" style=\"right: 0\">\n        <div v-if=\"isLoading\" class=\"lds-ring\">\n        </div>\n        <div v-if=\"success\"><i class=\"material-icons d-flex check-icon\">check_circle</i></div>\n        <div v-if=\"fail\"><i class=\"material-icons d-flex close-icon\">error</i></div>\n      </div>\n    </div>\n    <p class=\"dURLText my-3\" v-if=\"success\">{{ $t('message.metadata.downloadUrl') }}: <a :href=\"context.value?.['@id']\">{{\n      context.value?.['@id'] }}</a></p>\n    <div v-if=\"validExtensions && validExtensions.length\" class=\"allowedTypesWrapper\">\n      <p class=\"errorSub my-3 d-flex \" v-if=\"!success\">Allowed types: </p>\n      <div class=\"d-flex flex-wrap w-100\">\n        <span v-for=\"types in validExtensions\" :key=\"types\" class=\"mr-1 mb-1 allowedFTypes \">\n          {{ types }}\n        </span>\n      </div>\n\n    </div>\n\n\n  </div>\n\n</template>\n\n<script>\n/* eslint-disable consistent-return, no-unused-vars */\nimport { mapGetters, mapActions } from 'vuex';\nimport axios from 'axios';\nimport helper from '../utils/general-helper'\nimport { getNode } from '@formkit/core'\n\nimport { reactive, ref, onMounted, computed, defineComponent } from 'vue';\nimport { onClickOutside } from '@vueuse/core'\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\nimport { FormKit, useFormKitNodeById } from '@formkit/vue';\nimport { useI18n } from 'vue-i18n';\nimport { useDpiContext } from '../composables';\n\nexport default defineComponent({\n  props: {\n    context: {\n      type: Object,\n      required: true,\n    },\n  },\n\n  data() {\n    return {\n      inputChoice: '',\n      error: '',\n      URLValue: '',\n      uploadURL: false,\n      uploadFileSwitch: false,\n      checkifSet: false,\n      isLoading: false,\n      success: false,\n      fail: false,\n    \n      validExtensions: this.$env.content.dataProviderInterface.uploadFileTypes?.split(',') || []\n    };\n  },\n  computed: {\n\n    ...mapGetters('auth', [\n      'getUserData',\n      'getIsEditMode'\n    ]),\n    ...mapGetters('dpiStore', [\n      'getData',\n    ]),\n  },\n  methods: {\n    ...mapActions('dpiStore', [\n      'saveLocalstorageValues',\n    ]),\n    toggleUploadUrl() {\n      this.inputChoice = this.t('message.dataupload.datasets.conditional.fileupload')\n      if (this.uploadURL) { this.uploadURL = !this.uploadURL }\n    },\n    toggleUploadFileSwitch() {\n      this.inputChoice = this.t('message.dataupload.datasets.conditional.URL')\n      if (this.uploadFileSwitch) { this.uploadFileSwitch = !this.uploadFileSwitch }\n    },\n    validateFile(event) {\n      const file = event.target.files[0];\n      const fileExtension = '.' + file.name.split('.').pop().toLowerCase();\n      if (this.validExtensions && this.validExtensions.length) {\n        if (!this.validExtensions.includes(fileExtension)) {\n          console.log('Wrong filetype');\n        } else {\n          this.uploadOrReplaceFile({ file: event.target.files[0] })\n        }\n      } else {\n        this.error = \"\"\n        this.uploadOrReplaceFile({ file: event.target.files[0] })\n      }\n    },\n    async saveUrl() {\n\n      if (this.URLValue.includes('http://') || this.URLValue.includes('https://')) {\n        await this.context.node.input({ '@id': this.URLValue, 'mode': this.inputChoice })\n      }\n      else await this.context.node.input({ '@id': 'https://' + this.URLValue, 'mode': this.inputChoice })\n\n    },\n    checkIfPresent() {\n      // console.log(this.context.value['@id']);\n      if (this.context.value['@id']) {\n        // console.log(this.context.value['@id']);\n        this.URLValue = this.context.value['@id']\n        return true\n      }\n      else false\n    },\n    // finds the parent input group of a given element.\n    findParentInputGroupOfElement(element) {\n      // Start with the given element.\n      let currentElement = element;\n\n      // Traverse the DOM tree upwards.\n      while (currentElement) {\n        // If the current element is an input group, return it.\n        if (currentElement.classList.contains('formkit-input-group-repeatable')) {\n          return currentElement;\n        }\n        // If not, move to the parent element.\n        currentElement = currentElement.parentElement;\n      }\n\n      // If no input group was found, return null.\n      return null;\n    },\n    // finds the index of the distribution access URL based on the root of this component.\n    findDistributionAccessUrlIndex() {\n      // todo: find a more stable way to find the index of the distribution access URL.\n      // this way uses the DOM tree, which is not stable.\n\n      // Start at the root of this component.\n      const rootElement = this.$refs.fileupload;\n\n      // Find the parent input group of the root element.\n      const parentInputGroup = this.findParentInputGroupOfElement(rootElement);\n      if (!parentInputGroup) return null;\n\n      // Get the parent element of all input groups.\n      const parentOfAllInputGroups = parentInputGroup.parentElement;\n      const allInputGroupsNodeList = parentOfAllInputGroups.querySelectorAll('.formkit-input-group-repeatable');\n      const allInputGroupsArray = Array.from(allInputGroupsNodeList);\n\n      // Find the index of the parent input group within the array of all input groups.\n      const indexOfParentInputGroup = allInputGroupsArray.indexOf(parentInputGroup);\n\n      return indexOfParentInputGroup;\n    },\n    async uploadOrReplaceFile({ file }) {\n\n      const replaceEnabled = this.$env?.content?.dataProviderInterface?.enableFileUploadReplace || false;\n      const wantsToReplace = this.$route.query?.edit ?? false;\n\n      if (replaceEnabled && wantsToReplace) {\n        const distributionIndexToReplace = this.$route.query?.edit;\n        const fileIndexToReplace = this.findDistributionAccessUrlIndex();\n\n        const targetDistribution = this.getData('distributions')?.[distributionIndexToReplace];\n        const targetFile = targetDistribution?.['dcat:accessURL']?.[fileIndexToReplace];\n        const accessUrl = targetFile?.['@id'];\n        if (accessUrl) {\n          const fileUploadUrl = this.$env.api.fileUploadUrl;\n\n          const fileId = helper.getFileIdByAccessUrl({ accessUrl, fileUploadUrl })\n\n          return await this.uploadFile(file, {\n            method: 'PUT',\n            url: `${this.$env.api.fileUploadUrl}data/${fileId}?catalog=${this.catalogId}`,\n          });\n        }\n\n      }\n\n      return await this.uploadFile(file);\n    },\n    async uploadFile(file, options = {}) {\n\n      this.isLoading = true;\n\n      const form = new FormData();\n      form.append('file', file);\n\n      const catalog = this.catalogId;\n      const token = this.getUserData.rtpToken;\n\n      const resolvedOptions = {\n        method: 'POST',\n        url: `${this.$env.api.fileUploadUrl}data?catalog=${catalog}`,\n        ...options,\n      };\n\n      const requestOptions = {\n        method: resolvedOptions.method,\n        url: resolvedOptions.url,\n        headers: {\n          'Content-Type': 'multipart/form-data',\n          Authorization: `Bearer ${token}`,\n        },\n        data: form,\n      };\n\n      try {\n\n        const result = await axios.request(requestOptions);\n        const path = result.data.result.location.substring(result.data.result.location.indexOf('/') + 1);\n        this.isLoading = false;\n        this.success = true;\n        this.context.node.input({ '@id': `${this.$env.api.fileUploadUrl}${path}`, 'mode': this.inputChoice })\n\n      } catch (err) {\n\n        this.isLoading = false;\n        this.fail = true;\n        console.error(err); // eslint-disable-line\n      }\n    },\n  },\n  mounted() {\n\n    this.$nextTick(function () {\n\n      if (this.context.value['@id']) {\n        this.uploadURL = true\n        this.URLValue = this.context.value['@id']\n        this.inputChoice = \"Provide an URL\"\n        return true\n      }\n      else false\n    })\n  },\n  setup() {\n    const { t } = useI18n();\n    const env = useRuntimeEnv();\n \n\n\n    var drop = reactive({\n      active: false,\n    })\n\n\n    const fLoad = ref('fload');\n\n    onClickOutside(fLoad, event => {\n      drop.active = false\n    })\n    function triggerDropdown(e) {\n      drop.active = !drop.active\n    }\n\n    const dpiContext = useDpiContext();\n\n    const catalogIdFromFormkit = useFormKitNodeById('catalog')\n\n    const catalogId = computed(() =>\n      // Extract from catalog input field\n      catalogIdFromFormkit?.value.value\n      // Try to recover if catalog is empty for some reason\n      || dpiContext.value.edit?.catalog \n    );\n\n    return {\n      drop,\n      onClickOutside,\n      triggerDropdown,\n      t,\n      catalogId,\n    };\n  },\n});\n</script>\n\n<style lang=\"scss\" scoped>\n// @import '../../../styles/bootstrap_theme';\n// @import '../../../styles/utils/css-animations';\n.dURLText {}\n\n\n.accessUrl {\n  .formkit-outer {}\n}\n\n.file-div {\n  display: flex;\n  align-items: center;\n}\n\n.upload-feedback {\n  padding: 10px;\n}\n\n/*** MATERIAL ICONS ***/\n%modal-icon {\n  font-size: 20px;\n  cursor: default;\n}\n\n.check-icon {\n  @extend %modal-icon;\n  color: #28a745;\n}\n\n.close-icon {\n  @extend %modal-icon;\n  color: red;\n}\n\n.lds-ring {\n  display: inline-block;\n  position: relative;\n  width: 30px;\n  height: 30px;\n}\n\n.lds-ring div {\n  box-sizing: border-box;\n  display: block;\n  position: absolute;\n  right: 0;\n  width: 30px;\n  height: 30px;\n  border: 8px solid lightgray;\n  border-radius: 50%;\n  animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n  border-color: lightgray transparent transparent transparent;\n}\n\n.lds-ring div:nth-child(1) {\n  animation-delay: -0.45s;\n}\n\n.lds-ring div:nth-child(2) {\n  animation-delay: -0.3s;\n}\n\n.lds-ring div:nth-child(3) {\n  animation-delay: -0.15s;\n}\n\n.error {\n  color: red;\n}\n\n.errorSub {\n  color: black;\n}\n\n@keyframes lds-ring {\n  0% {\n    transform: rotate(0deg);\n  }\n\n  100% {\n    transform: rotate(360deg);\n  }\n}\n\n.allowedFTypes {\n  padding: 0.5rem;\n  border-radius: 5px;\n  border: 1px solid lightgrey;\n}\n\n.allowedTypesWrapper {\n  max-width: 100%;\n  display: flex;\n  flex-wrap: wrap;\n}\n\n.fileuploadList {\n  width: 96.7%;\n}\n</style>\n"],"names":["_sfc_main","defineComponent","_a","mapGetters","mapActions","event","fileExtension","element","currentElement","rootElement","parentInputGroup","allInputGroupsNodeList","file","replaceEnabled","_c","_b","wantsToReplace","_d","distributionIndexToReplace","_e","fileIndexToReplace","targetDistribution","_f","targetFile","_g","accessUrl","fileUploadUrl","fileId","helper","options","form","catalog","token","resolvedOptions","requestOptions","result","axios","path","err","useI18n","useRuntimeEnv","drop","reactive","fLoad","ref","onClickOutside","triggerDropdown","e","dpiContext","useDpiContext","catalogIdFromFormkit","useFormKitNodeById","catalogId","computed","_hoisted_1","_hoisted_5","_hoisted_15","_createElementVNode","_createVNode","_component_FormKit","_ctx","$event","_openBlock","_createElementBlock","_hoisted_2","_cache","_hoisted_3","_mergeProps","args","_vModelText","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_createTextVNode","_toDisplayString","_hoisted_12","_hoisted_13","_hoisted_14","_Fragment","_renderList","types"],"mappings":";;;;;;;;;;;;;;;AAkEA,MAAKA,IAAaC,EAAa;AAAA,EAC7B,OAAO;AAAA,IACL,SAAS;AAAA,MACP,MAAM;A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