polygon-software / flox

2 stars 1 forks source link

actual implementation for dossier files @johannschwabe #152

Closed github-actions[bot] closed 2 years ago

github-actions[bot] commented 2 years ago

actual implementation for dossier files @johannschwabe

const files = ref([])

{key: 'Beispiel2', uuid: 2, url: 'https://link.springer.com/content/pdf/10.1007/s00287-006-0063-2.pdf'},

{key: 'Beispiel3', uuid: 3, url: 'https://sisis.rz.htw-berlin.de/inh2009/12372030.pdf'},

{key: 'Beispiel4', uuid: 4, url: 'https://cds.cern.ch/record/798228/files/0131456601_TOC.pdf'},

eslint-disable-next-line @typescript-eslint/no-unused-vars,require-jsdoc

https://github.com/polygon-software/full-stack-bootstrap/blob/e66d41296d9f0536e1b2075074159d2a0ac0c2ba/frontend/src/components/dialogs/DownloadDocumentsDialog.vue#L54


<template>
  <q-dialog
    ref="dialog"
    :title="$t('employee_dashboard.all_documents')"
  >
    <q-card style="width: 600px;">
      <q-card-section>
        <p>
          {{ $t('employee_dashboard.all_documents') }}
        </p>
        <q-list
          bordered
          separator
        >
          <q-item
            v-for="(file) in existingFiles"
            :key="file.uuid"
          >
            <q-item-section>
              <div class="row flex justify-between content-center" style="height: 50px">
                <p class="col-8">{{ file.key }}</p>
                <div
                  v-if="file.url"
                  class="col-4"
                >
                  <q-btn
                    color="primary"
                    icon="download"
                    @click="openURL(file.url)"
                  />
                </div>
              </div>
            </q-item-section>
          </q-item>
        </q-list>
      </q-card-section>
      <q-card-actions>
        <q-btn
          class="q-ma-md"
          :label="$t('buttons.ok')"
          color="primary"
          @click="onCancel"
        />
      </q-card-actions>
    </q-card>
  </q-dialog>
</template>
<script setup lang="ts">
import {ref, Ref} from 'vue';
import {QDialog, openURL} from 'quasar';

const dialog: Ref<QDialog|null> = ref<QDialog|null>(null)

// TODO actual implementation for dossier files @johannschwabe
// const files = ref([])

//remove this and take the existing files form the backend from dossier table
const existingFiles = ref([
  {key: 'Beispiel1', uuid: 1, url: 'https://link.springer.com/content/pdf/10.1007/s11576-008-0095-0.pdf'},
  {key: 'Beispiel2', uuid: 2, url: 'https://link.springer.com/content/pdf/10.1007/s00287-006-0063-2.pdf'},
  {key: 'Beispiel3', uuid: 3, url: 'https://sisis.rz.htw-berlin.de/inh2009/12372030.pdf'},
  {key: 'Beispiel4', uuid: 4, url: 'https://cds.cern.ch/record/798228/files/0131456601_TOC.pdf'},
])

// Mandatory - do not remove!
// eslint-disable-next-line @typescript-eslint/no-unused-vars,require-jsdoc
function show(): void {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
  dialog.value?.show();
}
// eslint-disable-next-line require-jsdoc
function hide(): void {
  // eslint-disable-next-line @typescript-eslint/no-unsafe-call
  dialog.value?.hide()
}

// eslint-disable-next-line require-jsdoc
function onCancel(): void {
  hide()
}

</script>

d5135f894554f504dc4dce8ff9c7fb819c4ff85e

github-actions[bot] commented 2 years ago

Closed in 886f8a7117c5ef14018650c3ad4eb5e6510cc876