Skip to content
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Templated queries now also work for queries containing multiple occurrences of a template variable (#164).
- Works when served from any base URL including a path (e.g. `https://www.example.com/your/preferred/path`) (#165).
- Corrected the link created from a custom query's SHARE QUERY button for the case where the base URL includes a path (#169).

## [1.4.0] - 2024-10-02

Expand Down
2 changes: 1 addition & 1 deletion main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lint:markdown": "markdownlint-cli2",
"lint:markdown:fix": "markdownlint-cli2-fix",
"preview": "vite preview",
"dev-with-path": "vite --base /random/path"
"dev-with-path": "vite --base /random/path/"
},
"dependencies": {
"@comunica/query-sparql": "^3.2.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export default function CustomQueryEditButton({ queryID, submitted = false }) {

const handleSave = () => {

const url = new URL(window.location.href);
const serverURL = `${url.protocol}//${url.hostname}${url.port ? ':' + url.port : ''}`;

const savedUrl = `${serverURL}/#/customQuery?${customQuery.searchParams.toString()}`;
const savedUrl = `${window.location.href.split('/#/')[0]}/#/customQuery?${customQuery.searchParams.toString()}`;
setCopyUrl(savedUrl);
}

Expand Down
2 changes: 1 addition & 1 deletion test/cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig({
experimentalStudio: true,
experimentalRunAllSpecs: true,
defaultCommandTimeout: 10000, /* is OK for very slow computers */
baseUrl: 'http://localhost:5173/random/path',
baseUrl: 'http://localhost:5173/random/path/', /* include trailing slash */
video: false
},
});
4 changes: 2 additions & 2 deletions test/cypress/e2e/custom-query-editor.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ SELECT * WHERE {

})

it("Saves the correct URL", () => {
it("Shares the correct URL", () => {

cy.visit("/#/customQuery");

Expand All @@ -163,7 +163,7 @@ SELECT * WHERE {
cy.get('button').contains("Share Query").click();

cy.get('textarea[name="queryURL"]').invoke('val').then((val) => {
expect(val).to.include('?name=new+query&description=new+description&queryString=PREFIX+schema%3A+%3Chttp%3A%2F%2Fschema.org%2F%3E+%0ASELECT+*+WHERE+%7B%0A++++%3Flist+schema%3Aname+%3FlistTitle%3B%0A++++++schema%3AitemListElement+%5B%0A++++++schema%3Aname+%3FbookTitle%3B%0A++++++schema%3Acreator+%5B%0A++++++++schema%3Aname+%3FauthorName%0A++++++%5D%0A++++%5D.%0A%7D&source=http%3A%2F%2Flocalhost%3A8080%2Fexample%2Fwish-list');
expect(val).to.equal(Cypress.config('baseUrl') + '#/customQuery?name=new+query&description=new+description&queryString=PREFIX+schema%3A+%3Chttp%3A%2F%2Fschema.org%2F%3E+%0ASELECT+*+WHERE+%7B%0A++++%3Flist+schema%3Aname+%3FlistTitle%3B%0A++++++schema%3AitemListElement+%5B%0A++++++schema%3Aname+%3FbookTitle%3B%0A++++++schema%3Acreator+%5B%0A++++++++schema%3Aname+%3FauthorName%0A++++++%5D%0A++++%5D.%0A%7D&source=http%3A%2F%2Flocalhost%3A8080%2Fexample%2Fwish-list');
});


Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/fetch-status.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe("Fetch Status", () => {
cy.contains("button", "Authorize").click();
});

cy.url().should("eq", Cypress.config('baseUrl') + "/");
cy.url().should("eq", Cypress.config('baseUrl'));

// Go to the mixed book query
cy.contains("For testing only").click();
Expand Down
4 changes: 2 additions & 2 deletions test/cypress/e2e/log-in.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe("Log in", () => {
cy.contains("button", "Authorize").click();
});

cy.url().should("eq", Cypress.config('baseUrl') + "/");
cy.url().should("eq", Cypress.config('baseUrl'));
});

it("Log in with an invalid IDP issuer", () => {
Expand Down Expand Up @@ -83,7 +83,7 @@ describe("Log in", () => {
cy.contains("button", "Authorize").click();
});

cy.url().should("eq", Cypress.config('baseUrl') + "/");
cy.url().should("eq", Cypress.config('baseUrl'));

cy.contains("General examples").click();
cy.contains("A secret list of my favorite books").click();
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/save-custom-queries-on-pod.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe("Saving custom queries on pods - logged in", () => {
cy.contains("button", "Authorize").click();
});

cy.url().should("eq", Cypress.config('baseUrl') + "/");
cy.url().should("eq", Cypress.config('baseUrl'));

cy.visit("/#");
});
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/sources-from-indexfile.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ describe("Sources from index file", () => {
cy.contains("button", "Authorize").click();
});

cy.url().should("eq", Cypress.config('baseUrl') + "/");
cy.url().should("eq", Cypress.config('baseUrl'));

//now try again
cy.contains("For testing only").click();
Expand Down
2 changes: 1 addition & 1 deletion test/cypress/e2e/sources-info.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("Sources info", () => {
cy.contains("button", "Authorize").click();
});

cy.url().should("eq", Cypress.config('baseUrl') + "/");
cy.url().should("eq", Cypress.config('baseUrl'));

cy.contains("General examples").click();
cy.contains("A secret list of my favorite books").click();
Expand Down