Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Pleroma
admin-fe
Commits
c9ce3cf2
Commit
c9ce3cf2
authored
4 years ago
by
Angelina Filippova
Browse files
Options
Downloads
Patches
Plain Diff
Update function that removes opposite filters to work with need_approval filter
parent
6bf096b4
Branches
Branches containing commit
No related tags found
1 merge request
!154
Update usage of `need_approval` status
Pipeline
#29617
passed
4 years ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/views/users/components/UsersFilter.vue
+17
-12
17 additions, 12 deletions
src/views/users/components/UsersFilter.vue
with
17 additions
and
12 deletions
src/views/users/components/UsersFilter.vue
+
17
−
12
View file @
c9ce3cf2
...
...
@@ -37,20 +37,25 @@ export default {
methods
:
{
removeOppositeFilters
()
{
const
filtersQuantity
=
Object
.
keys
(
this
.
$store
.
state
.
users
.
filters
).
length
const
currentFilters
=
this
.
$data
.
value
.
slice
()
const
indexOfLocal
=
currentFilters
.
indexOf
(
'
local
'
)
const
indexOfExternal
=
currentFilters
.
indexOf
(
'
external
'
)
const
indexOfActive
=
currentFilters
.
indexOf
(
'
active
'
)
const
indexOfDeactivated
=
currentFilters
.
indexOf
(
'
deactivated
'
)
if
(
currentFilters
.
length
===
filtersQuantity
)
{
const
currentFilters
=
[]
const
indexOfLocal
=
this
.
$data
.
value
.
indexOf
(
'
local
'
)
const
indexOfExternal
=
this
.
$data
.
value
.
indexOf
(
'
external
'
)
const
indexOfActive
=
this
.
$data
.
value
.
indexOf
(
'
active
'
)
const
indexOfDeactivated
=
this
.
$data
.
value
.
indexOf
(
'
deactivated
'
)
const
indexOfPending
=
this
.
$data
.
value
.
indexOf
(
'
need_approval
'
)
if
(
this
.
$data
.
value
.
length
===
filtersQuantity
)
{
return
[]
}
else
if
(
indexOfLocal
>
-
1
&&
indexOfExternal
>
-
1
)
{
const
filterToRemove
=
indexOfLocal
>
indexOfExternal
?
indexOfExternal
:
indexOfLocal
currentFilters
.
splice
(
filterToRemove
,
1
)
}
else
if
(
indexOfActive
>
-
1
&&
indexOfDeactivated
>
-
1
)
{
const
filterToRemove
=
indexOfActive
>
indexOfDeactivated
?
indexOfDeactivated
:
indexOfActive
currentFilters
.
splice
(
filterToRemove
,
1
)
}
Math
.
max
(
indexOfLocal
,
indexOfExternal
)
>
-
1
?
currentFilters
.
push
(
this
.
$data
.
value
[
Math
.
max
(
indexOfLocal
,
indexOfExternal
)])
:
currentFilters
Math
.
max
(
indexOfActive
,
indexOfDeactivated
,
indexOfPending
)
>
-
1
?
currentFilters
.
push
(
this
.
$data
.
value
[
Math
.
max
(
indexOfActive
,
indexOfDeactivated
,
indexOfPending
)])
:
currentFilters
return
currentFilters
},
toggleFilters
()
{
...
...
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