-
Notifications
You must be signed in to change notification settings - Fork 47
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
Added kenyaemr providers esm #289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Rugute for this great work. Left some suggestions
packages/esm-providers-app/src/providers-header/providers-header.scss
Outdated
Show resolved
Hide resolved
const [searchResults, setSearchResults] = useState<any[]>([]); | ||
const [selectedUser, setSelectedUser] = useState<any | null>(null); | ||
const [licenseNumber, setLicenseNumber] = useState(''); | ||
const [expiryDate, setExpiryDate] = useState(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already using react-hook-form
it would be nice to use it here
if (response) { | ||
setSearchResults(response); | ||
} else { | ||
console.error('Error fetching users:'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should be notifying the user about any errors
const fetcher = async (url) => { | ||
try { | ||
const response = await openmrsFetch(url, {}); | ||
if (!response.ok) { | ||
throw new Error(`Failed to fetch data: ${response.statusText}`); | ||
} | ||
|
||
return response.json(); | ||
} catch (error) { | ||
throw new Error(`An error occurred while fetching data: ${error.message}`); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to define this fetcher if we are hitting openmrs
endpoints openmrsfetch
will just work fine
@use '@carbon/styles/scss/spacing'; | ||
@use '@carbon/styles/scss/type'; | ||
@import '~@openmrs/esm-styleguide/src/vars'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use as pointed above
packages/esm-providers-app/src/providers-metrics/providers-metrics-header.component.tsx
Outdated
Show resolved
Hide resolved
|
||
function ProviderMetrics() { | ||
const { t } = useTranslation(); | ||
const { response } = getAllProviders(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should use useSWRImmutable
to cache this aggressively since this data doesn't change very often
min-width: 8.875rem; | ||
|
||
&:active { | ||
outline: 2px solid var(--brand-03) !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are using !important
here
I am working on the changes. Pushing it back shotly |
Co-authored-by: Donald Kibet <[email protected]>
…er.scss Co-authored-by: Donald Kibet <[email protected]>
…rics-header.component.tsx Co-authored-by: Donald Kibet <[email protected]>
…rics-header.component.tsx Co-authored-by: Donald Kibet <[email protected]>
…harged.component.tsx Co-authored-by: Donald Kibet <[email protected]>
Co-authored-by: Donald Kibet <[email protected]>
Co-authored-by: Donald Kibet <[email protected]>
Requirements
Summary
Added Providers ESM
Screenshots
None.
Related Issue
None.
Other
None.