{
}}
schema="kind"
selected={borehole.data.kind}
+ readOnly={!isEditable}
/>
@@ -52,6 +53,7 @@ const BoreholeGeneralSegment = props => {
}}
schema="extended.drilling_method"
selected={borehole.data.extended.drilling_method}
+ readOnly={!isEditable}
/>
@@ -64,6 +66,7 @@ const BoreholeGeneralSegment = props => {
}}
schema="extended.purpose"
selected={borehole.data.extended.purpose}
+ readOnly={!isEditable}
/>
@@ -84,6 +87,7 @@ const BoreholeGeneralSegment = props => {
}}
schema="custom.cuttings"
selected={borehole.data.custom.cuttings}
+ readOnly={!isEditable}
/>
@@ -97,6 +101,7 @@ const BoreholeGeneralSegment = props => {
onChange={selected => {
updateChange("spud_date", selected, false);
}}
+ isEditable={isEditable}
/>
@@ -116,6 +121,7 @@ const BoreholeGeneralSegment = props => {
onChange={selected => {
updateChange("drilling_date", selected, false);
}}
+ isEditable={isEditable}
/>
@@ -138,6 +144,7 @@ const BoreholeGeneralSegment = props => {
? ""
: borehole.data.custom.drill_diameter
}
+ readOnly={!isEditable}
/>
@@ -161,6 +168,7 @@ const BoreholeGeneralSegment = props => {
return r;
})()}
thousandSeparator="'"
+ readOnly={!isEditable}
/>
@@ -173,6 +181,7 @@ const BoreholeGeneralSegment = props => {
}}
schema="extended.status"
selected={borehole.data.extended.status}
+ readOnly={!isEditable}
/>
@@ -197,6 +206,7 @@ const BoreholeGeneralSegment = props => {
? ""
: borehole.data.inclination
}
+ readOnly={!isEditable}
/>
@@ -219,6 +229,7 @@ const BoreholeGeneralSegment = props => {
? ""
: borehole.data.inclination_direction
}
+ readOnly={!isEditable}
/>
@@ -231,6 +242,7 @@ const BoreholeGeneralSegment = props => {
}}
schema="custom.qt_bore_inc_dir"
selected={borehole.data.custom.qt_bore_inc_dir}
+ readOnly={!isEditable}
/>
@@ -251,6 +263,7 @@ const BoreholeGeneralSegment = props => {
}}
rows={14}
value={borehole.data.custom.remarks}
+ readOnly={!isEditable}
/>
diff --git a/src/client/src/commons/form/borehole/segments/coordinatesSegment.js b/src/client/src/commons/form/borehole/segments/coordinatesSegment.js
index 7504be4ea..4be33557f 100644
--- a/src/client/src/commons/form/borehole/segments/coordinatesSegment.js
+++ b/src/client/src/commons/form/borehole/segments/coordinatesSegment.js
@@ -5,7 +5,6 @@ import {
Stack,
RadioGroup,
FormControlLabel,
- Radio,
} from "@mui/material";
import { Controller, useForm } from "react-hook-form";
import DomainDropdown from "../../domain/dropdown/domainDropdown";
@@ -15,6 +14,7 @@ import { Form, Segment } from "semantic-ui-react";
import { NumericFormat } from "react-number-format";
import { parseIfString, getPrecision } from "../../formUtils";
import { fetchApiV2 } from "../../../../api/fetchApiV2";
+import { DisabledRadio } from "./styledComponents";
const webApilv95tolv03 = "https://geodesy.geo.admin.ch/reframe/lv95tolv03";
const webApilv03tolv95 = "https://geodesy.geo.admin.ch/reframe/lv03tolv95";
@@ -388,16 +388,7 @@ const CoordinatesSegment = props => {
- }
+ control={}
label={
{
- }
+ control={}
label={
{
}}>
- }
+ control={}
label={}
/>
- }
+ control={}
label={}
/>
- }
+ control={}
label={}
/>
diff --git a/src/client/src/commons/form/borehole/segments/styledComponents.js b/src/client/src/commons/form/borehole/segments/styledComponents.js
new file mode 100644
index 000000000..d978d9b8e
--- /dev/null
+++ b/src/client/src/commons/form/borehole/segments/styledComponents.js
@@ -0,0 +1,16 @@
+import React from "react";
+import { Radio } from "@mui/material";
+
+export const DisabledRadio = ({ isEditable, ...props }) => {
+ return (
+
+ );
+};
diff --git a/src/client/src/commons/form/domain/tree/domainTree.js b/src/client/src/commons/form/domain/tree/domainTree.js
index 5768392ad..fc32059dd 100644
--- a/src/client/src/commons/form/domain/tree/domainTree.js
+++ b/src/client/src/commons/form/domain/tree/domainTree.js
@@ -135,7 +135,9 @@ class DomainTree extends React.Component {
}
handleOpen() {
- this.setState({ modalOpen: true });
+ if (this.props.isEditable === true) {
+ this.setState({ modalOpen: true });
+ }
}
handleClose() {
@@ -168,7 +170,7 @@ class DomainTree extends React.Component {
}
render() {
- const { domains, schema } = this.props;
+ const { domains, schema, isEditable } = this.props;
if (!domains.data.hasOwnProperty(schema)) {
if (domains.isFetching === true) {
return "loading translations";
@@ -415,6 +417,7 @@ class DomainTree extends React.Component {
icon="sitemap"
onClick={this.handleOpen}
value={this.getDomainText(this.state.selected)}
+ readOnly={!isEditable}
/>
}>
@@ -543,6 +546,7 @@ class DomainTree extends React.Component {
? this.state.selectedFilters[lev].id
: null
}
+ readOnly={!isEditable}
/>
) : null;
@@ -575,6 +579,7 @@ class DomainTree extends React.Component {
}}
placeholder="Search..."
value={this.state.search}
+ readOnly={!isEditable}
/>
diff --git a/src/client/src/commons/form/multiple/multipleForm.js b/src/client/src/commons/form/multiple/multipleForm.js
index 8517cd995..51957c827 100644
--- a/src/client/src/commons/form/multiple/multipleForm.js
+++ b/src/client/src/commons/form/multiple/multipleForm.js
@@ -177,6 +177,7 @@ class MultipleForm extends React.Component {
schema={schema === null ? this.state.data[field].api : schema}
selected={this.state.data[field].value}
title={}
+ isEditable={true}
/>
);
diff --git a/src/client/src/commons/form/profile/components/profileAttributes/components/profileAttributeList/profileAttributeList.js b/src/client/src/commons/form/profile/components/profileAttributes/components/profileAttributeList/profileAttributeList.js
index ebd422fe3..154eefd2d 100644
--- a/src/client/src/commons/form/profile/components/profileAttributes/components/profileAttributeList/profileAttributeList.js
+++ b/src/client/src/commons/form/profile/components/profileAttributes/components/profileAttributeList/profileAttributeList.js
@@ -200,6 +200,7 @@ const ProfileAttributeList = props => {
_.isNil(layer?.[item.value]) ? null : layer[item.value]
}
title={}
+ isEditable={true}
/>
)}
diff --git a/src/client/src/commons/search/components/listFilter.js b/src/client/src/commons/search/components/listFilter.js
index 7e9bcd577..51b375c14 100644
--- a/src/client/src/commons/search/components/listFilter.js
+++ b/src/client/src/commons/search/components/listFilter.js
@@ -387,6 +387,7 @@ const ListFilter = props => {
: search.filter[item.value]
}
title={}
+ isEditable={true}
/>
)}