-
Notifications
You must be signed in to change notification settings - Fork 42
MMT-2346: Notify user of potential data loss when attempting to edit a non-UMM collection #625
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
Conversation
ChristianTrummer99
commented
Aug 12, 2020
- Added extra logic to the collections show.html.erb page that pops up the loss_report_modal
- created _loss_report_modal.html.erb that offers users the option to view a loss report before editing a non-UMM collection
- because the _not_current_provider_modal.html.erb will be displayed if a user tries to edit a collection that requires a provider context that is not present, coffeescript was added to change_current_provider.coffee
- wrote tests to ensure the modals display correctly
…ollections controller
…every value in a hash
b3e4706 to
365a903
Compare
| <% end %> | ||
|
|
||
| <%= link_to 'Cancel', 'javascript:void(0);', class: 'eui-btn modal-close' %> | ||
| <%= link_to 'Invisible Link', '#not-current-provider-modal', class: 'display-modal not-current-provider is-invisible', id: 'loss-report-to-edit-collection', data: { provider: options[:provider_id], record_action: 'edit-collection' } %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this invisible link necessary? Could you add all this information to the Edit link directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There were 2 things I considered when I was making this invisible link
- closing one modal (the
loss-report-modal) then opening another (thenot-current-provider-modal) requires coffeescript so unfortunately I can just link directly to the next modal. There has to be a "close modal" action and then an "open modal" action in between. On top of that, thenot-current-provider-modalis a complex modal to open (reference change_current_provider.coffee) - That being said, the
not-current-provider-modaldoes a bit of event handling on its own, so I decided against copying all the code that is used to produce thenot-current-provider-modaland pasting it into the handler that handles clicks on theloss-reportclass. From what I could tell the next easiest option was to have a hidden link (similar to the _not_current_provider_modal.html.erb partial)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also simply adding the classes from 'invisible link' to the Edit link unfortunately doesn't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stand corrected, I did not properly add the classes from the invisible link to the Edit link. Thank you both for this suggestion
|
Thank you both for helping me clean up the modal close/open action. If you have any suggestions for the css let me know. I think I implemented 80% of the things Charles and I talked about for the css. I couldn't figure out how to make a true |
* MMT-2311: Add endpoint for CMR translation to CMR client (#613) * MMT-2231 Add revisions page to published UMM-T page (#610) * MMT-2231 Adding revisions page to Tool Records * MMT-2231 updating display_header_subtitle to work with drafts again * MMT-2311: Added a translate_collections.rake file and added nokogiri/diff to the gemfile * MMT-2288 Update jquery version that is being package for the preview gem (#611) * MMT-2288 updated version for preview gem * MMT-2288 updating preview gem commit ref. * MMT-2230 (#608) * added display parameter to rake task * MMT-2229 Adding delete for published tools * MMT-2311: Added a translate_collections.rake file and added nokogiri/diff to the gemfile * MMT-2311: added display parameter to rake task * MMT-2229 Updating not current provider modal * MMT-2229 Fixing the tool_permissions_spec * Fixing spacing for tools_permissions_spec.rb * MMT-2234 (#607) adding download json for tools * Hotfix/MMT-2231-1 Updating revisions helpers to sort by revision date (#615) * MMT-2231 updated revisions testing * MMT-2231 updating collection sorting and tests * Delete package-lock.json * MMT-2311: made changes as per PR change requests * MMT-2311: made changes per PR requests, added package-lock to gitignore * MMT-2229 Modifying delete_tool_spec due to comments and fixing tool_premissions_spec because of CMR-6332 * MMT-2229 Removing unneeded delete * MMT-2229 Removing unneeded native_id_3 * MMT-2311: added comments to each method definition * MMT-2311: Added nokogiri array-path-parsing feature; removed unused functions from rake task * MMT-2311: made changes according to change requests * MMT-2311: more changes as per PR change requests * MMT-2311: added comment * MMT-2232/2233 Revision viewing and reversion for tools (#617) * MMT-2232 MMT-2233 adding view, revert, and reinstate for tools * MMT-2232 updating a test that is causing intermittent failures. * MMT-2232 removing erroneous comment in test * MMT-2232 fixing response body in altered subscription test * MMT-2232 flipping feature toggles for UMM-T in UAT and prod * MMT-2232 Replacing 'Service' with 'Tool' in tests. * MMT-2232 updating test to clean up correctly * MMT-2232 VCRing the subscription failed delete test * MMT-2311: made changes according to PR change requests * MMT-2311: more changes per PR change requests * Hotfix/MMT-2232-1 Fixing tests bamboo started failing (#619) * MMT-2232 fixing some tests that bamboo started failing. * MMT-2232 adding comment to add_data_center_with_retry * MMT-2311: fixed dif10 asterisk issues * MMT-2311: Adjusted removal of namespaces Co-authored-by: ryanmiller-1 <40173609+ryanmiller-1@users.noreply.github.com> Co-authored-by: Christian Trummer <ctrummer@mbp-ctrummer.edn.ecs.nasa.gov> Co-authored-by: William Valencia <william.m.valencia@nasa.gov> Co-authored-by: Ryan Miller <ryan.miller-1@nasa.gov> Co-authored-by: william-valencia <51178394+william-valencia@users.noreply.github.com> * hotfix/MMT-2311-1 (#622) Updated methods to be congruent with those in MMT-2313. * MMT-2313: Make crude lossiness report available in web browser from MMT (#621) * MMT-2231 Add revisions page to published UMM-T page (#610) * MMT-2231 Adding revisions page to Tool Records * MMT-2231 updating display_header_subtitle to work with drafts again * MMT-2288 Update jquery version that is being package for the preview gem (#611) * MMT-2288 updated version for preview gem * MMT-2288 updating preview gem commit ref. * MMT-2230 (#608) * MMT-2229 Adding delete for published tools * MMT-2313: Added loss reporting route, added a display action to the collections controller * MMT-2229 Updating not current provider modal * MMT-2229 Fixing the tool_permissions_spec * Fixing spacing for tools_permissions_spec.rb * MMT-2234 (#607) adding download json for tools * Hotfix/MMT-2231-1 Updating revisions helpers to sort by revision date (#615) * MMT-2231 updated revisions testing * MMT-2231 updating collection sorting and tests * MMT-2313: added nokogiri/diff to gemfile, added hidden url endpoint for loss report * MMT-2313: added loss reporting for arrays * MMT-2313: Added comment to collections_controller * MMT-2229 Modifying delete_tool_spec due to comments and fixing tool_premissions_spec because of CMR-6332 * MMT-2229 Removing unneeded delete * MMT-2229 Removing unneeded native_id_3 * MMT-2313: made changes as per MMT-2311-1 PR change requests * MMT-2313: Updated comparison logic to use nokogiri for array paths * MMT-2313: removed some comments and test code * MMT-2313: Added custom function for hash mapping, finds the path for every value in a hash * MMT-2313: adjusted whitespace * MMT-2232/2233 Revision viewing and reversion for tools (#617) * MMT-2232 MMT-2233 adding view, revert, and reinstate for tools * MMT-2232 updating a test that is causing intermittent failures. * MMT-2232 removing erroneous comment in test * MMT-2232 fixing response body in altered subscription test * MMT-2232 flipping feature toggles for UMM-T in UAT and prod * MMT-2232 Replacing 'Service' with 'Tool' in tests. * MMT-2232 updating test to clean up correctly * MMT-2232 VCRing the subscription failed delete test * MMT-2313: added some comments * MMT-2313: increased readability of loss_report_output * MMT-2313: improved readability * Hotfix/MMT-2232-1 Fixing tests bamboo started failing (#619) * MMT-2232 fixing some tests that bamboo started failing. * MMT-2232 adding comment to add_data_center_with_retry * MMT-2313: attempting to fix asterisk problem * MMT-2313 attempting to fix asterisk problem * MMT-2306 Update FBM link for dMMT (#618) * MMT-2306 updating footer * MMT-2306 build without byebug * MMT-2313: fix nokogiri problems * MMT-2313: cleaned up inefficiencies, fixed bugs * MMT-2313: fixed bugs, improved accuracy * MMT-2313: added some test code to be removed later * MMT-2313: Added some exception handling * MMT-2313: created specs and stored some sample reports * MMT-2313: moved loss_report_samples_helper.rb and added it to the rails_helper.rb * MMT-2313: made changes per PR change requests * MMT-2313: removed unneeded comment * MMT-2313: removed an unecessary cmr call * MMT-2313: made changes per PR change requests. Also removed loss_report_helper_spec.rb and loss_report_samples_helper.rb * MMT-2313: fixed fixture file paths * MMT-2313: removed unncessary ternary operator * MMT-2313: made more PR change requests * MMT-2313: adjusted keyword arguments and a variable definition * MMT-2350 adding a wait for indexing after deleting a provider in reset_provider (#623) * MMT-2313: changed use of hide_items parameter * MMT-2313: made :display non-default * MMT-2313: completed change requests * MMT-2313: adjusted spec to be more universal Co-authored-by: ryanmiller-1 <40173609+ryanmiller-1@users.noreply.github.com> Co-authored-by: William Valencia <william.m.valencia@nasa.gov> Co-authored-by: Christian Trummer <ctrummer@mbp-ctrummer.edn.ecs.nasa.gov> Co-authored-by: Ryan Miller <ryan.miller-1@nasa.gov> Co-authored-by: william-valencia <51178394+william-valencia@users.noreply.github.com> * MMT-2346: Notify user of potential data loss when attempting to edit a non-UMM collection (#625) * MMT-2313: Added loss reporting route, added a display action to the collections controller * MMT-2313: added nokogiri/diff to gemfile, added hidden url endpoint for loss report * MMT-2313: added loss reporting for arrays * MMT-2313: Added comment to collections_controller * MMT-2313: made changes as per MMT-2311-1 PR change requests * MMT-2313: Updated comparison logic to use nokogiri for array paths * MMT-2313: removed some comments and test code * MMT-2313: Added custom function for hash mapping, finds the path for every value in a hash * MMT-2313: adjusted whitespace * MMT-2313: added some comments * MMT-2313: increased readability of loss_report_output * MMT-2313: improved readability * MMT-2313: attempting to fix asterisk problem * MMT-2313 attempting to fix asterisk problem * MMT-2313: fix nokogiri problems * MMT-2313: cleaned up inefficiencies, fixed bugs * MMT-2313: fixed bugs, improved accuracy * MMT-2313: added some test code to be removed later * MMT-2313: Added some exception handling * MMT-2313: created specs and stored some sample reports * MMT-2313: moved loss_report_samples_helper.rb and added it to the rails_helper.rb * MMT-2313: made changes per PR change requests * MMT-2313: removed unneeded comment * MMT-2313: removed an unecessary cmr call * MMT-2346: added loss-report modal * MMT-2346: loss reporting - link and modal options * MMT-2346: MVP modal access to loss report * MMT-2346: completed modal specs * MMT-2346: adjusted modal styling * MMT-2346: fixed another conflict * MMT-2346: adjusted some styling * MMT-2346: adjusted specs and styling * MMT-2346: Fixed affected specs * MMT-2346: completed PR change requests * MMT-2346: remove LARC from available context * MMT-2346: made specs more readable, improved styling of loss-report-modal * MMT-2346: adjusted modal Edit button and coffee script * MMT-2346: updated spec to match change requests Co-authored-by: Christian Trummer <ctrummer@mbp-ctrummer.edn.ecs.nasa.gov> * MMT-2388: added loss-report toggle for all non-prod envs; added tests * MMT-2388: added toggle to prod env - default false * MMT-2288: minor change to conditional * feature/MMT-2326: change requests * MMT-2326: change requests Co-authored-by: ryanmiller-1 <40173609+ryanmiller-1@users.noreply.github.com> Co-authored-by: Christian Trummer <ctrummer@mbp-ctrummer.edn.ecs.nasa.gov> Co-authored-by: William Valencia <william.m.valencia@nasa.gov> Co-authored-by: Ryan Miller <ryan.miller-1@nasa.gov> Co-authored-by: william-valencia <51178394+william-valencia@users.noreply.github.com>