Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
W
webclient
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
Container registry
Model registry
Operate
Environments
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
retribute.me
webclient
Commits
8897bab8
Verified
Commit
8897bab8
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Added account filter
parent
b636aa35
No related branches found
No related tags found
No related merge requests found
Pipeline
#4255
passed
6 years ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Suggestions.vue
+22
-5
22 additions, 5 deletions
src/components/Suggestions.vue
with
22 additions
and
5 deletions
src/components/Suggestions.vue
+
22
−
5
View file @
8897bab8
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<router-link
to=
"/connect"
class=
"secondary-content"
>
Add another account
</router-link>
<router-link
to=
"/connect"
class=
"secondary-content"
>
Add another account
</router-link>
<h5>
Connected accounts
</h5>
<h5>
Connected accounts
</h5>
</li>
</li>
<li
class=
"collection-item avatar"
v-for=
"account in accounts"
:key=
"account.
fullI
d"
>
<li
class=
"collection-item avatar"
v-for=
"account in accounts"
:key=
"account.
i
d"
>
<img
v-if=
"account._source.getAvatar(account)"
:src=
"account._source.getAvatar(account)"
alt=
""
class=
"circle"
>
<img
v-if=
"account._source.getAvatar(account)"
:src=
"account._source.getAvatar(account)"
alt=
""
class=
"circle"
>
<span
class=
"title"
>
{{
account
.
_source
.
getDisplayName
(
account
)
}}
</span>
<span
class=
"title"
>
{{
account
.
_source
.
getDisplayName
(
account
)
}}
</span>
<p>
{{
account
.
_source
.
label
}}
</p>
<p>
{{
account
.
_source
.
label
}}
</p>
...
@@ -28,17 +28,25 @@
...
@@ -28,17 +28,25 @@
</button>
</button>
</h2>
</h2>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"input-field col l
3
"
>
<div
class=
"input-field col l
4
"
>
<input
v-model=
"maxDays"
id=
"maxDays"
placeholder=
"60"
type=
"number"
min=
"1"
step=
"1"
max=
"365"
class=
"validate"
>
<input
v-model=
"maxDays"
id=
"maxDays"
placeholder=
"60"
type=
"number"
min=
"1"
step=
"1"
max=
"365"
class=
"validate"
>
<label
class=
"active"
for=
"maxDays"
>
Period (in days)
</label>
<label
class=
"active"
for=
"maxDays"
>
Period (in days)
</label>
</div>
</div>
<div
class=
"input-field col l
6
"
>
<div
class=
"input-field col l
4
"
>
<select
multiple
v-model=
"filters.providers"
>
<select
multiple
v-model=
"filters.providers"
>
<option
value=
""
disabled
selected
>
All
</option>
<option
v-for=
"provider in providers"
:key=
"provider.id"
:value=
"provider.id"
>
{{
provider
.
label
}}
</option>
<option
v-for=
"provider in providers"
:key=
"provider.id"
:value=
"provider.id"
>
{{
provider
.
label
}}
</option>
</select>
</select>
<label>
Donation services
</label>
<label>
Donation services
</label>
</div>
</div>
<div
class=
"input-field col l4"
>
<select
multiple
v-model=
"filters.accounts"
>
<option
v-for=
"account in accounts"
:key=
"account.id"
:value=
"account.id"
>
{{
account
.
_source
.
getDisplayName
(
account
)
}}
</option>
</select>
<label>
Accounts
</label>
</div>
</div>
</div>
<div
v-if=
"isLoading"
class=
"progress"
>
<div
v-if=
"isLoading"
class=
"progress"
>
<div
class=
"indeterminate"
></div>
<div
class=
"indeterminate"
></div>
...
@@ -102,7 +110,7 @@ import axios from 'axios'
...
@@ -102,7 +110,7 @@ import axios from 'axios'
export
default
{
export
default
{
data
()
{
data
()
{
let
filters
=
this
.
$store
.
state
.
cache
.
suggestionFilters
||
{}
let
filters
=
this
.
$store
.
state
.
cache
.
suggestionFilters
||
{}
filters
=
defaults
(
filters
,
{
providers
:
[],
retributeOnly
:
true
})
filters
=
defaults
(
filters
,
{
providers
:
[],
retributeOnly
:
true
,
accounts
:
[]
})
return
{
return
{
sources
:
sources
.
sources
,
sources
:
sources
.
sources
,
maxDays
:
this
.
$store
.
state
.
cache
.
maxDays
||
60
,
maxDays
:
this
.
$store
.
state
.
cache
.
maxDays
||
60
,
...
@@ -139,6 +147,15 @@ export default {
...
@@ -139,6 +147,15 @@ export default {
return
self
.
filters
.
providers
.
indexOf
(
m
.
provider
)
>
-
1
return
self
.
filters
.
providers
.
indexOf
(
m
.
provider
)
>
-
1
}).
length
>
0
}).
length
>
0
}
}
let
accountFilters
=
self
.
filters
.
accounts
.
filter
((
a
)
=>
{
return
!!
a
})
if
(
accountFilters
.
length
>
0
)
{
f
=
f
&&
s
.
accounts
&&
accountFilters
.
filter
((
a
)
=>
{
return
s
.
accounts
.
indexOf
(
a
)
>
-
1
}).
length
>
0
}
return
f
return
f
})
})
return
orderBy
(
suggestions
,
[
'
weight
'
,
'
id
'
],
[
'
desc
'
,
'
asc
'
])
return
orderBy
(
suggestions
,
[
'
weight
'
,
'
id
'
],
[
'
desc
'
,
'
asc
'
])
...
...
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