Skip to content

Commit

Permalink
PROBE-219: Add status
Browse files Browse the repository at this point in the history
  • Loading branch information
MPParsley committed Sep 3, 2024
1 parent 6d53977 commit fb12676
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
10 changes: 10 additions & 0 deletions webcomponents/reglementen-lijst/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ <h1>Reglementen lijst</h1>
</span>
</reglementen-lijst>

<reglementen-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="1"
statussen="Afgekeurd"
>
<span class="h3" slot="title">
Meest recente afgekeurd reglement Stad Gent
</span>
</reglementen-lijst>

<reglementen-lijst
sparql-endpoint="https://probe.stad.gent/sparql"
aantal="1"
Expand Down
11 changes: 11 additions & 0 deletions webcomponents/reglementen-lijst/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class ReglementenLijst extends HTMLElement {
datum="${reglement.publicatie_datum.value}"
url="${reglement.url.value}"
type="${ReglementenLijst.types[reglement.type.value]}"
status="${reglement.status.value}"
></reglementen-detail>
`;
}
Expand Down Expand Up @@ -113,6 +114,16 @@ class ReglementenLijst extends HTMLElement {
constructQuery() {
let filterparams = "";

// Status filter.
const statussen = this.getAttribute('statussen');
if (statussen) {
const statussenArray = statussen.split(",");
filterparams += "VALUES ?status { " + statussenArray.map(status => `"${status.trim()}"@nl`).join(" ") + " }"
} else {
filterparams += `BIND(COALESCE(?status, "Ontwerp") AS ?status)`;
}
console.log(statussen);

// Type filter.
const types = this.getAttribute('types');
if (types) {
Expand Down

0 comments on commit fb12676

Please sign in to comment.