@kenyaemr/esm-admin-app 5.4.4-pre.7 → 5.4.4-pre.71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -12
- package/dist/1074.js +1 -0
- package/dist/1074.js.map +1 -0
- package/dist/12.js +17 -0
- package/dist/12.js.map +1 -0
- package/dist/1201.js +1 -0
- package/dist/1201.js.map +1 -0
- package/dist/1242.js +1 -0
- package/dist/1242.js.map +1 -0
- package/dist/1311.js +1 -0
- package/dist/1311.js.map +1 -0
- package/dist/1425.js +1 -0
- package/dist/1425.js.map +1 -0
- package/dist/1462.js +1 -0
- package/dist/1462.js.map +1 -0
- package/dist/1469.js +1 -0
- package/dist/1469.js.map +1 -0
- package/dist/1506.js +13 -0
- package/dist/1506.js.map +1 -0
- package/dist/171.js +1 -0
- package/dist/171.js.map +1 -0
- package/dist/1718.js +1 -0
- package/dist/1718.js.map +1 -0
- package/dist/1722.js +1 -0
- package/dist/1722.js.map +1 -0
- package/dist/1772.js +1 -0
- package/dist/1772.js.map +1 -0
- package/dist/1889.js +1 -0
- package/dist/1889.js.map +1 -0
- package/dist/1972.js +1 -0
- package/dist/1972.js.map +1 -0
- package/dist/1990.js +1 -0
- package/dist/1990.js.map +1 -0
- package/dist/2080.js +1 -0
- package/dist/2080.js.map +1 -0
- package/dist/2096.js +1 -0
- package/dist/2096.js.map +1 -0
- package/dist/2153.js +1 -0
- package/dist/2153.js.map +1 -0
- package/dist/216.js +1 -0
- package/dist/216.js.map +1 -0
- package/dist/2270.js +1 -0
- package/dist/2270.js.map +1 -0
- package/dist/2294.js +1 -0
- package/dist/2294.js.map +1 -0
- package/dist/2345.js +1 -0
- package/dist/2345.js.map +1 -0
- package/dist/2402.js +1 -0
- package/dist/2402.js.map +1 -0
- package/dist/2500.js +1 -0
- package/dist/2500.js.map +1 -0
- package/dist/251.js +1 -0
- package/dist/251.js.map +1 -0
- package/dist/257.js +1 -0
- package/dist/257.js.map +1 -0
- package/dist/2586.js +1 -0
- package/dist/2586.js.map +1 -0
- package/dist/2625.js +1 -0
- package/dist/2625.js.map +1 -0
- package/dist/2652.js +1 -0
- package/dist/2652.js.map +1 -0
- package/dist/2685.js +1 -0
- package/dist/2685.js.map +1 -0
- package/dist/2948.js +1 -0
- package/dist/2948.js.map +1 -0
- package/dist/3089.js +1 -0
- package/dist/3089.js.map +1 -0
- package/dist/3190.js +1 -0
- package/dist/3190.js.map +1 -0
- package/dist/3224.js +1 -0
- package/dist/3224.js.map +1 -0
- package/dist/3366.js +1 -0
- package/dist/3366.js.map +1 -0
- package/dist/3548.js +1 -0
- package/dist/3548.js.map +1 -0
- package/dist/3571.js +1 -0
- package/dist/3571.js.map +1 -0
- package/dist/3691.js +1 -0
- package/dist/3691.js.map +1 -0
- package/dist/3775.js +1 -0
- package/dist/3775.js.map +1 -0
- package/dist/3816.js +1 -0
- package/dist/3816.js.map +1 -0
- package/dist/3852.js +1 -0
- package/dist/3852.js.map +1 -0
- package/dist/3906.js +1 -0
- package/dist/3906.js.map +1 -0
- package/dist/3963.js +1 -0
- package/dist/3963.js.map +1 -0
- package/dist/405.js +1 -0
- package/dist/405.js.map +1 -0
- package/dist/4296.js +1 -0
- package/dist/4296.js.map +1 -0
- package/dist/4337.js +1 -0
- package/dist/4337.js.map +1 -0
- package/dist/4735.js +1 -0
- package/dist/4735.js.map +1 -0
- package/dist/4744.js +1 -0
- package/dist/4744.js.map +1 -0
- package/dist/4813.js +2 -0
- package/dist/4813.js.map +1 -0
- package/dist/4858.js +1 -0
- package/dist/4858.js.map +1 -0
- package/dist/4970.js +1 -0
- package/dist/4970.js.map +1 -0
- package/dist/5202.js +1 -0
- package/dist/5202.js.map +1 -0
- package/dist/5294.js +1 -0
- package/dist/5294.js.map +1 -0
- package/dist/545.js +1 -0
- package/dist/545.js.map +1 -0
- package/dist/552.js +1 -0
- package/dist/552.js.map +1 -0
- package/dist/5592.js +1 -0
- package/dist/5592.js.map +1 -0
- package/dist/5669.js +1 -0
- package/dist/5669.js.map +1 -0
- package/dist/5884.js +1 -0
- package/dist/5884.js.map +1 -0
- package/dist/5940.js +1 -0
- package/dist/5940.js.map +1 -0
- package/dist/6092.js +1 -0
- package/dist/6092.js.map +1 -0
- package/dist/6155.js +1 -0
- package/dist/6155.js.map +1 -0
- package/dist/6178.js +1 -0
- package/dist/6178.js.map +1 -0
- package/dist/6399.js +1 -0
- package/dist/6399.js.map +1 -0
- package/dist/6456.js +1 -0
- package/dist/6466.js +3 -0
- package/dist/6466.js.map +1 -0
- package/dist/6492.js +1 -0
- package/dist/6492.js.map +1 -0
- package/dist/6676.js +1 -0
- package/dist/6676.js.map +1 -0
- package/dist/6800.js +1 -0
- package/dist/6800.js.map +1 -0
- package/dist/6976.js +1 -0
- package/dist/6976.js.map +1 -0
- package/dist/7005.js +1 -0
- package/dist/7005.js.map +1 -0
- package/dist/7201.js +1 -0
- package/dist/7201.js.map +1 -0
- package/dist/7210.js +1 -0
- package/dist/7210.js.map +1 -0
- package/dist/7234.js +1 -0
- package/dist/7234.js.map +1 -0
- package/dist/7261.js +1 -0
- package/dist/7261.js.map +1 -0
- package/dist/7326.js +1 -0
- package/dist/7463.js +1 -0
- package/dist/7463.js.map +1 -0
- package/dist/7528.js +1 -0
- package/dist/7528.js.map +1 -0
- package/dist/7584.js +1 -0
- package/dist/7584.js.map +1 -0
- package/dist/{127.js → 7607.js} +1 -1
- package/dist/7717.js +1 -0
- package/dist/7717.js.map +1 -0
- package/dist/7737.js +1 -0
- package/dist/7737.js.map +1 -0
- package/dist/7739.js +1 -0
- package/dist/7739.js.map +1 -0
- package/dist/7765.js +1 -0
- package/dist/7765.js.map +1 -0
- package/dist/7820.js +1 -0
- package/dist/7820.js.map +1 -0
- package/dist/7844.js +1 -0
- package/dist/7844.js.map +1 -0
- package/dist/7866.js +1 -0
- package/dist/7866.js.map +1 -0
- package/dist/7916.js +1 -0
- package/dist/7916.js.map +1 -0
- package/dist/7971.js +1 -0
- package/dist/7971.js.map +1 -0
- package/dist/8159.js +7 -0
- package/dist/8159.js.map +1 -0
- package/dist/8244.js +1 -0
- package/dist/8244.js.map +1 -0
- package/dist/8262.js +1 -0
- package/dist/8262.js.map +1 -0
- package/dist/834.js +1 -0
- package/dist/834.js.map +1 -0
- package/dist/8376.js +1 -0
- package/dist/8376.js.map +1 -0
- package/dist/845.js +1 -0
- package/dist/845.js.map +1 -0
- package/dist/8546.js +1 -0
- package/dist/8546.js.map +1 -0
- package/dist/8570.js +1 -0
- package/dist/8570.js.map +1 -0
- package/dist/87.js +1 -0
- package/dist/87.js.map +1 -0
- package/dist/8727.js +1 -0
- package/dist/8828.js +1 -0
- package/dist/8828.js.map +1 -0
- package/dist/8860.js +1 -0
- package/dist/8860.js.map +1 -0
- package/dist/9036.js +1 -0
- package/dist/9036.js.map +1 -0
- package/dist/9124.js +1 -0
- package/dist/9124.js.map +1 -0
- package/dist/9182.js +1 -0
- package/dist/921.js +1 -0
- package/dist/921.js.map +1 -0
- package/dist/9404.js +1 -0
- package/dist/9404.js.map +1 -0
- package/dist/9406.js +1 -0
- package/dist/9406.js.map +1 -0
- package/dist/9446.js +1 -0
- package/dist/9446.js.map +1 -0
- package/dist/9449.js +1 -0
- package/dist/9449.js.map +1 -0
- package/dist/9566.js +5 -0
- package/dist/9566.js.map +1 -0
- package/dist/9641.js +1 -0
- package/dist/9641.js.map +1 -0
- package/dist/9711.js +1 -0
- package/dist/9711.js.map +1 -0
- package/dist/9801.js +1 -0
- package/dist/9801.js.map +1 -0
- package/dist/9835.js +11 -0
- package/dist/9835.js.map +1 -0
- package/dist/kenyaemr-esm-admin-app.js +5 -5
- package/dist/kenyaemr-esm-admin-app.js.buildmanifest.json +2679 -156
- package/dist/kenyaemr-esm-admin-app.js.map +1 -1
- package/dist/main.js +5 -31
- package/dist/main.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +4 -6
- package/rspack.config.js +1 -1
- package/src/components/locations/forms/add-location/add-location.workspace.tsx +96 -95
- package/src/components/locations/forms/search-location/search-location.workspace.tsx +90 -85
- package/src/components/locations/tables/locations-table.component.tsx +117 -121
- package/src/components/users/manage-users/manage-user-role-scope/user-role-scope-workspace/user-role-scope.workspace.tsx +13 -13
- package/src/components/users/manage-users/user-list/user-list.component.tsx +22 -9
- package/src/components/users/manage-users/user-management.workspace.tsx +538 -531
- package/src/index.ts +51 -28
- package/src/root.component.tsx +11 -13
- package/src/routes.json +40 -40
- package/tsconfig.json +1 -1
- package/dist/267.js +0 -1
- package/dist/267.js.map +0 -1
- package/dist/281.js +0 -15
- package/dist/281.js.map +0 -1
- package/dist/329.js +0 -1
- package/dist/329.js.map +0 -1
- package/dist/40.js +0 -1
- package/dist/466.js +0 -1
- package/dist/466.js.map +0 -1
- package/dist/472.js +0 -1
- package/dist/472.js.map +0 -1
- package/dist/478.js +0 -1
- package/dist/478.js.map +0 -1
- package/dist/585.js +0 -1
- package/dist/585.js.map +0 -1
- package/dist/630.js +0 -1
- package/dist/630.js.map +0 -1
- package/dist/675.js +0 -1
- package/dist/675.js.map +0 -1
- package/dist/689.js +0 -1
- package/dist/689.js.map +0 -1
- package/dist/706.js +0 -27
- package/dist/706.js.map +0 -1
- package/dist/729.js +0 -17
- package/dist/729.js.map +0 -1
- package/dist/774.js +0 -1
- package/dist/774.js.map +0 -1
- package/dist/847.js +0 -1
- package/dist/847.js.map +0 -1
- package/dist/85.js +0 -1
- package/dist/85.js.map +0 -1
- package/dist/882.js +0 -1
- package/dist/91.js +0 -1
- package/dist/91.js.map +0 -1
- package/dist/916.js +0 -1
- package/dist/998.js +0 -1
- package/dist/998.js.map +0 -1
- package/jest.config.js +0 -8
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
useConfig,
|
|
10
10
|
showModal,
|
|
11
11
|
parseDate,
|
|
12
|
+
Workspace2,
|
|
13
|
+
Workspace2DefinitionProps,
|
|
12
14
|
} from '@openmrs/esm-framework';
|
|
13
15
|
import { Controller, FormProvider, useForm } from 'react-hook-form';
|
|
14
16
|
import styles from './user-management.workspace.scss';
|
|
@@ -46,9 +48,9 @@ import {
|
|
|
46
48
|
import UserManagementFormSchema from '../userManagementFormSchema';
|
|
47
49
|
import { ChevronLeft, Query, ChevronRight } from '@carbon/react/icons';
|
|
48
50
|
import { useSystemUserRoleConfigSetting } from '../../hook/useSystemRoleSetting';
|
|
49
|
-
import {
|
|
51
|
+
import { Provider, User } from '../../../types';
|
|
50
52
|
import { searchHealthCareWork, HealthWorkerAdapter, NormalizedPractitioner } from '../../hook/healthWorkerAdapter';
|
|
51
|
-
import { ROLE_CATEGORIES, SECTIONS
|
|
53
|
+
import { ROLE_CATEGORIES, SECTIONS } from '../../../constants';
|
|
52
54
|
import { ConfigObject } from '../../../config-schema';
|
|
53
55
|
import { mutate } from 'swr';
|
|
54
56
|
import { createProviderAttribute, updateProviderAttributes } from '../../modal/hwr-sync.resource';
|
|
@@ -58,13 +60,9 @@ type ManageUserWorkspaceProps = DefaultWorkspaceProps & {
|
|
|
58
60
|
initialUserValue?: User;
|
|
59
61
|
};
|
|
60
62
|
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
63
|
+
const ManageUserWorkspace: React.FC<Workspace2DefinitionProps<ManageUserWorkspaceProps, {}, {}>> = ({
|
|
64
64
|
closeWorkspace,
|
|
65
|
-
|
|
66
|
-
closeWorkspaceWithSavedChanges,
|
|
67
|
-
initialUserValue = {} as User,
|
|
65
|
+
workspaceProps: { initialUserValue = {} as User },
|
|
68
66
|
}) => {
|
|
69
67
|
const { t } = useTranslation();
|
|
70
68
|
const isTablet = useLayoutType() === 'tablet';
|
|
@@ -76,6 +74,7 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
76
74
|
const usernames =
|
|
77
75
|
users?.map((user) => user.username).filter((username) => username !== initialUserValue?.username) || [];
|
|
78
76
|
const isInitialValuesEmpty = Object.keys(initialUserValue).length === 0;
|
|
77
|
+
const [hasUnsavedChanges, setHasUnsavedChanges] = useState(false);
|
|
79
78
|
|
|
80
79
|
const { userManagementFormSchema } = UserManagementFormSchema(usernames);
|
|
81
80
|
|
|
@@ -248,9 +247,9 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
248
247
|
|
|
249
248
|
useEffect(() => {
|
|
250
249
|
if (isDirty) {
|
|
251
|
-
|
|
250
|
+
setHasUnsavedChanges(true);
|
|
252
251
|
}
|
|
253
|
-
}, [isDirty,
|
|
252
|
+
}, [isDirty, setHasUnsavedChanges]);
|
|
254
253
|
|
|
255
254
|
const setPractitionerValuesFromNormalized = (normalized: NormalizedPractitioner) => {
|
|
256
255
|
setValue('givenName', normalized.firstName || '');
|
|
@@ -448,7 +447,7 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
448
447
|
}
|
|
449
448
|
handleMutation(`${restBaseUrl}/user`);
|
|
450
449
|
mutate((key) => typeof key === 'string' && key.startsWith(`${restBaseUrl}/provider`));
|
|
451
|
-
|
|
450
|
+
closeWorkspace({ discardUnsavedChanges: true });
|
|
452
451
|
} catch (error) {
|
|
453
452
|
showSnackbarMessage(
|
|
454
453
|
t('userSaveFailed', 'Failed to save user'),
|
|
@@ -460,10 +459,12 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
460
459
|
|
|
461
460
|
const handleError = (error, response) => {
|
|
462
461
|
showSnackbar({
|
|
463
|
-
title: t('userSaveFailed', 'Fail to save {{error}}', response),
|
|
464
|
-
subtitle:
|
|
465
|
-
|
|
466
|
-
|
|
462
|
+
title: String(t('userSaveFailed', 'Fail to save {{error}}', response)),
|
|
463
|
+
subtitle: String(
|
|
464
|
+
t('userCreationFailedSubtitle', 'An error occurred while creating user {{errorMessage}}', {
|
|
465
|
+
errorMessage: JSON.stringify(error, null, 2),
|
|
466
|
+
}),
|
|
467
|
+
),
|
|
467
468
|
kind: 'error',
|
|
468
469
|
isLowContrast: true,
|
|
469
470
|
});
|
|
@@ -519,41 +520,41 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
519
520
|
};
|
|
520
521
|
|
|
521
522
|
return (
|
|
522
|
-
<
|
|
523
|
-
<div>
|
|
524
|
-
<div
|
|
525
|
-
<
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
<
|
|
542
|
-
<
|
|
543
|
-
<
|
|
544
|
-
<
|
|
545
|
-
{
|
|
546
|
-
|
|
547
|
-
<
|
|
548
|
-
{
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
523
|
+
<Workspace2 title={t('manageUserWorkspace', 'Manage User Workspace')} hasUnsavedChanges={hasUnsavedChanges}>
|
|
524
|
+
<div className={styles.leftContainer}>
|
|
525
|
+
<div>
|
|
526
|
+
<div className={styles.leftLayout}>
|
|
527
|
+
<ProgressIndicator
|
|
528
|
+
currentIndex={currentIndex}
|
|
529
|
+
spaceEqually={true}
|
|
530
|
+
vertical={true}
|
|
531
|
+
className={styles.progressIndicator}
|
|
532
|
+
onChange={(newIndex) => {
|
|
533
|
+
if (!searchHWR.isHWRLoading) {
|
|
534
|
+
toggleSection(steps[newIndex].id);
|
|
535
|
+
setCurrentIndex(newIndex);
|
|
536
|
+
}
|
|
537
|
+
}}>
|
|
538
|
+
{steps.map((step, index) => (
|
|
539
|
+
<ProgressStep key={step.id} label={step.label} className={styles.ProgresStep} />
|
|
540
|
+
))}
|
|
541
|
+
</ProgressIndicator>
|
|
542
|
+
<div className={styles.sections}>
|
|
543
|
+
<FormProvider {...userFormMethods}>
|
|
544
|
+
<form onSubmit={userFormMethods.handleSubmit(onSubmit, handleError)} className={styles.form}>
|
|
545
|
+
<div className={styles.formContainer}>
|
|
546
|
+
<Stack className={styles.formStackControl} gap={7}>
|
|
547
|
+
{hasDemographicInfo && (
|
|
548
|
+
<ResponsiveWrapper>
|
|
549
|
+
<span className={styles.formHeaderSection}>
|
|
550
|
+
{t('healthWorkVerify', 'Health worker registry verification')}
|
|
551
|
+
</span>
|
|
552
|
+
{searchHWR.isHWRLoading ? (
|
|
553
|
+
<InlineLoading
|
|
554
|
+
className={styles.formLoading}
|
|
555
|
+
description={t('pullDetailsfromHWR', 'Pulling data from Health worker registry...')}
|
|
556
|
+
/>
|
|
557
|
+
) : (
|
|
557
558
|
<>
|
|
558
559
|
<Column>
|
|
559
560
|
<ComboBox
|
|
@@ -566,6 +567,7 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
566
567
|
initialSelectedItem={defaultIdentifierType}
|
|
567
568
|
items={identifierTypes}
|
|
568
569
|
itemToString={(item) => (item ? item.name : '')}
|
|
570
|
+
disabled={!isInitialValuesEmpty}
|
|
569
571
|
/>
|
|
570
572
|
</Column>
|
|
571
573
|
<Column>
|
|
@@ -579,6 +581,7 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
579
581
|
initialSelectedItem={defaultRegulator}
|
|
580
582
|
items={regulatorOptions}
|
|
581
583
|
itemToString={(item) => (item ? item.name : '')}
|
|
584
|
+
disabled={!isInitialValuesEmpty}
|
|
582
585
|
/>
|
|
583
586
|
</Column>
|
|
584
587
|
<Column>
|
|
@@ -592,6 +595,7 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
592
595
|
defaultValue={searchHWR.identifier}
|
|
593
596
|
placeholder={t('enterIdentifierNumber', 'Enter identifier number')}
|
|
594
597
|
id="formSearchHealthWorkers"
|
|
598
|
+
disabled={!isInitialValuesEmpty}
|
|
595
599
|
onChange={(value) => {
|
|
596
600
|
setSearchHWR({ ...searchHWR, identifier: value.target.value });
|
|
597
601
|
}}
|
|
@@ -604,7 +608,8 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
604
608
|
!searchHWR.identifier ||
|
|
605
609
|
searchHWR.isHWRLoading ||
|
|
606
610
|
!searchHWR.identifierType ||
|
|
607
|
-
!searchHWR.regulator
|
|
611
|
+
!searchHWR.regulator ||
|
|
612
|
+
!isInitialValuesEmpty
|
|
608
613
|
}
|
|
609
614
|
iconDescription={t('search', 'Search')}
|
|
610
615
|
hasIconOnly
|
|
@@ -613,527 +618,529 @@ const ManageUserWorkspace: React.FC<ManageUserWorkspaceProps> = ({
|
|
|
613
618
|
/>
|
|
614
619
|
</Row>
|
|
615
620
|
</Column>
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
<
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
)}
|
|
633
|
-
/>
|
|
634
|
-
</ResponsiveWrapper>
|
|
635
|
-
<ResponsiveWrapper>
|
|
636
|
-
<Controller
|
|
637
|
-
name="middleName"
|
|
638
|
-
control={userFormMethods.control}
|
|
639
|
-
render={({ field }) => (
|
|
640
|
-
<TextInput
|
|
641
|
-
{...field}
|
|
642
|
-
id="middleName"
|
|
643
|
-
labelText={t('middleName', 'Middle Name')}
|
|
644
|
-
placeholder={t('middleName', 'Middle Name')}
|
|
645
|
-
/>
|
|
646
|
-
)}
|
|
647
|
-
/>
|
|
648
|
-
</ResponsiveWrapper>
|
|
649
|
-
<ResponsiveWrapper>
|
|
650
|
-
<Controller
|
|
651
|
-
name="familyName"
|
|
652
|
-
control={userFormMethods.control}
|
|
653
|
-
render={({ field }) => (
|
|
654
|
-
<TextInput
|
|
655
|
-
{...field}
|
|
656
|
-
id="familyName"
|
|
657
|
-
labelText={t('familyName', 'Family Name')}
|
|
658
|
-
placeholder={t('familyName', 'Family Name')}
|
|
659
|
-
invalid={!!errors.familyName}
|
|
660
|
-
invalidText={errors.familyName?.message}
|
|
661
|
-
/>
|
|
662
|
-
)}
|
|
663
|
-
/>
|
|
664
|
-
</ResponsiveWrapper>
|
|
665
|
-
<ResponsiveWrapper>
|
|
666
|
-
<Controller
|
|
667
|
-
name="phoneNumber"
|
|
668
|
-
control={userFormMethods.control}
|
|
669
|
-
render={({ field }) => (
|
|
670
|
-
<TextInput
|
|
671
|
-
{...field}
|
|
672
|
-
id="phoneNumber"
|
|
673
|
-
type="text"
|
|
674
|
-
disabled={isInitialValuesEmpty}
|
|
675
|
-
labelText={t('phoneNumber', 'Phone Number')}
|
|
676
|
-
placeholder={t('phoneNumber', 'Enter Phone Number')}
|
|
677
|
-
invalid={!!errors.phoneNumber}
|
|
678
|
-
invalidText={errors.phoneNumber?.message}
|
|
679
|
-
/>
|
|
680
|
-
)}
|
|
681
|
-
/>
|
|
682
|
-
</ResponsiveWrapper>
|
|
683
|
-
<ResponsiveWrapper>
|
|
684
|
-
<Controller
|
|
685
|
-
name="email"
|
|
686
|
-
control={userFormMethods.control}
|
|
687
|
-
render={({ field }) => (
|
|
688
|
-
<TextInput
|
|
689
|
-
{...field}
|
|
690
|
-
id="email"
|
|
691
|
-
type="email"
|
|
692
|
-
disabled={isInitialValuesEmpty}
|
|
693
|
-
labelText={t('email', 'Email')}
|
|
694
|
-
placeholder={t('email', 'Enter Email')}
|
|
695
|
-
invalid={!!errors.email}
|
|
696
|
-
invalidText={errors.email?.message}
|
|
697
|
-
className={styles.checkboxLabelSingleLine}
|
|
698
|
-
/>
|
|
699
|
-
)}
|
|
700
|
-
/>
|
|
701
|
-
</ResponsiveWrapper>
|
|
702
|
-
<ResponsiveWrapper>
|
|
703
|
-
<Controller
|
|
704
|
-
name="gender"
|
|
705
|
-
control={userFormMethods.control}
|
|
706
|
-
render={({ field }) => (
|
|
707
|
-
<RadioButtonGroup
|
|
708
|
-
{...field}
|
|
709
|
-
legendText={t('sex', 'Sex')}
|
|
710
|
-
orientation="vertical"
|
|
711
|
-
invalid={!!errors.gender}
|
|
712
|
-
invalidText={errors.gender?.message}>
|
|
713
|
-
<RadioButton
|
|
714
|
-
value="M"
|
|
715
|
-
id="M"
|
|
716
|
-
labelText={t('male', 'Male')}
|
|
717
|
-
checked={field.value === 'M'}
|
|
621
|
+
<span className={styles.formHeaderSection}>
|
|
622
|
+
{t('demographicInfo', 'Demographic info')}
|
|
623
|
+
</span>
|
|
624
|
+
<ResponsiveWrapper>
|
|
625
|
+
<Controller
|
|
626
|
+
name="givenName"
|
|
627
|
+
control={userFormMethods.control}
|
|
628
|
+
render={({ field }) => (
|
|
629
|
+
<TextInput
|
|
630
|
+
{...field}
|
|
631
|
+
id="givenName"
|
|
632
|
+
type="text"
|
|
633
|
+
labelText={t('givenName', 'Given Name')}
|
|
634
|
+
placeholder={t('userGivenName', 'Enter Given Name')}
|
|
635
|
+
invalid={!!errors.givenName}
|
|
636
|
+
invalidText={errors.givenName?.message}
|
|
718
637
|
/>
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
638
|
+
)}
|
|
639
|
+
/>
|
|
640
|
+
</ResponsiveWrapper>
|
|
641
|
+
<ResponsiveWrapper>
|
|
642
|
+
<Controller
|
|
643
|
+
name="middleName"
|
|
644
|
+
control={userFormMethods.control}
|
|
645
|
+
render={({ field }) => (
|
|
646
|
+
<TextInput
|
|
647
|
+
{...field}
|
|
648
|
+
id="middleName"
|
|
649
|
+
labelText={t('middleName', 'Middle Name')}
|
|
650
|
+
placeholder={t('middleName', 'Middle Name')}
|
|
724
651
|
/>
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
</ResponsiveWrapper>
|
|
811
|
-
<ResponsiveWrapper>
|
|
812
|
-
<Controller
|
|
813
|
-
name="registrationNumber"
|
|
814
|
-
control={userFormMethods.control}
|
|
815
|
-
render={({ field }) => (
|
|
816
|
-
<TextInput
|
|
817
|
-
{...field}
|
|
818
|
-
id="registrationNumber"
|
|
819
|
-
type="text"
|
|
820
|
-
disabled={isInitialValuesEmpty}
|
|
821
|
-
labelText={t('registrationNumber', 'Registration Number')}
|
|
822
|
-
placeholder={t('registrationNumber', 'Registration Number')}
|
|
823
|
-
className={styles.checkboxLabelSingleLine}
|
|
824
|
-
/>
|
|
825
|
-
)}
|
|
826
|
-
/>
|
|
827
|
-
</ResponsiveWrapper>
|
|
828
|
-
<ResponsiveWrapper>
|
|
829
|
-
<Controller
|
|
830
|
-
name="qualification"
|
|
831
|
-
control={userFormMethods.control}
|
|
832
|
-
render={({ field }) => (
|
|
833
|
-
<TextInput
|
|
834
|
-
{...field}
|
|
835
|
-
id="qualification"
|
|
836
|
-
type="qualification"
|
|
837
|
-
disabled
|
|
838
|
-
labelText={t('qualification', 'Qualification')}
|
|
839
|
-
placeholder={t('qualification', 'Qualification')}
|
|
840
|
-
invalid={!!errors.qualification}
|
|
841
|
-
invalidText={errors.qualification?.message}
|
|
842
|
-
className={styles.checkboxLabelSingleLine}
|
|
843
|
-
/>
|
|
844
|
-
)}
|
|
845
|
-
/>
|
|
652
|
+
)}
|
|
653
|
+
/>
|
|
654
|
+
</ResponsiveWrapper>
|
|
655
|
+
<ResponsiveWrapper>
|
|
656
|
+
<Controller
|
|
657
|
+
name="familyName"
|
|
658
|
+
control={userFormMethods.control}
|
|
659
|
+
render={({ field }) => (
|
|
660
|
+
<TextInput
|
|
661
|
+
{...field}
|
|
662
|
+
id="familyName"
|
|
663
|
+
labelText={t('familyName', 'Family Name')}
|
|
664
|
+
placeholder={t('familyName', 'Family Name')}
|
|
665
|
+
invalid={!!errors.familyName}
|
|
666
|
+
invalidText={errors.familyName?.message}
|
|
667
|
+
/>
|
|
668
|
+
)}
|
|
669
|
+
/>
|
|
670
|
+
</ResponsiveWrapper>
|
|
671
|
+
<ResponsiveWrapper>
|
|
672
|
+
<Controller
|
|
673
|
+
name="phoneNumber"
|
|
674
|
+
control={userFormMethods.control}
|
|
675
|
+
render={({ field }) => (
|
|
676
|
+
<TextInput
|
|
677
|
+
{...field}
|
|
678
|
+
id="phoneNumber"
|
|
679
|
+
type="text"
|
|
680
|
+
disabled={isInitialValuesEmpty}
|
|
681
|
+
labelText={t('phoneNumber', 'Phone Number')}
|
|
682
|
+
placeholder={t('phoneNumber', 'Enter Phone Number')}
|
|
683
|
+
invalid={!!errors.phoneNumber}
|
|
684
|
+
invalidText={errors.phoneNumber?.message}
|
|
685
|
+
/>
|
|
686
|
+
)}
|
|
687
|
+
/>
|
|
688
|
+
</ResponsiveWrapper>
|
|
689
|
+
<ResponsiveWrapper>
|
|
690
|
+
<Controller
|
|
691
|
+
name="email"
|
|
692
|
+
control={userFormMethods.control}
|
|
693
|
+
render={({ field }) => (
|
|
694
|
+
<TextInput
|
|
695
|
+
{...field}
|
|
696
|
+
id="email"
|
|
697
|
+
type="email"
|
|
698
|
+
disabled={isInitialValuesEmpty}
|
|
699
|
+
labelText={t('email', 'Email')}
|
|
700
|
+
placeholder={t('email', 'Enter Email')}
|
|
701
|
+
invalid={!!errors.email}
|
|
702
|
+
invalidText={errors.email?.message}
|
|
703
|
+
className={styles.checkboxLabelSingleLine}
|
|
704
|
+
/>
|
|
705
|
+
)}
|
|
706
|
+
/>
|
|
707
|
+
</ResponsiveWrapper>
|
|
708
|
+
<ResponsiveWrapper>
|
|
709
|
+
<Controller
|
|
710
|
+
name="gender"
|
|
711
|
+
control={userFormMethods.control}
|
|
712
|
+
render={({ field }) => (
|
|
713
|
+
<RadioButtonGroup
|
|
714
|
+
{...field}
|
|
715
|
+
legendText={t('sex', 'Sex')}
|
|
716
|
+
orientation="vertical"
|
|
717
|
+
invalid={!!errors.gender}
|
|
718
|
+
invalidText={errors.gender?.message}>
|
|
719
|
+
<RadioButton
|
|
720
|
+
value="M"
|
|
721
|
+
id="M"
|
|
722
|
+
labelText={t('male', 'Male')}
|
|
723
|
+
checked={field.value === 'M'}
|
|
724
|
+
/>
|
|
725
|
+
<RadioButton
|
|
726
|
+
value="F"
|
|
727
|
+
id="F"
|
|
728
|
+
labelText={t('female', 'Female')}
|
|
729
|
+
checked={field.value === 'F'}
|
|
730
|
+
/>
|
|
731
|
+
</RadioButtonGroup>
|
|
732
|
+
)}
|
|
733
|
+
/>
|
|
734
|
+
</ResponsiveWrapper>
|
|
735
|
+
</>
|
|
736
|
+
)}
|
|
846
737
|
</ResponsiveWrapper>
|
|
847
|
-
|
|
738
|
+
)}
|
|
739
|
+
{hasProviderAccount && (
|
|
848
740
|
<ResponsiveWrapper>
|
|
849
|
-
<
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
741
|
+
<span className={styles.formHeaderSection}>{t('providerDetails', 'Provider details')}</span>
|
|
742
|
+
<ResponsiveWrapper>
|
|
743
|
+
<Controller
|
|
744
|
+
name="providerUniqueIdentifier"
|
|
745
|
+
control={userFormMethods.control}
|
|
746
|
+
render={({ field }) => (
|
|
747
|
+
<TextInput
|
|
748
|
+
{...field}
|
|
749
|
+
id="providerUniqueIdentifier"
|
|
750
|
+
type="text"
|
|
751
|
+
labelText={t('providerUniqueIdentifier', 'Provider Unique Identifier')}
|
|
752
|
+
placeholder={t(
|
|
753
|
+
'providerUniqueIdentifierPlaceholder',
|
|
754
|
+
'Enter Provider Unqiue Identifier',
|
|
755
|
+
)}
|
|
756
|
+
invalid={!!errors.providerUniqueIdentifier}
|
|
757
|
+
invalidText={errors.providerUniqueIdentifier?.message}
|
|
758
|
+
/>
|
|
759
|
+
)}
|
|
760
|
+
/>
|
|
761
|
+
</ResponsiveWrapper>
|
|
762
|
+
<ResponsiveWrapper>
|
|
763
|
+
<Controller
|
|
764
|
+
name="nationalId"
|
|
765
|
+
control={userFormMethods.control}
|
|
766
|
+
render={({ field }) => (
|
|
767
|
+
<TextInput
|
|
768
|
+
{...field}
|
|
769
|
+
id="nationalId"
|
|
770
|
+
disabled={isInitialValuesEmpty}
|
|
771
|
+
type="text"
|
|
772
|
+
labelText={t('nationalID', 'National id')}
|
|
773
|
+
placeholder={t('nationalID', 'National id')}
|
|
774
|
+
invalid={!!errors.nationalId}
|
|
775
|
+
invalidText={errors.nationalId?.message}
|
|
776
|
+
className={styles.checkboxLabelSingleLine}
|
|
777
|
+
/>
|
|
778
|
+
)}
|
|
779
|
+
/>
|
|
780
|
+
</ResponsiveWrapper>
|
|
781
|
+
<ResponsiveWrapper>
|
|
782
|
+
<Controller
|
|
783
|
+
name="passportNumber"
|
|
784
|
+
control={userFormMethods.control}
|
|
785
|
+
render={({ field }) => (
|
|
786
|
+
<TextInput
|
|
787
|
+
{...field}
|
|
788
|
+
id="passportNumber"
|
|
789
|
+
disabled={isInitialValuesEmpty}
|
|
790
|
+
type="text"
|
|
791
|
+
labelText={t('passportNumber', 'Passport number')}
|
|
792
|
+
placeholder={t('passportNumber', 'Passport number')}
|
|
793
|
+
invalid={!!errors.nationalId}
|
|
794
|
+
invalidText={errors.nationalId?.message}
|
|
795
|
+
className={styles.checkboxLabelSingleLine}
|
|
796
|
+
/>
|
|
797
|
+
)}
|
|
798
|
+
/>
|
|
799
|
+
</ResponsiveWrapper>
|
|
800
|
+
<ResponsiveWrapper>
|
|
801
|
+
<Controller
|
|
802
|
+
name="providerLicense"
|
|
803
|
+
control={userFormMethods.control}
|
|
804
|
+
render={({ field }) => (
|
|
805
|
+
<TextInput
|
|
806
|
+
{...field}
|
|
807
|
+
id="providerLicense"
|
|
808
|
+
type="text"
|
|
809
|
+
disabled={isInitialValuesEmpty}
|
|
810
|
+
labelText={t('providerLicense', 'License Number')}
|
|
811
|
+
placeholder={t('providerLicense', 'License Number')}
|
|
812
|
+
className={styles.checkboxLabelSingleLine}
|
|
813
|
+
/>
|
|
814
|
+
)}
|
|
815
|
+
/>
|
|
816
|
+
</ResponsiveWrapper>
|
|
817
|
+
<ResponsiveWrapper>
|
|
818
|
+
<Controller
|
|
819
|
+
name="registrationNumber"
|
|
820
|
+
control={userFormMethods.control}
|
|
821
|
+
render={({ field }) => (
|
|
822
|
+
<TextInput
|
|
823
|
+
{...field}
|
|
824
|
+
id="registrationNumber"
|
|
825
|
+
type="text"
|
|
826
|
+
disabled={isInitialValuesEmpty}
|
|
827
|
+
labelText={t('registrationNumber', 'Registration Number')}
|
|
828
|
+
placeholder={t('registrationNumber', 'Registration Number')}
|
|
829
|
+
className={styles.checkboxLabelSingleLine}
|
|
830
|
+
/>
|
|
831
|
+
)}
|
|
832
|
+
/>
|
|
833
|
+
</ResponsiveWrapper>
|
|
834
|
+
<ResponsiveWrapper>
|
|
835
|
+
<Controller
|
|
836
|
+
name="qualification"
|
|
837
|
+
control={userFormMethods.control}
|
|
838
|
+
render={({ field }) => (
|
|
839
|
+
<TextInput
|
|
840
|
+
{...field}
|
|
841
|
+
id="qualification"
|
|
842
|
+
type="qualification"
|
|
868
843
|
disabled
|
|
869
|
-
|
|
870
|
-
|
|
844
|
+
labelText={t('qualification', 'Qualification')}
|
|
845
|
+
placeholder={t('qualification', 'Qualification')}
|
|
846
|
+
invalid={!!errors.qualification}
|
|
847
|
+
invalidText={errors.qualification?.message}
|
|
848
|
+
className={styles.checkboxLabelSingleLine}
|
|
871
849
|
/>
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
850
|
+
)}
|
|
851
|
+
/>
|
|
852
|
+
</ResponsiveWrapper>
|
|
853
|
+
|
|
854
|
+
<ResponsiveWrapper>
|
|
855
|
+
<Controller
|
|
856
|
+
name="licenseExpiryDate"
|
|
857
|
+
control={userFormMethods.control}
|
|
858
|
+
render={({ field }) => (
|
|
859
|
+
<DatePicker
|
|
860
|
+
datePickerType="single"
|
|
861
|
+
className={styles.formDatePicker}
|
|
862
|
+
onChange={(event) => {
|
|
863
|
+
if (event.length) {
|
|
864
|
+
field.onChange(event[0]);
|
|
865
|
+
}
|
|
866
|
+
}}
|
|
867
|
+
value={field.value ? new Date(field.value) : ''}>
|
|
868
|
+
<DatePickerInput
|
|
869
|
+
className={styles.formDatePicker}
|
|
870
|
+
placeholder="mm/dd/yyyy"
|
|
871
|
+
labelText={t('licenseExpiryDate', 'License Expiry Date')}
|
|
872
|
+
id="formLicenseDatePicker"
|
|
873
|
+
size="md"
|
|
874
|
+
disabled
|
|
875
|
+
invalid={!!errors.licenseExpiryDate}
|
|
876
|
+
invalidText={errors.licenseExpiryDate?.message}
|
|
894
877
|
/>
|
|
895
|
-
|
|
896
|
-
|
|
878
|
+
</DatePicker>
|
|
879
|
+
)}
|
|
880
|
+
/>
|
|
881
|
+
</ResponsiveWrapper>
|
|
882
|
+
{loadingProvider || providerError ? (
|
|
883
|
+
<InlineLoading status="active" iconDescription="Loading" description="Loading data..." />
|
|
884
|
+
) : provider.length > 0 ? (
|
|
885
|
+
<>
|
|
886
|
+
<ResponsiveWrapper>
|
|
887
|
+
<Controller
|
|
888
|
+
name="systemId"
|
|
889
|
+
control={userFormMethods.control}
|
|
890
|
+
render={({ field }) => (
|
|
891
|
+
<TextInput
|
|
892
|
+
{...field}
|
|
893
|
+
id="systemeId"
|
|
894
|
+
type="text"
|
|
895
|
+
labelText={t('providerId', 'Provider Id')}
|
|
896
|
+
placeholder={t('providerId', 'Provider Id')}
|
|
897
|
+
invalid={!!errors.systemId}
|
|
898
|
+
invalidText={errors.systemId?.message}
|
|
899
|
+
className={styles.checkboxLabelSingleLine}
|
|
900
|
+
/>
|
|
901
|
+
)}
|
|
902
|
+
/>
|
|
903
|
+
<Controller
|
|
904
|
+
name="isEditProvider"
|
|
905
|
+
control={userFormMethods.control}
|
|
906
|
+
render={({ field }) => (
|
|
907
|
+
<CheckboxGroup
|
|
908
|
+
legendText={t('editProvider', 'Edit Provider Details')}
|
|
909
|
+
className={styles.multilineCheckboxLabel}>
|
|
910
|
+
<Checkbox
|
|
911
|
+
className={styles.checkboxLabelSingleLine}
|
|
912
|
+
id="isEditProvider"
|
|
913
|
+
labelText={t('EditProviderDetails', 'Edit provider details?')}
|
|
914
|
+
checked={field.value || false}
|
|
915
|
+
onChange={(e) => field.onChange(e.target.checked)}
|
|
916
|
+
/>
|
|
917
|
+
</CheckboxGroup>
|
|
918
|
+
)}
|
|
919
|
+
/>
|
|
920
|
+
</ResponsiveWrapper>
|
|
921
|
+
</>
|
|
922
|
+
) : (
|
|
923
|
+
<>
|
|
897
924
|
<Controller
|
|
898
|
-
name="
|
|
925
|
+
name="providerIdentifiers"
|
|
899
926
|
control={userFormMethods.control}
|
|
900
927
|
render={({ field }) => (
|
|
901
928
|
<CheckboxGroup
|
|
902
|
-
legendText={t('
|
|
929
|
+
legendText={t('providerIdentifiers', 'Provider Details')}
|
|
903
930
|
className={styles.multilineCheckboxLabel}>
|
|
904
931
|
<Checkbox
|
|
905
932
|
className={styles.checkboxLabelSingleLine}
|
|
906
|
-
id="
|
|
907
|
-
labelText={t('
|
|
933
|
+
id="providerIdentifiersa"
|
|
934
|
+
labelText={t('providerIdentifiers', 'Create a Provider account for this user')}
|
|
908
935
|
checked={field.value || false}
|
|
909
936
|
onChange={(e) => field.onChange(e.target.checked)}
|
|
910
937
|
/>
|
|
911
938
|
</CheckboxGroup>
|
|
912
939
|
)}
|
|
913
940
|
/>
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
941
|
+
</>
|
|
942
|
+
)}
|
|
943
|
+
</ResponsiveWrapper>
|
|
944
|
+
)}
|
|
945
|
+
{hasLoginInfo && (
|
|
946
|
+
<ResponsiveWrapper>
|
|
947
|
+
<span className={styles.formHeaderSection}>{t('loginInfo', 'Login Info')}</span>
|
|
948
|
+
<ResponsiveWrapper>
|
|
949
|
+
<Controller
|
|
950
|
+
name="username"
|
|
951
|
+
control={userFormMethods.control}
|
|
952
|
+
render={({ field }) => (
|
|
953
|
+
<TextInput
|
|
954
|
+
{...field}
|
|
955
|
+
id="username"
|
|
956
|
+
labelText={t('username', 'Username')}
|
|
957
|
+
invalid={!!errors.username}
|
|
958
|
+
invalidText={errors.username?.message}
|
|
959
|
+
/>
|
|
960
|
+
)}
|
|
961
|
+
/>
|
|
962
|
+
</ResponsiveWrapper>
|
|
963
|
+
|
|
964
|
+
<ResponsiveWrapper>
|
|
965
|
+
<Controller
|
|
966
|
+
name="password"
|
|
967
|
+
control={userFormMethods.control}
|
|
968
|
+
rules={
|
|
969
|
+
isInitialValuesEmpty
|
|
970
|
+
? {
|
|
971
|
+
required: 'Password is required',
|
|
972
|
+
minLength: { value: 8, message: 'Password must be at least 8 characters long' },
|
|
973
|
+
pattern: {
|
|
974
|
+
value: /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$/,
|
|
975
|
+
message: 'Password must include uppercase, lowercase, and a number',
|
|
976
|
+
},
|
|
977
|
+
}
|
|
978
|
+
: {}
|
|
979
|
+
}
|
|
980
|
+
render={({ field }) => (
|
|
981
|
+
<PasswordInput
|
|
982
|
+
{...field}
|
|
983
|
+
id="password"
|
|
984
|
+
labelText="Password"
|
|
985
|
+
invalid={!!errors.password}
|
|
986
|
+
invalidText={errors.password?.message}
|
|
987
|
+
/>
|
|
988
|
+
)}
|
|
989
|
+
/>
|
|
990
|
+
</ResponsiveWrapper>
|
|
991
|
+
<ResponsiveWrapper>
|
|
992
|
+
<Controller
|
|
993
|
+
name="confirmPassword"
|
|
994
|
+
control={userFormMethods.control}
|
|
995
|
+
rules={
|
|
996
|
+
isInitialValuesEmpty
|
|
997
|
+
? {
|
|
998
|
+
required: 'Please confirm your password',
|
|
999
|
+
validate: (value) =>
|
|
1000
|
+
value === userFormMethods.watch('password') || 'Passwords do not match',
|
|
1001
|
+
}
|
|
1002
|
+
: {}
|
|
1003
|
+
}
|
|
1004
|
+
render={({ field }) => (
|
|
1005
|
+
<PasswordInput
|
|
1006
|
+
{...field}
|
|
1007
|
+
id="confirmPassword"
|
|
1008
|
+
labelText="Confirm Password"
|
|
1009
|
+
invalid={!!errors.confirmPassword}
|
|
1010
|
+
invalidText={errors.confirmPassword?.message}
|
|
1011
|
+
/>
|
|
1012
|
+
)}
|
|
1013
|
+
/>
|
|
1014
|
+
</ResponsiveWrapper>
|
|
1015
|
+
<ResponsiveWrapper>
|
|
918
1016
|
<Controller
|
|
919
|
-
name="
|
|
1017
|
+
name="forcePasswordChange"
|
|
920
1018
|
control={userFormMethods.control}
|
|
921
1019
|
render={({ field }) => (
|
|
922
1020
|
<CheckboxGroup
|
|
923
|
-
legendText={t('
|
|
924
|
-
className={styles.
|
|
1021
|
+
legendText={t('forcePasswordChange', 'Force Password Change')}
|
|
1022
|
+
className={styles.checkboxGroupGrid}>
|
|
925
1023
|
<Checkbox
|
|
926
|
-
className={styles.
|
|
927
|
-
id="
|
|
928
|
-
labelText={t(
|
|
929
|
-
|
|
1024
|
+
className={styles.multilineCheckboxLabel}
|
|
1025
|
+
id="forcePasswordChange"
|
|
1026
|
+
labelText={t(
|
|
1027
|
+
'forcePasswordChangeHelper',
|
|
1028
|
+
'Optionally require this user to change their password on next login',
|
|
1029
|
+
)}
|
|
1030
|
+
checked={!!field.value || false}
|
|
930
1031
|
onChange={(e) => field.onChange(e.target.checked)}
|
|
931
1032
|
/>
|
|
932
1033
|
</CheckboxGroup>
|
|
933
1034
|
)}
|
|
934
1035
|
/>
|
|
935
|
-
|
|
936
|
-
)}
|
|
937
|
-
</ResponsiveWrapper>
|
|
938
|
-
)}
|
|
939
|
-
{hasLoginInfo && (
|
|
940
|
-
<ResponsiveWrapper>
|
|
941
|
-
<span className={styles.formHeaderSection}>{t('loginInfo', 'Login Info')}</span>
|
|
942
|
-
<ResponsiveWrapper>
|
|
943
|
-
<Controller
|
|
944
|
-
name="username"
|
|
945
|
-
control={userFormMethods.control}
|
|
946
|
-
render={({ field }) => (
|
|
947
|
-
<TextInput
|
|
948
|
-
{...field}
|
|
949
|
-
id="username"
|
|
950
|
-
labelText={t('username', 'Username')}
|
|
951
|
-
invalid={!!errors.username}
|
|
952
|
-
invalidText={errors.username?.message}
|
|
953
|
-
/>
|
|
954
|
-
)}
|
|
955
|
-
/>
|
|
1036
|
+
</ResponsiveWrapper>
|
|
956
1037
|
</ResponsiveWrapper>
|
|
1038
|
+
)}
|
|
957
1039
|
|
|
1040
|
+
{hasRoles && (
|
|
958
1041
|
<ResponsiveWrapper>
|
|
959
|
-
<
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
{...field}
|
|
977
|
-
id="password"
|
|
978
|
-
labelText="Password"
|
|
979
|
-
invalid={!!errors.password}
|
|
980
|
-
invalidText={errors.password?.message}
|
|
981
|
-
/>
|
|
982
|
-
)}
|
|
983
|
-
/>
|
|
984
|
-
</ResponsiveWrapper>
|
|
985
|
-
<ResponsiveWrapper>
|
|
986
|
-
<Controller
|
|
987
|
-
name="confirmPassword"
|
|
988
|
-
control={userFormMethods.control}
|
|
989
|
-
rules={
|
|
990
|
-
isInitialValuesEmpty
|
|
991
|
-
? {
|
|
992
|
-
required: 'Please confirm your password',
|
|
993
|
-
validate: (value) =>
|
|
994
|
-
value === userFormMethods.watch('password') || 'Passwords do not match',
|
|
995
|
-
}
|
|
996
|
-
: {}
|
|
997
|
-
}
|
|
998
|
-
render={({ field }) => (
|
|
999
|
-
<PasswordInput
|
|
1000
|
-
{...field}
|
|
1001
|
-
id="confirmPassword"
|
|
1002
|
-
labelText="Confirm Password"
|
|
1003
|
-
invalid={!!errors.confirmPassword}
|
|
1004
|
-
invalidText={errors.confirmPassword?.message}
|
|
1005
|
-
/>
|
|
1006
|
-
)}
|
|
1007
|
-
/>
|
|
1008
|
-
</ResponsiveWrapper>
|
|
1009
|
-
<ResponsiveWrapper>
|
|
1010
|
-
<Controller
|
|
1011
|
-
name="forcePasswordChange"
|
|
1012
|
-
control={userFormMethods.control}
|
|
1013
|
-
render={({ field }) => (
|
|
1014
|
-
<CheckboxGroup
|
|
1015
|
-
legendText={t('forcePasswordChange', 'Force Password Change')}
|
|
1016
|
-
className={styles.checkboxGroupGrid}>
|
|
1017
|
-
<Checkbox
|
|
1018
|
-
className={styles.multilineCheckboxLabel}
|
|
1019
|
-
id="forcePasswordChange"
|
|
1020
|
-
labelText={t(
|
|
1021
|
-
'forcePasswordChangeHelper',
|
|
1022
|
-
'Optionally require this user to change their password on next login',
|
|
1023
|
-
)}
|
|
1024
|
-
checked={!!field.value || false}
|
|
1025
|
-
onChange={(e) => field.onChange(e.target.checked)}
|
|
1026
|
-
/>
|
|
1027
|
-
</CheckboxGroup>
|
|
1028
|
-
)}
|
|
1029
|
-
/>
|
|
1030
|
-
</ResponsiveWrapper>
|
|
1031
|
-
</ResponsiveWrapper>
|
|
1032
|
-
)}
|
|
1033
|
-
|
|
1034
|
-
{hasRoles && (
|
|
1035
|
-
<ResponsiveWrapper>
|
|
1036
|
-
<span className={styles.formHeaderSection}>{t('rolesInfo', 'Roles Info')}</span>
|
|
1037
|
-
<ResponsiveWrapper>
|
|
1038
|
-
{filterRolesConfig(rolesConfig).map((category) => (
|
|
1039
|
-
<Column key={category.category} xsm={8} md={12} lg={12} className={styles.checkBoxColumn}>
|
|
1040
|
-
<CheckboxGroup legendText={category.category} className={styles.checkboxGroupGrid}>
|
|
1041
|
-
{isLoading ? (
|
|
1042
|
-
<InlineLoading
|
|
1043
|
-
status="active"
|
|
1044
|
-
iconDescription="Loading"
|
|
1045
|
-
description="Loading data..."
|
|
1046
|
-
/>
|
|
1047
|
-
) : (
|
|
1048
|
-
<Controller
|
|
1049
|
-
name="roles"
|
|
1050
|
-
control={userFormMethods.control}
|
|
1051
|
-
render={({ field }) => {
|
|
1052
|
-
const selectedRoles = field.value || [];
|
|
1042
|
+
<span className={styles.formHeaderSection}>{t('rolesInfo', 'Roles Info')}</span>
|
|
1043
|
+
<ResponsiveWrapper>
|
|
1044
|
+
{filterRolesConfig(rolesConfig).map((category) => (
|
|
1045
|
+
<Column key={category.category} xsm={8} md={12} lg={12} className={styles.checkBoxColumn}>
|
|
1046
|
+
<CheckboxGroup legendText={category.category} className={styles.checkboxGroupGrid}>
|
|
1047
|
+
{isLoading ? (
|
|
1048
|
+
<InlineLoading
|
|
1049
|
+
status="active"
|
|
1050
|
+
iconDescription="Loading"
|
|
1051
|
+
description="Loading data..."
|
|
1052
|
+
/>
|
|
1053
|
+
) : (
|
|
1054
|
+
<Controller
|
|
1055
|
+
name="roles"
|
|
1056
|
+
control={userFormMethods.control}
|
|
1057
|
+
render={({ field }) => {
|
|
1058
|
+
const selectedRoles = field.value || [];
|
|
1053
1059
|
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1060
|
+
return (
|
|
1061
|
+
<>
|
|
1062
|
+
{roles
|
|
1063
|
+
.filter((role) => category.roles.includes(role.name))
|
|
1064
|
+
.map((role) => {
|
|
1065
|
+
const isSelected = selectedRoles.some(
|
|
1066
|
+
(r) =>
|
|
1067
|
+
r.display === role.display &&
|
|
1068
|
+
r.description === role.description &&
|
|
1069
|
+
r.uuid === role.uuid,
|
|
1070
|
+
);
|
|
1065
1071
|
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1072
|
+
return (
|
|
1073
|
+
<label
|
|
1074
|
+
key={role.display}
|
|
1075
|
+
className={
|
|
1076
|
+
isSelected ? styles.checkboxLabelSelected : styles.checkboxLabel
|
|
1077
|
+
}>
|
|
1078
|
+
<input
|
|
1079
|
+
type="checkbox"
|
|
1080
|
+
id={role.display}
|
|
1081
|
+
checked={isSelected}
|
|
1082
|
+
onChange={(e) => {
|
|
1083
|
+
const updatedValue = e.target.checked
|
|
1084
|
+
? [
|
|
1085
|
+
...selectedRoles,
|
|
1086
|
+
{
|
|
1087
|
+
uuid: role.uuid,
|
|
1088
|
+
display: role.display,
|
|
1089
|
+
description: role.description ?? null,
|
|
1090
|
+
},
|
|
1091
|
+
]
|
|
1092
|
+
: selectedRoles.filter(
|
|
1093
|
+
(selectedRole) => selectedRole.display !== role.display,
|
|
1094
|
+
);
|
|
1089
1095
|
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1096
|
+
field.onChange(updatedValue);
|
|
1097
|
+
}}
|
|
1098
|
+
/>
|
|
1099
|
+
{role.display}
|
|
1100
|
+
</label>
|
|
1101
|
+
);
|
|
1102
|
+
})}
|
|
1103
|
+
</>
|
|
1104
|
+
);
|
|
1105
|
+
}}
|
|
1106
|
+
/>
|
|
1107
|
+
)}
|
|
1108
|
+
</CheckboxGroup>
|
|
1109
|
+
</Column>
|
|
1110
|
+
))}
|
|
1111
|
+
</ResponsiveWrapper>
|
|
1105
1112
|
</ResponsiveWrapper>
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
</
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
</Button>
|
|
1113
|
+
)}
|
|
1114
|
+
</Stack>
|
|
1115
|
+
</div>
|
|
1116
|
+
<ButtonSet className={classNames({ [styles.tablet]: isTablet, [styles.desktop]: !isTablet })}>
|
|
1117
|
+
<Button kind="secondary" onClick={handleBackClick} className={styles.btn}>
|
|
1118
|
+
{t(hasDemographicInfo ? 'cancel' : 'back', hasDemographicInfo ? 'Cancel' : 'Back')}
|
|
1119
|
+
</Button>
|
|
1114
1120
|
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1121
|
+
<Button
|
|
1122
|
+
kind="primary"
|
|
1123
|
+
type={getSubmitButtonType()}
|
|
1124
|
+
disabled={isSubmitting || Object.keys(errors).length > 0 || searchHWR.isHWRLoading}
|
|
1125
|
+
renderIcon={getSubmitButtonIcon()}
|
|
1126
|
+
className={styles.btn}
|
|
1127
|
+
onClick={handleNextClick}>
|
|
1128
|
+
{isSubmitting ? (
|
|
1129
|
+
<span style={{ display: 'flex', alignItems: 'center' }}>
|
|
1130
|
+
{t('submitting', 'Submitting...')} <InlineLoading status="active" />
|
|
1131
|
+
</span>
|
|
1132
|
+
) : (
|
|
1133
|
+
getSubmitButtonText()
|
|
1134
|
+
)}
|
|
1135
|
+
</Button>
|
|
1136
|
+
</ButtonSet>
|
|
1137
|
+
</form>
|
|
1138
|
+
</FormProvider>
|
|
1139
|
+
</div>
|
|
1133
1140
|
</div>
|
|
1134
1141
|
</div>
|
|
1135
1142
|
</div>
|
|
1136
|
-
</
|
|
1143
|
+
</Workspace2>
|
|
1137
1144
|
);
|
|
1138
1145
|
};
|
|
1139
1146
|
|