From 7d97ee5917c94d099dd9bb231b98eb2c071ce2f8 Mon Sep 17 00:00:00 2001 From: isah <isabelle.herbauts@univie.ac.at> Date: Tue, 28 Jul 2020 12:08:00 +0200 Subject: [PATCH] fixed missing phaidra files --- src/components/browse/PCollectionGallery.vue | 219 ---------- .../display/phaidra_display/PDAdaptation.vue | 80 ---- .../phaidra_display/PDBfPublication.vue | 64 --- .../display/phaidra_display/PDCitation.vue | 34 -- .../display/phaidra_display/PDDimension.vue | 33 -- .../display/phaidra_display/PDDuration.vue | 43 -- .../display/phaidra_display/PDEntity.vue | 56 --- .../display/phaidra_display/PDExactMatch.vue | 55 --- .../display/phaidra_display/PDFunder.vue | 29 -- .../phaidra_display/PDGeoreference.vue | 33 -- .../display/phaidra_display/PDJsonld.vue | 399 ------------------ .../phaidra_display/PDJsonldLayout.vue | 86 ---- .../display/phaidra_display/PDKeyword.vue | 41 -- .../phaidra_display/PDLabeledValue.vue | 50 --- .../display/phaidra_display/PDLangValue.vue | 24 -- .../display/phaidra_display/PDLicense.vue | 44 -- .../display/phaidra_display/PDProject.vue | 44 -- .../display/phaidra_display/PDSeries.vue | 72 ---- .../phaidra_display/PDSkosPreflabel.vue | 44 -- .../display/phaidra_display/PDStudyPlan.vue | 32 -- .../display/phaidra_display/PDTitle.vue | 34 -- .../display/phaidra_display/PDUwmetadata.vue | 212 ---------- .../display/phaidra_display/PDValue.vue | 24 -- src/components/search/SearchResults.vue | 2 - src/components/select/CollectionDialog.vue | 116 ----- src/components/select/ListDialog.vue | 102 ----- src/components/select/OrgUnitsTreeDialog.vue | 77 ---- 27 files changed, 2049 deletions(-) delete mode 100644 src/components/browse/PCollectionGallery.vue delete mode 100644 src/components/display/phaidra_display/PDAdaptation.vue delete mode 100644 src/components/display/phaidra_display/PDBfPublication.vue delete mode 100644 src/components/display/phaidra_display/PDCitation.vue delete mode 100644 src/components/display/phaidra_display/PDDimension.vue delete mode 100644 src/components/display/phaidra_display/PDDuration.vue delete mode 100644 src/components/display/phaidra_display/PDEntity.vue delete mode 100644 src/components/display/phaidra_display/PDExactMatch.vue delete mode 100644 src/components/display/phaidra_display/PDFunder.vue delete mode 100644 src/components/display/phaidra_display/PDGeoreference.vue delete mode 100644 src/components/display/phaidra_display/PDJsonld.vue delete mode 100644 src/components/display/phaidra_display/PDJsonldLayout.vue delete mode 100644 src/components/display/phaidra_display/PDKeyword.vue delete mode 100644 src/components/display/phaidra_display/PDLabeledValue.vue delete mode 100644 src/components/display/phaidra_display/PDLangValue.vue delete mode 100644 src/components/display/phaidra_display/PDLicense.vue delete mode 100644 src/components/display/phaidra_display/PDProject.vue delete mode 100644 src/components/display/phaidra_display/PDSeries.vue delete mode 100644 src/components/display/phaidra_display/PDSkosPreflabel.vue delete mode 100644 src/components/display/phaidra_display/PDStudyPlan.vue delete mode 100644 src/components/display/phaidra_display/PDTitle.vue delete mode 100644 src/components/display/phaidra_display/PDUwmetadata.vue delete mode 100644 src/components/display/phaidra_display/PDValue.vue delete mode 100644 src/components/select/CollectionDialog.vue delete mode 100644 src/components/select/ListDialog.vue delete mode 100644 src/components/select/OrgUnitsTreeDialog.vue diff --git a/src/components/browse/PCollectionGallery.vue b/src/components/browse/PCollectionGallery.vue deleted file mode 100644 index 4e8a992..0000000 --- a/src/components/browse/PCollectionGallery.vue +++ /dev/null @@ -1,219 +0,0 @@ -<template> - <v-container> - <v-row> - <v-toolbar> - <v-toolbar-title>Toolbar</v-toolbar-title> - <v-spacer></v-spacer> - <v-btn icon @click="mode = 'single'"> - <v-icon>mdi-image-outline</v-icon> - </v-btn> - <v-btn icon @click="mode = 'gallery'"> - <v-icon>mdi-grid</v-icon> - </v-btn> - </v-toolbar> - </v-row> - <v-row> - <v-col md="auto"> - <v-treeview - :items="collections" - :load-children="getChildren" - :active.sync="active" - :open.sync="open" - activatable - transition - color="primary" - ></v-treeview> - </v-col> - <v-divider vertical></v-divider> - <v-col v-if="mode === 'single'"> - <v-carousel hide-delimiters height="100%"> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039867/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039866/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039865/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039864/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039863/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039862/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039861/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039860/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - <v-carousel-item :src="'https://phaidra.univie.ac.at/preview/o:1039859/ImageManipulator/boxImage/800/jpg'"></v-carousel-item> - </v-carousel> - </v-col> - <v-col v-if="mode === 'gallery'"> - <v-container> - <v-row> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039867/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039866/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039865/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039864/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039863/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039862/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039861/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039860/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - <v-col class="d-flex child-flex" cols="4"> - <v-card flat tile class="d-flex"> - <v-img class="grey lighten-2" aspect-ratio="1" :src="'https://phaidra.univie.ac.at/preview/o:1039859/ImageManipulator/boxImage/800/jpg'"> - <template v-slot:placeholder> - <v-row class="fill-height ma-0" align="center" justify="center"> - <v-progress-circular indeterminate color="grey lighten-5"></v-progress-circular> - </v-row> - </template> - </v-img> - </v-card> - </v-col> - </v-row> - </v-container> - </v-col> - </v-row> - </v-container> -</template> - -<script> -import qs from 'qs' - -export default { - name: 'p-collection-gallery', - props: { - collection: { - type: String, - required: true - } - }, - data () { - return { - active: [], - open: [this.collection], - collections: [ - { - id: this.collection, - name: 'Root', - children: [] - } - ], - mode: 'gallery', - selectedImage: { - src: '' - } - } - }, - methods: { - getChildren: async function (item) { - try { - let params = { - q: '*:*', - defType: 'edismax', - wt: 'json', - fq: 'ispartof:"' + item.id + '"', - start: 0, - rows: 5000 - } - let response = await this.$http.request({ - method: 'POST', - url: this.$store.state.instanceconfig.solr + '/select', - data: qs.stringify(params, { arrayFormat: 'repeat' }), - headers: { - 'content-type': 'application/x-www-form-urlencoded' - } - }) - let docs = response.data.response.docs - let total = response.data.response.numFound - if (total < 1) { - console.log(item.id + ' has ' + total + ' members') - return - } - for (let member of docs) { - let node = { - id: member.pid, - name: member.dc_title, - children: [] - } - item.children.push(node) - } - } catch (error) { - console.log(error) - this.$store.commit('setAlerts', [{ type: 'danger', msg: error }]) - } - } - } - -} -</script> diff --git a/src/components/display/phaidra_display/PDAdaptation.vue b/src/components/display/phaidra_display/PDAdaptation.vue deleted file mode 100644 index 0b95244..0000000 --- a/src/components/display/phaidra_display/PDAdaptation.vue +++ /dev/null @@ -1,80 +0,0 @@ -<template> - <v-layout row> - <v-flex xs10> - <v-card> - <v-card-title class="subheading grey white--text"> - <span>{{ $t(p) }}</span> - </v-card-title> - <v-divider></v-divider> - <v-card-text class="mt-4"> - <v-layout row wrap> - <template v-for="(title, j) in o['dce:title']"> - <template v-for="(mt, i) in title['bf:mainTitle']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'mt'+j+i"> - {{ $t(title['@type']) }} - <template v-if="mt['@language']">({{ mt['@language'] }})</template> - </v-flex> - <v-flex md8 xs12 :key="'mtv'+i"> - <v-layout column> - <v-flex class="valuefield">{{ mt['@value'] }}</v-flex> - <template v-for="(st, i) in title['bf:subtitle']"> - <v-flex class="valuefield" :key="'stv'+i">{{ st['@value'] }}</v-flex> - </template> - </v-layout> - </v-flex> - </template> - </template> - </v-layout> - <v-layout v-for="(obj, pred, i) in o" :key="'role' + i" row wrap> - <template v-if="pred.startsWith('role')"> - <v-flex - md4 - xs12 - class="pdlabel primary--text" - >{{ getLocalizedTermLabel('rolepredicate', pred) }}</v-flex> - <v-flex md8 xs12 v-for="(n, i) in obj" :key="'adpname' + i"> - <v-layout column> - <v-flex> - <template - class="valuefield" - v-for="(gn) in n['schema:givenName']" - >{{ gn['@value'] }}</template> - <template - class="valuefield" - v-for="(fn) in n['schema:familyName']" - >{{ fn['@value'] }}</template> - <template class="valuefield" v-for="(fn) in n['schema:name']">{{ fn['@value'] }}</template> - <template v-if="n['schema:affiliation']" class="grey--text"> - <template v-for="(af) in n['schema:affiliation']"> - <template class="valuefield" v-for="(afn) in af">{{ afn['@value'] }}</template> - </template> - </template> - </v-flex> - </v-layout> - </v-flex> - </template> - </v-layout> - </v-card-text> - </v-card> - </v-flex> - </v-layout> -</template> - -<script> -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-series", - mixins: [vocabulary], - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -}; -</script> - diff --git a/src/components/display/phaidra_display/PDBfPublication.vue b/src/components/display/phaidra_display/PDBfPublication.vue deleted file mode 100644 index d942c27..0000000 --- a/src/components/display/phaidra_display/PDBfPublication.vue +++ /dev/null @@ -1,64 +0,0 @@ -<template> - <v-layout row> - <v-flex xs10> - <v-card> - <v-card-title class="subheading grey white--text"> - <span>{{ $t(p) }}</span> - </v-card-title> - <v-divider></v-divider> - <v-card-text class="mt-4"> - <v-layout row wrap> - <template v-for="(publisher, j) in o['bf:agent']"> - <template v-for="(publishername, i) in publisher['schema:name']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'publnamel'+j+i">{{ $t('ORG_PUBLISHER') }}</v-flex> - <v-flex md8 xs12 :key="'publname'+j+i"> - <v-layout column> - <v-flex class="valuefield">{{ publishername['@value'] }}</v-flex> - </v-layout> - </v-flex> - </template> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(publishingplace, j) in o['bf:place']"> - <template v-for="(place, i) in publishingplace['skos:prefLabel']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'publplacel'+j+i">{{ $t('Place') }}</v-flex> - <v-flex md8 xs12 :key="'publplace'+j+i"> - <v-layout column> - <v-flex class="valuefield">{{ place['@value'] }}</v-flex> - </v-layout> - </v-flex> - </template> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(publishingdate, j) in o['bf:date']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'publdatel'+j">{{ $t('Date') }}</v-flex> - <v-flex md8 xs12 :key="'publdate'+j"> - <v-layout column> - <v-flex>{{ publishingdate }}</v-flex> - </v-layout> - </v-flex> - </template> - </v-layout> - </v-card-text> - </v-card> - </v-flex> - </v-layout> -</template> - -<script> -export default { - name: 'p-d-bf-publication', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDCitation.vue b/src/components/display/phaidra_display/PDCitation.vue deleted file mode 100644 index 5be1cda..0000000 --- a/src/components/display/phaidra_display/PDCitation.vue +++ /dev/null @@ -1,34 +0,0 @@ -<template> - <v-flex> - <v-layout column > - <v-flex> - <template v-for="(pl, i) in o['skos:prefLabel']"> - <v-layout :key="'row'+i" row wrap> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'mt'+i">{{ $t(p) }}<template v-if="pl['@language']"> ({{ pl['@language'] }})</template></v-flex> - <v-flex md8 xs12> - <v-layout row :key="'mtv'+i"> - <v-flex class="valuefield">{{ pl['@value'] }}<template v-for="(identifier) in o['skos:exactMatch']"> ({{ identifier }})</template></v-flex> - </v-layout> - </v-flex> - </v-layout> - </template> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-citation', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDDimension.vue b/src/components/display/phaidra_display/PDDimension.vue deleted file mode 100644 index d029ecd..0000000 --- a/src/components/display/phaidra_display/PDDimension.vue +++ /dev/null @@ -1,33 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text" xs3>{{ $t(p) }}</v-flex> - <v-flex md8 xs12> - <span v-for="(v, i) in o['schema:value']" :key="'v'+i">{{ v }}</span> - <span - v-for="(v, i) in o['schema:unitCode']" - :key="'u'+i" - >{{ getLocalizedTermLabel('uncefact', v) }}</span> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-dimension", - mixins: [vocabulary], - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -}; -</script> - diff --git a/src/components/display/phaidra_display/PDDuration.vue b/src/components/display/phaidra_display/PDDuration.vue deleted file mode 100644 index 3f89989..0000000 --- a/src/components/display/phaidra_display/PDDuration.vue +++ /dev/null @@ -1,43 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text" xs3>{{ $t(p) }}</v-flex> - <v-flex md8 xs12> - <template v-if="duration.hours > 0">{{ duration.hours }} {{$t('hours') + ' '}}</template> - <template v-if="duration.minutes > 0">{{ duration.minutes }} {{$t('minutes') + ' '}}</template> - <template v-if="duration.seconds > 0">{{ duration.seconds }} {{$t('seconds')}}</template> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-duration", - mixins: [vocabulary], - props: { - o: { - type: String, - required: true - }, - p: { - type: String - } - }, - computed: { - duration: function() { - let m = this.o.match(/PT(\d+)H(\d+)M(\d+)S/); - if (m) { - return { - hours: m[1], - minutes: m[2], - seconds: m[3] - }; - } - } - } -}; -</script> - diff --git a/src/components/display/phaidra_display/PDEntity.vue b/src/components/display/phaidra_display/PDEntity.vue deleted file mode 100644 index 7c75ed0..0000000 --- a/src/components/display/phaidra_display/PDEntity.vue +++ /dev/null @@ -1,56 +0,0 @@ -<template> - <v-flex> - <v-layout v-if="entity" row wrap> - <v-flex md4 xs12 class="pdlabel primary--text">{{ getLocalizedTermLabel(this.role) }}</v-flex> - <v-flex md8 xs12> - <v-layout column> - <v-flex> - <template - class="valuefield" - v-for="(gn) in entity['schema:givenName']" - >{{ gn['@value'] }}</template> - <template - class="valuefield" - v-for="(fn) in entity['schema:familyName']" - >{{ fn['@value'] }}</template> - <template class="valuefield" v-for="(fn) in entity['schema:name']">{{ fn['@value'] }}</template> - <template v-if="entity['schema:affiliation']" class="grey--text"> - <template v-for="(af) in entity['schema:affiliation']"> - <template class="valuefield" v-for="(afn) in af">{{ afn['@value'] }}</template> - </template> - </template> - </v-flex> - </v-layout> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-entity", - mixins: [vocabulary], - props: { - entity: { - type: Object, - required: true - }, - role: { - type: String, - required: true - } - }, - methods: { - getLocalizedTermLabel: function(role) { - return this.$store.getters.getLocalizedTermLabel( - "rolepredicate", - role, - this.$i18n.locale - ); - } - } -}; -</script> - diff --git a/src/components/display/phaidra_display/PDExactMatch.vue b/src/components/display/phaidra_display/PDExactMatch.vue deleted file mode 100644 index 3e4daf4..0000000 --- a/src/components/display/phaidra_display/PDExactMatch.vue +++ /dev/null @@ -1,55 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text" xs3>{{ $t(p) }}</v-flex> - <v-flex md8 xs12>{{ resolve(p, o['skos:exactMatch']) }}</v-flex> - </v-layout> - </v-flex> -</template> - -<script> -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-exact-match", - mixins: [vocabulary], - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - }, - data() { - return { - langCode2to3: { - en: "eng", - de: "deu", - it: "ita" - } - }; - }, - methods: { - resolve: function(p, v) { - var vocabulary = ""; - switch (p) { - case "vra:hasInscription": - vocabulary = "https://phaidra.org/vocabulary/stamp"; - break; - - default: - console.error( - "p-d-exact-match resolve: unrecognized predicate ", - p, - v - ); - } - - return this.getLocalizedTermLabel(vocabulary, v); - } - } -}; -</script> - diff --git a/src/components/display/phaidra_display/PDFunder.vue b/src/components/display/phaidra_display/PDFunder.vue deleted file mode 100644 index 09722aa..0000000 --- a/src/components/display/phaidra_display/PDFunder.vue +++ /dev/null @@ -1,29 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <template v-for="(l, i) in o['skos:prefLabel']"> - <v-flex class="pdlabel primary--text" md4 xs12 :key="'fl'+i">{{ $t('Funder') }} ({{ l['@language'] }})</v-flex> - <v-flex class="valuefield" md8 xs12 :key="'fv'+i">{{ l['@value'] }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(id, i) in o['skos:exactMatch']"> - <v-flex class="pdlabel primary--text" md4 xs12 :key="'idl'+i">{{ $t('Funder Id') }}</v-flex> - <v-flex md8 xs12 :key="'idv'+i">{{ id }}</v-flex> - </template> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-funder', - props: { - o: { - type: Object, - required: true - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDGeoreference.vue b/src/components/display/phaidra_display/PDGeoreference.vue deleted file mode 100644 index c63c812..0000000 --- a/src/components/display/phaidra_display/PDGeoreference.vue +++ /dev/null @@ -1,33 +0,0 @@ -<template> - <v-flex> - <template v-if="o['skos:prefLabel']"> - <v-layout row wrap> - <v-flex class="pdlabel primary--text" md4 xs12>{{ $t(p) }}<template v-for="(l) in o['skos:prefLabel']"><template v-if="l['@language']"> ({{ l['@language'] }})</template></template></v-flex> - <v-flex md8 xs12> - <v-layout column> - <v-flex class="valuefield" v-for="(l, i) in o['skos:prefLabel']" :key="'gplv'+i">{{ l['@value'] }}</v-flex> - <template v-if="o['rdfs:label']"> - <v-flex class="grey--text valuefield" v-for="(l, i) in o['rdfs:label']" :key="'gl'+i">[{{ l['@value'] }}]</v-flex> - </template> - </v-layout> - </v-flex> - </v-layout> - </template> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-georeference', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDJsonld.vue b/src/components/display/phaidra_display/PDJsonld.vue deleted file mode 100644 index bd08475..0000000 --- a/src/components/display/phaidra_display/PDJsonld.vue +++ /dev/null @@ -1,399 +0,0 @@ -<template> - <p-d-jsonld-layout v-if="jsonld"> - <template v-if="pid" slot="pid"> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text">{{ $t('Persistent identifier') }}</v-flex> - <v-flex md8 xs12>https://{{ instance.baseurl }}/{{ pid }}</v-flex> - </v-layout> - </v-flex> - </template> - - <template v-for="(o, p) in jsonld"> - <template v-if="p==='dcterms:type'" slot="dcterms:type"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'type'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='edm:hasType'" slot="edm:hasType"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'objtyp'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='schema:genre'" slot="schema:genre"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'genre'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='rdau:P60059'" slot="rdau:P60059"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'P60059'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='dce:title'" slot="dce:title"> - <p-d-title :o="t" v-for="(t, j) in o" :key="componentid+'title'+j"></p-d-title> - </template> - - <template v-else-if="p.startsWith('role:')" slot="role"> - <p-d-entity :role="p" :entity="e" v-for="(e, j) in o" :key="componentid+'entity'+p+j"></p-d-entity> - </template> - - <template v-else-if="p==='bf:note'" slot="bf:note"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'text'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='bf:tableOfContents'" slot="bf:tableOfContents"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'toc'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='dce:subject'" slot="dce:subject"> - <p-d-keyword :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'keyword'+j"></p-d-keyword> - </template> - - <template v-else-if="p==='dcterms:language'" slot="dcterms:language"> - <p-d-labeled-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'lan'+j"></p-d-labeled-value> - </template> - - <template v-else-if="p==='schema:subtitleLanguage'" slot="schema:subtitleLanguage"> - <p-d-labeled-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'sublan'+j"></p-d-labeled-value> - </template> - - <template v-else-if="p==='dcterms:date'" slot="dcterms:date"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'date'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:created'" slot="dcterms:created"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'created'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:modified'" slot="dcterms:modified"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'modified'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:available'" slot="dcterms:available"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'available'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:issued'" slot="dcterms:issued"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'issued'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:valid'" slot="dcterms:valid"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'valid'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:dateAccepted'" slot="dcterms:dateAccepted"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'dateAccepted'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:dateCopyrighted'" slot="dcterms:dateCopyrighted"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'dateCopyrighted'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:dateSubmitted'" slot="dcterms:dateSubmitted"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'dateSubmitted'+j"></p-d-value> - </template> - - <template v-else-if="p==='rdau:P60071'" slot="rdau:P60071"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'dateOfProduction'+j"></p-d-value> - </template> - - <template v-else-if="p==='phaidra:dateAccessioned'" slot="phaidra:dateAccessioned"> - <p-d-value - :p="p" - :o="item" - v-for="(item, j) in o" - :key="componentid+'phaidra:dateAccessioned'+j" - ></p-d-value> - </template> - - <template v-else-if="p==='dcterms:temporal'" slot="dcterms:temporal"> - <p-d-lang-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'temporal'+j"></p-d-lang-value> - </template> - - <template v-else-if="p==='rdau:P60193'" slot="rdau:P60193"> - <p-d-series :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'series'+j"></p-d-series> - </template> - - <template v-else-if="p==='bf:provisionActivity'" slot="bf:provisionActivity"> - <p-d-bf-publication :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'bfpubl'+j"></p-d-bf-publication> - </template> - - <template v-else-if="p==='cito:cites'" slot="cito:cites"> - <p-d-citation :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'cites'+j"></p-d-citation> - </template> - - <template v-else-if="p==='cito:isCitedBy'" slot="cito:isCitedBy"> - <p-d-citation :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'citedby'+j"></p-d-citation> - </template> - - <template v-else-if="p==='rdau:P60227'" slot="rdau:P60227"> - <p-d-adaptation :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'adaptation'+j"></p-d-adaptation> - </template> - - <template v-else-if="p==='frapo:isOutputOf'" slot="frapo:isOutputOf"> - <template v-for="(item, j) in o"> - <template v-if="item['@type']==='aaiso:Programme'"> - <p-d-study-plan :p="p" :o="item" :key="componentid+'study-plan'+j"></p-d-study-plan> - </template> - <template v-else-if="item['@type']==='foaf:Project'"> - <p-d-project :p="p" :o="item" :key="componentid+'project'+j"></p-d-project> - </template> - </template> - </template> - - <template v-else-if="p==='frapo:hasFundingAgency'" slot="frapo:hasFundingAgency"> - <p-d-funder :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'funder'+j"></p-d-funder> - </template> - - <template v-else-if="p==='rdax:P00009'" slot="rdax:P00009"> - <p-d-skos-preflabel - :p="p" - :o="item" - v-for="(item, j) in o" - :key="componentid+'association'+j" - ></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='bf:physicalLocation'" slot="bf:physicalLocation"> - <p-d-lang-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'physloc'+j"></p-d-lang-value> - </template> - - <template v-else-if="p==='bf:shelfMark'" slot="bf:shelfMark"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'callnr'+j"></p-d-value> - </template> - - <template v-else-if="p==='dcterms:provenance'" slot="dcterms:provenance"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'prov'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='dcterms:spatial'" slot="dcterms:spatial"> - <p-d-georeference :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'spatial'+j"></p-d-georeference> - </template> - - <template v-else-if="p==='vra:placeOfCreation'" slot="vra:placeOfCreation"> - <p-d-georeference - :p="p" - :o="item" - v-for="(item, j) in o" - :key="componentid+'placeOfCreation'+j" - ></p-d-georeference> - </template> - - <template v-else-if="p==='vra:placeOfRepository'" slot="vra:placeOfRepository"> - <p-d-georeference :p="p" :o="item" v-for="(item, j) in o" :key="'placeOfRepository'+j"></p-d-georeference> - </template> - - <template v-else-if="p==='vra:placeOfSite'" slot="vra:placeOfSite"> - <p-d-georeference - :p="p" - :o="item" - v-for="(item, j) in o" - :key="componentid+'placeOfSite'+j" - ></p-d-georeference> - </template> - - <template v-else-if="p==='ebucore:filename'" slot="ebucore:filename"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'filename'+j"></p-d-value> - </template> - - <template v-else-if="p==='ebucore:hasMimeType'" slot="ebucore:hasMimeType"> - <p-d-labeled-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'mime'+j"></p-d-labeled-value> - </template> - - <template v-else-if="p==='opaque:cco_accessionNumber'" slot="opaque:cco_accessionNumber"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'accnr'+j"></p-d-value> - </template> - - <template v-else-if="p==='vra:hasInscription'" slot="vra:hasInscription"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'inscr'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='vra:material'" slot="vra:material"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'material'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='vra:hasTechnique'" slot="vra:hasTechnique"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'techn'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='dce:format'" slot="dce:format"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'format'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='rdau:P60048'" slot="rdau:P60048"> - <p-d-skos-preflabel - :p="p" - :o="item" - v-for="(item, j) in o" - :key="componentid+'carriertype'+j" - ></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='rdau:P60059'" slot="rdau:P60059"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'regenc'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='schema:width'" slot="schema:width"> - <p-d-dimension :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'width'+j"></p-d-dimension> - </template> - - <template v-else-if="p==='schema:height'" slot="schema:height"> - <p-d-dimension :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'height'+j"></p-d-dimension> - </template> - - <template v-else-if="p==='schema:depth'" slot="schema:depth"> - <p-d-dimension :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'depth'+j"></p-d-dimension> - </template> - - <template v-else-if="p==='schema:weight'" slot="schema:weight"> - <p-d-dimension :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'weight'+j"></p-d-dimension> - </template> - - <template v-else-if="p==='schema:duration'" slot="schema:duration"> - <p-d-duration :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'duration'+j"></p-d-duration> - </template> - - <template v-else-if="p==='schema:numberOfPages'" slot="schema:numberOfPages"> - <p-d-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'numberOfPages'+j"></p-d-value> - </template> - - <template v-else-if="p==='bf:soundCharacteristic'" slot="bf:soundCharacteristic"> - <p-d-value - :p="p" - :o="item" - v-for="(item, j) in o" - :key="componentid+'soundCharacteristic'+j" - ></p-d-value> - </template> - - <template v-else-if="p==='bf:supplementaryContent'" slot="bf:supplementaryContent"> - <p-d-skos-preflabel - :p="p" - :o="item" - v-for="(item, j) in o" - :key="componentid+'supplementaryContent'+j" - ></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='dcterms:audience'" slot="dcterms:audience"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'audience'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='bf:awards'" slot="bf:awards"> - <p-d-skos-preflabel :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'awards'+j"></p-d-skos-preflabel> - </template> - - <template v-else-if="p==='edm:rights'" slot="edm:rights"> - <p-d-license :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'license'+j"></p-d-license> - </template> - - <template v-else-if="p==='dce:rights'" slot="dce:rights"> - <p-d-lang-value :p="p" :o="item" v-for="(item, j) in o" :key="componentid+'rights'+j"></p-d-lang-value> - </template> - - <template v-else-if="p==='dcterms:subject'" slot="dcterms:subject"> - <template v-for="(subject, j) in o"> - <v-card - class="mt-3" - v-if="subject['@type']==='phaidra:Subject'" - :key="componentid+'psubject'+j" - > - <v-toolbar dense flat> - <v-layout> - <v-toolbar-title class="font-weight-light">Subject</v-toolbar-title> - </v-layout> - </v-toolbar> - <v-card-text class="ma-2"> - <p-d-jsonld :jsonld="subject"></p-d-jsonld> - </v-card-text> - </v-card> - <p-d-skos-preflabel v-else :p="p" :o="subject" :key="componentid+'subject'+j"></p-d-skos-preflabel> - </template> - </template> - - <template v-else-if="p==='@type'"></template> - - <template v-else slot="unknown-predicate"> - <v-container :key="p"> - <v-alert :type="'error'" :value="true" transition="fade-transition"> - Unknown predicate - <b>{{p}}</b> - </v-alert> - <p-i-unknown-readonly :jsonld="o" :label="p"></p-i-unknown-readonly> - </v-container> - </template> - </template> - </p-d-jsonld-layout> -</template> - -<script> -import PDLicense from "../phaidra_display/PDLicense"; -import PDTitle from "../phaidra_display/PDTitle"; -import PDSkosPreflabel from "../phaidra_display/PDSkosPreflabel"; -import PDKeyword from "../phaidra_display/PDKeyword"; -import PDLangValue from "../phaidra_display/PDLangValue"; -import PDValue from "../phaidra_display/PDValue"; -import PDDimension from "../phaidra_display/PDDimension"; -import PDDuration from "../phaidra_display/PDDuration"; -import PDGeoreference from "../phaidra_display/PDGeoreference"; -import PDEntity from "../phaidra_display/PDEntity"; -import PDLabeledValue from "../phaidra_display/PDLabeledValue"; -import PDFunder from "../phaidra_display/PDFunder"; -import PDProject from "../phaidra_display/PDProject"; -import PDBfPublication from "../phaidra_display/PDBfPublication"; -import PDStudyPlan from "../phaidra_display/PDStudyPlan"; -import PDSeries from "../phaidra_display/PDSeries"; -import PDAdaptation from "../phaidra_display/PDAdaptation"; -import PDCitation from "../phaidra_display/PDCitation"; -import PDJsonldLayout from "../phaidra_display/PDJsonldLayout"; -import PIUnknownReadonly from "../../input/phaidra_inputs/PIUnknownReadonly"; -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-jsonld", - mixins: [vocabulary], - props: { - jsonld: { - type: Object, - default: null - }, - pid: String - }, - components: { - PDTitle, - PDEntity, - PDJsonldLayout, - PDSkosPreflabel, - PDKeyword, - PDLangValue, - PDLicense, - PDValue, - PDDimension, - PDDuration, - PDGeoreference, - PDLabeledValue, - PDFunder, - PDProject, - PDBfPublication, - PDStudyPlan, - PDSeries, - PDAdaptation, - PDCitation, - PIUnknownReadonly - }, - computed: { - instance: function() { - return this.$store.state.settings.instance; - }, - componentid: function() { - return Math.floor(Math.random() * 10000000); - } - }, - mounted: function() { - this.$store.dispatch("loadLanguages"); - } -}; -</script> - -<style> -.valuefield { - white-space: pre-wrap; -} -</style> \ No newline at end of file diff --git a/src/components/display/phaidra_display/PDJsonldLayout.vue b/src/components/display/phaidra_display/PDJsonldLayout.vue deleted file mode 100644 index d9eeb65..0000000 --- a/src/components/display/phaidra_display/PDJsonldLayout.vue +++ /dev/null @@ -1,86 +0,0 @@ -<template> - <v-container> - <v-layout column> - <slot name="dce:title"></slot> - <slot name="role"></slot> - <slot name="bf:note"></slot> - <slot name="bf:tableOfContents"></slot> - - <slot name="edm:hasType"></slot> - <slot name="schema:genre"></slot> - - <slot name="dcterms:language"></slot> - <slot name="schema:subtitleLanguage"></slot> - <slot name="dce:subject"></slot> - - <slot name="dcterms:date"></slot> - <slot name="dcterms:created"></slot> - <slot name="dcterms:modified"></slot> - <slot name="dcterms:available"></slot> - <slot name="dcterms:issued"></slot> - <slot name="dcterms:valid"></slot> - <slot name="dcterms:dateAccepted"></slot> - <slot name="dcterms:dateCopyrighted"></slot> - <slot name="dcterms:dateSubmitted"></slot> - <slot name="rdau:P60071"></slot> - <slot name="phaidra:dateAccessioned"></slot> - <slot name="dcterms:temporal"></slot> - - <slot name="rdau:P60193"></slot> - <slot name="cito:cites"></slot> - <slot name="cito:isCitedBy"></slot> - <slot name="bf:provisionActivity"></slot> - <slot name="rdau:P60227"></slot> - - <slot name="frapo:hasFundingAgency"></slot> - <slot name="frapo:isOutputOf"></slot> - <slot name="rdax:P00009"></slot> - <slot name="dcterms:provenance"></slot> - - <slot name="dcterms:spatial"></slot> - <slot name="vra:placeOfCreation"></slot> - <slot name="vra:placeOfRepository"></slot> - <slot name="vra:placeOfSite"></slot> - - <slot name="schema:numberOfPages"></slot> - <slot name="bf:soundCharacteristic"></slot> - <slot name="bf:supplementaryContent"></slot> - <slot name="bf:awards"></slot> - <slot name="dcterms:audience"></slot> - <slot name="rdau:P60059"></slot> - - <slot name="ebucore:filename"></slot> - <slot name="ebucore:hasMimeType"></slot> - - <slot name="opaque:cco_accessionNumber"></slot> - <slot name="bf:shelfMark"></slot> - <slot name="bf:physicalLocation"></slot> - - <slot name="vra:hasInscription"></slot> - <slot name="vra:material"></slot> - <slot name="vra:hasTechnique"></slot> - <slot name="dce:format"></slot> - <slot name="rdau:P60048"></slot> - <slot name="schema:width"></slot> - <slot name="schema:height"></slot> - <slot name="schema:depth"></slot> - <slot name="schema:weight"></slot> - <slot name="schema:duration"></slot> - - <slot name="dcterms:type"></slot> - <slot name="pid"></slot> - - <slot name="edm:rights"></slot> - <slot name="dce:rights"></slot> - - <slot name="dcterms:subject"></slot> - - <slot name="unknown-predicate"></slot> - </v-layout> - </v-container> -</template> -<script> -export default { - name: 'p-d-jsonld-layout' -} -</script> \ No newline at end of file diff --git a/src/components/display/phaidra_display/PDKeyword.vue b/src/components/display/phaidra_display/PDKeyword.vue deleted file mode 100644 index f2560c4..0000000 --- a/src/components/display/phaidra_display/PDKeyword.vue +++ /dev/null @@ -1,41 +0,0 @@ -<template> - <v-flex> - <v-layout column > - <v-flex> - <template v-for="(l, i) in o['skos:prefLabel']"> - <v-layout row wrap :key="'row'+i"> - <v-flex class="pdlabel primary--text" md4 xs12 :key="'l'+i">{{ $t(p) }}<template v-if="l['@language']"> ({{ l['@language'] }})</template></v-flex> - <v-flex md8 xs12 :key="'t'+i"> - <v-chip v-for="(keyword, j) in getKeywords(l)" :key="'kw'+j">{{keyword}}</v-chip> - </v-flex> - </v-layout> - </template> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-keyword', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - }, - methods: { - getKeywords: function (l) { - if (l['@value']) { - return l['@value'].split(',') - } else { - return [] - } - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDLabeledValue.vue b/src/components/display/phaidra_display/PDLabeledValue.vue deleted file mode 100644 index 59ee0c3..0000000 --- a/src/components/display/phaidra_display/PDLabeledValue.vue +++ /dev/null @@ -1,50 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text">{{ $t(p) }}</v-flex> - <v-flex md8 xs12> - {{ resolve(p, o) }} - <span class="grey--text">[{{o}}]</span> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-labeled-value", - mixins: [vocabulary], - props: { - o: { - type: String, - required: true - }, - p: { - type: String - } - }, - methods: { - resolve: function(p, v) { - var vocabulary = ""; - switch (p) { - case "dcterms:language": - case "schema:subtitleLanguage": - vocabulary = "lang"; - break; - - case "ebucore:hasMimeType": - vocabulary = "mimetypes"; - break; - - default: - //console.error('p-d-uri resolve: unrecognized predicate ', p, v) - } - - return this.getLocalizedTermLabel(vocabulary, v); - } - } -}; -</script> - diff --git a/src/components/display/phaidra_display/PDLangValue.vue b/src/components/display/phaidra_display/PDLangValue.vue deleted file mode 100644 index e75a707..0000000 --- a/src/components/display/phaidra_display/PDLangValue.vue +++ /dev/null @@ -1,24 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text" xs3>{{ $t(p) }}<template v-if="o['@language']"> ({{ o['@language'] }})</template></v-flex> - <v-flex class="valuefield" md8 xs12>{{ o['@value'] }}</v-flex> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-lang-value', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDLicense.vue b/src/components/display/phaidra_display/PDLicense.vue deleted file mode 100644 index 78b2629..0000000 --- a/src/components/display/phaidra_display/PDLicense.vue +++ /dev/null @@ -1,44 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text">{{ $t(p) }}</v-flex> - <v-flex md8 xs12> - <a :href="o" target="_blank">{{ getLocalizedTermLabel('licenses', o) }}</a> - <!-- - <v-flex> - <v-img :src="'../../assets/' + getTermProperty('licenses', o, 'img')" :alt="o" class="license-icon"/> - </v-flex> - --> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-license", - mixins: [vocabulary], - props: { - o: { - type: String, - required: true - }, - p: { - type: String - } - } -}; -</script> - -<style scoped> -.license-icon { - height: 1.3em; - vertical-align: text-bottom; -} - -.license-label { - vertical-align: middle; -} -</style> diff --git a/src/components/display/phaidra_display/PDProject.vue b/src/components/display/phaidra_display/PDProject.vue deleted file mode 100644 index f9d9465..0000000 --- a/src/components/display/phaidra_display/PDProject.vue +++ /dev/null @@ -1,44 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <template v-for="(l, i) in o['skos:prefLabel']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'pl'+i">{{ $t('Project') }} ({{ l['@language'] }})</v-flex> - <v-flex class="valuefield" md8 xs12 :key="'pv'+i" >{{ l['@value'] }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(id, i) in o['skos:exactMatch']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'idl'+i">{{ $t('Project Id') }}</v-flex> - <v-flex md8 xs12 :key="'idv'+i">{{ id }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(d, i) in o['rdfs:comment']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'dl'+i">{{ $t('Project Description') }} ({{ d['@language'] }})</v-flex> - <v-flex class="valuefield" md8 xs12 :key="'dv'+i">{{ d['@value'] }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(hp, i) in o['foaf:homepage']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'hpl'+i">{{ $t('Project Homepage') }}</v-flex> - <v-flex md8 xs12 :key="'hpv'+i">{{ hp }}</v-flex> - </template> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-project', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDSeries.vue b/src/components/display/phaidra_display/PDSeries.vue deleted file mode 100644 index 2775efc..0000000 --- a/src/components/display/phaidra_display/PDSeries.vue +++ /dev/null @@ -1,72 +0,0 @@ -<template> - <v-layout row wrap> - <v-flex xs10> - <v-card > - <v-card-title class="subheading grey white--text"> - <span>{{ $t(p) }}</span> - </v-card-title> - <v-divider></v-divider> - <v-card-text class="mt-4"> - <v-layout row wrap> - <template v-for="(title, j) in o['dce:title']"> - <template v-for="(mt, i) in title['bf:mainTitle']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'mt'+j+i">{{ $t(title['@type']) }}<template v-if="mt['@language']"> ({{ mt['@language'] }})</template></v-flex> - <v-flex md8 xs12 :key="'mtv'+j+i"> - <v-layout column> - <v-flex class="valuefield">{{ mt['@value'] }}</v-flex> - </v-layout> - </v-flex> - </template> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(volume, i) in o['bibo:volume']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'vl'+i">{{ $t('Volume') }}</v-flex> - <v-flex md8 xs12 :key="'v'+i">{{ volume }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(issue, i) in o['bibo:issue']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'il'+i">{{ $t('Issue') }}</v-flex> - <v-flex md8 xs12 :key="'i'+i">{{ issue }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(issn, i) in o['identifiers:issn']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'isl'+i">{{ $t('ISSN') }}</v-flex> - <v-flex md8 xs12 :key="'is'+i">{{ issn }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(issued, i) in o['dcterms:issued']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'idatel'+i">{{ $t('Issued') }}</v-flex> - <v-flex md8 xs12 :key="'idate'+i">{{ issued }}</v-flex> - </template> - </v-layout> - <v-layout row wrap> - <template v-for="(id, i) in o['skos:exactMatch']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'idatel'+i">{{ $t('Identifier') }}</v-flex> - <v-flex md8 xs12 :key="'id'+i">{{ id }}</v-flex> - </template> - </v-layout> - </v-card-text> - </v-card> - </v-flex> - </v-layout> -</template> - -<script> -export default { - name: 'p-d-series', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDSkosPreflabel.vue b/src/components/display/phaidra_display/PDSkosPreflabel.vue deleted file mode 100644 index ba3f12c..0000000 --- a/src/components/display/phaidra_display/PDSkosPreflabel.vue +++ /dev/null @@ -1,44 +0,0 @@ -<template> - <v-flex> - <v-layout column > - <v-flex> - <template v-for="(l, i) in o['skos:prefLabel']"> - <v-layout :key="'lay'+i" row wrap v-if="l['@language'] === displaylang"> - <v-flex md4 xs12 v-if="p==='bf:note'" class="pdlabel primary--text" :key="'l'+i">{{ $t(o['@type']) }}<template v-if="l['@language']"> ({{ l['@language'] }})</template></v-flex> - <v-flex md4 xs12 v-else class="pdlabel primary--text" :key="'l'+i">{{ $t(p) }}<template v-if="l['@language']"> ({{ l['@language'] }})</template></v-flex> - <v-flex md8 xs12 v-if="o['skos:exactMatch']" :key="'t-id'+i"><a class="valuefield" :href="o['skos:exactMatch'][0]" target="_blank">{{ l['@value'] }}</a></v-flex> - <v-flex class="valuefield" md8 xs12 v-else :key="'t'+i">{{ l['@value'] }}</v-flex> - </v-layout> - </template> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-skos-preflabel', - props: { - o: { - type: Object, - required: true - }, - p: { - type: String - } - }, - computed: { - displaylang: function() { - let lang - let somelang - for (let label of this.o['skos:prefLabel']) { - somelang = label['@language'] - if (label['@language'] === this.$i18n.locale) { - lang = this.$i18n.locale - } - } - return lang ? lang : somelang - } - } -} -</script> diff --git a/src/components/display/phaidra_display/PDStudyPlan.vue b/src/components/display/phaidra_display/PDStudyPlan.vue deleted file mode 100644 index f278c57..0000000 --- a/src/components/display/phaidra_display/PDStudyPlan.vue +++ /dev/null @@ -1,32 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <template v-for="(l, i) in o['skos:prefLabel']"> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'pl'+i">{{ $t('Study plan') }}</v-flex> - <v-flex md8 xs12 :key="'spl'+i"> - <v-layout column> - <v-flex class="valuefield" >{{ l['@value'] }}</v-flex> - <template v-for="(id, i) in o['skos:notation']"> - <v-flex class="grey--text" xs4 :key="'notation'+i">[{{ id }}]</v-flex> - </template> - </v-layout> - </v-flex> - - </template> - </v-layout> - - </v-flex> -</template> - -<script> -export default { - name: 'p-d-study-plan', - props: { - o: { - type: Object, - required: true - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDTitle.vue b/src/components/display/phaidra_display/PDTitle.vue deleted file mode 100644 index a8d3911..0000000 --- a/src/components/display/phaidra_display/PDTitle.vue +++ /dev/null @@ -1,34 +0,0 @@ -<template> - <v-flex> - <v-layout column > - <v-flex> - <template v-for="(mt, i) in o['bf:mainTitle']"> - <v-layout :key="'row'+i" row wrap> - <v-flex md4 xs12 class="pdlabel primary--text" :key="'mt'+i">{{ $t(o['@type']) }}<template v-if="mt['@language']"> ({{ mt['@language'] }})</template></v-flex> - <v-flex md8 xs12> - <v-layout column :key="'mtv'+i"> - <v-flex class="valuefield">{{ mt['@value'] }}</v-flex> - <template v-for="(st, i) in o['bf:subtitle']"> - <v-flex class="valuefield" :key="'stv'+i">{{ st['@value'] }}</v-flex> - </template> - </v-layout> - </v-flex> - </v-layout> - </template> - </v-flex> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-title', - props: { - o: { - type: Object, - required: true - } - } -} -</script> - diff --git a/src/components/display/phaidra_display/PDUwmetadata.vue b/src/components/display/phaidra_display/PDUwmetadata.vue deleted file mode 100644 index e7ce685..0000000 --- a/src/components/display/phaidra_display/PDUwmetadata.vue +++ /dev/null @@ -1,212 +0,0 @@ -<template> - <v-flex v-if="this.indexdata"> - <v-flex v-for="(title,i) in getTitles()" :key="'title'+i" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('Title') }} ({{ title.lang }})</v-flex> - <v-flex xs9>{{ title.value }}</v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex v-for="(role,i) in parsedRolesUwm()" :key="'role'+i" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ role.label }}</v-flex> - <v-flex xs9> - <v-layout column> - <v-flex v-for="(entity,j) in role.entities" :key="j"> - {{ entity.firstname }} {{ entity.lastname }} - <span class="grey--text">{{ entity.institution }}</span> - </v-flex> - </v-layout> - </v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex v-if="indexdata.bib_journal" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('Journal') }}</v-flex> - <v-flex xs9> - <v-layout column> - <v-flex v-for="(v,i) in indexdata.bib_journal" :key="i">{{v}}</v-flex> - </v-layout> - </v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex v-if="indexdata.bib_volume" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('Volume') }}</v-flex> - <v-flex xs9> - <v-layout column> - <v-flex v-for="(v,i) in indexdata.bib_volume" :key="i">{{v}}</v-flex> - </v-layout> - </v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex v-if="indexdata.bib_publisher" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('Publisher') }}</v-flex> - <v-flex xs9> - <v-layout column> - <v-flex v-for="(v,i) in indexdata.bib_publisher" :key="i">{{v}}</v-flex> - </v-layout> - </v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex v-if="indexdata.bib_published" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('Published') }}</v-flex> - <v-flex xs9> - <v-layout column> - <v-flex v-for="(v,i) in indexdata.bib_published" :key="i">{{v}}</v-flex> - </v-layout> - </v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex v-if="indexdata.bib_publisherlocation" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('Publisher location') }}</v-flex> - <v-flex xs9> - <v-layout column> - <v-flex v-for="(v,i) in indexdata.bib_publisherlocation" :key="i">{{v}}</v-flex> - </v-layout> - </v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex v-for="(desc,i) in getDescriptions()" :key="'desc'+i" class="mt-3"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('Description') }} ({{ desc.lang }})</v-flex> - <v-flex xs9>{{ desc.value }}</v-flex> - </v-layout> - </v-container> - </v-flex> - - <v-flex class="mt-3" v-if="indexdata.dc_license"> - <v-container fluid> - <v-layout row> - <v-flex class="caption grey--text" xs2>{{ $t('License') }}</v-flex> - <v-flex xs9> - <p-d-license v-if="indexdata.dc_license" :dclicense="indexdata.dc_license[0]"></p-d-license> - </v-flex> - </v-layout> - </v-container> - </v-flex> - </v-flex> -</template> - -<script> -import PDLicense from "./PDLicense"; -import { vocabulary } from "../../../mixins/vocabulary"; - -export default { - name: "p-d-uwmetadata", - mixins: [vocabulary], - props: { - pid: { - type: String - }, - indexdata: { - type: Object, - default: null - } - }, - components: { - PDLicense - }, - methods: { - getRoleLabel: function(role) { - var id = role.substring(role.indexOf(":") + 1); - var roleTerms = this.vocabularies["rolepredicate"].terms; - for (var i = 0; i < roleTerms.length; i++) { - if (roleTerms[i]["@id"] === id) { - return roleTerms[i]["skos:prefLabel"][0]["@value"]; - } - } - }, - getTitles: function() { - var titles = []; - var doc = this.indexdata; - Object.keys(doc).forEach(function(field) { - if (field.startsWith("dc_title_")) { - for (var i = 0; i < doc[field].length; i++) { - titles.push({ - value: doc[field][i], - lang: field.substr(field.length - 3) - }); - } - } - }); - return titles; - }, - getDescriptions: function() { - var descriptions = []; - var doc = this.indexdata; - Object.keys(doc).forEach(function(field) { - if (field.startsWith("dc_description_")) { - for (var i = 0; i < doc[field].length; i++) { - descriptions.push({ - value: doc[field][i], - lang: field.substr(field.length - 3) - }); - } - } - }); - return descriptions; - }, - parsedRolesUwm: function() { - var rolesHash = {}; - if (this.indexdata.uwm_roles_json) { - var sortedContr = JSON.parse(this.indexdata.uwm_roles_json).sort( - function(a, b) { - return a.data_order - b.data_order; - } - ); - for (var i = 0; i < sortedContr.length; i++) { - sortedContr[i].entities = sortedContr[i].entities.sort(function( - a, - b - ) { - return a.data_order - b.data_order; - }); - // merge multiple entities and multiple contributions if they have the same role - if (!rolesHash[sortedContr[i].role]) { - rolesHash[sortedContr[i].role] = { - role: sortedContr[i].role, - label: this.getRoleLabel(sortedContr[i].role), - entities: [] - }; - } - for (var j = 0; j < sortedContr[i].entities.length; j++) { - rolesHash[sortedContr[i].role]["entities"].push( - sortedContr[i].entities[j] - ); - } - } - } - var roles = []; - Object.keys(rolesHash).forEach(function(r) { - roles.push(rolesHash[r]); - }); - return roles; - } - } -}; -</script> diff --git a/src/components/display/phaidra_display/PDValue.vue b/src/components/display/phaidra_display/PDValue.vue deleted file mode 100644 index 49c1e49..0000000 --- a/src/components/display/phaidra_display/PDValue.vue +++ /dev/null @@ -1,24 +0,0 @@ -<template> - <v-flex> - <v-layout row wrap> - <v-flex md4 xs12 class="pdlabel primary--text">{{ $t(p) }}</v-flex> - <v-flex md8 xs12>{{ o }}</v-flex> - </v-layout> - </v-flex> -</template> - -<script> -export default { - name: 'p-d-value', - props: { - o: { - type: String, - required: true - }, - p: { - type: String - } - } -} -</script> - diff --git a/src/components/search/SearchResults.vue b/src/components/search/SearchResults.vue index 193e903..9382689 100644 --- a/src/components/search/SearchResults.vue +++ b/src/components/search/SearchResults.vue @@ -108,13 +108,11 @@ </template> <script> -import PDLicense from "../display/phaidra_display/PDLicense"; import PImg from "../utils/PImg"; export default { name: "search-results", components: { - PDLicense, PImg }, props: { diff --git a/src/components/select/CollectionDialog.vue b/src/components/select/CollectionDialog.vue deleted file mode 100644 index 0697890..0000000 --- a/src/components/select/CollectionDialog.vue +++ /dev/null @@ -1,116 +0,0 @@ -<template> - <v-dialog v-model="dialog" width="700px"> - <v-card> - <v-card-title class="grey white--text">{{ $t('Select a collection') }}</v-card-title> - <v-card-text> - <v-text-field - v-model="collectionsSearch" - append-icon="search" - :label="$t('Search...')" - single-line - hide-details - class="mb-4" - ></v-text-field> - <v-data-table - hide-default-header - :headers="collectionsHeaders" - :items="collections" - :search="collectionsSearch" - :custom-filter="filterTitle" - :loading="loading" - :loading-text="$t('Loading...')" - :items-per-page="5" - > - <template v-slot:item.title="{ item }"> - <span v-if="item.dc_title">{{ item.dc_title[0] | truncate(50) }}</span> - </template> - <template v-slot:item.created="{ item }"> - {{ item.created | date }} - </template> - <template v-slot:item.actions="{ item }"> - <v-btn text color="primary" @click="selectCollection(item)">{{ $t('Select') }}</v-btn> - </template> - </v-data-table> - </v-card-text> - <v-divider></v-divider> - <v-card-actions> - <v-container> - <v-row justify="end" class="px-4"> - <v-btn color="grey" dark @click="dialog = false">{{ $t('Cancel') }}</v-btn> - </v-row> - </v-container> - </v-card-actions> - </v-card> - </v-dialog> -</template> - -<script> -export default { - name: 'collection-dialog', - computed: { - instance: function () { - return this.$store.state.instanceconfig - } - }, - data () { - return { - dialog: false, - loading: false, - collectionsSearch: '', - collectionsHeaders: [ - { text: 'Pid', align: 'left', value: 'pid' }, - { text: 'Title', align: 'left', value: 'title' }, - { text: 'Created', align: 'right', value: 'created' }, - { text: 'Actions', align: 'right', value: 'actions', sortable: false } - ], - collections: [] - } - }, - methods: { - filterTitle (value, search, item) { - if (item.dc_title) { - if (item.dc_title.length > 0) { - return item.dc_title[0].indexOf(search) !== -1 - } else { - return false - } - } else { - return false - } - }, - open: async function () { - this.dialog = true - this.loading = true - let params = { - q: '*:*', - defType: 'edismax', - wt: 'json', - start: 0, - rows: 1000, - sort: 'created desc', - fq: [ 'resourcetype:collection', 'owner:' + this.$store.state.user.username ] - } - try { - let response = await this.$http.request({ - method: 'POST', - url: this.instance.solr + '/select', - headers: { - 'X-XSRF-TOKEN': this.$store.state.user.token - }, - params: params - }) - this.collections = response.data.response.docs - } catch (error) { - console.log(error) - this.$store.commit('setAlerts', [{ type: 'danger', msg: error }]) - } finally { - this.loading = false - } - }, - selectCollection: function (item) { - this.$emit('collection-selected', item) - this.dialog = false - } - } -} -</script> diff --git a/src/components/select/ListDialog.vue b/src/components/select/ListDialog.vue deleted file mode 100644 index 97ae7ca..0000000 --- a/src/components/select/ListDialog.vue +++ /dev/null @@ -1,102 +0,0 @@ -<template> - <v-dialog v-model="dialog" width="700px"> - <v-card> - <v-card-title class="grey white--text">{{ $t('Select a list') }}</v-card-title> - <v-card-text> - <v-text-field - v-model="listsSearch" - append-icon="search" - :label="$t('Search...')" - single-line - hide-details - class="mb-4" - ></v-text-field> - <v-data-table - hide-default-header - :headers="listsHeaders" - :items="lists" - :search="listsSearch" - :loading="loading" - :loading-text="$t('Loading...')" - :items-per-page="5" - > - <template v-slot:item.name="{ item }"> - <v-tooltip bottom> - <template v-slot:activator="{ on }"> - <span v-on="on">{{ item.name | truncate(50) }}</span> - </template> - <span>{{ item.listid }}</span> - </v-tooltip> - </template> - <template v-slot:item.created="{ item }"> - {{ item.created | unixtime }} - </template> - <template v-slot:item.updated="{ item }"> - {{ item.updated | unixtime }} - </template> - <template v-slot:item.actions="{ item }"> - <v-btn text color="primary" @click="selectList(item)">{{ $t('Select') }}</v-btn> - </template> - </v-data-table> - </v-card-text> - <v-divider></v-divider> - <v-card-actions> - <v-container> - <v-row justify="end" class="px-4"> - <v-btn color="grey" dark @click="dialog = false">{{ $t('Cancel') }}</v-btn> - </v-row> - </v-container> - </v-card-actions> - </v-card> - </v-dialog> -</template> - -<script> -export default { - name: 'list-dialog', - computed: { - instance: function () { - return this.$store.state.instanceconfig - } - }, - data () { - return { - dialog: false, - loading: false, - listsSearch: '', - listsHeaders: [ - { text: 'Name', align: 'left', value: 'name' }, - { text: 'Created', align: 'right', value: 'created' }, - { text: 'Updated', align: 'right', value: 'updated' }, - { text: 'Actions', align: 'right', value: 'actions', sortable: false } - ], - lists: [] - } - }, - methods: { - open: async function () { - this.dialog = true - this.loading = true - try { - let response = await this.$http.request({ - method: 'GET', - url: this.instance.api + '/lists', - headers: { - 'X-XSRF-TOKEN': this.$store.state.user.token - } - }) - this.lists = response.data.lists - } catch (error) { - console.log(error) - this.$store.commit('setAlerts', [{ type: 'danger', msg: error }]) - } finally { - this.loading = false - } - }, - selectList: function (item) { - this.$emit('list-selected', item) - this.dialog = false - } - } -} -</script> diff --git a/src/components/select/OrgUnitsTreeDialog.vue b/src/components/select/OrgUnitsTreeDialog.vue deleted file mode 100644 index a3ba47a..0000000 --- a/src/components/select/OrgUnitsTreeDialog.vue +++ /dev/null @@ -1,77 +0,0 @@ -<template> - <v-dialog v-model="dialog" width="700px"> - <v-card :loading="loading"> - <v-card-title class="grey white--text">{{ $t('Select an organizational unit') }}</v-card-title> - <v-card-text> - <v-treeview :items="orgunits" item-children="subunits" item-key="@id" hoverable activatable @update:active="selectUnit($event)"></v-treeview> - </v-card-text> - <v-divider></v-divider> - <v-card-actions> - <v-container> - <v-row justify="end" class="px-4"> - <v-btn color="grey" dark @click="dialog = false">{{ $t('Cancel') }}</v-btn> - </v-row> - </v-container> - </v-card-actions> - </v-card> - </v-dialog> -</template> - -<script> -export default { - name: 'org-units-tree-dialog', - computed: { - instance: function () { - return this.$store.state.instanceconfig - } - }, - data () { - return { - dialog: false, - loading: false, - orgunits: [] - } - }, - methods: { - open: async function () { - this.dialog = true - this.loading = true - try { - let response = await this.$http.request({ - method: 'GET', - url: this.$store.state.instanceconfig.api + '/directory/org_get_units', - headers: { - 'X-XSRF-TOKEN': this.$store.state.user.token - } - }) - if (response.data.alerts && response.data.alerts.length > 0) { - this.$store.commit('setAlerts', response.data.alerts) - } - this.orgunits = response.data.units - this.addNames(this.orgunits) - } catch (error) { - console.log(error) - this.$store.commit('setAlerts', [{ type: 'danger', msg: error }]) - } finally { - this.loading = false - } - }, - addNames: function (units) { - for (let u of units) { - if (u['skos:prefLabel']) { - u['name'] = u['skos:prefLabel'][this.$i18n.locale] - } - if (u['subunits']) { - if (u.subunits.length > 0) { - this.addNames(u.subunits) - } - } - } - }, - selectUnit: function (item) { - this.$emit('unit-selected', item[0]) - this.dialog = false - } - } -} -</script> -- GitLab