Skip to content

Commit 505ef0c

Browse files
[MDS-6206] Tweak permit condition category input field sizes (#3335)
* [MDS-6206] Updated sizing of permit condition category edit fields * Removed unused clause * MDS-6206 Fix column use * Removed unused import
1 parent 03c7bbb commit 505ef0c

File tree

2 files changed

+57
-51
lines changed

2 files changed

+57
-51
lines changed

services/core-web/src/components/mine/Permit/PermitConditionCategory.tsx

+56-50
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import RenderField from "@mds/common/components/forms/RenderField";
33
import RenderSubmitButton from "@mds/common/components/forms/RenderSubmitButton";
44
import { FORM } from "@mds/common/constants/forms";
55
import { IPermitConditionCategory } from "@mds/common/interfaces";
6-
import { Button, Popconfirm, Row, Tooltip, Typography } from "antd";
6+
import { Button, Col, Popconfirm, Row, Tooltip, Typography } from "antd";
77
import React, { useState } from "react";
88
import { Field } from "redux-form";
99
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
@@ -65,59 +65,65 @@ export const EditPermitConditionCategoryInline = (props: IPermitConditionCategor
6565

6666
return (
6767
<FormWrapper scrollOnToggleEdit={false} name={formName} onSubmit={handleSubmit} initialValues={props.category} isEditMode={isEditMode}>
68-
<Row className="flex" style={{ gap: '0.5em' }}>
69-
<Field name="step" component={RenderField} required={true} validate={[required]} />
70-
<PermitConditionCategorySelector showLabel={false} />
71-
<Button
72-
className="icon-button-container"
73-
style={{ marginRight: 0 }}
74-
onClick={cancel}
75-
type="primary"
76-
icon={<FontAwesomeIcon icon={faXmark} />}
77-
/>
68+
<Row style={{ gap: '0.5em' }}>
69+
<Col flex-shrink="1" style={{ maxWidth: '40px' }}>
70+
<Field name="step" component={RenderField} required={true} validate={[required]} style={{ marginRight: 0, }} />
71+
</Col>
72+
<Col>
73+
<PermitConditionCategorySelector showLabel={false} />
74+
</Col>
75+
<Col flex="auto" style={{ display: 'flex', gap: '0.5em' }}>
76+
<Button
77+
className="icon-button-container"
78+
style={{ marginRight: 0 }}
79+
onClick={cancel}
80+
type="primary"
81+
icon={<FontAwesomeIcon icon={faXmark} />}
82+
/>
7883

79-
<RenderSubmitButton buttonText="" buttonProps={{ "aria-label": "Confirm", className: "icon-button-container", style: { marginRight: 0, marginLeft: 0 }, icon: <FontAwesomeIcon icon={faCheck} /> }} />
84+
<RenderSubmitButton buttonText="" buttonProps={{ "aria-label": "Confirm", className: "icon-button-container", style: { marginRight: 0, marginLeft: 0 }, icon: <FontAwesomeIcon icon={faCheck} /> }} />
8085

81-
<Popconfirm
82-
disabled={props.conditionCount > 0}
83-
placement="topRight"
84-
title={
85-
<>
86-
<Typography.Paragraph>Are you sure you want to delete {props.category.description}?</Typography.Paragraph>
87-
<Typography.Paragraph>This action cannot be undone.</Typography.Paragraph>
88-
</>
89-
}
90-
onConfirm={() => handleDelete(props.category)}
91-
okText="Yes, Delete Category"
92-
cancelText="No"
93-
>
94-
<Button
86+
<Popconfirm
9587
disabled={props.conditionCount > 0}
96-
danger={true}
97-
icon={<FontAwesomeIcon icon={faTrash} />}
98-
aria-label="Delete Category" />
99-
</Popconfirm>
88+
placement="topRight"
89+
title={
90+
<>
91+
<Typography.Paragraph>Are you sure you want to delete {props.category.description}?</Typography.Paragraph>
92+
<Typography.Paragraph>This action cannot be undone.</Typography.Paragraph>
93+
</>
94+
}
95+
onConfirm={() => handleDelete(props.category)}
96+
okText="Yes, Delete Category"
97+
cancelText="No"
98+
>
99+
<Button
100+
disabled={props.conditionCount > 0}
101+
danger={true}
102+
icon={<FontAwesomeIcon icon={faTrash} />}
103+
aria-label="Delete Category" />
104+
</Popconfirm>
100105

101-
<Button
102-
disabled={props.currentPosition <= 0}
103-
onClick={(event) => {
104-
event.stopPropagation();
105-
props.moveUp(props.category);
106-
}}
107-
type="default"
108-
aria-label="Move Category Up"
109-
icon={<FontAwesomeIcon icon={faArrowUp} />}
110-
/>
111-
<Button
112-
style={{ marginLeft: 0 }}
113-
disabled={props.currentPosition >= props.categoryCount - 1}
114-
aria-label="Move Category Down"
115-
onClick={(event) => {
116-
event.stopPropagation();
117-
props.moveDown(props.category);
118-
}}
119-
icon={<FontAwesomeIcon icon={faArrowDown} />}
120-
/>
106+
<Button
107+
disabled={props.currentPosition <= 0}
108+
onClick={(event) => {
109+
event.stopPropagation();
110+
props.moveUp(props.category);
111+
}}
112+
type="default"
113+
aria-label="Move Category Up"
114+
icon={<FontAwesomeIcon icon={faArrowUp} />}
115+
/>
116+
<Button
117+
style={{ marginLeft: 0 }}
118+
disabled={props.currentPosition >= props.categoryCount - 1}
119+
aria-label="Move Category Down"
120+
onClick={(event) => {
121+
event.stopPropagation();
122+
props.moveDown(props.category);
123+
}}
124+
icon={<FontAwesomeIcon icon={faArrowDown} />}
125+
/>
126+
</Col>
121127
</Row>
122128
</FormWrapper >
123129
)

services/core-web/src/components/mine/Permit/PermitConditionCategorySelector.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const PermitConditionCategorySelector: FC<IPermitConditionCategorySelectorProps>
3737
const showLabel = props.showLabel !== undefined ? props.showLabel : true;
3838

3939
return (
40-
<Form.Item style={{ marginRight: 0 }}>
40+
<Form.Item style={{ marginRight: 0, minWidth: '250px' }}>
4141
<Field
4242
id="description"
4343
name="description"

0 commit comments

Comments
 (0)