Skip to content

Commit

Permalink
(feat) : enhance registry UI and add null check for obs concept (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldkibet committed Jan 5, 2025
1 parent ebe8f0b commit 3dabcc3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function ObsField({ fieldDefinition }: ObsFieldProps) {
return null;
}

switch (concept.datatype.display) {
switch (concept?.datatype?.display) {
case 'Text':
return (
<TextObsField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export function useGlobalProperties() {
const { data, isLoading, error } = useSWRImmutable(
`https://afyakenyaidentityapi.health.go.ke/connect/token`,
swrFetcher,
{ refreshInterval: 864000 },
{ refreshInterval: 864000, errorRetryCount: 0 },
);
return { data: data, isLoading, error };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ const PatientVerification: React.FC<PatientVerificationProps> = ({ props }) => {
<h3 className={styles.productiveHeading02} style={{ color: '#161616' }}>
{t('clientVerificationWithClientRegistry', 'Client verification with client registry')}
</h3>
<span className={styles.label01}>
{t('allFieldsRequiredText', 'All fields are required unless marked optional')}
</span>
<div style={{ margin: '1rem 0 1rem' }}>
<Layer>
{isLoading && <InlineLoading status="active" iconDescription="Loading" description="Loading data..." />}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
@use '@carbon/colors';
@use '@carbon/layout';
@use '@carbon/type';
@use '@openmrs/esm-styleguide/src/vars' as *;
@import '../patient-registration/patient-registration.scss';

/* Desktop */
Expand All @@ -23,3 +26,16 @@
.errorWrapper {
margin: 0 0 1rem 0;
}

.label01 {
@include type.type-style('label-01');
margin-top: layout.$spacing-05;
margin-bottom: layout.$spacing-05;
color: $ui-04;
}

.productiveHeading02 {
@include type.type-style('heading-compact-02');
color: $ui-04;
cursor: pointer;
}

0 comments on commit 3dabcc3

Please sign in to comment.