feat: delete tag#3035
Conversation
|
Thanks for the pull request, @mgwozdz-unicon! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
3c66441 to
f2c0f45
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3035 +/- ##
==========================================
+ Coverage 95.47% 95.50% +0.02%
==========================================
Files 1386 1394 +8
Lines 32665 32967 +302
Branches 7483 7569 +86
==========================================
+ Hits 31188 31484 +296
- Misses 1408 1414 +6
Partials 69 69 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
brian-smith-tcril
left a comment
There was a problem hiding this comment.
Thank you for this!
| draftError: string | undefined; | ||
| isError: boolean | undefined; | ||
| isUpdateError: boolean | undefined; | ||
| isDeleteError?: boolean; |
| // Only request recursive deletion when the frontend has loaded descendants. | ||
| // If this state is stale and the backend finds subtags while with_subtags is false, | ||
| // the backend rejects the request instead of deleting the parent alone. |
There was a problem hiding this comment.
This improved comment resolves #3025 (comment)
Thank you!
| await deleteTagMutation.mutateAsync({ value: rowData.value, withSubtags: shouldDeleteSubtags }); | ||
| // In view mode, the table reloads on change, reflecting the deletion | ||
| // without needing to manually update the table state | ||
| enterViewMode(); |
There was a problem hiding this comment.
This reordering along with the deleteTagMutation.isPending guard in TagListTable resolves #3025 (comment)
Thank you!
08fca79 to
2ebe17a
Compare
Description
This is part of openedx/modular-learning#260 - a split-out so that it's smaller PRs to review.
The intention is to implement the actual deletion logic here, but not implement the Delete Modal yet.
The Delete Modal is replaced by a simple browser confirm for now, the PR to implement that is #3024.
To deliver the Delete functionality cleanly, I have included quite a bit of refactoring, which includes adding a React context.
Both PRs are designed to be independent, mergable in any order.
Important
After merging the other PR, the browser confirm should be replaced with its
<DeleteModal>.Note to reviewer
If there's missing test coverage, please allow me to delay addressing that until it the PR undergone a first review.
Testing instructions
Please see AC of the related ticket for exact behavior to test: openedx/modular-learning#260.
But: note that anything related to the delete modal is in the sister PR.
Use of AI
Best Practices Checklist
We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:
.ts,.tsx).propTypesanddefaultPropsin any new or modified code.src/testUtils.tsx(specificallyinitializeMocks)apiHooks.tsin this repo for examples.messages.tsfiles have adescriptionfor translators to use.../in import paths. To import from parent folders, use@src, e.g.import { initializeMocks } from '@src/testUtils';instead offrom '../../../../testUtils'