Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 868f780

Browse files
authored
Merge pull request #478 from cagdas001/dev
Fix MonthPicker on EditRoleForm & Increase Delay Before Redirection
2 parents daeeb06 + 66e1dfe commit 868f780

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/routes/CreateNewTeam/components/EditRoleForm/index.jsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ const Error = ({ name }) => {
3030
};
3131

3232
function EditRoleForm({ onChange, role }) {
33-
const [startMonthVisible, setStartMonthVisible] = useState(false);
3433
const onRoleChange = (state) => {
3534
if (state.hasValidationErrors) {
3635
onChange(false);
@@ -121,9 +120,9 @@ function EditRoleForm({ onChange, role }) {
121120
<Error name="durationWeeks" />
122121
</td>
123122
<td>
124-
{startMonthVisible ? (
123+
{role.startMonth ? (
125124
<>
126-
<Field name="startMonth" initialValue={Date.now()}>
125+
<Field name="startMonth" initialValue={role.startMonth}>
127126
{(props) => (
128127
<MonthPicker
129128
name={props.input.name}
@@ -143,7 +142,9 @@ function EditRoleForm({ onChange, role }) {
143142
<div styleName="flex-container">
144143
<button
145144
styleName="toggle-button"
146-
onClick={() => setStartMonthVisible(true)}
145+
onClick={() =>
146+
onRoleChange({ values: { startMonth: Date.now() } })
147+
}
147148
>
148149
Add Start Month
149150
</button>

src/routes/CreateNewTeam/components/SubmitContainer/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ function SubmitContainer({
148148
.then(() => {
149149
setTimeout(() => {
150150
dispatch(clearSearchedRoles());
151-
// Backend api create project has sync issue, so delay 2 seconds
151+
// Backend api create project has sync issue, so delay 4 seconds
152152
navigate("/taas/myteams");
153-
}, 2000);
153+
}, 4000);
154154
})
155155
.catch((err) => {
156156
setRequestLoading(false);

0 commit comments

Comments
 (0)