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 config property for rendering the Create appointment button #838

Closed
wants to merge 4 commits into from

Conversation

CynthiaKamau
Copy link
Contributor

@CynthiaKamau CynthiaKamau commented Oct 9, 2023

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.

Copy link
Member

@mseaton mseaton left a 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.

Copy link
Member

@mogoodrich mogoodrich left a 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: {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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`',
Copy link
Member

@denniskigen denniskigen Oct 26, 2023

Choose a reason for hiding this comment

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

Suggested change
_description: 'Whether to show the create appointment button`',
_description: 'Whether or not `Create Appointment` button in the appointments page header gets rendered',

},
}}
/>
{showCreateAppointmentButtons && (
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{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();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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 ? (
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{scheduleType === 'Scheduled' && showCreateAppointmentButtons ? (
{scheduleType === 'Scheduled' && showCreateAppointmentButton ? (

@denniskigen denniskigen changed the title (feat) Add config to show/hide create appointment button (feat) Add config property for rendering the Create appointment button Oct 26, 2023
@ibacher ibacher closed this Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants