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

(feat) Add notification for HIE sync failure #558

Merged
merged 18 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const FacilityInfo: React.FC = () => {
const [facilityData, setFacilityData] = useState<FacilityData>(defaultFacility);
useEffect(() => {
setFacilityData(defaultFacility);
if (defaultFacility?.operationalStatus !== 'Operational') {
showNotification({ kind: 'error', title: 'Error', description: 'The facility SHA status is is not operational' });
}
}, [defaultFacility]);

const synchronizeFacilityData = async () => {
Expand All @@ -28,6 +25,13 @@ const FacilityInfo: React.FC = () => {
kind: 'success',
isLowContrast: true,
});
if (defaultFacility?.source != 'HIE') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an error or just a notification?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what set's the defaultFacility variable?

Copy link
Contributor Author

@FelixKiprotich350 FelixKiprotich350 Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ojwanganto youre right should be a notification ,,,but of kind warning. (pink one)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ojwanganto also updated screenshot

showSnackbar({
kind: 'warning',
title: 'HIE Sync Failed. Pulling local info.',
isLowContrast: true,
});
}
} catch (error) {
const errorMessage = error?.responseBody?.error?.message ?? 'An error occurred while synchronizing with HIE';
showSnackbar({
Expand Down Expand Up @@ -66,7 +70,7 @@ const FacilityInfo: React.FC = () => {
<hr className={styles.cardDivider} />
<div className={styles.cardContent}>
<p>
<strong>Facility Name:</strong> {facilityData?.display || 'N/A'}
<strong>Facility Name:</strong> {facilityData?.display}
</p>
<p>
<strong>Facility KMHFR Code:</strong> {facilityData?.mflCode}
Expand Down
1 change: 1 addition & 0 deletions packages/esm-admin-app/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ export interface FacilityData {
shaFacilityId?: string;
shaFacilityLicenseNumber?: string;
shaFacilityExpiryDate?: string;
source?: string;
}
Loading