Skip to content
Snippets Groups Projects
Commit 80074473 authored by Michael  Peters's avatar Michael Peters
Browse files

Merge branch 'widgetBFS' into 'master'

Widget Feature (Project Specific)

See merge request piveau/ui/piveau-ui!218
parents ce2eb340 50c3108a
No related branches found
No related tags found
No related merge requests found
Showing
with 4182 additions and 1084 deletions
<template>
<div class="formkitProperty">
<h4 class="">Tag</h4>
<div class="formkitCmpWrap d-flex p-3 w-100">
<div class="formkit-inner">
<input readonly="" placeholder="Wählen Sie die Art des Widgets aus" class="formkit-input" type="text"
name="mode" aria-required="true" :value="widgetType" aria-describedby="input_164-rule_required"
@click="activeList = !activeList">
<ul ref="dropdownListWidget" v-show="activeList" class="autocompleteResultList">
<li v-for="match in matches" :key="match" @click="setValue(match); activeList = !activeList"
class="p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC">{{ match
}}
</li>
</ul>
</div>
<!-- Liste Distribution/ Widget/ Report --- leading kann nur 1 sein und auch nur ein widget -->
<button class="ml-3 widgetButton" v-if="widgetType === 'Widget' "
:class="{ activeLeading: activeButton || props.context.value === 'LeadingWidget', }" type="button"
@click="isLeading">
Leading
</button>
</div>
</div>
</template>
<script setup>
import { ref, watch } from 'vue';
import { getNode } from '@formkit/core'
const props = defineProps({
context: Object
})
let disList = ref(getNode('Distributions').value['distributionList'])
let activeButton = ref(false)
const isLeading = () => {
checkForLead()
// console.log(props.context.value['type']);
if (props.context.value['type'] != 'LeadingWidget' && !activeLeadingWidget.value) {
props.context.node.input('LeadingWidget')
activeButton.value = !activeButton.value
} else {
activeLeadingWidget.value = false
activeButton.value = false
widgetType.value = "Widget"
props.context.node.input('Widget')
}
}
const activeList = ref(false)
const matches = ref(['Distribution', 'Widget', 'Report'])
let activeLeadingWidget = ref(false)
let widgetType = ref('')
// Init every dis as distribution if there's nothing set - default state
if (props.context.value != undefined) {
if (props.context.value === 'LeadingWidget') {
widgetType.value = 'Widget'
} else widgetType.value = props.context.value
} else widgetType.value = 'Distribution'
console.log(widgetType);
const checkForLead = () => {
disList.value = getNode('Distributions').value['distributionList']
for (let index = 0; index < disList.value.length; index++) {
if (disList.value[index]['Mandatory']['pv:DistributionType'] === 'LeadingWidget') {
activeLeadingWidget.value = true
}
}
}
const setValue = (item) => {
checkForLead()
props.context.node.input(item)
widgetType.value = item
}
</script>
<style scoped>
.formkit-inner:focus-within {
margin-top: 0;
}
.formkit-inner {
flex-grow: 1;
}
.formkitCmpWrap {
position: relative;
}
.widgetButton {
border-color: lightgray;
&:hover {
background-color: green;
color: white;
}
}
.activeLeading {
background-color: green;
color: white;
border-color: green;
}
</style>
\ No newline at end of file
// all properties which value is a single URI
const singularURI = {
datasets: [
"dct:accrualPeriodicity",
"dct:accessRights",
"dct:type",
"dcatap:availability",
"dcatde:qualityProcessURI",
// singular URIs nested within other properties
'vcard:hasEmail', // contact point
'vcard:hasURL', // contect point
'dext:isUsedBy', // isUsedBy
'foaf:mbox', // creator, publisher
'foaf:homepage', // creator, publisher
'dct:format', // page
],
distributions: [
"dct:format",
"dct:type",
"dcat:mediaType",
"dcatap:availability",
"dcat:compressFormat",
"dcat:packageFormat",
"adms:status",
// singular URIs nested within other properties
'spdx:algorithm', // checksum
'dcat:endpointURL', // accessservice
"skos:exactMatch", // license,
'dct:license'
],
catalogues: [
'foaf:homepage', // homepage and creator
'dct:isPartOf',
// singular URIs nested within other properties
'foaf:mbox', // creator
'dct:format', // page
"skos:exactMatch", // license
],
};
// all properties with multiple URI values
const multipleURI = {
datasets: [
"dcatde:politicalGeocodingLevelURI",
"dcatde:politicalGeocodingURI",
"dcatde:contributorID",
"dct:language",
"dct:subject",
"dcat:theme",
"dct:source",
"dcat:landingPage",
"dct:relation",
"dcat:qualifiedRelation",
"prov:qualifiedAttribution",
"dct:isReferencedBy",
"prov:wasGeneratedBy",
"dct:isVersionOf",
"dct:hasVersion",
"dct:references",
"dct:spatial",
],
distributions: [
"dcat:accessURL",
"dcat:downloadURL",
"dct:language",
"odrl:hasPolicy",
],
catalogues: [
"dct:hasPart",
'dcat:catalog',
'dct:language',
'dct:spatial',
],
};
// all properties which are typed strings
const typedStrings = {
datasets: [
"dct:issued",
"dct:modified",
"dcat:spatialResolutionInMeters",
// nested typed strings
'dcat:endDate',
'dcat:startDate',
],
distributions: [
"dct:issued",
"dct:modified",
"dcat:spatialResolutionInMeters",
"pv:DistributionType",
"dcat:byteSize",
],
catalogues: [],
};
// all properties with a singular string
const singularString = {
datasets: [
"owl:versionInfo",
// nested singulat strings
'vcard:fn', // contactPoint
'vcard:hasOrganizationName', // contactPoint
'vcard:hasTelephone', // contactPoint
"vcard:country_name", // hasAddress
"vcard:locality", // hasAddress
"vcard:postal_code", // hasAddress
"vcard:street_address", // hasAddress
'rdfs:label', // conformsTo and provenance
'foaf:name', // creator, publisher
],
distributions: [
// nested singular string
'spdx:checksumValue', //checksum
'rdfs:label', // rights !!!
"skos:prefLabel", //license
],
catalogues: [
// nested singular strings
'rdfs:label', // conformsTo and rights
'foaf:name', // creator
"skos:prefLabel", // license
],
};
// all properties which can be provided in different languages
const multilingualStrings = {
datasets: [
"dct:title", // also nested within page
"dct:description", // also nested within page
"dcat:keyword",
"adms:versionNotes",
"dcatde:geocodingDescription",
"dcatde:legalBasis",
],
distributions: [
"dct:title", // also nested within page
"dct:description", // also nested within page
"dcatde:licenseAttributionByText",
],
catalogues: [
'dct:title',
'dct:description',
],
};
// all properties which contain grouped values
const groupedProperties = {
datasets: [
'dcat:contactPoint',
'dct:creator',
'dext:metadataExtension',
'dct:provenance',
'dct:conformsTo',
'foaf:page',
'dct:temporal',
'adms:identifier',
// nested grouped properties
'vcard:hasAddress',
'skos:notation',
"dct:contributor",
"dcatde:originator",
"dcatde:maintainer",
],
distributions: [
'foaf:page',
'dcat:accessService',
'spdx:checksum',
'dct:conformsTo',
],
catalogues: [
'dct:creator',
'dct:conformsTo',
]
};
// some properties provide the ability to choose the input type and therefore the respective fields which will be provided
const conditionalProperties = {
datasets: [
'dct:publisher',
],
distributions: [],
catalogues: [
'dct:publisher',
'dct:license'
],
}
// some properties have additional statement included which must be added to the linked data
const additionalPropertyTypes = {
'dct:temporal': 'dct:PeriodOfTime',
'dct:conformsTo': 'dct:Standard',
'foaf:page': 'foaf:Document',
'dct:provenance': 'dct:ProvenanceStatement',
'dext:metadataExtension': 'dext:MetadataExtension',
'spdx:checksum': 'spdx:Checksum',
'dcat:accessService': 'dcat:DataService',
'dct:publisher': 'foaf:Agent',
}
// some inputs need URIs in diefferent formats
const URIformat = {
// {'name': '', 'resource': ''} mainly needed for vocabulary data
voc: [
'dct:publisher',
'dcat:theme',
"dct:accrualPeriodicity",
"dct:accessRights",
"dct:type",
"dct:format",
"dcat:mediaType",
"dcatap:availability",
"dcat:compressFormat",
"dcat:packageFormat",
'spdx:algorithm',
"dct:subject",
"dct:language",
"adms:status",
"dct:spatial",
"dcatde:politicalGeocodingLevelURI",
"dcatde:contributorID",
"dcatde:politicalGeocodingURI",
'dct:license'
],
// 'URI' mainly used for mail addresses
string: [
'vcard:hasEmail',
'vcard:hasURL',
'foaf:mbox',
"skos:exactMatch",
'foaf:homepage',
'dext:isUsedBy',
'dcat:endpointURL',
'dcatde:qualityProcessURI',
],
// {'@id': ''} mainly used for repeated links
id: [
'dct:source',
"dcat:accessURL",
"dcat:downloadURL",
"odrl:hasPolicy",
"dct:hasPart",
'dcat:catalog',
"dct:source",
"dcat:landingPage",
"dct:relation",
"dcat:qualifiedRelation",
"prov:qualifiedAttribution",
"dct:isReferencedBy",
"prov:wasGeneratedBy",
"dct:isVersionOf",
"dct:hasVersion",
'dct:isPartOf',
"dct:references",
]
}
export default {
singularURI,
multipleURI,
typedStrings,
singularString,
multilingualStrings,
groupedProperties,
additionalPropertyTypes,
conditionalProperties,
URIformat,
};
\ No newline at end of file
const config = {
datasets: {
Mandatory: [ 'title', 'datasetID', 'description', 'catalog', 'publisher', 'theme', 'issued', 'modified' ],
Advised: [ 'politicalGeocodingLevelURI', 'politicalGeocodingURI', 'availabilityDE', 'contributorID', 'geocodingDescription', 'legalBasis', 'qualityProcessURI', 'references', 'contributor', 'originator', 'maintainer', 'keyword', 'contactPoint', 'landingPage', 'accrualPeriodicity', 'language', 'spatial', 'temporal', 'creator', 'identifier', 'admsIdentifier', 'page', 'accessRights' ],
Recommended: [ 'type', 'isUsedBy', 'conformsTo', 'versionInfo', 'versionNotes', 'temporalResolution', 'spatialResolutionInMeters', 'relation', 'qualifiedRelation', 'isReferencedBy', 'hasVersion', 'isVersionOf', 'source', 'provenance', 'qualifiedAttribution', 'wasGeneratedBy' ],
Distributions: [],
Overview: [ 'overview' ]
},
distributions: {
Mandatory: [ 'isWidget','accessURL', 'title', 'description' ],
Advised: [ 'licence', 'licenseAttributionByText', 'downloadUrl', 'format', 'mediaType', 'status', 'availability', 'issued', 'modified' ],
Recommended: [ 'type', 'byteSize', 'checksum', 'compressFormat', 'packageFormat', 'language', 'page', 'conformsTo', 'rights', 'hasPolicy', 'temporalResolution', 'spatialResolutionInMeters' ],
DataService: [ 'accessService' ]
},
catalogues: {
Mandatory: [ 'title', 'availabilityCatDE', 'datasetID', 'description', 'publisher', 'language', 'homepage', 'licence' ],
Advised: [ 'spatial', 'hasPart', 'isPartOf', 'rights', 'catalog', 'creator' ],
Overview: ['overview']
}
};
export default config;
\ No newline at end of file
const prefixes = {
adms: "http://www.w3.org/ns/adms#",
dcat: "http://www.w3.org/ns/dcat#",
dcatap: "http://data.europa.eu/r5r/",
dct: "http://purl.org/dc/terms/",
foaf: "http://xmlns.com/foaf/0.1/",
locn: "http://www.w3.org/ns/locn#",
owl: "http://www.w3.org/2002/07/owl#",
odrl: "http://www.w3.org/ns/odrl/2/",
prov: "http://www.w3.org/ns/prov#",
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
rdfs: "http://www.w3.org/2000/01/rdf-schema#",
schema: "http://schema.org/",
skos: "http://www.w3.org/2004/02/skos/core#",
spdx: "http://spdx.org/rdf/terms#",
xsd: "http://www.w3.org/2001/XMLSchema#",
vann: "http://purl.org/vocab/vann/",
voaf: "http://purl.org/vocommons/voaf#",
vcard: "http://www.w3.org/2006/vcard/ns#",
time: "http://www.w3.org/2006/time#",
dext: "https://data.europa.eu/ns/ext#",
dcatde: "http://dcat-ap.de/def/dcatde/",
pv: "https://piveau.eu/ns/voc#",
};
export default prefixes;
const vocabPrefixesDCATAPDE = {
"licence": "http://dcat-ap.de/def/licenses/",
"contributors": "http://dcat-ap.de/def/contributors/",
"dataset-type": "http://publications.europa.eu/resource/authority/dataset-type/",
"dataset-types": "http://dcat-ap.de/def/datasetTypes/",
"hash-algorithm": "http://dcat-ap.de/def/hashAlgorithms/",
"planned-availability": "http://dcat-ap.de/def/plannedAvailability/",
"political-geocoding-level": "http://dcat-ap.de/def/politicalGeocoding/Level/",
"political-geocoding-district-key": "http://dcat-ap.de/def/politicalGeocoding/districtKey/",
"political-geocoding-government-district-key": "http://dcat-ap.de/def/politicalGeocoding/governmentDistrictKey/",
"political-geocoding-municipal-association-key": "http://dcat-ap.de/def/politicalGeocoding/municipalAssociationKey/",
"political-geocoding-municipality-key": "http://dcat-ap.de/def/politicalGeocoding/municipalityKey/",
"political-geocoding-regional-key": "http://dcat-ap.de/def/politicalGeocoding/regionalKey/",
"political-geocoding-state-key": "http://dcat-ap.de/def/politicalGeocoding/",
"eurovoc": "http://eurovoc.europa.eu/",
"corporate-body": "http://publications.europa.eu/resource/authority/corporate-body/",
"continent": "http://publications.europa.eu/resource/authority/continent/",
"country": "http://publications.europa.eu/resource/authority/country/",
"place": "http://publications.europa.eu/resource/authority/place/",
"data-theme": "http://publications.europa.eu/resource/authority/data-theme/",
"access-right": "http://publications.europa.eu/resource/authority/access-right/",
"file-type": "http://publications.europa.eu/resource/authority/file-type/",
"frequency": "http://publications.europa.eu/resource/authority/frequency/",
"language": "http://publications.europa.eu/resource/authority/language/",
"notation-type": "http://publications.europa.eu/resource/authority/notation-type/",
"iana-media-types": "https://www.iana.org/assignments/media-types/",
"spdx-checksum-algorithm": "http://spdx.org/rdf/terms#",
"distribution-type": "http://publications.europa.eu/resource/authority/distribution-type/",
"dataset-status": "http://publications.europa.eu/resource/authority/dataset-status/",
};
export default vocabPrefixesDCATAPDE;
......@@ -15,6 +15,13 @@ import prefixesDCATAPDE from './dcatapde/prefixes';
import formatTypesDCATAPDE from './dcatapde/format-types';
import vocabPrefixesDCATAPDE from './dcatapde/vocab-prefixes';
// import DCAT-AP.de for BFS (with widgets)
import pageContentDCATAPDE_BFS from './dcatapde_BFS/page-content-config';
import inputDefinitionDCATAPDE_BFS from './dcatapde_BFS/input-definition';
import prefixesDCATAPDE_BFS from './dcatapde_BFS/prefixes';
import formatTypesDCATAPDE_BFS from './dcatapde_BFS/format-types';
import vocabPrefixesDCATAPDE_BFS from './dcatapde_BFS/vocab-prefixes';
// import DCAT-AP.de for ODB
import pageContentDCATAPDEODB from './dcatapdeODB/page-content-config';
import inputDefinitionDCATAPDEODB from './dcatapdeODB/input-definition';
......@@ -38,6 +45,13 @@ export const config = {
prefixes: prefixesDCATAPDE,
vocabPrefixes: vocabPrefixesDCATAPDE,
},
dcatapde_BFS: {
pageConent: pageContentDCATAPDE_BFS,
inputDefinition: inputDefinitionDCATAPDE_BFS,
formatTypes: formatTypesDCATAPDE_BFS,
prefixes: prefixesDCATAPDE_BFS,
vocabPrefixes: vocabPrefixesDCATAPDE_BFS,
},
dcatapdeODB: {
pageConent: pageContentDCATAPDEODB,
inputDefinition: inputDefinitionDCATAPDEODB,
......
......@@ -106,6 +106,8 @@ const actions = {
catalogues: generalHelper.mergeNestedObjects(state.catalogues)
};
// console.log(data);
// merging each distribution object within the overall array of distributions
if (has(state.datasets, 'Distributions') && has(state.datasets.Distributions, 'distributionList') && !isEmpty(state.datasets.Distributions.distributionList)) {
for (let index = 0; index < state.datasets.Distributions.distributionList.length; index++) {
......
......@@ -3,7 +3,7 @@
<div ref="fkInputContainer" class="inputContainer" v-if="isInput">
<div class="formContainer formkit position-relative">
<!-- <details>{{ formValues }}</details> -->
<details>{{ formValues }}</details>
<FormKit type="form" v-model="formValues" :actions="false" :plugins="[stepPlugin]" id="dpiForm"
@change="saveFormValues({ property: property, page: page, distid: id, values: formValues })"
@click="saveFormValues({ property: property, page: page, distid: id, values: formValues })" @submit.prevent=""
......
......@@ -9,8 +9,6 @@
<!-- SINGULAR STRING -->
<td v-if="value.type === 'singularString'">
<span v-if="data[property]['@type'] != '' && property === 'dct:rights'"> {{ data[property]['rdfs:label'] }}</span>
<span v-if="property != 'dct:rights'">
{{ data[property] }} <span v-if="property === 'dcat:spatialResolutionInMeters'">Meters</span>
......
......@@ -157,6 +157,8 @@ export default {
});
},
interpretTranslateKey(key, prefix) {
console.log(key);
if (key === '') return '';
if (key.startsWith('/')) return `${this.i18n.global.t(key.substring(1))}:`;
if (key.startsWith('\'')) return key.substring(1, key.length - 1);
......
......@@ -2,6 +2,7 @@ import Repeatable from "./Repeatable.vue";
import FormKitGroup from "./FormKitGroup.vue";
import { FormKitLibrary } from "@formkit/core";
import AutocompleteInput from "../data-provider-interface/components/AutocompleteInput.vue";
import WidgetInput from "../data-provider-interface/components/WidgetInput.vue";
import FileUpload from "../data-provider-interface/components/FileUpload.vue";
import UniqueIdentifierInput from "../data-provider-interface/components/UniqueIdentifierInput.vue";
import SpatialInput from "../data-provider-interface/components/SpatialInput.vue";
......@@ -10,49 +11,49 @@ import SimpleSelect from "../data-provider-interface/components/SimpleSelect.vue
import SimpleInput from "../data-provider-interface/components/SimpleInput.vue";
import SimpleAccessURLInput from "../data-provider-interface/components/SimpleAccessURLInput.vue";
export default {
repeatable: {
type: 'list',
component: Repeatable
},
id: {
type: 'input',
component: UniqueIdentifierInput,
},
auto: {
type: 'group',
component: AutocompleteInput
},
fileupload: {
type: 'group',
component: FileUpload
},
spatialinput: {
type: 'group',
component: SpatialInput
},
formkitGroup: {
type: 'group',
component: FormKitGroup
},
simpleConditional: {
type: 'group',
component: ConditionalInput
},
simpleSelect: {
type: 'input',
component: SimpleSelect,
},
simpleInput: {
type: 'input',
component: SimpleInput,
},
simpleAccessURLInput: {
type: 'group',
component: SimpleAccessURLInput,
},
} as FormKitLibrary;
\ No newline at end of file
repeatable: {
type: "list",
component: Repeatable,
},
widget: {
type: "input",
component: WidgetInput,
},
id: {
type: "input",
component: UniqueIdentifierInput,
},
auto: {
type: "group",
component: AutocompleteInput,
},
fileupload: {
type: "group",
component: FileUpload,
},
spatialinput: {
type: "group",
component: SpatialInput,
},
formkitGroup: {
type: "group",
component: FormKitGroup,
},
simpleConditional: {
type: "group",
component: ConditionalInput,
},
simpleSelect: {
type: "input",
component: SimpleSelect,
},
simpleInput: {
type: "input",
component: SimpleInput,
},
simpleAccessURLInput: {
type: "group",
component: SimpleAccessURLInput,
},
} as FormKitLibrary;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment