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

🐛 Update migration wave form & modal styles #1563

Merged
merged 6 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ import {
Grid,
GridItem,
DatePicker,
Level,
LevelItem,
} from "@patternfly/react-core";

import { useFetchStakeholders } from "@app/queries/stakeholders";
Expand Down Expand Up @@ -289,71 +287,65 @@ export const WaveForm: React.FC<WaveFormProps> = ({
fieldId="name"
/>
</GridItem>
<Level>
<LevelItem>
<GridItem span={5}>
<HookFormPFGroupController
control={control}
name="startDateStr"
label="Potential Start Date"
fieldId="startDateStr"
isRequired
renderInput={({ field: { value, name, onChange } }) => (
<DatePicker
aria-label={name}
onChange={(e, val) => {
onChange(val);
trigger("endDateStr"); // Validation of endDateStr depends on startDateStr
}}
placeholder="MM/DD/YYYY"
value={value}
dateFormat={(val) => dayjs(val).format("MM/DD/YYYY")}
dateParse={(val) => dayjs(val).toDate()}
validators={[startDateRangeValidator]}
appendTo={() =>
document.getElementById(
"create-edit-migration-wave-modal"
) as HTMLElement
}
/>
)}
<GridItem span={3}>
<HookFormPFGroupController
control={control}
name="startDateStr"
label="Potential Start Date"
fieldId="startDateStr"
isRequired
renderInput={({ field: { value, name, onChange } }) => (
<DatePicker
aria-label={name}
onChange={(e, val) => {
onChange(val);
trigger("endDateStr"); // Validation of endDateStr depends on startDateStr
}}
placeholder="MM/DD/YYYY"
value={value}
dateFormat={(val) => dayjs(val).format("MM/DD/YYYY")}
dateParse={(val) => dayjs(val).toDate()}
validators={[startDateRangeValidator]}
appendTo={() => document.body}
/>
</GridItem>
</LevelItem>
<LevelItem>
<GridItem span={2}>to</GridItem>
</LevelItem>
<LevelItem>
<GridItem span={5}>
<HookFormPFGroupController
control={control}
name="endDateStr"
label="Potential End Date"
fieldId="endDateStr"
isRequired
renderInput={({ field: { value, name, onChange } }) => (
<DatePicker
aria-label={name}
onChange={(e, val) => {
onChange(val);
}}
placeholder="MM/DD/YYYY"
value={value}
dateFormat={(val) => dayjs(val).format("MM/DD/YYYY")}
dateParse={(val) => dayjs(val).toDate()}
validators={[endDateRangeValidator]}
appendTo={() =>
document.getElementById(
"create-edit-migration-wave-modal"
) as HTMLElement
}
isDisabled={!!formErrors.startDateStr}
/>
)}
)}
/>
</GridItem>
<GridItem
span={1}
style={{
display: "flex",
alignItems: "center",
justifyContent: "center",
}}
>
to
</GridItem>

<GridItem span={8}>
<HookFormPFGroupController
control={control}
name="endDateStr"
label="Potential End Date"
fieldId="endDateStr"
isRequired
renderInput={({ field: { value, name, onChange } }) => (
<DatePicker
aria-label={name}
onChange={(e, val) => {
onChange(val);
}}
placeholder="MM/DD/YYYY"
value={value}
dateFormat={(val) => dayjs(val).format("MM/DD/YYYY")}
dateParse={(val) => dayjs(val).toDate()}
validators={[endDateRangeValidator]}
appendTo={() => document.body}
isDisabled={!!formErrors.startDateStr}
/>
</GridItem>
</LevelItem>
</Level>
)}
/>
</GridItem>
<GridItem span={12}>
<HookFormPFGroupController
control={control}
Expand Down
2 changes: 1 addition & 1 deletion client/src/app/pages/migration-waves/migration-waves.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ export const MigrationWaves: React.FC = () => {
what: t("terms.migrationWave").toLowerCase(),
})
}
variant={ModalVariant.small}
variant={ModalVariant.medium}
isOpen={isWaveModalOpen}
onClose={closeWaveModal}
>
Expand Down
Loading