Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: empty dropdown #66

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/warm-mayflies-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@view-builder/api": patch
---

Remove the restriction on searching for `ssz:Objekte`. Fixes the issue where the dropdown would load empty when creating a new view
7 changes: 2 additions & 5 deletions apps/api/lib/sourceViewCollection.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import $rdf from 'rdf-ext'
import clownface from 'clownface'
import asyncMiddleware from 'middleware-async'
import { dcterms, hydra, rdf, rdfs, schema } from '@tpluscode/rdf-ns-builders'
import { hydra, rdf, rdfs, schema } from '@tpluscode/rdf-ns-builders'
import { CONSTRUCT } from '@tpluscode/sparql-builder'
import { cube } from '@zazuko/vocabulary-extras/builders'
import { ssz, viewBuilder } from '@view-builder/core/ns.js'
import { ssz } from '@view-builder/core/ns.js'

/**
* GET handler for loading view metadata from the metadata endpoint
*
* The response is a hydra collection
*/
export const get = asyncMiddleware(async (req, res) => {
const publisher = req.knossos.config.out(viewBuilder.publisher).term

const collection = clownface({
dataset: $rdf.dataset(),
term: req.hydra.term,
Expand All @@ -28,7 +26,6 @@ export const get = asyncMiddleware(async (req, res) => {
?view a ${ssz.Objekte} ;
${schema.name} ?label ;
${schema.alternateName} ?uniqueId ;
${dcterms.publisher} ${publisher} ;
.
}

Expand Down
2 changes: 0 additions & 2 deletions apps/api/resources/api/config.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ PREFIX knossos: <https://hypermedia.app/knossos#>

<>
a knossos:Configuration ;
# TODO: make these env specific
view-builder:publisher <https://ld.stadt-zuerich.ch/statistics/meta/org/4> ;
view-builder:publishedViewTemplate
[
a hydra:IriTemplate ;
Expand Down