-
Notifications
You must be signed in to change notification settings - Fork 233
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 config property for rendering the Create appointment
button
#838
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.
I'm adding @mogoodrich and @denniskigen as reviewers here. I know Mark is also working on a PR for appointment changes. Is this change being done in the context of a ticket? Please reference the ticket if so, and please create a ticket and reference it if not. Thanks.
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.
Yes @CynthiaKamau this seems good to me, but as @mseaton says, let's create tickets for all our changes going forward, so we can document in them the reason for a change. Thanks!
@@ -71,6 +71,11 @@ export const configSchema = { | |||
_description: 'The name of the patient identifier type to be used for the patient identifier field', | |||
_default: 'OpenMRS ID', | |||
}, | |||
showCreateAppointmentButtons: { |
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.
showCreateAppointmentButtons: { | |
showCreateAppointmentButton: { |
@@ -71,6 +71,11 @@ export const configSchema = { | |||
_description: 'The name of the patient identifier type to be used for the patient identifier field', | |||
_default: 'OpenMRS ID', | |||
}, | |||
showCreateAppointmentButtons: { | |||
_type: Type.Boolean, | |||
_description: 'Whether to show the create appointment button`', |
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.
_description: 'Whether to show the create appointment button`', | |
_description: 'Whether or not `Create Appointment` button in the appointments page header gets rendered', |
}, | ||
}} | ||
/> | ||
{showCreateAppointmentButtons && ( |
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.
{showCreateAppointmentButtons && ( | |
{showCreateAppointmentButton && ( |
import styles from './metrics-header.scss'; | ||
import { spaBasePath } from '../constants'; | ||
import AppointmentForm from '../appointments/forms/create-edit-form/appointments-form.component'; | ||
import { closeOverlay, launchOverlay } from '../hooks/useOverlay'; | ||
|
||
const MetricsHeader: React.FC = () => { | ||
const { t } = useTranslation(); | ||
const { showCreateAppointmentButtons } = useConfig(); |
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 { showCreateAppointmentButtons } = useConfig(); | |
const { showCreateAppointmentButton } = useConfig(); |
@@ -29,7 +30,7 @@ export const EmptyState: React.FC<EmptyStateProps> = ({ headerTitle, displayText | |||
There are no {displayText} to display | |||
</Trans> | |||
</p> | |||
{scheduleType === 'Scheduled' ? ( | |||
{scheduleType === 'Scheduled' && showCreateAppointmentButtons ? ( |
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.
{scheduleType === 'Scheduled' && showCreateAppointmentButtons ? ( | |
{scheduleType === 'Scheduled' && showCreateAppointmentButton ? ( |
Create appointment
button
Requirements
Summary
Add config to show/hide create appointment button
Screenshots
https://www.loom.com/share/929bc5bbebb2442a86c1783639c1d1f5?sid=b9e9b80b-0044-46f5-9741-de5f10237640
None.
Related Issue
None.
Other
None.