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

feat(app-trash-bin): add trash bin to app-headless-cms #4059

Merged
merged 76 commits into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
889697f
refactor: delete method - add destroy method (ddb only)
leopuleo Mar 3, 2024
9d88a0d
refactor: change delete topics to accept permanent flag
leopuleo Mar 4, 2024
f7180f8
fix: create and update metadata
leopuleo Mar 4, 2024
84e79d7
refactor: delete method - add destroy method (ddb-es only)
leopuleo Mar 4, 2024
b666de2
test: add new fields to tests
leopuleo Mar 4, 2024
dbdd4a3
Merge branch 'leo/feat/hcms-bin' into leo/feat/api-soft-delete
leopuleo Mar 4, 2024
0acd364
chore: merge next branch
leopuleo Mar 4, 2024
c1995de
fix: make deleted flag optional for storage operations
leopuleo Mar 4, 2024
857c8f5
test: fix system and model fields
leopuleo Mar 4, 2024
c29116e
fix: pass storageEntry to storage operations
leopuleo Mar 5, 2024
e7688ec
feat: make permanent deletion default behaviour
leopuleo Mar 5, 2024
e35bfc0
refactor: add dataLoaders method helpers
leopuleo Mar 5, 2024
006241e
test: add soft delete test
leopuleo Mar 5, 2024
f1fd2d7
chore: resolve eslint issues
leopuleo Mar 5, 2024
d7817e5
fix: add deleted as default field
leopuleo Mar 6, 2024
79402f6
fix: es not operator
leopuleo Mar 7, 2024
7189f81
test: change ES not equal tests
leopuleo Mar 7, 2024
efd71f6
chore: remove deleted flags from get queries
leopuleo Mar 7, 2024
11935d5
chore: remove deleted flags from get queries
leopuleo Mar 7, 2024
7f50f91
test: add soft delete scenario
leopuleo Mar 7, 2024
b8a2f96
test: fix deleted metadata
leopuleo Mar 7, 2024
a10ecfc
test: add delete entry test suite
leopuleo Mar 8, 2024
0d8e333
refactor: organize code in useCases
leopuleo Mar 12, 2024
85344a1
test: test mutation after move to bin
leopuleo Mar 12, 2024
14503be
test: fix flp tests
leopuleo Mar 12, 2024
58b3770
test: use toMatchObject instead of objectContaining
leopuleo Mar 12, 2024
d287828
Merge branch 'leo/feat/hcms-bin' into leo/feat/api-soft-delete
leopuleo Mar 12, 2024
8bc51fe
wip: bootstrap app-bin
leopuleo Mar 14, 2024
24d04eb
wip: add permatently delete flag
leopuleo Mar 14, 2024
5025276
wip: add trash bin renderer
leopuleo Mar 18, 2024
82f6e36
wip: change move to trash labels
leopuleo Mar 18, 2024
951f7da
wip: add loading
leopuleo Mar 19, 2024
dc93d8b
wip: add meta and loading bar
leopuleo Mar 19, 2024
0ed0f72
wip: add empty view state
leopuleo Mar 19, 2024
e4c59fe
wip: reorganise files
leopuleo Mar 19, 2024
eb2c1bf
wip: reorganise files
leopuleo Mar 19, 2024
f75a87c
wip: reorganise controllers
leopuleo Mar 19, 2024
a2fc656
wip: reorganise presenter
leopuleo Mar 20, 2024
687cd23
wip: rename entry to item
leopuleo Mar 20, 2024
515f0ff
wip: re-organize dependencies
leopuleo Mar 20, 2024
b1e57b6
wip: create separated selected repo
leopuleo Mar 20, 2024
96688b7
wip: change meta on item deletion
leopuleo Mar 20, 2024
1e1065d
wip: add search
leopuleo Mar 20, 2024
c601370
wip: add bin button
leopuleo Mar 21, 2024
3016f9b
wip: handle loading
leopuleo Mar 21, 2024
197d249
wip: add tests
leopuleo Mar 21, 2024
1593ba6
wip: add useCases
leopuleo Mar 22, 2024
630b910
wip: change loading enum
leopuleo Mar 22, 2024
9e6255b
wip: dependency organisation
leopuleo Mar 22, 2024
182d736
chore: remove custom sorting plugin
leopuleo Mar 25, 2024
80172e3
chore: merge next
leopuleo Mar 25, 2024
7fc0afe
chore: remove wrong folder name
leopuleo Mar 25, 2024
c7fda55
chore: manage deps
leopuleo Mar 25, 2024
19c8124
chore: pass controller instead of usecase
leopuleo Mar 25, 2024
aa81329
test: add tests
leopuleo Mar 25, 2024
fd445ff
refactor: remove init
leopuleo Mar 25, 2024
0ce9d11
chore: fix eslint
leopuleo Mar 25, 2024
5501ae1
feat: add default sort with react properties
leopuleo Mar 26, 2024
820a1ab
refactor: reorganise file structure
leopuleo Mar 26, 2024
4445345
refactor: reorganise file structure
leopuleo Mar 26, 2024
e8d5969
refactor: reorganise useTrashBin
leopuleo Mar 26, 2024
758d10c
fix: adio issue
leopuleo Mar 26, 2024
3c8ec28
fix: remove trash bin in case of no delete permissions
leopuleo Mar 27, 2024
0dc6b8b
Merge branch 'next' into leo/feat/admin-soft-delete
leopuleo Mar 27, 2024
e82261d
Merge branch 'next' into leo/feat/admin-soft-delete
leopuleo Mar 27, 2024
3040ddb
Merge branch 'next' into leo/feat/admin-soft-delete
leopuleo Mar 27, 2024
0034f4f
refactor: small UI text refactors
leopuleo Mar 28, 2024
65a5148
Merge remote-tracking branch 'origin/leo/feat/admin-soft-delete' into…
leopuleo Mar 28, 2024
4f33553
feat: add restore action / bulk action
leopuleo Mar 29, 2024
4ef7923
chore: remove console log
leopuleo Mar 29, 2024
c4befb1
feat: add bulk action location link
leopuleo Mar 29, 2024
0f9fe69
refactor: re-organize controllers and useCases
leopuleo Apr 9, 2024
749f59d
refactor: create useCases outside of Domain
leopuleo Apr 9, 2024
5359197
refactor: remove app-trash-bin-common
leopuleo Apr 9, 2024
945f23e
Merge branch 'next' into leo/feat/admin-soft-delete
leopuleo Apr 9, 2024
9603c8f
chore: fix deps
leopuleo Apr 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: create and update metadata
  • Loading branch information
leopuleo committed Mar 4, 2024
commit f7180f899b58ae2905d4bde9a940061f181731ea
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ export const createDeleteEntryData = async ({
/**
* Entry-level meta fields. 👇
*/
deletedOn: getDate(currentDateTime),
deletedBy: getIdentity(currentIdentity),
deletedOn: getDate(currentDateTime, null),
deletedBy: getIdentity(currentIdentity, null),

/**
* Revision-level meta fields. 👇
*/
revisionDeletedOn: getDate(currentDateTime),
revisionDeletedBy: getIdentity(currentIdentity)
revisionDeletedOn: getDate(currentDateTime, null),
revisionDeletedBy: getIdentity(currentIdentity, null)
};

return { entry };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,11 @@ export const createEntryData = async ({
createdOn: getDate(rawInput.createdOn, currentDateTime),
modifiedOn: getDate(rawInput.modifiedOn, null),
savedOn: getDate(rawInput.savedOn, currentDateTime),
deletedOn: getDate(rawInput.deletedOn, null),
createdBy: getIdentity(rawInput.createdBy, currentIdentity),
modifiedBy: getIdentity(rawInput.modifiedBy, null),
savedBy: getIdentity(rawInput.savedBy, currentIdentity),
deletedBy: getIdentity(rawInput.deletedBy, null),
...entryLevelPublishingMetaFields,

/**
Expand All @@ -156,9 +158,11 @@ export const createEntryData = async ({
revisionCreatedOn: getDate(rawInput.revisionCreatedOn, currentDateTime),
revisionModifiedOn: getDate(rawInput.revisionModifiedOn, null),
revisionSavedOn: getDate(rawInput.revisionSavedOn, currentDateTime),
revisionDeletedOn: getDate(rawInput.revisionDeletedOn, null),
revisionCreatedBy: getIdentity(rawInput.revisionCreatedBy, currentIdentity),
revisionModifiedBy: getIdentity(rawInput.revisionModifiedBy, null),
revisionSavedBy: getIdentity(rawInput.revisionSavedBy, currentIdentity),
revisionDeletedBy: getIdentity(rawInput.revisionDeletedBy, null),
...revisionLevelPublishingMetaFields,

version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const createUpdateEntryData = async ({
revisionCreatedOn: getDate(rawInput.revisionCreatedOn, originalEntry.revisionCreatedOn),
revisionModifiedOn: getDate(rawInput.revisionModifiedOn, currentDateTime),
revisionSavedOn: getDate(rawInput.revisionSavedOn, currentDateTime),
revisionDeletedOn: getDate(rawInput.revisionDeletedOn, null),
revisionFirstPublishedOn: getDate(
rawInput.revisionFirstPublishedOn,
originalEntry.revisionFirstPublishedOn
Expand All @@ -103,6 +104,7 @@ export const createUpdateEntryData = async ({
revisionCreatedBy: getIdentity(rawInput.revisionCreatedBy, originalEntry.revisionCreatedBy),
revisionModifiedBy: getIdentity(rawInput.revisionModifiedBy, currentIdentity),
revisionSavedBy: getIdentity(rawInput.revisionSavedBy, currentIdentity),
revisionDeletedBy: getIdentity(rawInput.revisionSavedBy, null),
revisionFirstPublishedBy: getIdentity(
rawInput.revisionFirstPublishedBy,
originalEntry.revisionFirstPublishedBy
Expand All @@ -120,11 +122,13 @@ export const createUpdateEntryData = async ({
createdOn: getDate(rawInput.createdOn, originalEntry.createdOn),
savedOn: getDate(rawInput.savedOn, currentDateTime),
modifiedOn: getDate(rawInput.modifiedOn, currentDateTime),
deletedOn: getDate(rawInput.deletedOn, null),
firstPublishedOn: getDate(rawInput.firstPublishedOn, originalEntry.firstPublishedOn),
lastPublishedOn: getDate(rawInput.lastPublishedOn, originalEntry.lastPublishedOn),
createdBy: getIdentity(rawInput.createdBy, originalEntry.createdBy),
savedBy: getIdentity(rawInput.savedBy, currentIdentity),
modifiedBy: getIdentity(rawInput.modifiedBy, currentIdentity),
deletedBy: getIdentity(rawInput.deletedBy, null),
firstPublishedBy: getIdentity(rawInput.firstPublishedBy, originalEntry.firstPublishedBy),
lastPublishedBy: getIdentity(rawInput.lastPublishedBy, originalEntry.lastPublishedBy),

Expand Down
9 changes: 8 additions & 1 deletion packages/api-headless-cms/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2292,9 +2292,10 @@ export interface CreateCmsEntryInput {
createdOn?: Date | string;
modifiedOn?: Date | string | null;
savedOn?: Date | string;
deletedOn?: Date | string | null;
createdBy?: CmsIdentity;
modifiedBy?: CmsIdentity | null;
savedBy?: CmsIdentity;
deletedBy?: CmsIdentity | null;
firstPublishedOn?: Date | string;
lastPublishedOn?: Date | string;
firstPublishedBy?: CmsIdentity;
Expand All @@ -2306,9 +2307,11 @@ export interface CreateCmsEntryInput {
revisionCreatedOn?: Date | string;
revisionModifiedOn?: Date | string | null;
revisionSavedOn?: Date | string;
revisionDeletedOn?: Date | string | null;
revisionCreatedBy?: CmsIdentity;
revisionModifiedBy?: CmsIdentity | null;
revisionSavedBy?: CmsIdentity;
revisionDeletedBy?: CmsIdentity | null;
revisionFirstPublishedOn?: Date | string;
revisionLastPublishedOn?: Date | string;
revisionFirstPublishedBy?: CmsIdentity;
Expand Down Expand Up @@ -2376,11 +2379,13 @@ export interface UpdateCmsEntryInput {
revisionCreatedOn?: Date | string | null;
revisionModifiedOn?: Date | string | null;
revisionSavedOn?: Date | string | null;
revisionDeletedOn?: Date | string | null;
revisionFirstPublishedOn?: Date | string | null;
revisionLastPublishedOn?: Date | string | null;
revisionModifiedBy?: CmsIdentity | null;
revisionCreatedBy?: CmsIdentity | null;
revisionSavedBy?: CmsIdentity | null;
revisionDeletedBy?: CmsIdentity | null;
revisionFirstPublishedBy?: CmsIdentity | null;
revisionLastPublishedBy?: CmsIdentity | null;

Expand All @@ -2390,11 +2395,13 @@ export interface UpdateCmsEntryInput {
createdOn?: Date | string | null;
modifiedOn?: Date | string | null;
savedOn?: Date | string | null;
deletedOn?: Date | string | null;
firstPublishedOn?: Date | string | null;
lastPublishedOn?: Date | string | null;
createdBy?: CmsIdentity | null;
modifiedBy?: CmsIdentity | null;
savedBy?: CmsIdentity | null;
deletedBy?: CmsIdentity | null;
firstPublishedBy?: CmsIdentity | null;
lastPublishedBy?: CmsIdentity | null;

Expand Down