Skip to content

Commit

Permalink
Merge branch 'main' into data-migration-groundwater
Browse files Browse the repository at this point in the history
  • Loading branch information
MiraGeowerkstatt authored Nov 28, 2024
2 parents ac60f6e + 065841d commit 6cae437
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
- The responsive design of the coordinate segment in the detail view was broken.
- When clicking the select all checkbox in the borehole table, only the boreholes on the current page were selected.
- Some filter chips were missing translations or where not displayed correctly.
- Filtering striae for "not specified" returned wrong results.
- Filtering striae for `not specified` returned wrong results.
- Filtering by `borehole status` did not work.

## v2.1.870 - 2024-09-27

Expand Down
27 changes: 26 additions & 1 deletion src/client/cypress/e2e/filters/filter.cy.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
import { showTableAndWaitForData, verifyPaginationText } from "../helpers/dataGridHelpers";
import { createBorehole, createLithologyLayer, createStratigraphy, loginAsAdmin } from "../helpers/testHelpers.js";
import {
createBorehole,
createLithologyLayer,
createStratigraphy,
loginAsAdmin,
returnToOverview,
startBoreholeEditing,
} from "../helpers/testHelpers.js";

describe("Search filter tests", () => {
it("has search filters", () => {
Expand Down Expand Up @@ -220,6 +227,24 @@ describe("Search filter tests", () => {
verifyPaginationText("1–100 of 1630");
});

it("filters boreholes by status", () => {
createBorehole({ "extended.original_name": "Filter by status" }).as("borehole_id");
cy.get("@borehole_id").then(id => {
loginAsAdmin(`/${id}/status`);
startBoreholeEditing();
cy.get('[data-cy="workflow_submit"]').click();
cy.get('[data-cy="workflow_dialog_submit"]').click();
returnToOverview();
cy.get('[data-cy="show-filter-button"]').click();
cy.contains("Status").click();
cy.get('[data-cy="boreholes-number-preview"]').should("have.text", "1'627");
cy.get('[data-cy="statuseditor"]').click();
cy.get('[data-cy="boreholes-number-preview"]').should("have.text", "1'626");
cy.get('[data-cy="statuscontroller"]').click();
cy.get('[data-cy="boreholes-number-preview"]').should("have.text", "1");
});
});

it("filters boreholes by color and uscs3", () => {
loginAsAdmin();
cy.get('[data-cy="show-filter-button"]').click();
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/pages/detail/detailHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const DetailHeader = ({
<Typography variant="h2"> {borehole?.alternateName}</Typography>
{!auth.anonymousModeEnabled && (
<Typography variant={"subtitle2"}>
{t("lastUpdated")}: <DateText date={borehole?.updated} /> {t("by")} {borehole?.updatedBy.name}{" "}
{t("lastUpdated")}: <DateText date={borehole?.updated} /> {t("by")} {borehole?.updatedBy?.name}
</Typography>
)}
</Stack>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,28 @@ class StatusFilter extends Component {
{capitalizeFirstLetter(t("alls"))}
</span>
</Form.Field>
{["statuseditor", "statuscontroller", "statusvalidator", "statuspublisher"].map(role => (
<Form.Field key={"sec-" + role}>
{[
{ name: "EDIT", translationKey: "statuseditor" },
{ name: "CONTROL", translationKey: "statuscontroller" },
{ name: "VALID", translationKey: "statusvalidator" },
{ name: "PUBLIC", translationKey: "statuspublic" },
].map(role => (
<Form.Field key={"sec-" + role.translationKey}>
<Radio
checked={search.filter.role === role.replace("status", "").toUpperCase()}
checked={search.filter.role === role.name}
label={""}
data-cy={role.translationKey}
name="radioGroup"
onChange={() => {
this.props.setFilter("role", role.replace("status", "").toUpperCase());
this.props.setFilter("role", role.name);
}}
/>
<span
style={{
color: "black",
fontSize: "1.1em",
}}>
{capitalizeFirstLetter(t(role))}
{capitalizeFirstLetter(t(role.translationKey))}
</span>
</Form.Field>
))}
Expand Down

0 comments on commit 6cae437

Please sign in to comment.