Skip to content

Add confirmation dialog before script execution #2474

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

Closed
3 tasks done
mtrezza opened this issue Jun 23, 2023 · 7 comments · Fixed by #2481
Closed
3 tasks done

Add confirmation dialog before script execution #2474

mtrezza opened this issue Jun 23, 2023 · 7 comments · Fixed by #2481
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:feature New feature or improvement of existing feature

Comments

@mtrezza
Copy link
Member

mtrezza commented Jun 23, 2023

New Feature / Enhancement Checklist

Current Limitation

A script is executed as soon as it is selected from the context menu. For sensitive operations it should be possible to show a confirmation dialog before the script is executed.

Feature / Enhancement Description

Add a config option to the script that shows a confirmation dialog, which allows the user to either "Cancel" (default / highlight button) or "Continue". By default, no dialog should be displayed.

The dialog could look like this:

Screenshot 2023-06-23 at 20 59 02

In addition, the confirmation dialog should have 2 levels of severity, as is currently implemented throughout the dashboard UI. A "critical" level (red style) and an "info" level (blue style), like this:

image

Example Use Case

"apps": [
  {
    "scripts": [
      {
        "title": "Delete Account",
        "classes": ["_User"],
        "cloudCodeFunction": "deleteAccount",
        "showConfirmationDialog": true,
        "confirmationDialogStyle": "critical" // or "info" for blue style
      }
    ]
  }
]

Alternatives / Workarounds

None

@parse-github-assistant
Copy link

parse-github-assistant bot commented Jun 23, 2023

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza mtrezza added type:feature New feature or improvement of existing feature bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) labels Jun 23, 2023
@patelmilanun
Copy link
Member

do we want the dialog text as well?

@mtrezza
Copy link
Member Author

mtrezza commented Jun 27, 2023

You mean a customizable dialog text? That would be a nice addition, but it would need to support some build-in variables, like {{scriptName}}, {{className}}, {{objectId}}, in order to compose a specific message text, like in the example above. If no text is set, it could just display the text in the example above by default:

Do you want to run the script "Delete User" on "_User" object "Abc123Xy"?

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.2.0-alpha.24

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jun 28, 2023
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Sep 15, 2023
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0-alpha.1

@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version type:feature New feature or improvement of existing feature
Projects
None yet
3 participants