mantidproject / mantid

Main repository for Mantid code
https://www.mantidproject.org
GNU General Public License v3.0
210 stars 122 forks source link

Fix Issue 37040: Dragging text onto plot not handled well #37524

Closed yusufjimoh closed 3 months ago

yusufjimoh commented 3 months ago

Description of work

Dragging text onto the plot throws a KeyError.

Summary of work

Introduced error handling to gracefully handle the KeyError when dragging text onto the plot. Displays a warning to the user for invalid workspaces.

Fixes: https://github.com/mantidproject/mantid/issues/37040

To test:

  1. Create a plot
  2. Drag some text onto the plot
  3. A warning is displayed to the user in the message box

Reviewer

Please comment on the points listed below (full description). Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.

Code Review

Functional Tests

Does everything look good? Mark the review as Approve. A member of @mantidproject/gatekeepers will take care of it.

Gatekeeper

If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.

jhaigh0 commented 3 months ago

For commits like this https://github.com/mantidproject/mantid/pull/37524/commits/90b2f30924b5a61459498f4b5dcbe659fda25fe6 you are better off doing git commit --amend --no-edit which will just add the changes to your previous commit, remove he --no-edit if you want to change the commit name. If you have already pushed the changes, you'll have to do git push -f since you're changing the history

yusufjimoh commented 3 months ago

This will be very useful, I will add that to my git toolbox.

yusufjimoh commented 3 months ago

The latest commit contains the suggested necessary changes