Skip to content

Commit

Permalink
fix overflowMenu position
Browse files Browse the repository at this point in the history
  • Loading branch information
jwamalwa committed Aug 23, 2023
1 parent 970d9f2 commit e4eab9b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/esm-patient-list-app/src/api/api-remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export async function removePatientFromList(cohortMembershipUuid: string, ac = n
return postData(
`${cohortUrl}/cohortmember/${cohortMembershipUuid}`,
{
voidReason: '',
endDate: new Date(),
},
ac,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { removePatientFromList } from '../api/api-remote';
import { ExtensionSlot, isDesktop, showToast, useLayoutType } from '@openmrs/esm-framework';
import { OverflowMenu, Layer, OverflowMenuItem, Modal } from '@carbon/react';
import styles from './patient-table.scss';
import overflowMenuStyles from './overflow-menu.scss';

interface OverflowMenuCellProps {
cohortMembershipUuid: string;
Expand Down Expand Up @@ -44,7 +45,7 @@ const OverflowMenuComponent: React.FC<OverflowMenuCellProps> = ({
}, [cohortMembershipUuid, cohortName, mutatePatientListMembers, t]);

return (
<Layer className={styles.layer}>
<Layer className={overflowMenuStyles.layer}>
<OverflowMenu
data-floating-menu-container
ariaLabel={`Remove patient from the ${cohortName} list`}
Expand All @@ -53,7 +54,7 @@ const OverflowMenuComponent: React.FC<OverflowMenuCellProps> = ({
<ExtensionSlot name={'cohort-member-action-items'} />
<OverflowMenuItem
size={desktopLayout ? 'sm' : 'lg'}
className={styles.menuItem}
className={overflowMenuStyles.menuItem}
onClick={() => setShowConfirmationModal(true)}
itemText={t('removePatient', 'Remove patient')}
isDelete
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.layer {
height: 100%;
}
.menuItem {
max-width: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const PatientTable: React.FC<PatientTableProps> = ({
{row.cells.map((cell) => (
<TableCell key={cell.id}>{cell.value?.content ?? cell.value}</TableCell>
))}
<TableCell>
<TableCell className="cds--table-column-menu">
<PatientListOverflowMenuComponent
cohortMembershipUuid={row.id}
cohortName={cohortName}
Expand Down

0 comments on commit e4eab9b

Please sign in to comment.