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

finalized the widget feature

parent 8e688b27
No related branches found
Tags v4.6.26
No related merge requests found
Showing with 1421 additions and 1076 deletions
......@@ -17,8 +17,9 @@
</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,}" type="button" @click="isLeading">
<button class="ml-3 widgetButton" v-if="widgetType === 'Widget' || 'LeadingWidget'"
:class="{ activeLeading: activeButton || props.context.value === 'LeadingWidget', }" type="button"
@click="isLeading">
Leading
</button>
</div>
......@@ -35,24 +36,21 @@ const props = defineProps({
context: Object
})
let disList = ref(getNode('Distributions').value['distributionList'])
// Init every dis as distribution - default state
props.context.node.input({ type: 'distribution' })
let activeButton = ref(false)
const isLeading = () => {
checkForLead()
console.log(props.context.value['type']);
// console.log(props.context.value['type']);
if (props.context.value['type'] != 'LeadingWidget' && !activeLeadingWidget.value) {
props.context.node.input({ type: 'LeadingWidget' })
props.context.node.input('LeadingWidget')
activeButton.value = !activeButton.value
} else {
activeLeadingWidget.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'])
let activeLeadingWidget = ref(false)
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 = () => {
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++) {
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
}
}
}
const setValue = (item) => {
checkForLead()
console.log(getNode('Distributions').value['distributionList'].length);
props.context.node.input({ type: item })
// console.log(getNode('Distributions').value['distributionList'].length);
props.context.node.input(item)
widgetType.value = item
}
</script>
......
......@@ -88,6 +88,7 @@ const typedStrings = {
"dct:issued",
"dct:modified",
"dcat:spatialResolutionInMeters",
"pv:DistributionType",
"dcat:byteSize",
],
catalogues: [],
......
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/"
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;
\ No newline at end of file
export default prefixes;
......@@ -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++) {
......
......@@ -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>
......
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