Skip to content

Commit

Permalink
(fix) O3-3906: ComposedModal usage missing scroll bar (#1308)
Browse files Browse the repository at this point in the history
* (fix) O3-3906:  ComposedModal usage missing scroll bar

* (fix) O3-3906:  ComposedModal usage missing scroll bar
  • Loading branch information
IamMujuziMoses authored Sep 13, 2024
1 parent 9143a3e commit bac1f4d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
InlineNotification,
} from '@carbon/react';
import { useTranslation } from 'react-i18next';
import { type Location } from '@openmrs/esm-framework';
import { getCoreTranslation, type Location } from '@openmrs/esm-framework';
import type { BedType, BedFormData } from '../types';
import { type BedAdministrationData } from './bed-administration-types';

Expand Down Expand Up @@ -119,7 +119,7 @@ const BedAdministrationForm: React.FC<BedAdministrationFormProps> = ({
<ComposedModal open={showModal} onClose={() => onModalChange(false)} preventCloseOnClickOutside>
<ModalHeader title={headerTitle} />
<ModalBody hasScrollingContent>
<Form onSubmit={handleSubmit(onSubmit, onError)}>
<Form>
<Stack gap={3}>
<FormGroup legendText={''}>
<Controller
Expand Down Expand Up @@ -279,7 +279,7 @@ const BedAdministrationForm: React.FC<BedAdministrationFormProps> = ({
</ModalBody>
<ModalFooter>
<Button onClick={() => onModalChange(false)} kind="secondary">
{t('cancel', 'Cancel')}
{getCoreTranslation('cancel', 'Cancel')}
</Button>
<Button disabled={!isDirty} onClick={handleSubmit(onSubmit, onError)}>
<span>{t('save', 'Save')}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
InlineNotification,
} from '@carbon/react';
import { useTranslation } from 'react-i18next';
import { type Location } from '@openmrs/esm-framework';
import { getCoreTranslation, type Location } from '@openmrs/esm-framework';
import type { BedTagData } from '../types';

const BedTagAdministrationSchema = z.object({
Expand Down Expand Up @@ -77,8 +77,8 @@ const BedTagsAdministrationForm: React.FC<BedTagAdministrationFormProps> = ({
return (
<ComposedModal open={showModal} onClose={() => onModalChange(false)} preventCloseOnClickOutside>
<ModalHeader title={headerTitle} />
<Form onSubmit={handleSubmit(onSubmit, onError)}>
<ModalBody hasScrollingContent>
<ModalBody hasScrollingContent>
<Form>
<Stack gap={3}>
<FormGroup legendText={''}>
<Controller
Expand Down Expand Up @@ -110,16 +110,16 @@ const BedTagsAdministrationForm: React.FC<BedTagAdministrationFormProps> = ({
/>
)}
</Stack>
</ModalBody>
<ModalFooter>
<Button onClick={() => onModalChange(false)} kind="secondary">
{t('cancel', 'Cancel')}
</Button>
<Button disabled={!isDirty} type="submit">
<span>{t('save', 'Save')}</span>
</Button>
</ModalFooter>
</Form>
</Form>
</ModalBody>
<ModalFooter>
<Button onClick={() => onModalChange(false)} kind="secondary">
{getCoreTranslation('cancel', 'Cancel')}
</Button>
<Button disabled={!isDirty} onClick={handleSubmit(onSubmit, onError)}>
<span>{t('save', 'Save')}</span>
</Button>
</ModalFooter>
</ComposedModal>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
InlineNotification,
} from '@carbon/react';
import { useTranslation } from 'react-i18next';
import { type Location } from '@openmrs/esm-framework';
import { getCoreTranslation, type Location } from '@openmrs/esm-framework';
import type { BedType, BedTypeData } from '../types';

const BedTypeAdministrationSchema = z.object({
Expand Down Expand Up @@ -81,8 +81,8 @@ const BedTypeAdministrationForm: React.FC<BedAdministrationFormProps> = ({
return (
<ComposedModal open={showModal} onClose={() => onModalChange(false)} preventCloseOnClickOutside>
<ModalHeader title={headerTitle} />
<Form onSubmit={handleSubmit(onSubmit, onError)}>
<ModalBody hasScrollingContent>
<ModalBody hasScrollingContent>
<Form>
<Stack gap={3}>
<FormGroup legendText={''}>
<Controller
Expand Down Expand Up @@ -149,16 +149,16 @@ const BedTypeAdministrationForm: React.FC<BedAdministrationFormProps> = ({
/>
)}
</Stack>
</ModalBody>
<ModalFooter>
<Button onClick={() => onModalChange(false)} kind="secondary">
{t('cancel', 'Cancel')}
</Button>
<Button disabled={!isDirty} type="submit">
<span>{t('save', 'Save')}</span>
</Button>
</ModalFooter>
</Form>
</Form>
</ModalBody>
<ModalFooter>
<Button onClick={() => onModalChange(false)} kind="secondary">
{getCoreTranslation('cancel', 'Cancel')}
</Button>
<Button disabled={!isDirty} onClick={handleSubmit(onSubmit, onError)}>
<span>{t('save', 'Save')}</span>
</Button>
</ModalFooter>
</ComposedModal>
);
};
Expand Down

0 comments on commit bac1f4d

Please sign in to comment.