From e76f94b0373a6a466f16234a191e21b1029c34fb Mon Sep 17 00:00:00 2001 From: Ludwig Reiter Date: Fri, 6 Oct 2023 13:42:59 +0200 Subject: [PATCH 1/4] Add clear selection option in search-selector --- .../base-search-selector/base-search-selector.component.html | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html b/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html index 2df217f737..da1a6c8c23 100644 --- a/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html +++ b/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html @@ -68,6 +68,7 @@ > {{ noOptionsFoundLabel | translate }} + Clear selection Date: Mon, 9 Oct 2023 09:19:59 +0200 Subject: [PATCH 2/4] Add input field addClearSelection to base-search-selector --- .../components/motion-content/motion-content.component.html | 1 + .../base-search-selector.component.html | 2 +- .../base-search-selector/base-search-selector.component.ts | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.html b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.html index 82cd9fdf1a..23c2f060ca 100644 --- a/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.html +++ b/client/src/app/site/pages/meetings/pages/motions/pages/motion-detail/components/motion-content/motion-content.component.html @@ -183,6 +183,7 @@ placeholder="{{ 'Category' | translate }}" [repo]="categoryRepo" [excludeIds]="true" + [addClearSelection]="true" > diff --git a/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html b/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html index da1a6c8c23..1b08e271bd 100644 --- a/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html +++ b/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html @@ -68,7 +68,7 @@ > {{ noOptionsFoundLabel | translate }} - Clear selection + Clear selection Date: Mon, 9 Oct 2023 12:20:26 +0200 Subject: [PATCH 3/4] Update clear option text to minus --- .../base-search-selector/base-search-selector.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html b/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html index 1b08e271bd..e4512c3c50 100644 --- a/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html +++ b/client/src/app/ui/modules/search-selector/components/base-search-selector/base-search-selector.component.html @@ -68,7 +68,7 @@ > {{ noOptionsFoundLabel | translate }} - Clear selection + - Date: Mon, 9 Oct 2023 12:40:23 +0200 Subject: [PATCH 4/4] Fix layout --- .../motion-multiselect/services/motion-multiselect.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/src/app/site/pages/meetings/pages/motions/components/motion-multiselect/services/motion-multiselect.service.ts b/client/src/app/site/pages/meetings/pages/motions/components/motion-multiselect/services/motion-multiselect.service.ts index 2afc9cf6a8..0f7f0ac5e8 100644 --- a/client/src/app/site/pages/meetings/pages/motions/components/motion-multiselect/services/motion-multiselect.service.ts +++ b/client/src/app/site/pages/meetings/pages/motions/components/motion-multiselect/services/motion-multiselect.service.ts @@ -419,9 +419,11 @@ export class MotionMultiselectService { } return submitterIds.map(id => ({ id })); } + private submitterInMotion(userId: Id, motion: ViewMotion): boolean { return motion.submitters.some(submitter => userId == submitter.user_id); } + private newSubmittersInMotion(userIds: Ids, motion: ViewMotion): Identifiable[] { const newSubmitters: Id[] = userIds.filter(userId => !this.submitterInMotion(userId, motion)); return newSubmitters.map(id => ({ id }));