Skip to content

Commit 1b79529

Browse files
EmilioTRmvanbrab
andauthored
Fix/89 (#117)
Adding queryGroups. Fixes #89. --------- Co-authored-by: Martin Vanbrabant <[email protected]>
1 parent a297298 commit 1b79529

21 files changed

+307
-148
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212
- "Clear query cache and refresh" button (#105)
1313
- Source verification effective code (#77)
1414
- Query can now also be based on index file (#91)
15+
- Added collapsible query groups to the menu on the left (#89)
1516

1617
### Changed
1718

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,21 @@ The configuration file follows a simple structure.
9191
"queryFolder": "The base location of the queries, all query locations will start from this folder (relative to public folder.)",
9292
"httpProxy": "The http proxy through which the requests will be rerouted. When left empty, the Comunica query engine will handle it. This is useful when CORS headers are not set (correctly) on the queried source.",
9393
"introductionText": "The text that the app shows on the dashboard, which the app also shows when you first open it.",
94+
"queryGroups" : [
95+
{
96+
"id": "A unique ID for the query group",
97+
"name": "A name for the query group",
98+
"icon": "The key to the icon for the query group. This is optional and a default menu icon will be used when left empty."
99+
}
100+
],
94101
"queries": [
95102
{
103+
"id": "A unique ID for the query. This ID appears in the URL of the displayed result. Queries are ordered in the menu according to ascending ID.",
104+
"queryGroupId": "ID of the query group too which this query belongs. If not given, the query is displayed outside existing groups.",
96105
"queryLocation": "Path to the query location, relative to 'queryFolder'",
97106
"name": "A name for the query",
98107
"description": "Description of the query",
99-
"id": "A unique ID for the query",
100-
"icon": "The key to the icon for the query . This is optional and a default menu icon will be used when left empty.",
108+
"icon": "The key to the icon for the query. This is optional and a default menu icon will be used when left empty.",
101109
"comunicaContext": {
102110
"sources": "Initial list of sources over which the query should be executed",
103111
"useProxy": "True or false, whether the query should be executed through the proxy or not. This field is optional and defaults to false.",

cypress/e2e/aggregating-query.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe("Aggregating query", () => {
22
it("AVG() function - see https://github.com/SolidLabResearch/generic-data-viewer-react-admin/issues/70", () => {
33
cy.visit("/");
4-
4+
cy.contains("General examples").click();
55
cy.contains("Average value").click();
66
cy.contains("Finished in:");
77
cy.get('.column-average').find('span').contains("75");

cypress/e2e/bad-cors.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe("Bad CORS", () => {
22
it('Querying resource with "bad" cors header, though a proxy should work', () => {
33
cy.visit("/");
4-
4+
cy.contains("General examples").click();
55
cy.contains("My idols").click();
66
cy.get(".MuiSnackbarContent-message").should("not.exist");
77
});

cypress/e2e/column-header.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
describe("Column header", () => {
22
it("Variables link to ontology", () => {
33
cy.visit("/");
4-
5-
cy.contains("My favourite musicians").click();
4+
cy.contains("General examples").click();
5+
cy.contains("A query about musicians").click();
66
cy.contains("Finished in:");
77
cy.get('a[href="http://schema.org/name"]');
88
})

cypress/e2e/dashboard.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ describe("Dashboard", () => {
55

66
it("Custom icon per query is displayed", () => {
77
cy.visit("/");
8-
8+
cy.contains("General examples").click();
99
cy.get('[data-testid="PhotoIcon"]').should("exist");
1010
cy.get('[data-testid="BrushIcon"]').should("exist");
1111
})

cypress/e2e/fetch-status.cy.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ describe("Fetch Status", () => {
33
it("Fetch data with no authenticated user", () => {
44

55
cy.visit("/");
6-
6+
77
// Go immediately to query
8-
cy.contains("A book query testing sources with and without authentication required").click();
8+
cy.contains("For testing only").click();
9+
cy.contains("A query on a secret and a public list of books").click();
910

1011
// Check if the public and restricted sources appear
1112
cy.get('[aria-label="Sources info"]').click();
@@ -49,7 +50,8 @@ describe("Fetch Status", () => {
4950
cy.url().should("eq", "http://localhost:5173/");
5051

5152
// Go to the mixed book query
52-
cy.contains("A book query testing sources with and without authentication required").click();
53+
cy.contains("For testing only").click();
54+
cy.contains("A query on a secret and a public list of books").click();
5355

5456
// Check if the public and restricted sources appear
5557
cy.get('[aria-label="Sources info"]').click();
@@ -75,7 +77,8 @@ describe("Fetch Status", () => {
7577
cy.visit("/");
7678

7779
// Go immediately to query
78-
cy.contains("My favourite musicians").click();
80+
cy.contains("General examples").click();
81+
cy.contains("A query about musicians").click();
7982

8083
// Check if the good and bad sources appear
8184
cy.get('[aria-label="Sources info"]').click();

cypress/e2e/lenient.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
describe("Lenient mode", () => {
22
it("When one source throws an error, the results of other sources are still shown", () => {
33
cy.visit("/");
4-
5-
cy.contains("My favourite musicians").click();
4+
cy.contains("General examples").click();
5+
cy.contains("A query about musicians").click();
66
cy.contains("Finished in:");
77
cy.contains("Ludwig van Beethoven");
88
});

cypress/e2e/log-in.cy.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ describe("Log in", () => {
6565

6666
cy.url().should("eq", "http://localhost:5173/");
6767

68-
cy.contains("A list of my favorite books").click();
68+
cy.contains("General examples").click();
69+
cy.contains("A secret list of my favorite books").click();
6970
cy.contains("It Ends With Us");
7071

7172
cy.get('[aria-label="Profile"]').click();
@@ -76,15 +77,15 @@ describe("Log in", () => {
7677

7778
it("Do not log in and query on private data unauthenticated", () => {
7879
cy.visit("/");
79-
80-
cy.contains("A list of my favorite books").click();
80+
cy.contains("General examples").click();
81+
cy.contains("A secret list of my favorite books").click();
8182
cy.contains("It Ends With Us").should("not.exist");
8283
});
8384

8485
it("Do not log in and query public data", () => {
8586
cy.visit("/");
86-
87-
cy.contains("My wish list").click();
87+
cy.contains("General examples").click();
88+
cy.contains("A public list of books I'd love to own").click();
8889
cy.contains("Too Late");
8990
});
9091
});

cypress/e2e/no-duplicates.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
describe("No duplicates", () => {
22
it("When sources contain identical triples, duplicates should not be counted in a SELECT DISTINCT query", () => {
33
cy.visit("/");
4-
4+
cy.contains("For testing only").click();
55
cy.contains("A test on DISTINCT LIMIT OFFSET").click();
66
cy.contains("1-10 of 36");
77
cy.contains("http://www.example.com/data#s00").should("not.exist");

0 commit comments

Comments
 (0)