Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNFT1-3392: Design fixes for identification section for basic patient form #2126

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ import { ReactNode } from 'react';
import { Column } from 'design-system/table';
import { RepeatingBlock } from 'design-system/entry/multi-value';
import { BasicIdentificationEntry } from '../entry';
import { initial } from './entry';
import { BasicIdentificationFields } from './BasicIdentificationFields';
import { BasicIdentificationView } from './BasicIdentificationView';
import styles from './identification.module.scss';

const defaultValue: Partial<BasicIdentificationEntry> = initial();

type BasicIdentificationRepeatingBlockProps = {
id: string;
Expand All @@ -24,15 +28,20 @@ export const BasicIdentificationRepeatingBlock = ({
const renderView = (entry: BasicIdentificationEntry) => <BasicIdentificationView entry={entry} />;

const columns: Column<BasicIdentificationEntry>[] = [
{ id: 'identificationType', name: 'Type', render: (v) => v.type?.name },
{ id: 'assigningAuthority', name: 'Assigning authority', render: (v) => v.issuer?.name },
{ id: 'idValue', name: 'ID value', render: (v) => v.id }
{ id: 'identificationType', name: 'Type', className: styles['col-type'], render: (v) => v.type?.name },
{
id: 'assigningAuthority',
name: 'Assigning authority',
className: styles['col-authority'],
render: (v) => v.issuer?.name
},
{ id: 'idValue', name: 'ID value', className: styles['col-id'], render: (v) => v.id }
];
return (
<RepeatingBlock<BasicIdentificationEntry>
id={id}
title="Identification"
defaultValues={undefined}
defaultValues={defaultValue}
values={values}
columns={columns}
onChange={onChange}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { BasicIdentificationEntry } from '../entry';

const initial = (): Partial<BasicIdentificationEntry> => ({
type: undefined,
issuer: undefined,
id: ''
});

export { initial };
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.col-type {
width: 40%;
}

.col-authority {
width: 30%;
}

.col-id {
width: 30%;
}
Loading