Skip to content

Commit 4d52dc8

Browse files
committed
Disable location details view link
1 parent 09e4e11 commit 4d52dc8

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

.vscode/settings.json

-2
This file was deleted.

packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx

+6-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import React, { useState } from 'react';
22
import { useSimpleTabularView } from '@opensrp/react-utils';
33
import { RouteComponentProps } from 'react-router';
44
import { ILocation } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/ILocation';
@@ -9,9 +9,7 @@ import {
99
} from '../../constants';
1010
import {
1111
BrokenPage,
12-
useSearchParams,
1312
TableLayout,
14-
viewDetailsQuery,
1513
PageHeader,
1614
SearchForm,
1715
} from '@opensrp/react-utils';
@@ -20,10 +18,9 @@ import { Helmet } from 'react-helmet';
2018
import { useTranslation } from '../../mls';
2119
import { Row, Col, Button, Divider, Dropdown } from 'antd';
2220
import { useHistory, Link } from 'react-router-dom';
23-
import { RbacCheck, useUserRole } from '@opensrp/rbac';
21+
import { RbacCheck } from '@opensrp/rbac';
2422
import type { MenuProps } from 'antd';
2523
import { MoreOutlined, PlusOutlined } from '@ant-design/icons';
26-
import { LocationUnitDetail } from '../LocationUnitDetail';
2724

2825
interface RouteParams {
2926
locationId: string | undefined;
@@ -48,8 +45,7 @@ export const AllLocationListFlat: React.FC<LocationListPropTypes> = (props) => {
4845
const { fhirBaseURL } = props;
4946
const { t } = useTranslation();
5047
const history = useHistory();
51-
const { addParam, sParams } = useSearchParams();
52-
const userRole = useUserRole();
48+
const [_, setDetailId] = useState<string>();
5349

5450
const {
5551
queryValues: { data, isFetching, isLoading, error},
@@ -76,20 +72,13 @@ export const AllLocationListFlat: React.FC<LocationListPropTypes> = (props) => {
7672
return [
7773
{
7874
key: '1',
79-
permissions: [],
8075
label: (
81-
<Button type="link" onClick={() => addParam(viewDetailsQuery, record.id)}>
82-
View Details
76+
<Button disabled type="link" onClick={() => setDetailId(record.id)}>
77+
{t('View details')}
8378
</Button>
8479
),
8580
},
86-
]
87-
.filter((item) => userRole.hasPermissions(item.permissions))
88-
.map((item) => {
89-
const { permissions, ...rest } = item;
90-
return rest;
91-
});
92-
};
81+
]};
9382

9483
const columns = [
9584
{

0 commit comments

Comments
 (0)