parse-community / parse-dashboard

A dashboard for managing Parse Server
https://parseplatform.org
Other
3.74k stars 1.38k forks source link

Add confirmation dialog before script execution #2474

Closed mtrezza closed 1 year ago

mtrezza commented 1 year ago

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[bot] commented 1 year ago

Thanks for opening this issue!

patelmilanun commented 1 year ago

do we want the dialog text as well?

mtrezza commented 1 year ago

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 commented 1 year ago

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

parseplatformorg commented 11 months ago

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

parseplatformorg commented 11 months ago

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

parseplatformorg commented 9 months ago

🎉 This change has been released in version 5.3.0