From 494a21a37f53e3f27aa16e0691a9ee63d5a9a688 Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Sat, 21 Jun 2025 11:36:16 +0200 Subject: [PATCH 1/5] add search field --- .../topic-ideation.component.html | 8 ++++++++ .../topic-ideation.component.scss | 4 ++++ .../topic-ideation.component.ts | 19 +++++++++++-------- src/app/services/topic-idea.service.ts | 1 + src/assets/i18n/en.json | 1 + 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/app/ideation/components/topic-ideation/topic-ideation.component.html b/src/app/ideation/components/topic-ideation/topic-ideation.component.html index ee364188a..5405f1968 100644 --- a/src/app/ideation/components/topic-ideation/topic-ideation.component.html +++ b/src/app/ideation/components/topic-ideation/topic-ideation.component.html @@ -397,6 +397,14 @@ + + + + diff --git a/src/app/ideation/components/topic-ideation/topic-ideation.component.scss b/src/app/ideation/components/topic-ideation/topic-ideation.component.scss index 06437e918..da5bc3b82 100644 --- a/src/app/ideation/components/topic-ideation/topic-ideation.component.scss +++ b/src/app/ideation/components/topic-ideation/topic-ideation.component.scss @@ -232,6 +232,10 @@ .dropdown_input { width: calc(100% / 3 - 16px); } + + .search_input { + flex-grow: 1; + } } } diff --git a/src/app/ideation/components/topic-ideation/topic-ideation.component.ts b/src/app/ideation/components/topic-ideation/topic-ideation.component.ts index bb4a58390..d26c98285 100644 --- a/src/app/ideation/components/topic-ideation/topic-ideation.component.ts +++ b/src/app/ideation/components/topic-ideation/topic-ideation.component.ts @@ -58,7 +58,8 @@ export class TopicIdeationComponent { residence: '', type: '', orderBy: '', - participants: '' + participants: '', + search: '', }; mobileIdeaFiltersList = false; @@ -77,6 +78,7 @@ export class TopicIdeationComponent { municipalities = municipalities; + ideaSearchFilter$ = new BehaviorSubject(''); ideaTypeFilter$ = new BehaviorSubject(''); ageFilter$ = new BehaviorSubject<(number | string)[]>([]); genderFilter$ = new BehaviorSubject(''); @@ -84,7 +86,6 @@ export class TopicIdeationComponent { orderFilter$ = new BehaviorSubject(''); ideaParticipantsFilter$ = new BehaviorSubject(''); searchIdeasInput = ''; - ideaSearchFilter$ = new BehaviorSubject(''); folderFilter$ = new BehaviorSubject(''); loadFolders$ = new BehaviorSubject(undefined); selectedFolder?: Folder; @@ -106,9 +107,9 @@ export class TopicIdeationComponent { ) { } ngOnInit(): void { - this.ideas$ = combineLatest([this.ideaTypeFilter$, this.orderFilter$, this.ideaParticipantsFilter$, this.folderFilter$, this.ideaSearchFilter$, this.TopicIdeaService.reload$, this.ageFilter$, this.genderFilter$, this.residenceFilter$]) + this.ideas$ = combineLatest([this.ideaTypeFilter$, this.orderFilter$, this.ideaParticipantsFilter$, this.folderFilter$, this.TopicIdeaService.reload$, this.ageFilter$, this.genderFilter$, this.residenceFilter$, this.ideaSearchFilter$]) .pipe( - switchMap(([typeFilter, orderFilter, participantFilter, folderFilter, search, load, age, gender, residence]) => { + switchMap(([typeFilter, orderFilter, participantFilter, folderFilter, load, age, gender, residence, search]) => { this.TopicIdeaService.reset(); this.TopicIdeaService.setParam('topicId', this.topic.id); this.TopicIdeaService.setParam('ideationId', this.topic.ideationId); @@ -135,6 +136,7 @@ export class TopicIdeationComponent { this.TopicIdeaService.setParam('folderId', folderFilter); } if (search) { + console.log('search', search); this.TopicIdeaService.setParam('search', search); } @@ -217,6 +219,11 @@ export class TopicIdeationComponent { ).join(', '); } + setSearch(value: string) { + this.ideaSearchFilter$.next(value); + this.ideaFilters.search = value; + } + setType(type: string) { if (type === 'all' || typeof type !== 'string') type = ''; this.ideaTypeFilter$.next(type); @@ -493,10 +500,6 @@ export class TopicIdeationComponent { }); }; - searchIdeas(search: string) { - this.ideaSearchFilter$.next(search); - } - closeMobileFilter() { const filtersShow = Object.entries(this.mobileIdeaFilters).find(([key, value]) => { return !!value; diff --git a/src/app/services/topic-idea.service.ts b/src/app/services/topic-idea.service.ts index 07921fb37..b12704f59 100644 --- a/src/app/services/topic-idea.service.ts +++ b/src/app/services/topic-idea.service.ts @@ -31,6 +31,7 @@ export class TopicIdeaService extends ItemsListService { IDEA_VERSION_SEPARATOR = '_v'; IdeaIds = []; params = { + search: null, topicId: null, ideationId: null, orderBy: this.IDEA_ORDER_BY.date, diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json index 0caa70912..fdf7914e5 100644 --- a/src/assets/i18n/en.json +++ b/src/assets/i18n/en.json @@ -787,6 +787,7 @@ "OPT_DOWNLOAD_IDEAS": "Export ideas", "OPT_EDIT_IDEATION": "Edit idea gathering", "OPT_CLOSE_IDEATION": "End idea gathering", + "SEARCH": "Search", "FILTER_ALL": "@:VIEWS.MY_TOPICS.FILTER_ALL", "FILTER_TYPE_YOUR_IDEAS": "Your ideas", "FILTER_TYPE_FAVOURITES": "Saved ideas", From ed459bd8b9c98393f61d8f0742a085a25a37fd3d Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Sat, 21 Jun 2025 11:36:49 +0200 Subject: [PATCH 2/5] clean --- .../components/topic-ideation/topic-ideation.component.scss | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/app/ideation/components/topic-ideation/topic-ideation.component.scss b/src/app/ideation/components/topic-ideation/topic-ideation.component.scss index da5bc3b82..82759f500 100644 --- a/src/app/ideation/components/topic-ideation/topic-ideation.component.scss +++ b/src/app/ideation/components/topic-ideation/topic-ideation.component.scss @@ -47,9 +47,6 @@ font-weight: 400; line-height: 16px; } - .deadline { - - } } button { padding: 8px 16px; From 977bbabe30d194f8cc823560c236c1269e1d45da Mon Sep 17 00:00:00 2001 From: Viktar Maslouski Date: Sat, 21 Jun 2025 23:19:11 +0200 Subject: [PATCH 3/5] update filters --- .../topic-ideation.component.html | 2014 +++++++++++++---- .../topic-ideation.component.scss | 25 +- .../topic-ideation.component.ts | 262 ++- 3 files changed, 1720 insertions(+), 581 deletions(-) diff --git a/src/app/ideation/components/topic-ideation/topic-ideation.component.html b/src/app/ideation/components/topic-ideation/topic-ideation.component.html index 5405f1968..d7a58aae7 100644 --- a/src/app/ideation/components/topic-ideation/topic-ideation.component.html +++ b/src/app/ideation/components/topic-ideation/topic-ideation.component.html @@ -4,46 +4,97 @@
-
{{ideation.question}}
-
-
+
- {{ideation.deadline | date:'YYYY-MM-dd HH:mm'}} + {{ + ideation.deadline | date : "YYYY-MM-dd HH:mm" + }}
@@ -96,48 +179,87 @@
-
+
- +
- - + + [translateParams]="{ count: ideation.folders?.count || 0 }" + >
- + + fill="url(#paint0_linear_698_77087)" + /> + fill="url(#paint1_linear_698_77087)" + /> - + - + @@ -149,184 +271,417 @@
- ({{selectedFolder?.ideas?.count}}) + ({{ selectedFolder?.ideas?.count }})
- +
- + *ngIf=" + topic.visibility === TopicService.VISIBILITY.public || + (topic.visibility === TopicService.VISIBILITY.private && + canUpdate()) + " + > +
- +
- -