Skip to content

Added Piwik PRO WEB snippet#24

Closed
victoriobentivogli wants to merge 16 commits intomainfrom
develop
Closed

Added Piwik PRO WEB snippet#24
victoriobentivogli wants to merge 16 commits intomainfrom
develop

Conversation

@victoriobentivogli
Copy link
Copy Markdown
Contributor

For deployment. Includes the following changes:

"node-fetch": "^2.6.1"
"node-fetch": "^2.6.1",
"sparqljs": "^3.7.3",
"ted-sparql-editor": "file:"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This dependency is declared as 'file:', is that intended?

Copy link
Copy Markdown
Contributor

@cristianvasquez cristianvasquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor improvements needed

  1. Unused queries
    Several query files under src/assets/queries/ are not currently used by the application. Additionally, index.yaml only references 4 of the 20 available queries. If these files are indeed unused, consider removing the entire src/assets/queries/ directory to keep the repository clean.

  2. Application not running due to missing static file serving
    The application does not currently start correctly because the CORS proxy server (src/js/cors-proxy.js) defines only a /proxy route and does not serve static assets (HTML, CSS, JS).
    To fix this, add the following line:

    // Serve static files from the project root
    app.use(express.static('.'));
  3. Self-referential dependency in package.json
    The dependency entry

    "ted-sparql-editor": "file:"

    is self-referential (the package name is also ted-sparql-editor) and is not used anywhere in the codebase. It can be safely removed.

@victoriobentivogli
Copy link
Copy Markdown
Contributor Author

Superceeded by PR#25

rousso added a commit that referenced this pull request Apr 9, 2026
Stage 6 already wired ?facet= URL loading via SearchPanel.init →
controller.initFromUrlParams → controller.search. Stage 8 added
editor reflection on user-initiated searches. This commit closes
the gap by also reflecting the canned query into the editor when
a facet is loaded from the URL — anyone landing on the merged app
via a shared link sees the same editor + Explore state they would
have seen if they'd typed the search themselves.

The share button (added in PR #24, ported in Stage 3) already
emits ?facet=...-shaped URLs with the same identity-only stripping,
so the round-trip is symmetric:

  Click share on Explore tab
    → ?facet=%7B%22type%22%3A%22notice-number%22%2C%22value%22%3A%2200172531-2026%22%7D
  Open in new tab
    → URL parsed, facet validated, search runs, lands on Explore
    → Title: "Notice 00172531-2026 — 244 triples"
    → Search input mirrored
    → Editor pre-filled with the canned CONSTRUCT
    → Tree rendered

Implementation:

  src/js/SearchPanel.js
    init() — after the existing notice-number input mirroring,
    also wraps a try/catch around getQuery(facet) and calls
    this.loadEditorText() so the editor reflection applies to
    all facet types (notice-number, named-node, query) loaded
    from URL.

Verification:

  - npm test: 139/139 passing
  - Navigate to ?facet=%7B%22type%22%3A%22notice-number%22%2C%22value%22%3A%2200172531-2026%22%7D
  - Auto-switches to Explore tab (Stage 6 behaviour preserved)
  - Title: "Notice 00172531-2026 — 244 triples" (notice-number
    semantics preserved via the existing controller.search call
    inside initFromUrlParams)
  - Search input shows "00172531-2026"
  - Query Editor tab shows the canned CONSTRUCT pre-filled
  - Click share → 103-char URL identical in shape to the input URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants