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

frontend: add confirm action component via context #3230

Closed
wants to merge 8 commits into from

Conversation

jecr
Copy link
Contributor

@jecr jecr commented Feb 12, 2025

This pull request introduces a confirmation dialog component and integrates it into the existing wizard component. The main changes include the creation of the ConfirmAction component and the necessary modifications to the Wizard component to utilize this new dialog.

image

Addition of Confirmation Dialog:

Integration with Wizard Component:

  • frontend/packages/wizard/src/wizard.tsx:
    • Imported useState and the new ConfirmAction component. [1] [2]
    • Added state variables to manage the dialog's open state and configuration.
    • Added a function showConfirmAction to configure and open the ConfirmAction dialog.
    • Integrated the ConfirmAction component into the Wizard component's JSX, passing the necessary props and handling the confirm and cancel actions.

Comment on lines +44 to +49
<TextField
label="Confirmation"
value={input}
onChange={e => setInput(e.target.value)}
fullWidth
/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to leave this as part of the description. We may prefer to have to some workflows with a confirmation but not necessarily requiring an input, so that should be left up to the implementer.

Comment on lines +31 to +33
if (input === confirmationText) {
onConfirm();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll probably want to leave this to the implementer as well. We will likely want a generic reason field versus something specific, better auditing that way.

@jecr jecr changed the title frontend: add confirm action component frontend: add confirm action component via context Feb 14, 2025
@jecr
Copy link
Contributor Author

jecr commented Feb 17, 2025

closed in favor of #3231

@jecr jecr closed this Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants