Skip to content

Commit

Permalink
Add disclaimer with new style
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt committed Aug 15, 2024
1 parent 5f9f866 commit dff8a64
Show file tree
Hide file tree
Showing 60 changed files with 1,334 additions and 1,936 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Removed unused `IsViewer` flag from user.
- Removed unused `UserEvent` from user.
- Migrated `User` API endpoints to .NET API.
- Disclaimer is now displayed at every login.
- Changed boreholes table design.
- Migrated `Workgroup` API endpoints to .NET API.
- Use `filled` style for form components.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Requests and das Legacy API werden mit dem [YARP Reverse Proxy](https://microsof

- Das UI-Design ist in [Figma](https://www.figma.com/design/cEiOoOazAQZqpRY92ZhBeO/SwissGeol?node-id=7390-40928&t=DemUCUzYlysJ5lB4-0) definiert. Unter Pages/Screens sind die definitiven Designs zu finden.
- Standardmässig werden die [Lucid Icons](https://lucide.dev/icons/) verwendet. Custom-Icons können aus [Figma](https://www.figma.com/design/cEiOoOazAQZqpRY92ZhBeO/SwissGeol?node-id=7390-40928&t=DemUCUzYlysJ5lB4-0) kopiert und als SVG eingebunden werden. Um die Icons farblich stylen zu können, müssen `fill` und `stroke` wie folgt angepasst werden `fill="currentColor" stroke="currentColor"`.
- [MUI](https://mui.com/) wird als UI-Component library verwendet. Allgemeine Styles werden im [AppTheme.ts](./src/client/src/AppTheme.ts) definiert und diese Styles wo immer möglich verwendet. [MUI Styled Components](https://mui.com/system/styled/) im gleichen File mit der Komponente definieren, sobald die Styles mehrfach gebraucht werden. Übergreifende Styled Components werden in [styledComponents.js](./src/client/src/components/styledComponents.js) definiert.
- [MUI](https://mui.com/) wird als UI-Component library verwendet. Allgemeine Styles werden im [AppTheme.ts](./src/client/src/AppTheme.ts) definiert und diese Styles wo immer möglich verwendet. [MUI Styled Components](https://mui.com/system/styled/) im gleichen File mit der Komponente definieren, sobald die Styles mehrfach gebraucht werden. Übergreifende Styled Components werden in [styledComponents.ts](./src/client/src/components/styledComponents.ts) definiert.

#### Typescript

Expand Down
9 changes: 3 additions & 6 deletions src/client/cypress/e2e/admin/aboutSettings.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import license from "../../fixtures/license.json";

describe("Admin about page tests", () => {
it("shows version information linking the corresponding release on GitHub.", () => {
loginAsAdmin();
cy.visit("/setting/about");
loginAsAdmin("/setting/about");

cy.get('[data-cy="version"]')
.should("contain", "0.0.99+dev")
Expand All @@ -13,17 +12,15 @@ describe("Admin about page tests", () => {

it("shows license information (with fixtures)", () => {
cy.intercept("/license.json", license);
loginAsAdmin();
cy.visit("/setting/about");
loginAsAdmin("/setting/about");

cy.get('[data-cy^="credits-"]').should("have.length", 2);
cy.get('[data-cy="[email protected]"]').should("contain", "example-js (Version 0.0.999)");
cy.get('[data-cy="[email protected]"]').should("contain", "example-react (Version 0.0.111)");
});

it("shows license information (without fixtures)", () => {
loginAsAdmin();
cy.visit("/setting/about");
loginAsAdmin("/setting/about");
cy.get('[data-cy^="credits-"]').should("have.length.above", 0);
});
});
4 changes: 1 addition & 3 deletions src/client/cypress/e2e/admin/userAdministration.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { loginAsAdmin } from "../helpers/testHelpers";

describe("Admin settings test", () => {
beforeEach(() => {
loginAsAdmin();
cy.visit("/setting/admin");

loginAsAdmin("/setting/admin");
cy.get('[data-cy="user-list-table-body"]').children().should("have.length", 8);
});

Expand Down
6 changes: 2 additions & 4 deletions src/client/cypress/e2e/editor/backfill.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ describe("Backfill crud tests", () => {

it("adds, edits and deletes backfills", () => {
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
});
cy.wait("@get-completions-by-boreholeId");

Expand Down Expand Up @@ -102,8 +101,7 @@ describe("Backfill crud tests", () => {
});

cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
startBoreholeEditing();
});
cy.get("[data-cy=completion-content-tab-backfill]").click();
Expand Down
Empty file.
6 changes: 2 additions & 4 deletions src/client/cypress/e2e/editor/casing.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ describe("Casing crud tests", () => {

// open completion editor
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
});

cy.wait("@get-completions-by-boreholeId");
Expand Down Expand Up @@ -131,8 +130,7 @@ describe("Casing crud tests", () => {
{ fromDepth: 0, toDepth: 12, kindId: 25000103 },
]);
});
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
});

// casing 1
Expand Down
3 changes: 1 addition & 2 deletions src/client/cypress/e2e/editor/chronostratigraphy.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ describe("Tests for the chronostratigraphy editor.", () => {

// open chronostratigraphy editor
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/stratigraphy/chronostratigraphy`);
loginAsAdmin(`/${id}/stratigraphy/chronostratigraphy`);
});
cy.wait("@get-layers-by-profileId");

Expand Down
9 changes: 3 additions & 6 deletions src/client/cypress/e2e/editor/completion.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ describe("completion crud tests", () => {
it("adds, edits, copies and deletes completions", () => {
createBorehole({ "extended.original_name": "INTEADAL" }).as("borehole_id");
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
});
cy.wait("@get-completions-by-boreholeId");
cy.contains("No completion available");
Expand Down Expand Up @@ -157,8 +156,7 @@ describe("completion crud tests", () => {
createBorehole({ "extended.original_name": "INTEADAL" }).as("borehole_id");
cy.get("@borehole_id").then(id => {
boreholeId = id;
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
});
cy.wait("@get-completions-by-boreholeId");
cy.contains("No completion available");
Expand Down Expand Up @@ -403,8 +401,7 @@ describe("completion crud tests", () => {

// open completion editor
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
});
cy.wait("@get-completions-by-boreholeId");

Expand Down
6 changes: 2 additions & 4 deletions src/client/cypress/e2e/editor/dataCards.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ describe("Tests for the data cards in the editor.", () => {
it("resets datacards when stop editing", () => {
createBorehole({ "extended.original_name": "INTEADAL" }).as("borehole_id");
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/hydrogeology/wateringress`);
loginAsAdmin(`/${id}/hydrogeology/wateringress`);
});

startBoreholeEditing();
Expand Down Expand Up @@ -35,8 +34,7 @@ describe("Tests for the data cards in the editor.", () => {
it("checks for unsaved changes when switching between cards", () => {
createBorehole({ "extended.original_name": "INTEADAL" }).as("borehole_id");
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/hydrogeology/wateringress`);
loginAsAdmin(`/${id}/hydrogeology/wateringress`);
});
startBoreholeEditing();

Expand Down
4 changes: 2 additions & 2 deletions src/client/cypress/e2e/editor/fieldMeasurement.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ beforeEach(() => {
describe("Tests for the field measurement editor.", () => {
it("Creates, updates and deletes field measurement", () => {
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/hydrogeology/fieldmeasurement`);
loginAsAdmin(`/${id}/hydrogeology/fieldmeasurement`);

startBoreholeEditing();
selectLanguage("de");
Expand Down Expand Up @@ -92,6 +91,7 @@ describe("Tests for the field measurement editor.", () => {
createFieldMeasurement(id, "2012-11-14T12:06Z", 15203157, 15203209, 15203219, 10, null, 0, 10);
createFieldMeasurement(id, "2012-11-14T12:07Z", 15203157, 15203209, 15203219, 10, null, 0, 12);
cy.visit(`/${id}/hydrogeology/fieldmeasurement`);
cy.get('[data-cy="accept-button"]').click();

startBoreholeEditing();
cy.get('[data-cy="fieldMeasurement-card.0"] [data-cy="todepth-formDisplay"]').contains("10");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ describe("Tests for the groundwater level measurement editor.", () => {
);

cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}`);
loginAsAdmin(`/${id}`);
});
startBoreholeEditing();

Expand Down Expand Up @@ -74,8 +73,7 @@ describe("Tests for the groundwater level measurement editor.", () => {
cy.get("@borehole_id").then(id => {
createGroundwaterLevelMeasurement(id, "2012-11-14T12:06Z", 15203157, 15203208, null, 0, 10);
createGroundwaterLevelMeasurement(id, "2012-11-14T12:07Z", 15203157, 15203207, null, 0, 12);
loginAsAdmin();
cy.visit(`/${id}/hydrogeology/groundwaterlevelmeasurement`);
loginAsAdmin(`/${id}/hydrogeology/groundwaterlevelmeasurement`);
});
startBoreholeEditing();

Expand Down
9 changes: 3 additions & 6 deletions src/client/cypress/e2e/editor/hydrotest.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ describe("Tests for the hydrotest editor.", () => {
);

cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}`);
loginAsAdmin(`/${id}`);
});
startBoreholeEditing();

Expand Down Expand Up @@ -112,8 +111,7 @@ describe("Tests for the hydrotest editor.", () => {
.then(id => {
createHydrotest(id, "2012-11-14T12:06Z", 15203157, [15203175], null, 0, 10);
createHydrotest(id, "2012-11-14T12:07Z", 15203157, [15203174], null, 0, 12);
loginAsAdmin();
cy.visit(`/${id}/hydrogeology/hydrotest`);
loginAsAdmin(`/${id}/hydrogeology/hydrotest`);
});
startBoreholeEditing();

Expand Down Expand Up @@ -142,8 +140,7 @@ describe("Tests for the hydrotest editor.", () => {
it("checks for unsaved changes when switching between cards", () => {
createBorehole({ "extended.original_name": "INTEADAL" }).as("borehole_id");
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/hydrogeology/hydrotest`);
loginAsAdmin(`/${id}/hydrogeology/hydrotest`);
});
startBoreholeEditing();

Expand Down
5 changes: 1 addition & 4 deletions src/client/cypress/e2e/editor/import.cy.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { loginAsAdmin, getImportFileFromFixtures } from "../../e2e/helpers/testHelpers";
import { getImportFileFromFixtures, loginAsAdmin } from "../../e2e/helpers/testHelpers";

describe("Test for importing boreholes.", () => {
it("Successfully imports multiple boreholes.", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="import-borehole-button"]').click();

// Select borehole csv file
Expand Down Expand Up @@ -71,7 +70,6 @@ describe("Test for importing boreholes.", () => {

it("Displays borehole validation errors.", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="import-borehole-button"]').click();

// Select borehole csv file
Expand Down Expand Up @@ -111,7 +109,6 @@ describe("Test for importing boreholes.", () => {

it("Displays lithology validation errors.", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="import-borehole-button"]').click();

// Select borehole csv file
Expand Down
3 changes: 1 addition & 2 deletions src/client/cypress/e2e/editor/instrumentation.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ describe("Instrumentation crud tests", () => {

// open completion editor
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/completion`);
loginAsAdmin(`/${id}/completion`);
});

cy.wait("@get-completions-by-boreholeId");
Expand Down
3 changes: 1 addition & 2 deletions src/client/cypress/e2e/editor/lithostratigraphy.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ describe("Tests for the lithostratigraphy editor.", () => {

// open lithostratigraphy editor
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/stratigraphy/lithostratigraphy`);
loginAsAdmin(`/${id}/stratigraphy/lithostratigraphy`);
});
cy.wait("@get-layers-by-profileId");

Expand Down
3 changes: 1 addition & 2 deletions src/client/cypress/e2e/editor/publicationWorkflow.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ describe("Tests the publication workflow.", () => {
it("Publishes a borehole without rejections", () => {
createBorehole({ "extended.original_name": "Borehole to publish" }).as("borehole_id");
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}/status`);
loginAsAdmin(`/${id}/status`);
});

startEditing();
Expand Down
6 changes: 2 additions & 4 deletions src/client/cypress/e2e/editor/waterIngress.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ describe("Tests for the wateringress editor.", () => {

// open completion editor
cy.get("@borehole_id").then(id => {
loginAsAdmin();
cy.visit(`/${id}`);
loginAsAdmin(`/${id}`);
});

// start editing session
Expand Down Expand Up @@ -79,8 +78,7 @@ describe("Tests for the wateringress editor.", () => {
cy.get("@borehole_id").then(id => {
createWateringress(id, "2012-11-14T12:06Z", 15203157, 15203161, null, 0, 10);
createWateringress(id, "2012-11-14T12:07Z", 15203157, 15203162, null, 0, 12);
loginAsAdmin();
cy.visit(`/${id}/hydrogeology/wateringress`);
loginAsAdmin(`/${id}/hydrogeology/wateringress`);
});
startBoreholeEditing();

Expand Down
8 changes: 0 additions & 8 deletions src/client/cypress/e2e/filters/filter.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ import { showTableAndWaitForData, verifyPaginationText } from "../helpers/dataGr
describe("Search filter tests", () => {
it("has search filters", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("Filters");
});

it("shows the correct dropdowns", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("h6", "Location").click();
cy.contains("Show all fields").children().eq(0).click();
Expand Down Expand Up @@ -48,7 +46,6 @@ describe("Search filter tests", () => {
it("checks that the registration filter settings control the filter visibility.", () => {
// precondition filters not visible
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("Registration").click();
cy.contains("Show all fields")
Expand Down Expand Up @@ -80,7 +77,6 @@ describe("Search filter tests", () => {

it("filters boreholes by creator name", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("Registration").click();
cy.contains("Show all fields").children(".checkbox").click();
Expand All @@ -96,7 +92,6 @@ describe("Search filter tests", () => {

it("filters boreholes by color and uscs3", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("Lithology").click();
cy.contains("Show all fields").children(".checkbox").click();
Expand Down Expand Up @@ -147,7 +142,6 @@ describe("Search filter tests", () => {

it("filters boreholes by original lithology in editor mode", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
filterByOriginalLithology();
cy.wait("@edit_list");
Expand All @@ -156,7 +150,6 @@ describe("Search filter tests", () => {
});
it("filters boreholes by creation date", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("Registration").click();
cy.contains("Show all fields").children(".checkbox").click();
Expand Down Expand Up @@ -185,7 +178,6 @@ describe("Search filter tests", () => {

it("filters boreholes by workgroup", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
showTableAndWaitForData();
cy.contains("Workgroup").click();
Expand Down
3 changes: 0 additions & 3 deletions src/client/cypress/e2e/filters/hierarchicalDataFilter.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { loginAsAdmin } from "../helpers/testHelpers.js";
describe("Hierachical data filter tests", () => {
it("check visible filters", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("h6", "Chronostratigraphy").click();
cy.get("Show all fields").should("not.exist");
Expand All @@ -15,7 +14,6 @@ describe("Hierachical data filter tests", () => {

it("check sorting of filter values", () => {
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("h6", "Chronostratigraphy").click();
let periodsDropdown = cy.contains("label", "Period").next();
Expand Down Expand Up @@ -51,7 +49,6 @@ describe("Hierachical data filter tests", () => {
"late Burdigalian",
];
loginAsAdmin();
cy.visit("/");
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("h6", "Chronostratigraphy").click();
cy.get('[data-cy="hierarchical-data-search"]')
Expand Down
1 change: 0 additions & 1 deletion src/client/cypress/e2e/filters/polygonFilter.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ function assertPolygonFilterActive() {
describe("Polygon filter tests", () => {
it("draws polygon and asserts filtering", () => {
loginAsAdmin();
cy.visit("/");
cy.wait(5000);
cy.wait("@borehole_geojson");
cy.get('[data-cy="show-filter-button"]').click();
Expand Down
Loading

0 comments on commit dff8a64

Please sign in to comment.