Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
retribute.me
webclient
Commits
8897bab8
Verified
Commit
8897bab8
authored
Jun 09, 2019
by
Eliot Berriot
Browse files
Added account filter
parent
b636aa35
Pipeline
#4255
passed with stages
in 1 minute and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/Suggestions.vue
View file @
8897bab8
...
...
@@ -5,7 +5,7 @@
<router-link
to=
"/connect"
class=
"secondary-content"
>
Add another account
</router-link>
<h5>
Connected accounts
</h5>
</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"
>
<span
class=
"title"
>
{{
account
.
_source
.
getDisplayName
(
account
)
}}
</span>
<p>
{{
account
.
_source
.
label
}}
</p>
...
...
@@ -28,17 +28,25 @@
</button>
</h2>
<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"
>
<label
class=
"active"
for=
"maxDays"
>
Period (in days)
</label>
</div>
<div
class=
"input-field col l
6
"
>
<div
class=
"input-field col l
4
"
>
<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>
</select>
<label>
Donation services
</label>
</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
v-if=
"isLoading"
class=
"progress"
>
<div
class=
"indeterminate"
></div>
...
...
@@ -102,7 +110,7 @@ import axios from 'axios'
export
default
{
data
()
{
let
filters
=
this
.
$store
.
state
.
cache
.
suggestionFilters
||
{}
filters
=
defaults
(
filters
,
{
providers
:
[],
retributeOnly
:
true
})
filters
=
defaults
(
filters
,
{
providers
:
[],
retributeOnly
:
true
,
accounts
:
[]
})
return
{
sources
:
sources
.
sources
,
maxDays
:
this
.
$store
.
state
.
cache
.
maxDays
||
60
,
...
...
@@ -139,6 +147,15 @@ export default {
return
self
.
filters
.
providers
.
indexOf
(
m
.
provider
)
>
-
1
}).
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
orderBy
(
suggestions
,
[
'
weight
'
,
'
id
'
],
[
'
desc
'
,
'
asc
'
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment