diff --git a/src/client/src/pages/detail/form/location/nameSegment.tsx b/src/client/src/pages/detail/form/location/nameSegment.tsx index a09c976d6..7059020f3 100644 --- a/src/client/src/pages/detail/form/location/nameSegment.tsx +++ b/src/client/src/pages/detail/form/location/nameSegment.tsx @@ -25,6 +25,24 @@ const NameSegment = ({ borehole, editingEnabled, formMethods }: NameSegmentProps + {!auth.anonymousModeEnabled && ( + + + + + )} - - {!auth.anonymousModeEnabled && ( - - )} - - diff --git a/src/client/src/pages/overview/boreholeTable/boreholeTable.tsx b/src/client/src/pages/overview/boreholeTable/boreholeTable.tsx index 655ad81f5..45daf8e8f 100644 --- a/src/client/src/pages/overview/boreholeTable/boreholeTable.tsx +++ b/src/client/src/pages/overview/boreholeTable/boreholeTable.tsx @@ -18,6 +18,7 @@ import { LockKeyhole } from "lucide-react"; import { Boreholes, ReduxRootState, User } from "../../../api-lib/ReduxStateInterfaces.ts"; import { useDomains } from "../../../api/fetchApiV2"; import { theme } from "../../../AppTheme.ts"; +import { useAuth } from "../../../auth/useBdmsAuth.tsx"; import { muiLocales } from "../../../mui.locales.ts"; import { OverViewContext } from "../overViewContext.tsx"; import { TablePaginationActions } from "./TablePaginationActions.tsx"; @@ -51,6 +52,7 @@ export const BoreholeTable: FC = ({ const history = useHistory(); const domains = useDomains(); const apiRef = useGridApiRef(); + const auth = useAuth(); const firstRender = useRef(true); const { tableScrollPosition, setTableScrollPosition } = useContext(OverViewContext); const hasLoaded = useRef(false); @@ -68,14 +70,6 @@ export const BoreholeTable: FC = ({ const columns: GridColDef[] = [ { field: "alternate_name", headerName: t("name"), flex: 1 }, - { - field: "workgroup", - valueGetter: (value: { name: string }) => { - return value.name; - }, - headerName: t("workgroup"), - flex: 1, - }, { field: "borehole_type", valueGetter: (value: number) => { @@ -148,6 +142,17 @@ export const BoreholeTable: FC = ({ }, ]; + // Add workgroup column if not in anonymous mode + !auth.anonymousModeEnabled && + columns.splice(1, 0, { + field: "workgroup", + valueGetter: (value: { name: string }) => { + return value.name; + }, + headerName: t("workgroup"), + flex: 1, + }); + const handleRowClick: GridEventListener<"rowClick"> = params => { history.push(`/${params.row.id}/location`); };