parse-dashboard
parse-dashboard copied to clipboard
feat: Add ability to select script field
New Pull Request Checklist
- [x] I am not disclosing a vulnerability.
- [x] I am creating this PR in reference to an issue.
Issue Description
Currently, scripts show on all fields, and every single value.
Closes: #2487 Closes: #2485
Approach
Adds the following script syntax:
"scripts": [
{
"title": "Delete account",
"classes": [
{
"name": "_User",
"fields": [{ "name": "createdAt", "validator": "value => value > new Date(\"2025\")" }]
}
],
"cloudCodeFunction": "deleteAccount"
}
]
If using this syntax, the script will only show on a field defined in fields, and it will be disabled if the validator returns false.
TODOs before merging
- [ ] Add changes to documentation (guides, repository pages, in-code descriptions)
I will reformat the title to use the proper commit message syntax.
Thanks for opening this pull request!
- 🎉 We are excited about your hands-on contribution!
Uffizzi Ephemeral Environment deployment-29709
:watch: Updated Jun 29, 2023, 05:42 UTC
:cloud: https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2488
:page_facing_up: View Application Logs etc.
What is Uffizzi? Learn more
Wow, impressive PR!
The two referenced issues are not necessarily related. One could enable a script only on fieldA if fieldB has a specific value. Would that be possible?
Updated the syntax so the full Parse Object is passed through:
"validator": (row, field) => row.get(field) > new Date("2025")
Btw could you see whether the prettier hook works for you? I've added husky to the repo, but not sure whether the git hook is actually working for existing clones of the repo.
Didn't seem to run for me, perhaps my branch is outdated
Maybe hooks don't get committed? If I add a hook at least I don't see anything to commit. Anyway, was just a side node.
@dblythy Could your take a look at the open questions? This seems almost ready to get merged.
Uffizzi Ephemeral Environment deployment-47529
:watch: Updated Feb 29, 2024, 13:39 UTC
:cloud: https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2488
:page_facing_up: View Application Logs etc.
What is Uffizzi? Learn more
🎉 This change has been released in version 6.0.0-alpha.8