-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ CoreData Entities ] add support for delete operations (#21557)
* reset, delete nav menu items there is a missing state preservation when menus are changed on the menus editor component * fixing a bad merge * no invalidateCache and refactored according to review * revert change to getMergedItemIds * refactor according to self review * deletes query items, adds tests for new entity methods also adds changelog * refactored for properly deleteing entity ids from querries * updates tests * moved the REMOVE_ITEMS reducer to receive all query keys props @aduth * removes the need to send query on delete * updates some comments also removes cruft from a test * refactoring according to review - removes superfluous actions from deleteEntityRecords - treats invalidateCache properly - attempts to make lookups faster for items when removing querries * do not clear cache on delete * fixes test after reming superfluous actions from deleteEntityRecord * makes a proper POJO for removing items from queries and invalidates the cache after items are removed * fix changelog and add deleteQueryParams to deleteRecord * fixes test * Rename deleteQueryParams to query for consistency * Use the new deleteEntityRecord to delete menus (#22428) * adds delete menu with entity delete * updates the delete and removes the stateMenus * passes the new force query param * fix bug with resetting current menu after delete * fixes query param's type for consistency * comment linting, removed useless catch logic for deleteEntityRecord, removed useless string conversion * try implement error handling for delete * fixed the intentional typo and the unintentional one * updates and fixes according to review * rename remove items' action id collection * makes notices unique in menu editor * Update packages/core-data/src/queried-data/actions.js Co-authored-by: Enrique Piqueras <epiqueras@users.noreply.github.com> * fixes bugs introduced by renaming items to itemsIds in the remove items action also improves tests and made sure the notifications always have unique ids * lint * moves noticeId creation inside effect * updated according to review - test delete for final shape when generator is done - simplify filter removing items from query * lint Co-authored-by: Enrique Piqueras <epiqueras@users.noreply.github.com>
- Loading branch information
1 parent
83abb17
commit b67cd9a
Showing
15 changed files
with
408 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { removeItems } from '../actions'; | ||
|
||
describe( 'removeItems', () => { | ||
it( 'builds an action object', () => { | ||
const postIds = [ 1, 2, 3 ]; | ||
expect( removeItems( 'postType', 'post', postIds ) ).toEqual( { | ||
type: 'REMOVE_ITEMS', | ||
itemIds: postIds, | ||
kind: 'postType', | ||
name: 'post', | ||
invalidateCache: false, | ||
} ); | ||
} ); | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.