nasa / mmt

NASA's Metadata Management Tool.
Apache License 2.0
87 stars 36 forks source link

MMT-3915: Fixed when a user tries to publish a draft and is unsuccessful, there is no error message displayed #1308

Closed cgokey closed 1 month ago

cgokey commented 1 month ago

Overview

What is the feature?

There was an influx of users trying to publish drafts to CMR, when they clicked published there was no indication of whether or not the published work. In the cases mentioned, CMR failed to push and the user had no idea. We should capture any errors during publish and present any errors if there are problems.

What is the Solution?

The hook provides errors, so I added a useEffect to capture any changes and now presenting them to the user.

What areas of the application does this impact?

Publishing a draft.

Testing

This is easier to test before GQL-75 gets merged, as there are a number of records that won't publish due to the native id including special characters. So you should be able to ingest a record where the native id has '/' in it and try publishing with MMT, it should not work and now MMT will show an error to the UI.

Checklist

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.66%. Comparing base (86b5bf0) to head (4d16e78). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1308 +/- ## ======================================= Coverage 97.66% 97.66% ======================================= Files 362 362 Lines 5601 5613 +12 Branches 1166 1180 +14 ======================================= + Hits 5470 5482 +12 Misses 130 130 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.