Skip to content

Commit

Permalink
Merge branch 'main' into remove-litho-import
Browse files Browse the repository at this point in the history
  • Loading branch information
Lehats committed Dec 10, 2024
2 parents e33d2b2 + 18bf8a3 commit a0a18b2
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Updated the layout of the borehole general tab.
- Removed deduplication check when adding and detaching attachments.
- When copying a borehole, attachments won't be copied.
- Removed layers settings for anonymous users.
- Removed csv lithology import.

### Fixed
Expand All @@ -40,6 +41,8 @@
- Filtering striae for `not specified` returned wrong results.
- Filtering by `borehole status` did not work.
- When saving with ctrl+s in the borehole sections, the form content was reset.
- There was a bug when changing the order, transparency or visibility of custom WMS user layers.
- The borehole status was not translated everywhere in the workflow panel.

## v2.1.870 - 2024-09-27

Expand Down
17 changes: 16 additions & 1 deletion src/client/cypress/e2e/detailPage/location.cy.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { addItem, saveWithSaveBar, stopEditing } from "../helpers/buttonHelpers";
import { checkRowWithText, clickOnRowWithText, showTableAndWaitForData } from "../helpers/dataGridHelpers";
import { evaluateInput, evaluateSelect, setInput, setSelect } from "../helpers/formHelpers";
import { evaluateInput, evaluateSelect, isDisabled, setInput, setSelect } from "../helpers/formHelpers";
import {
createBorehole,
goToRouteAndAcceptTerms,
Expand Down Expand Up @@ -124,6 +124,21 @@ describe("Tests for 'Location' edit page.", () => {
});
});

it("Saves restriction until date.", () => {
newEditableBorehole().as("borehole_id");

setSelect("restrictionId", 3);
isDisabled("restrictionUntil", false);
setInput("restrictionUntil", "2012-11-14");
evaluateInput("restrictionUntil", "2012-11-14");
saveWithSaveBar();
// navigate away and back to check if values are saved
cy.get('[data-cy="borehole-menu-item"]').click();
cy.get('[data-cy="location-menu-item"]').click();

evaluateInput("restrictionUntil", "2012-11-14");
});

it("saves with ctrl s", () => {
newEditableBorehole();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,14 +203,12 @@ class DomainDropdown extends React.Component {
),
})),
);
if (readOnly) {
let selectedOption = options.find(option => option.value === selected);
return <Form.Input fluid readOnly value={selectedOption?.text || ""} />;
}
return (
<Form.Select
data-cy="domain-dropdown"
fluid
readOnly={readOnly}
style={{ pointerEvents: readOnly ? "none" : "auto" }}
multiple={multiple}
onChange={this.handleChange}
options={options}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ const RestrictionSegment = ({ borehole, editingEnabled, formMethods }: Restricti
const { dirtyFields } = formMethods.formState;
const restriction = formMethods.watch("restrictionId");

useEffect(() => {
//TODO: Adapt data type on backend to Date instead of slicing the returned DateTime
formMethods.setValue("restrictionUntil", borehole.restrictionUntil?.toString().slice(0, 10) ?? "");
}, [borehole.restrictionUntil, formMethods]);

useEffect(() => {
if (dirtyFields.restrictionId) {
setRestrictionUntilEnabled(restriction === restrictionUntilCode);
Expand Down
2 changes: 1 addition & 1 deletion src/client/src/pages/detail/form/workflow/workflowForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ class WorkflowForm extends React.Component {
whiteSpace: "nowrap",
}}>
<Typography variant="h6" sx={{ color: "#909090" }}>
<TranslationText id={`status${role.toLowerCase()}`} />
<TranslationText id={`status${this.roleMap[role].toLowerCase()}`} />
</Typography>
</div>
<div
Expand Down
14 changes: 7 additions & 7 deletions src/client/src/pages/overview/layout/mainSideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ const MainSideNav = ({
setUpload(true);
}}
/>
<NavButton
data-cy="layers-button"
icon={<Layers />}
label={t("usersMap")}
selected={isLayersPanelVisible}
onClick={handleToggleLayers}
/>
</>
)}
<NavButton
data-cy="layers-button"
icon={<Layers />}
label={t("usersMap")}
selected={isLayersPanelVisible}
onClick={handleToggleLayers}
/>
</Stack>
<Stack
direction="column"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class StatusFilter extends Component {
{ name: "EDIT", translationKey: "statuseditor" },
{ name: "CONTROL", translationKey: "statuscontroller" },
{ name: "VALID", translationKey: "statusvalidator" },
{ name: "PUBLIC", translationKey: "statuspublic" },
{ name: "PUBLIC", translationKey: "statuspublisher" },
].map(role => (
<Form.Field key={"sec-" + role.translationKey}>
<Radio
Expand Down
5 changes: 3 additions & 2 deletions src/client/src/pages/settings/editorSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ const EditorSettings = () => {
position: number,
queryable: boolean,
) => {
const key = type === "WMTS" ? layer?.Identifier : layer?.Name;
dispatch(
patchSettings(
"map.explorer",
{
Identifier: layer.Identifier,
Identifier: key,
Abstract: layer.Abstract,
position: position,
Title: layer.Title,
Expand All @@ -88,7 +89,7 @@ const EditorSettings = () => {
conf: conf,
},
// @ts-expect-error typing not complete
type === "WMTS" ? layer?.Identifier : layer?.Name,
key,
),
);
};
Expand Down

0 comments on commit a0a18b2

Please sign in to comment.