Skip to content
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

Edit exception message when editing certain fields of a catalogue item with children #418

Conversation

rowan04
Copy link
Member

@rowan04 rowan04 commented Nov 13, 2024

Description

Edit the returned exception message to make it clearer when trying to update protected fields on a catalogue item or catalogue category that has a child element.

Testing instructions

Add a set up instructions describing how the reviewer should test the code

  • Review code
  • Check Actions build
  • Review changes to test coverage
  • {more steps here}

Agile board tracking

Resolves #353

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.87%. Comparing base (e5f2e8c) to head (3cdae51).
Report is 6 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #418   +/-   ##
========================================
  Coverage    97.87%   97.87%           
========================================
  Files           41       41           
  Lines         1504     1504           
========================================
  Hits          1472     1472           
  Misses          32       32           

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


🚨 Try these New Features:

@rowan04 rowan04 marked this pull request as ready for review November 14, 2024 10:14
@joelvdavies joelvdavies self-requested a review November 18, 2024 12:21
Copy link
Collaborator

@joelvdavies joelvdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment could you perhaps list the fields from CATALOGUE_ITEM_WITH_CHILD_NON_EDITABLE_FIELDS so it's kept up to date with changes. Also I just noticed we also have exactly the same sort of error message for the catalogue category edit could you update these as well so they are consistent.

The front end may need a change to be more user friendly
image

@rowan04 rowan04 requested a review from joelvdavies November 20, 2024 11:04
@rowan04
Copy link
Member Author

rowan04 commented Nov 20, 2024

The linter check is failing, but I'm pretty sure all the lines I added are under 120. So is this failing because of previously written lines in the files I edited?

@joelvdavies
Copy link
Collaborator

joelvdavies commented Nov 20, 2024

The linter check is failing, but I'm pretty sure all the lines I added are under 120. So is this failing because of previously written lines in the files I edited?

Could be that your local version of black needs updating or vscode isn't autoformatting correctly. You can use python3.12 -m black --line-length 120 . to run it locally. To update your version of black in the venv use python3.12 -m pip install -e .[dev] again. If you haven't already setup formatting on vscode I can give you the settings I use.

@rowan04
Copy link
Member Author

rowan04 commented Nov 20, 2024

The linter check is failing, but I'm pretty sure all the lines I added are under 120. So is this failing because of previously written lines in the files I edited?

Could be that your local version of black needs updating or vscode isn't autoformatting correctly. You can use python3.12 -m black --line-length 120 . to run it locally. To update your version of black in the venv use python3.12 -m pip install -e .[dev] again. If you haven't already setup formatting on vscode I can give you the settings I use.

image

Copy link
Collaborator

@joelvdavies joelvdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I added a corresponding front end issue here ral-facilities/inventory-management-system#1136.

@rowan04 rowan04 merged commit c2707d1 into develop Nov 21, 2024
8 checks passed
@rowan04 rowan04 deleted the reword-message-when-editing-catalogue-item-fields-with-children-#353 branch November 21, 2024 15:54
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.

Message when attempting to edit catalogue item fields with children is misleading
2 participants