parse-dashboard icon indicating copy to clipboard operation
parse-dashboard copied to clipboard

feat: Add ability to select script field

Open dblythy opened this issue 2 years ago • 10 comments

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)

dblythy avatar Jun 29 '23 05:06 dblythy

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

uffizzi-cloud[bot] avatar Jun 29 '23 05:06 uffizzi-cloud[bot]

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?

mtrezza avatar Jun 29 '23 11:06 mtrezza

Updated the syntax so the full Parse Object is passed through:

"validator": (row, field) => row.get(field) > new Date("2025")

dblythy avatar Jun 30 '23 03:06 dblythy

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.

mtrezza avatar Jul 05 '23 07:07 mtrezza

Didn't seem to run for me, perhaps my branch is outdated

dblythy avatar Jul 18 '23 00:07 dblythy

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.

mtrezza avatar Jul 18 '23 00:07 mtrezza

@dblythy Could your take a look at the open questions? This seems almost ready to get merged.

mtrezza avatar Aug 27 '23 22:08 mtrezza

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

uffizzi-cloud[bot] avatar Feb 29 '24 13:02 uffizzi-cloud[bot]

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

parseplatformorg avatar Jun 27 '24 23:06 parseplatformorg