Skip to content

Commit

Permalink
Disable location details view link
Browse files Browse the repository at this point in the history
  • Loading branch information
ciremusyoka committed Mar 5, 2024
1 parent 09e4e11 commit 4d52dc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
2 changes: 0 additions & 2 deletions .vscode/settings.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import { useSimpleTabularView } from '@opensrp/react-utils';
import { RouteComponentProps } from 'react-router';
import { ILocation } from '@smile-cdr/fhirts/dist/FHIR-R4/interfaces/ILocation';
Expand All @@ -9,9 +9,7 @@ import {
} from '../../constants';
import {

Check failure on line 10 in packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx

View workflow job for this annotation

GitHub Actions / test (16.17.0, ubuntu-latest)

Replace `⏎··BrokenPage,⏎··TableLayout,⏎··PageHeader,⏎··SearchForm,⏎` with `·BrokenPage,·TableLayout,·PageHeader,·SearchForm·`
BrokenPage,
useSearchParams,
TableLayout,
viewDetailsQuery,
PageHeader,
SearchForm,
} from '@opensrp/react-utils';
Expand All @@ -20,10 +18,9 @@ import { Helmet } from 'react-helmet';
import { useTranslation } from '../../mls';
import { Row, Col, Button, Divider, Dropdown } from 'antd';
import { useHistory, Link } from 'react-router-dom';
import { RbacCheck, useUserRole } from '@opensrp/rbac';
import { RbacCheck } from '@opensrp/rbac';
import type { MenuProps } from 'antd';
import { MoreOutlined, PlusOutlined } from '@ant-design/icons';
import { LocationUnitDetail } from '../LocationUnitDetail';

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

const {
queryValues: { data, isFetching, isLoading, error},

Check failure on line 51 in packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx

View workflow job for this annotation

GitHub Actions / test (16.17.0, ubuntu-latest)

Insert `·`
Expand All @@ -76,20 +72,13 @@ export const AllLocationListFlat: React.FC<LocationListPropTypes> = (props) => {
return [
{
key: '1',
permissions: [],
label: (
<Button type="link" onClick={() => addParam(viewDetailsQuery, record.id)}>
View Details
<Button disabled type="link" onClick={() => setDetailId(record.id)}>
{t('View details')}
</Button>
),
},
]
.filter((item) => userRole.hasPermissions(item.permissions))
.map((item) => {
const { permissions, ...rest } = item;
return rest;
});
};
]};

Check failure on line 81 in packages/fhir-location-management/src/components/AllLocationListFlat/index.tsx

View workflow job for this annotation

GitHub Actions / test (16.17.0, ubuntu-latest)

Insert `;⏎··`

const columns = [
{
Expand Down

0 comments on commit 4d52dc8

Please sign in to comment.