Skip to content

Commit

Permalink
Update billable services workspace (#267)
Browse files Browse the repository at this point in the history
* removed the console statements

* redisigned the edit billable services form to launch from a workspace

* fix the display of the worspace for editing a billable service

* fix styling on the editing of billable services form

* rename initialData to service
  • Loading branch information
agesa3 authored Aug 5, 2024
1 parent 1656acf commit 5b81cb1
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 14 deletions.
1 change: 1 addition & 0 deletions kenyaemr-esm-3.x
Submodule kenyaemr-esm-3.x added at a0a110
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import {
ErrorState,
navigate,
WorkspaceContainer,
launchWorkspace,
} from '@openmrs/esm-framework';
import { EmptyState } from '@openmrs/esm-patient-common-lib';
import styles from './billable-services.scss';
import { useTranslation } from 'react-i18next';
import { useBillableServices } from './billable-service.resource';
import { ArrowRight } from '@carbon/react/icons';
import { ArrowRight, Edit } from '@carbon/react/icons';

const BillableServices = () => {
const { t } = useTranslation();
Expand All @@ -45,6 +46,12 @@ const BillableServices = () => {
const [showOverlay, setShowOverlay] = useState(false);
const [overlayHeader, setOverlayTitle] = useState('');

const handleEditClick = (service) => {
launchWorkspace('update-billable-services-workspace', {
service,
});
};

const headerData = [
{
header: t('serviceName', 'Service Name'),
Expand Down Expand Up @@ -103,7 +110,7 @@ const BillableServices = () => {
serviceType: service?.serviceType?.display,
status: service.serviceStatus,
prices: '--',
actions: '--',
actions: <Edit onClick={() => handleEditClick(service)} style={{ cursor: 'pointer' }} />,
};
let cost = '';
service.servicePrices.forEach((price) => {
Expand Down Expand Up @@ -138,6 +145,7 @@ const BillableServices = () => {

return (
<>
<WorkspaceContainer overlay contextKey="billable-services" />
{billableServices?.length > 0 ? (
<div className={styles.serviceContainer}>
<FilterableTableHeader
Expand Down
Loading

0 comments on commit 5b81cb1

Please sign in to comment.