Skip to content

Commit

Permalink
Hotfix to 7decf9c, #1377:
Browse files Browse the repository at this point in the history
- Ensure that we auto-activate the modify tool if user goes backwards in the Simple Edit workflow.
  • Loading branch information
jacobwod committed Aug 22, 2023
1 parent 5944ae2 commit 6b8392d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions new-client/src/plugins/Edit/EditView.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class EditView extends React.PureComponent {
loadingError: status === "data-load-error" ? true : false,
activeStep: status === "data-load-error" ? 0 : 1,
});
this.potentiallyAutoActivateModify();
};

potentiallyAutoActivateModify = () => {
// If the selected source only allows simple edit, let's
// activate the "modify" tool automatically.
if (this.state.editSource?.simpleEditWorkflow === true) {
Expand Down Expand Up @@ -81,6 +85,14 @@ class EditView extends React.PureComponent {
activeStep: 0,
activeTool: undefined,
});
} else if (activeStep === 1) {
this.setState({ activeStep });
// If we end up on step 1 again, it means that user has
// clicked on "Continue editing" button after a save has
// been completed. In that case, we must check again if
// the simple edit workflow is active and in that case
// auto-activate the modify tool.
this.potentiallyAutoActivateModify();
} else {
this.setState({ activeStep });
}
Expand Down

0 comments on commit 6b8392d

Please sign in to comment.