Skip to content

Commit

Permalink
Fix url collision to user details
Browse files Browse the repository at this point in the history
  • Loading branch information
peterMuriuki committed Jan 16, 2024
1 parent 8745404 commit b9138c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion app/src/App/fhir-apps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ import {
import {
CreateEditUser as FHIRConnectedCreateEditUser,
UserList as FhirUserList,
USER_DETAILS_URL,
UserDetailsV2,
} from '@opensrp/fhir-user-management';
import { Home } from '../containers/pages/Home/Home';
Expand Down Expand Up @@ -229,7 +230,7 @@ const FHIRApps = () => {
redirectPath={APP_CALLBACK_URL}
disableLoginProtection={DISABLE_LOGIN_PROTECTION}
exact
path={`${URL_USER}/:${'id'}`}
path={USER_DETAILS_URL}
permissions={['iam_user.read']}
component={UserDetailsV2}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@ import { Divider, Dropdown, Button } from 'antd';
import type { MenuProps } from 'antd';
import { MoreOutlined } from '@ant-design/icons';
import { Link } from 'react-router-dom';
import {
KeycloakUser,
URL_USER_EDIT,
URL_USER_CREDENTIALS,
URL_USER,
} from '@opensrp/user-management';
import { KeycloakUser, URL_USER_EDIT, URL_USER_CREDENTIALS } from '@opensrp/user-management';
import { Dictionary } from '@onaio/utils';
import { Column } from '@opensrp/react-utils';
import type { TFunction } from '@opensrp/i18n';
import { RbacCheck, UserRole } from '@opensrp/rbac';
import { History } from 'history';
import { UserDeleteBtn } from '../../UserDeleteBtn';
import { USER_DETAILS_URL } from '../../../constants';

/**
* Get table columns for user list
Expand Down Expand Up @@ -60,7 +56,7 @@ export const getTableColumns = (
key: '1',
permissions: ['iam_user.read'],
label: (
<Button onClick={() => history.push(`${URL_USER}/${record.id}`)} type="link">
<Button onClick={() => history.push(`${USER_DETAILS_URL}/${record.id}`)} type="link">
{t('View Details')}
</Button>
),
Expand Down
5 changes: 5 additions & 0 deletions packages/fhir-keycloak-user-management/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { URL_USER } from '@opensrp/user-management';

export const practitionerResourceType = 'Practitioner';
export const careTeamResourceType = 'CareTeam';
export const organizationResourceType = 'Organization';
Expand All @@ -10,3 +12,6 @@ export const practitionerDetailsResourceType = 'PractitionerDetail';
export const keycloakCountEndpoint = 'count';
export const keycloakGroupEndpoint = 'groups';
export const keycloakMembersEndpoint = 'members';

// router urls
export const USER_DETAILS_URL = `${URL_USER}/details/:id`;

0 comments on commit b9138c0

Please sign in to comment.