Skip to content
Snippets Groups Projects
Commit 38dcbd6f authored by mic29226's avatar mic29226
Browse files

finalized the widget feature

parent 8e688b27
Branches widgetBFS
Tags
No related merge requests found
Showing with 1421 additions and 1076 deletions
...@@ -17,8 +17,9 @@ ...@@ -17,8 +17,9 @@
</div> </div>
<!-- Liste Distribution/ Widget/ Report --- leading kann nur 1 sein und auch nur ein widget --> <!-- Liste Distribution/ Widget/ Report --- leading kann nur 1 sein und auch nur ein widget -->
<button class="ml-3 widgetButton" v-if="widgetType === 'Widget'" <button class="ml-3 widgetButton" v-if="widgetType === 'Widget' || 'LeadingWidget'"
:class="{ activeLeading: activeButton,}" type="button" @click="isLeading"> :class="{ activeLeading: activeButton || props.context.value === 'LeadingWidget', }" type="button"
@click="isLeading">
Leading Leading
</button> </button>
</div> </div>
...@@ -35,24 +36,21 @@ const props = defineProps({ ...@@ -35,24 +36,21 @@ const props = defineProps({
context: Object context: Object
}) })
let disList = ref(getNode('Distributions').value['distributionList']) let disList = ref(getNode('Distributions').value['distributionList'])
// Init every dis as distribution - default state
props.context.node.input({ type: 'distribution' })
let activeButton = ref(false) let activeButton = ref(false)
const isLeading = () => { const isLeading = () => {
checkForLead() checkForLead()
console.log(props.context.value['type']); // console.log(props.context.value['type']);
if (props.context.value['type'] != 'LeadingWidget' && !activeLeadingWidget.value) { if (props.context.value['type'] != 'LeadingWidget' && !activeLeadingWidget.value) {
props.context.node.input({ type: 'LeadingWidget' }) props.context.node.input('LeadingWidget')
activeButton.value = !activeButton.value activeButton.value = !activeButton.value
} else { } else {
activeLeadingWidget.value = false activeLeadingWidget.value = false
activeButton.value = false activeButton.value = false
props.context.node.input({ type: 'Widget' }) widgetType.value = "Widget"
props.context.node.input('Widget')
} }
} }
...@@ -61,23 +59,40 @@ const matches = ref(['Distribution', 'Widget', 'Report']) ...@@ -61,23 +59,40 @@ const matches = ref(['Distribution', 'Widget', 'Report'])
let activeLeadingWidget = ref(false) let activeLeadingWidget = ref(false)
let widgetType = ref('') let widgetType = ref('')
// Init every dis as distribution if there's nothing set - default state
try {
console.log(props.context.value);
if (props.context.value != undefined) {
if (props.context.value === 'LeadingWidget') {
widgetType.value = 'Widget'
} else widgetType.value = props.context.value
} else widgetType.value = 'Distribution'
} catch (error) {
}
const checkForLead = () => { const checkForLead = () => {
disList.value = getNode('Distributions').value['distributionList'] disList.value = getNode('Distributions').value['distributionList']
console.log(disList.value, getNode('Distributions').value['distributionList']); // console.log(disList.value, getNode('Distributions').value['distributionList']);
for (let index = 0; index < disList.value.length; index++) { for (let index = 0; index < disList.value.length; index++) {
console.log(disList.value[index]['Mandatory']['pv:DistributionType']['type']); // console.log(disList.value[index]['Mandatory']['pv:DistributionType']['type']);
if (disList.value[index]['Mandatory']['pv:DistributionType']['type'] === 'LeadingWidget') { if (disList.value[index]['Mandatory']['pv:DistributionType'] === 'LeadingWidget') {
activeLeadingWidget.value = true activeLeadingWidget.value = true
} }
} }
} }
const setValue = (item) => { const setValue = (item) => {
checkForLead() checkForLead()
console.log(getNode('Distributions').value['distributionList'].length); // console.log(getNode('Distributions').value['distributionList'].length);
props.context.node.input({ type: item }) props.context.node.input(item)
widgetType.value = item widgetType.value = item
} }
</script> </script>
......
...@@ -88,6 +88,7 @@ const typedStrings = { ...@@ -88,6 +88,7 @@ const typedStrings = {
"dct:issued", "dct:issued",
"dct:modified", "dct:modified",
"dcat:spatialResolutionInMeters", "dcat:spatialResolutionInMeters",
"pv:DistributionType",
"dcat:byteSize", "dcat:byteSize",
], ],
catalogues: [], catalogues: [],
......
const prefixes = { const prefixes = {
adms: "http://www.w3.org/ns/adms#", adms: "http://www.w3.org/ns/adms#",
dcat: "http://www.w3.org/ns/dcat#", dcat: "http://www.w3.org/ns/dcat#",
dcatap: "http://data.europa.eu/r5r/", dcatap: "http://data.europa.eu/r5r/",
dct: "http://purl.org/dc/terms/", dct: "http://purl.org/dc/terms/",
foaf: "http://xmlns.com/foaf/0.1/", foaf: "http://xmlns.com/foaf/0.1/",
locn: "http://www.w3.org/ns/locn#", locn: "http://www.w3.org/ns/locn#",
owl: "http://www.w3.org/2002/07/owl#", owl: "http://www.w3.org/2002/07/owl#",
odrl: "http://www.w3.org/ns/odrl/2/", odrl: "http://www.w3.org/ns/odrl/2/",
prov: "http://www.w3.org/ns/prov#", prov: "http://www.w3.org/ns/prov#",
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#", rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
rdfs: "http://www.w3.org/2000/01/rdf-schema#", rdfs: "http://www.w3.org/2000/01/rdf-schema#",
schema: "http://schema.org/", schema: "http://schema.org/",
skos: "http://www.w3.org/2004/02/skos/core#", skos: "http://www.w3.org/2004/02/skos/core#",
spdx: "http://spdx.org/rdf/terms#", spdx: "http://spdx.org/rdf/terms#",
xsd: "http://www.w3.org/2001/XMLSchema#", xsd: "http://www.w3.org/2001/XMLSchema#",
vann: "http://purl.org/vocab/vann/", vann: "http://purl.org/vocab/vann/",
voaf: "http://purl.org/vocommons/voaf#", voaf: "http://purl.org/vocommons/voaf#",
vcard: "http://www.w3.org/2006/vcard/ns#", vcard: "http://www.w3.org/2006/vcard/ns#",
time: "http://www.w3.org/2006/time#", time: "http://www.w3.org/2006/time#",
dext: "https://data.europa.eu/ns/ext#", dext: "https://data.europa.eu/ns/ext#",
dcatde: "http://dcat-ap.de/def/dcatde/" dcatde: "http://dcat-ap.de/def/dcatde/",
pv: "https://piveau.eu/ns/voc#",
}; };
export default prefixes; export default prefixes;
\ No newline at end of file
...@@ -106,6 +106,8 @@ const actions = { ...@@ -106,6 +106,8 @@ const actions = {
catalogues: generalHelper.mergeNestedObjects(state.catalogues) catalogues: generalHelper.mergeNestedObjects(state.catalogues)
}; };
// console.log(data);
// merging each distribution object within the overall array of distributions // 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)) { 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++) { for (let index = 0; index < state.datasets.Distributions.distributionList.length; index++) {
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
<!-- SINGULAR STRING --> <!-- SINGULAR STRING -->
<td v-if="value.type === 'singularString'"> <td v-if="value.type === 'singularString'">
<span v-if="data[property]['@type'] != '' && property === 'dct:rights'"> {{ data[property]['rdfs:label'] }}</span> <span v-if="data[property]['@type'] != '' && property === 'dct:rights'"> {{ data[property]['rdfs:label'] }}</span>
<span v-if="property != 'dct:rights'"> <span v-if="property != 'dct:rights'">
{{ data[property] }} <span v-if="property === 'dcat:spatialResolutionInMeters'">Meters</span> {{ data[property] }} <span v-if="property === 'dcat:spatialResolutionInMeters'">Meters</span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment