Skip to content

Commit

Permalink
refactor: changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
amosmachora committed Jul 23, 2024
1 parent 521a1d6 commit 9325e71
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const BillLineItems: React.FC<{ bill: MappedBill }> = ({ bill }) => {

const handleOpenEditLineItemWorkspace = (lineItem: LineItem) => {
launchWorkspace('edit-bill-form', {
workspaceTitle: t('editBillForm' , 'Edit Bill Form'),
workspaceTitle: t('editBillForm', 'Edit Bill Form'),
lineItem,
});
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import React from 'react';
import { ModalHeader, ModalBody, ModalFooter, Button } from '@carbon/react';
import styles from './cancel-bill.scss';
import { useTranslation } from 'react-i18next';

export const CancelBillModal: React.FC<{
onClose: () => void;
}> = ({ onClose }) => {
const { t } = useTranslation();
return (
<React.Fragment>
<ModalHeader onClose={onClose} className={styles.modalHeaderLabel} closeModal={onClose}>
Cancel bill
{t('cancelBill', 'Cancel Bill')}
</ModalHeader>
<ModalBody className={styles.modalHeaderHeading}>
Are you sure you want to cancel this bill? Proceed cautiously.
{t('cancelBillDescription', 'Are you sure you want to cancel this bill? Proceed cautiously.')}
</ModalBody>
<ModalFooter>
<Button kind="secondary" onClick={onClose}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
@use '@carbon/type';

.modalHeaderLabel {
box-sizing: border-box;
font-family: inherit;
font-size: 100%;
vertical-align: baseline;
font-size: var(--cds-label-01-font-size, 0.75rem);
font-weight: var(--cds-label-01-font-weight, 400);
line-height: var(--cds-label-01-line-height, 1.33333);
letter-spacing: var(--cds-label-01-letter-spacing, 0.32px);
color: var(--cds-text-secondary, #525252);
-webkit-margin-after: 0.25rem;
margin-block-end: 0.25rem;
@include type.type-style('label-02');
}

.modalHeaderHeading {
box-sizing: border-box;
font-family: inherit;
font-size: 100%;
vertical-align: baseline;
font-size: var(--cds-heading-03-font-size, 1.25rem);
font-weight: var(--cds-heading-03-font-weight, 400);
line-height: var(--cds-heading-03-line-height, 1.4);
letter-spacing: var(--cds-heading-03-letter-spacing, 0);
color: var(--cds-text-primary, #161616);
-webkit-padding-end: calc(20% - 3rem);
padding-inline-end: calc(20% - 3rem);
@include type.type-style('heading-compact-02');
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
} from '@carbon/react';
import { convertToCurrency, extractString } from '../../helpers';
import { useTranslation } from 'react-i18next';
import { EmptyDataIllustration } from '@openmrs/esm-patient-common-lib';
import { EmptyDataIllustration, EmptyState } from '@openmrs/esm-patient-common-lib';
import { MappedBill } from '../../types';
import styles from '../../bills-table/bills-table.scss';
import BillLineItems from './bill-line-items.component';
Expand Down Expand Up @@ -53,15 +53,11 @@ const PatientBills: React.FC<PatientBillsProps> = ({ bills }) => {

if (bills.length === 0) {
return (
<div style={{ marginTop: '0.625rem' }}>
<Layer className={styles.emptyStateContainer}>
<Tile className={styles.tile}>
<div className={styles.illo}>
<EmptyDataIllustration />
</div>
<p className={styles.content}>{t('noBillDisplay', 'There are no bills to display for this patient')}</p>
</Tile>
</Layer>
<div style={{ marginTop: '1rem' }}>
<EmptyState
displayText={t('noBillDisplay', 'There are no bills to display for this patient')}
headerTitle="No bills"
/>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@include type.type-style('body-01');
}

.caseFormTitle {
.formTitle {
@include type.type-style('heading-02');
display: flex;
align-items: center;
Expand All @@ -57,6 +57,6 @@
}
}

.editFormInput{
.editFormInput {
margin-bottom: spacing.$spacing-05;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const WaiveBillForm: React.FC<BillWaiverFormProps> = ({ bill }) => {

return (
<Form className={styles.form} aria-label={t('waiverForm', 'Waiver form')} onSubmit={handleSubmit(onSubmit)}>
<span className={styles.caseFormTitle}>{t('formTitle', 'Fill in the form details')}</span>
<span className={styles.formTitle}>{t('formTitle', 'Fill in the form details')}</span>
<Stack gap={7}>
<FormGroup>
<section className={styles.billWaiverDescription}>
Expand Down
1 change: 0 additions & 1 deletion packages/esm-billing-app/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import PriceInfoOrder from './billable-services/billiable-item/test-order/price-
import ProcedureOrder from './billable-services/billiable-item/test-order/procedure-order.component';
import ImagingOrder from './billable-services/billiable-item/test-order/imaging-order.component';


const moduleName = '@kenyaemr/esm-billing-app';

const options = {
Expand Down
3 changes: 1 addition & 2 deletions packages/esm-billing-app/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"discard": "Discard",
"discardClaim": "Discard Claim",
"discount": "Discount",
"editBillForm": "Edit Bill Form",
"enterAmount": "Enter amount",
"enterConcept": "Associated concept",
"enterReferenceNumber": "Enter ref. number",
Expand Down Expand Up @@ -122,7 +123,6 @@
"selectExemptionCategory": "Select exemption category",
"selectitemstobeclaimed": "Select items that are to be included in the claims",
"selectPaymentMethod": "Select payment method",
"selectPaymentMethodPlaceholder": "Select payment method",
"sellingAmount": "Enter selling price",
"sellingPrice": "Selling Price",
"sendClaim": "Claim sent successfully",
Expand Down Expand Up @@ -150,6 +150,5 @@
"validSHANumber": "SHA number is valid, proceed with care",
"visitTime": "Visit time",
"visittype": "Visit Type",
"waiverForm": "Waiver form",
"yes": "Yes"
}

0 comments on commit 9325e71

Please sign in to comment.