Skip to content

Conversation

@cgokey
Copy link
Collaborator

@cgokey cgokey commented Sep 30, 2025

Overview

What is the feature?

Couple issues on this one:

  1. The collections permissions form is not surfacing errors from cmr graphql. \
  2. If there are errors in the form, the submit button should be disabled.
  3. If you go to an ACL that doesn't exist, it should provide a proper error message (not found or something), right now it gives a destructure error.

What is the Solution?

For #1, wrote a helper method that will extract any errors it finds from the graphql response and surface them.
For #2, added a check if the form is valid, if not don't enable the submit button.
For #3, If you go to a ACL that doesn't exist, now shows a toast message and redirects you back to the permissions page.

What areas of the application does this impact?

Collection Permissions Page

Testing

For #1, try adding a start/stop date but don't choose a mask. The graphql error should properly surface now.
For #2, try not filling in a Name field, the submit button should not enable.
For #2, try hitting permission endpoint with /permissions/ACL-BAD or /permissions/ACL-BAD/edit should surface concept not found.

Attachments

Please include relevant screenshots or files that would be helpful in reviewing and verifying this change.

Checklist

  • I have added automated tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

@codecov-commenter
Copy link

codecov-commenter commented Sep 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.12%. Comparing base (c7d9ddc) to head (9a1bea9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1413      +/-   ##
==========================================
- Coverage   98.12%   98.12%   -0.01%     
==========================================
  Files         421      422       +1     
  Lines        6779     6810      +31     
  Branches     1429     1448      +19     
==========================================
+ Hits         6652     6682      +30     
- Misses        126      127       +1     
  Partials        1        1              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@cgokey cgokey merged commit 7dac8aa into main Oct 2, 2025
7 checks passed
@cgokey cgokey deleted the MMT-4086 branch October 2, 2025 19:27
@eudoroolivares2016 eudoroolivares2016 changed the title MMT collections permission form should surface errors properly MMT-4086: MMT collections permission form should surface errors properly Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants