Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
wotwizard-ui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
clients
wotwizard-ui
Merge requests
!11
Add possibility to use Favorites
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add possibility to use Favorites
CaTasTrOOf/wotwizard-ui:favourites-filter
into
master
Overview
0
Commits
2
Pipelines
0
Changes
1
Merged
CaTasTrOOf
requested to merge
CaTasTrOOf/wotwizard-ui:favourites-filter
into
master
3 years ago
Overview
0
Commits
2
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Viewing commit
edb44694
Prev
Next
Show latest version
1 file
+
13
−
22
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
edb44694
Add sort method to fatorize code
· edb44694
CaTasTrOOf
authored
3 years ago
components/member/List.vue
+
13
−
22
Options
@@ -146,6 +146,11 @@ export default {
if
(
this
.
adhesion
)
return
member
.
limitDate
if
(
this
.
certif
)
return
member
.
received_certifications
.
limit
return
Math
.
min
(
member
.
limitDate
,
member
.
received_certifications
.
limit
)
},
sort
(
a
,
b
,
order
)
{
if
(
a
<
b
)
return
-
1
*
order
if
(
a
>
b
)
return
1
*
order
return
0
}
},
computed
:
{
@@ -156,30 +161,18 @@ export default {
let
modifier
=
this
.
currentSortDir
===
"
desc
"
?
-
1
:
1
if
(
this
.
currentSort
==
"
uid
"
)
{
if
(
a
[
"
uid
"
].
toLowerCase
()
<
b
[
"
uid
"
].
toLowerCase
())
return
-
1
*
modifier
if
(
a
[
"
uid
"
].
toLowerCase
()
>
b
[
"
uid
"
].
toLowerCase
())
return
1
*
modifier
sort
(
a
[
"
uid
"
].
toLowerCase
(),
b
[
"
uid
"
].
toLowerCase
(),
modifier
)
}
else
if
(
this
.
currentSort
==
"
pubkey
"
)
{
if
(
a
[
"
pubkey
"
].
toLowerCase
()
<
b
[
"
pubkey
"
].
toLowerCase
())
return
-
1
*
modifier
if
(
a
[
"
pubkey
"
].
toLowerCase
()
>
b
[
"
pubkey
"
].
toLowerCase
())
return
1
*
modifier
sort
(
a
[
"
pubkey
"
].
toLowerCase
(),
b
[
"
pubkey
"
].
toLowerCase
(),
modifier
)
}
else
if
(
this
.
currentSort
==
"
date_sortie
"
)
{
if
(
this
.
adhesion
)
{
if
(
a
[
"
limitDate
"
]
<
b
[
"
limitDate
"
])
return
-
1
*
modifier
if
(
a
[
"
limitDate
"
]
>
b
[
"
limitDate
"
])
return
1
*
modifier
sort
(
a
[
"
limitDate
"
],
b
[
"
limitDate
"
],
modifier
)
}
else
if
(
this
.
certif
)
{
if
(
a
[
"
received_certifications
"
][
"
limit
"
]
<
b
[
"
received_certifications
"
][
"
limit
"
]
sort
(
a
[
"
received_certifications
"
][
"
limit
"
],
b
[
"
received_certifications
"
][
"
limit
"
],
modifier
)
return
-
1
*
modifier
if
(
a
[
"
received_certifications
"
][
"
limit
"
]
>
b
[
"
received_certifications
"
][
"
limit
"
]
)
return
1
*
modifier
}
else
{
let
minA
=
Math
.
min
(
a
[
"
limitDate
"
],
@@ -189,11 +182,9 @@ export default {
b
[
"
limitDate
"
],
b
[
"
received_certifications
"
][
"
limit
"
]
)
if
(
minA
<
minB
)
return
-
1
*
modifier
if
(
minA
>
minB
)
return
1
*
modifier
sort
(
minA
,
minB
,
modifier
)
}
}
return
0
})
.
filter
((
row
,
index
)
=>
{
Loading