Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MaarchCourrier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maarch
MaarchCourrier
Commits
dceeb350
Commit
dceeb350
authored
4 years ago
by
Alex ORLUC
Browse files
Options
Downloads
Patches
Plain Diff
FEAT #13271 TIME 0:15 get real count filter
parent
680004a0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/frontend/app/search/filter-tool/filter-tool.component.html
+5
-3
5 additions, 3 deletions
...rontend/app/search/filter-tool/filter-tool.component.html
src/frontend/app/search/filter-tool/filter-tool.component.ts
+4
-0
4 additions, 0 deletions
src/frontend/app/search/filter-tool/filter-tool.component.ts
with
9 additions
and
3 deletions
src/frontend/app/search/filter-tool/filter-tool.component.html
+
5
−
3
View file @
dceeb350
...
@@ -5,8 +5,10 @@
...
@@ -5,8 +5,10 @@
</mat-panel-title>
</mat-panel-title>
</mat-expansion-panel-header>
</mat-expansion-panel-header>
<mat-selection-list
#filterList
*ngFor=
"let filterKey of filters | keyvalue"
class=
"filter-list"
>
<mat-selection-list
#filterList
*ngFor=
"let filterKey of filters | keyvalue"
class=
"filter-list"
>
<div
class=
"catGroupTitle"
>
{{'lang.'+filterKey.key | translate}} ({{filters[filterKey.key]['values'].length}})
</div>
<ng-container
*ngIf=
"getRealCount(filterKey.key) > 0"
>
<mat-divider
style=
"width: 80%;"
></mat-divider>
<div
class=
"catGroupTitle"
>
{{'lang.'+filterKey.key | translate}} ({{getRealCount(filterKey.key)}})
</div>
<mat-divider
style=
"width: 80%;"
></mat-divider>
</ng-container>
<ng-container
*ngFor=
"let cat of filters[filterKey.key]['values'];let i=index"
>
<ng-container
*ngFor=
"let cat of filters[filterKey.key]['values'];let i=index"
>
<ng-container
*ngIf=
"cat.count > 0 || (cat.count === 0 && cat.selected)"
>
<ng-container
*ngIf=
"cat.count > 0 || (cat.count === 0 && cat.selected)"
>
<mat-list-option
color=
"primary"
class=
"catContent"
*ngIf=
"i < 5 || filters[filterKey.key]['expand']"
(click)=
"toggleFilter(filterKey.key,i)"
[selected]=
"cat.selected"
checkboxPosition=
"before"
[disabled]=
"isLoadingResults"
>
<mat-list-option
color=
"primary"
class=
"catContent"
*ngIf=
"i < 5 || filters[filterKey.key]['expand']"
(click)=
"toggleFilter(filterKey.key,i)"
[selected]=
"cat.selected"
checkboxPosition=
"before"
[disabled]=
"isLoadingResults"
>
...
@@ -14,6 +16,6 @@
...
@@ -14,6 +16,6 @@
</mat-list-option>
</mat-list-option>
</ng-container>
</ng-container>
</ng-container>
</ng-container>
<button
mat-button
*ngIf=
"
filters[filterKey.key]['values'].length
> 5"
style=
"width:100%;"
color=
"primary"
(click)=
"toggleDisplay(filterKey.key)"
>
{{filters[filterKey.key]['expand'] ? ('lang.less' | translate) : ('lang.more' | translate) }}
<mat-icon
style=
"height:auto;"
class=
"fas"
[class.fa-chevron-down]=
"!filters[filterKey.key]['expand']"
[class.fa-chevron-up]=
"filters[filterKey.key]['expand']"
></mat-icon></button>
<button
mat-button
*ngIf=
"
getRealCount(filterKey.key)
> 5"
style=
"width:100%;"
color=
"primary"
(click)=
"toggleDisplay(filterKey.key)"
>
{{filters[filterKey.key]['expand'] ? ('lang.less' | translate) : ('lang.more' | translate) }}
<mat-icon
style=
"height:auto;"
class=
"fas"
[class.fa-chevron-down]=
"!filters[filterKey.key]['expand']"
[class.fa-chevron-up]=
"filters[filterKey.key]['expand']"
></mat-icon></button>
</mat-selection-list>
</mat-selection-list>
</mat-expansion-panel>
</mat-expansion-panel>
This diff is collapsed.
Click to expand it.
src/frontend/app/search/filter-tool/filter-tool.component.ts
+
4
−
0
View file @
dceeb350
...
@@ -36,4 +36,8 @@ export class FilterToolComponent implements OnInit {
...
@@ -36,4 +36,8 @@ export class FilterToolComponent implements OnInit {
toggleDisplay
(
key
:
string
)
{
toggleDisplay
(
key
:
string
)
{
this
.
filters
[
key
][
'
expand
'
]
=
!
this
.
filters
[
key
][
'
expand
'
];
this
.
filters
[
key
][
'
expand
'
]
=
!
this
.
filters
[
key
][
'
expand
'
];
}
}
getRealCount
(
key
:
string
)
{
return
this
.
filters
[
key
][
'
values
'
].
filter
((
item
:
any
)
=>
item
.
count
>
0
||
(
item
.
count
===
0
&&
item
.
selected
)).
length
;
}
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment