Skip to content

Enable / disable script in context menu based on object field values #2487

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 28, 2023 · 4 comments · Fixed by #2488
Closed
3 tasks done

Enable / disable script in context menu based on object field values #2487

mtrezza opened this issue Jun 28, 2023 · 4 comments · Fixed by #2488
Labels
bounty:$50 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 28, 2023

New Feature / Enhancement Checklist

Current Limitation

Currently, a script is visible in the data browser cell context menu based on the object class and (soon) object field.

Feature / Enhancement Description

Enable / Disable script in context menu based on a combination of object field values. The script should be shown but grayed out in the context menu, so that the dashboard user knows that a script is available but currently disabled based on field values.

Example Use Case

For example, a purchase transaction in which there is a buyingUser and sellingUser, but only the buyingUser can be flagged:

"apps": [
  {
    "scripts": [
      {
        "title": "Flag fraudulent purchase",
        "classes": ["Transaction$buyingUser"],
        "requiredObjectValues": {
           "completed": true,
           "status": 1,
           "country": "US"
        },
        "cloudCodeFunction": "flagUser"
      }
    ]
  }
]

The conditions should support bool, string, number types and conditions should be AND related, i.e. all conditions need to be met for a script to be enabled. The default (if no conditions are set if that no fields are required and the script is always enabled.

There may be a better syntax for how to define these conditions, especially considering possible future additions (see below).

Possible Future Extension

  • Support combinations AND, OR
  • Support comparative conditions like <, >=, !=
@parse-github-assistant
Copy link

parse-github-assistant bot commented Jun 28, 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:$50 Bounty applies for fixing this issue (Parse Bounty Program) labels Jun 28, 2023
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0-alpha.8

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

🎉 This change has been released in version 6.0.0-beta.2

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Oct 7, 2024
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$50 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
2 participants