Skip to content

Commit cefb58a

Browse files
DiverVMilmartyrk
andcommitted
Feature: Add search function to ideas [#1528] (#2326)
* New Crowdin updates (#2289) * New translations en.json (French) * New translations en.json (Spanish) * New translations en.json (Bulgarian) * New translations en.json (Czech) * New translations en.json (German) * New translations en.json (Dutch) * New translations en.json (Russian) * New translations en.json (Slovak) * New translations en.json (Albanian) * New translations en.json (Ukrainian) * New translations en.json (Indonesian) * New translations en.json (Estonian) * New translations en.json (Swahili) * New translations en.json (Somali) * New translations en.json (French) * New translations en.json (Spanish) * New translations en.json (Bulgarian) * New translations en.json (Czech) * New translations en.json (German) * New translations en.json (Dutch) * New translations en.json (Russian) * New translations en.json (Slovak) * New translations en.json (Albanian) * New translations en.json (Ukrainian) * New translations en.json (Indonesian) * New translations en.json (Estonian) * New translations en.json (Swahili) * New translations en.json (Somali) * New translations en.json (French) * New translations en.json (Spanish) * New translations en.json (Bulgarian) * New translations en.json (Czech) * New translations en.json (German) * New translations en.json (Dutch) * New translations en.json (Russian) * New translations en.json (Slovak) * New translations en.json (Albanian) * New translations en.json (Ukrainian) * New translations en.json (Indonesian) * New translations en.json (Estonian) * New translations en.json (Swahili) * New translations en.json (Somali) * add search field * clean * update filters * add mobile field * add icon --------- Co-authored-by: Ilmar Türk <[email protected]>
1 parent 237472a commit cefb58a

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

src/app/ideation/components/topic-ideation/topic-ideation.component.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,13 @@
878878
<div class="options filter_options">
879879
<a
880880
class="filter_option"
881+
(click)="mobileIdeaFilters.type = true"
882+
>
883+
<span
884+
class="filter_option_text"
885+
translate="COMPONENTS.TOPIC_IDEATION.IDEA_FILTER_TYPE"
886+
></span>
887+
<span class="bold">
881888
<span
882889
*ngIf="!ideaFilters.type"
883890
translate="COMPONENTS.TOPIC_IDEATION.FILTER_ALL"
@@ -898,6 +905,7 @@
898905
{{
899906
"COMPONENTS.TOPIC_IDEATION.FILTER_TYPE_MODERATED"
900907
| translate
908+
}}</span
901909
>
902910
</span>
903911
</a>

src/app/ideation/components/topic-ideation/topic-ideation.component.ts

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import { LocationService } from '@services/location.service';
2929
selector: 'topic-ideation',
3030
templateUrl: './topic-ideation.component.html',
3131
styleUrls: ['./topic-ideation.component.scss'],
32-
standalone: false
3332
})
3433
export class TopicIdeationComponent {
3534
@Input() ideation!: any;
@@ -247,6 +246,18 @@ export class TopicIdeationComponent {
247246
});
248247
}
249248

249+
get isCountryEstonia() {
250+
return this.topic.country === 'Estonia';
251+
}
252+
253+
get hasDemograficsField() {
254+
return {
255+
age: this.ideation.demographicsConfig?.age,
256+
gender: this.ideation.demographicsConfig?.gender,
257+
residence: this.ideation.demographicsConfig?.residence,
258+
};
259+
}
260+
250261
get sortedSelectedAges() {
251262
return this.ideaFilters.age
252263
.sort((a, b) => {
@@ -266,18 +277,6 @@ export class TopicIdeationComponent {
266277
this.ideaFilters.search = value;
267278
}
268279

269-
get isCountryEstonia() {
270-
return this.topic.country === 'Estonia';
271-
}
272-
273-
get hasDemograficsField() {
274-
return {
275-
age: this.ideation.demographicsConfig?.age,
276-
gender: this.ideation.demographicsConfig?.gender,
277-
residence: this.ideation.demographicsConfig?.residence
278-
};
279-
}
280-
281280
setType(type: string) {
282281
if (type === 'all' || typeof type !== 'string') type = '';
283282
this.ideaTypeFilter$.next(type);
@@ -597,9 +596,11 @@ export class TopicIdeationComponent {
597596
}
598597

599598
showMobileOverlay() {
600-
const filtersShow = Object.entries(this.mobileIdeaFilters).find(([key, value]) => {
601-
return !!value;
602-
});
599+
const filtersShow = Object.entries(this.mobileIdeaFilters).find(
600+
([key, value]) => {
601+
return !!value;
602+
}
603+
);
603604

604605
if (filtersShow) return true;
605606

0 commit comments

Comments
 (0)