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

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

Open
3 tasks done
mtrezza opened this issue Jun 28, 2023 · 1 comment · May be fixed by #2488
Open
3 tasks done

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

mtrezza opened this issue Jun 28, 2023 · 1 comment · May be fixed by #2488
Labels
bounty:$50 Bounty applies for fixing this issue (Parse Bounty Program) 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
@dblythy dblythy linked a pull request Jun 29, 2023 that will close this issue
3 tasks
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) type:feature New feature or improvement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant