From 0c0bfe1a1034816047c95d04ce2cb33adeaca76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 21 Apr 2022 10:52:11 +0200 Subject: [PATCH] Rename to filterByActivated and filterByDeleted --- admin/src/graphql/searchUsers.js | 12 +++++----- admin/src/pages/Creation.spec.js | 16 ++++++------- admin/src/pages/Creation.vue | 4 ++-- admin/src/pages/UserSearch.spec.js | 24 +++++++++---------- admin/src/pages/UserSearch.vue | 5 ++-- backend/src/graphql/arg/SearchUsersArgs.ts | 4 ++-- backend/src/graphql/resolver/AdminResolver.ts | 12 +++++----- 7 files changed, 39 insertions(+), 38 deletions(-) diff --git a/admin/src/graphql/searchUsers.js b/admin/src/graphql/searchUsers.js index 706927eb1..34c962678 100644 --- a/admin/src/graphql/searchUsers.js +++ b/admin/src/graphql/searchUsers.js @@ -5,15 +5,15 @@ export const searchUsers = gql` $searchText: String! $currentPage: Int $pageSize: Int - $withActivated: Boolean - $withDeleted: Boolean + $filterByActivated: Boolean + $filterByDeleted: Boolean ) { searchUsers( searchText: $searchText currentPage: $currentPage pageSize: $pageSize - withActivated: $withActivated - withDeleted: $withDeleted + filterByActivated: $filterByActivated + filterByDeleted: $filterByDeleted ) { userCount userList { @@ -24,8 +24,8 @@ export const searchUsers = gql` creation hasElopage emailConfirmationSend - withActivated - withDeleted + filterByActivated + filterByDeleted } } } diff --git a/admin/src/pages/Creation.spec.js b/admin/src/pages/Creation.spec.js index d1d6f0f2e..98c03d277 100644 --- a/admin/src/pages/Creation.spec.js +++ b/admin/src/pages/Creation.spec.js @@ -71,8 +71,8 @@ describe('Creation', () => { searchText: '', currentPage: 1, pageSize: 25, - withActivated: true, - withDeleted: false, + filterByActivated: true, + filterByDeleted: false, }, }), ) @@ -271,8 +271,8 @@ describe('Creation', () => { searchText: 'XX', currentPage: 1, pageSize: 25, - withActivated: true, - withDeleted: false, + filterByActivated: true, + filterByDeleted: false, }, }), ) @@ -288,8 +288,8 @@ describe('Creation', () => { searchText: '', currentPage: 1, pageSize: 25, - withActivated: true, - withDeleted: false, + filterByActivated: true, + filterByDeleted: false, }, }), ) @@ -305,8 +305,8 @@ describe('Creation', () => { searchText: '', currentPage: 2, pageSize: 25, - withActivated: true, - withDeleted: false, + filterByActivated: true, + filterByDeleted: false, }, }), ) diff --git a/admin/src/pages/Creation.vue b/admin/src/pages/Creation.vue index 76d6077f5..54bc0d735 100644 --- a/admin/src/pages/Creation.vue +++ b/admin/src/pages/Creation.vue @@ -102,8 +102,8 @@ export default { searchText: this.criteria, currentPage: this.currentPage, pageSize: this.perPage, - withActivated: true, - withDeleted: false, + filterByActivated: true, + filterByDeleted: false, }, fetchPolicy: 'network-only', }) diff --git a/admin/src/pages/UserSearch.spec.js b/admin/src/pages/UserSearch.spec.js index 602852608..2eb24f84b 100644 --- a/admin/src/pages/UserSearch.spec.js +++ b/admin/src/pages/UserSearch.spec.js @@ -82,8 +82,8 @@ describe('UserSearch', () => { searchText: '', currentPage: 1, pageSize: 25, - withActivated: null, - withDeleted: null, + filterByActivated: null, + filterByDeleted: null, }, }), ) @@ -101,8 +101,8 @@ describe('UserSearch', () => { searchText: '', currentPage: 1, pageSize: 25, - withActivated: true, - withDeleted: null, + filterByActivated: false, + filterByDeleted: null, }, }), ) @@ -121,8 +121,8 @@ describe('UserSearch', () => { searchText: '', currentPage: 1, pageSize: 25, - withActivated: null, - withDeleted: true, + filterByActivated: null, + filterByDeleted: true, }, }), ) @@ -141,8 +141,8 @@ describe('UserSearch', () => { searchText: '', currentPage: 2, pageSize: 25, - withActivated: null, - withDeleted: null, + filterByActivated: null, + filterByDeleted: null, }, }), ) @@ -161,8 +161,8 @@ describe('UserSearch', () => { searchText: 'search string', currentPage: 1, pageSize: 25, - withActivated: null, - withDeleted: null, + filterByActivated: null, + filterByDeleted: null, }, }), ) @@ -178,8 +178,8 @@ describe('UserSearch', () => { searchText: '', currentPage: 1, pageSize: 25, - withActivated: null, - withDeleted: null, + filterByActivated: null, + filterByDeleted: null, }, }), ) diff --git a/admin/src/pages/UserSearch.vue b/admin/src/pages/UserSearch.vue index f0bf60ae1..8a0a4b86f 100644 --- a/admin/src/pages/UserSearch.vue +++ b/admin/src/pages/UserSearch.vue @@ -3,6 +3,7 @@
+ {{ filterCheckedEmails ? $t('unregistered_emails') : $t('all_emails') }} @@ -85,8 +86,8 @@ export default { searchText: this.criteria, currentPage: this.currentPage, pageSize: this.perPage, - withActivated: this.filterCheckedEmails, - withDeleted: this.filterDeletedUser, + filterByActivated: this.filterCheckedEmails, // Wolle: check logic + filterByDeleted: this.filterDeletedUser, }, fetchPolicy: 'no-cache', }) diff --git a/backend/src/graphql/arg/SearchUsersArgs.ts b/backend/src/graphql/arg/SearchUsersArgs.ts index fab17e527..b47f39d56 100644 --- a/backend/src/graphql/arg/SearchUsersArgs.ts +++ b/backend/src/graphql/arg/SearchUsersArgs.ts @@ -12,8 +12,8 @@ export default class SearchUsersArgs { pageSize?: number @Field(() => Boolean, { nullable: true }) - withActivated?: boolean | null + filterByActivated?: boolean | null @Field(() => Boolean, { nullable: true }) - withDeleted?: boolean | null + filterByDeleted?: boolean | null } diff --git a/backend/src/graphql/resolver/AdminResolver.ts b/backend/src/graphql/resolver/AdminResolver.ts index bdb078ad1..7cc578a87 100644 --- a/backend/src/graphql/resolver/AdminResolver.ts +++ b/backend/src/graphql/resolver/AdminResolver.ts @@ -56,19 +56,19 @@ export class AdminResolver { searchText, currentPage = 1, pageSize = 25, - withActivated = null, - withDeleted = null, + filterByActivated = null, + filterByDeleted = null, }: SearchUsersArgs, ): Promise { const userRepository = getCustomRepository(UserRepository) const filterCriteria: ObjectLiteral[] = [] - if (withActivated !== null) { - filterCriteria.push({ withActivated: withActivated }) + if (filterByActivated !== null) { + filterCriteria.push({ filterByActivated: filterByActivated }) } - if (withDeleted !== null) { - filterCriteria.push({ withDeleted: withDeleted ? Not(IsNull()) : IsNull() }) + if (filterByDeleted !== null) { + filterCriteria.push({ filterByDeleted: filterByDeleted ? Not(IsNull()) : IsNull() }) } const userFields = ['id', 'firstName', 'lastName', 'email', 'emailChecked', 'deletedAt']