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

Delete a catalogue item #8 #77

Merged
merged 14 commits into from
Oct 20, 2023
Merged

Conversation

joshuadkitenge
Copy link
Collaborator

@joshuadkitenge joshuadkitenge commented Sep 22, 2023

Description

A user should be able to delete a catalogue item using bin icon on the respective row.

Testing instructions

  • Test that it deletes successfully and renders correct after deletion

  • Review code

  • Check Actions build

  • Review changes to test coverage

  • {more steps here}

Agile board tracking

closes #8

@joshuadkitenge joshuadkitenge changed the base branch from develop to landing-pages-catelogue-items-#69 September 22, 2023 13:14
@codecov
Copy link

codecov bot commented Sep 22, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (fc1464e) 87.73% compared to head (2b16406) 87.74%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop      #77   +/-   ##
========================================
  Coverage    87.73%   87.74%           
========================================
  Files           28       29    +1     
  Lines         1019     1093   +74     
  Branches       290      305   +15     
========================================
+ Hits           894      959   +65     
- Misses         124      133    +9     
  Partials         1        1           
Files Coverage Δ
...ogue/items/catalogueItemsLandingPage.component.tsx 100.00% <100.00%> (ø)
.../catalogue/items/catalogueItemsTable.component.tsx 95.45% <100.00%> (+0.71%) ⬆️
...ogue/items/deleteCatalogueItemDialog.component.tsx 100.00% <100.00%> (ø)
src/api/catalogueItem.tsx 88.73% <94.44%> (+1.93%) ⬆️
src/mocks/handlers.ts 95.50% <92.30%> (+1.83%) ⬆️
src/index.tsx 0.00% <0.00%> (ø)

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

…gue-item-#8

* landing-pages-catelogue-items-#69:
  add manufacturer details to the landing page #69
  fix e2e test
  add error checking for URL
  add manufacturer details in the view catalogue items #66
  manufacturer details in the add catalogue item
  add e2e test for edit catalogue category from a leaf node to a non - leaf
  add better checking for catalogue properties and invalidate queries for the catalogueCategory list and getById (patch and post queries) #38
  Fix loading screen issue on firefox
…gue-item-#8

* landing-pages-catelogue-items-#69:
  Update cypress/e2e/catalogue/catalogueCategory.cy.ts
  fix linting
  fix linting
  remove redundant code
  remove redundant test
  refactor properties
  remove duplicate code and add improve coverage
…gue-item-#8

* landing-pages-catelogue-items-#69:
  revert logic
…gue-item-#8

* landing-pages-catelogue-items-#69:
  Update dependency @types/node to v18
  fix unit test
  stop getById triggering when catalogue category is deleted
  refactor if statement for boolean values
  address review comments
  Update tanstack-query monorepo to v4.35.7
  Update dependency axios to v1.5.1
  address review comments
  Update actions/cache digest to 704facf
  Update actions/upload-artifact action to v3
  Update actions/setup-node action to v3
  Update dependency eslint-plugin-prettier to v5
  Update dependency @types/jest to v29
  Update codecov/codecov-action action to v3
  Update dependency eslint-config-prettier to v8.9.0
  Update dependency @testing-library/jest-dom to v5.17.0
Base automatically changed from landing-pages-catelogue-items-#69 to develop October 11, 2023 16:11
@joshuadkitenge joshuadkitenge marked this pull request as ready for review October 17, 2023 10:10
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.

Just two minor suggestions. Obviously waiting on ral-facilities/inventory-management-system-api#81 as well.

src/api/catalogueItem.tsx Show resolved Hide resolved
src/catalogue/items/catalogueItemsTable.component.test.tsx Outdated Show resolved Hide resolved
joelvdavies
joelvdavies previously approved these changes Oct 18, 2023
@VKTB
Copy link
Collaborator

VKTB commented Oct 19, 2023

Just for reference, I get Uncaught runtime errors: Response constructor: Response body is given with a null body status. when deleting a catalogue item. The catalogue item does get deleted. Let me know when this is fixed and I will test again.

@joelvdavies
Copy link
Collaborator

Could we modify the logic of the fix so msw runs when process.env.REACT_APP_E2E_TESTING as well regardless of the apiUrl? Right now I have to modify my config before running the tests or they will fail.

@joshuadkitenge joshuadkitenge merged commit 775ddc3 into develop Oct 20, 2023
3 checks passed
@joshuadkitenge joshuadkitenge deleted the delete-a-catalogue-item-#8 branch October 20, 2023 10:41
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.

As an admin, I want to be able to delete catalogue items
3 participants