-
Notifications
You must be signed in to change notification settings - Fork 203
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
(enhc) Remove un-used forms code and updated forms config. #1354
Conversation
Size Change: -119 B (0%) Total Size: 8.38 MB ℹ️ View Unchanged
|
@@ -13,8 +13,9 @@ import { ConfigObject } from '../config-schema'; | |||
import { isValidOfflineFormEncounter } from '../offline-forms/offline-form-helpers'; | |||
|
|||
export function useFormEncounters(cachedOfflineFormsOnly = false, patientUuid: string = '') { | |||
const { showConfigurableForms, customFormsUrl, showHtmlFormEntryForms } = useConfig() as ConfigObject; | |||
const url = showConfigurableForms | |||
const { customFormsUrl, showHtmlFormEntryForms } = useConfig() as ConfigObject; |
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.
const { customFormsUrl, showHtmlFormEntryForms } = useConfig() as ConfigObject; | |
const { customFormsUrl, showHtmlFormEntryForms } = useConfig<ConfigObject>(); |
const { showConfigurableForms, customFormsUrl, showHtmlFormEntryForms } = useConfig() as ConfigObject; | ||
const url = showConfigurableForms | ||
const { customFormsUrl, showHtmlFormEntryForms } = useConfig() as ConfigObject; | ||
const isCustomUrl = Boolean(customFormsUrl); |
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.
const isCustomUrl = Boolean(customFormsUrl); | |
const hasCustomFormsUrl = Boolean(customFormsUrl); |
@@ -23,7 +24,7 @@ export function useFormEncounters(cachedOfflineFormsOnly = false, patientUuid: s | |||
return useSWR([url, cachedOfflineFormsOnly], async () => { | |||
const res = await openmrsFetch<ListResponse<Form>>(url); | |||
// show published forms and hide component forms | |||
const forms = showConfigurableForms | |||
const forms = isCustomUrl |
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.
const forms = isCustomUrl | |
const forms = hasCustomFormsUrl |
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, @donaldkibet. LGTM. I've made minimal suggestions.
0a7b273
to
040cbab
Compare
Requirements
Summary
This PR removes unused code, following the removal of the
Notes and Forms
from patient-summary dashboard.From the design
Recommended, completed and All forms
tabs have been removed in favour of the form-dashboard.I have also maintained the
useCustomFormUrl
config that we at KenyaHMIS use to display available forms based on some program logic.Screenshots
Related Issue
Other