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
ac0c1838
Verified
Commit
ac0c1838
authored
6 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Fixed some loading issues
parent
9ca2dfff
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Suggestions.vue
+32
-10
32 additions, 10 deletions
src/components/Suggestions.vue
with
32 additions
and
10 deletions
src/components/Suggestions.vue
+
32
−
10
View file @
ac0c1838
...
...
@@ -9,7 +9,7 @@
<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>
<div
v-if=
"isLoading && results[account.id] && results[account.id].results.isLoading"
>
<div
v-if=
"isLoading
Sources
&& results[account.id] && results[account.id].results.isLoading"
>
<div
class=
"progress"
>
<div
v-if=
"results[account.id].results.progress === 'indeterminate'"
:class=
"indeterminate"
></div>
<div
v-else
class=
"determinate"
:style=
"
{width: `${results[account.id].results.progress}%`}">
</div>
...
...
@@ -68,11 +68,15 @@ import axios from 'axios'
export
default
{
data
()
{
return
{
isLoading
:
false
,
isLoadingSources
:
false
,
isLoadingRetribute
:
false
,
results
:
{},
aggregatedSuggestions
:
this
.
$store
.
state
.
cache
.
aggregatedSuggestions
||
{},
retributeProfiles
:
this
.
$store
.
state
.
cache
.
retributeProfiles
||
{},
loadingRetributeProfiles
:
[],
filters
:
{
retributeOnly
:
true
}
}
},
computed
:
{
...
...
@@ -82,18 +86,33 @@ export default {
return
a
})
},
allSuggestions
()
{
return
Object
.
values
(
this
.
aggregatedSuggestions
)
},
filteredSuggestions
()
{
return
orderBy
(
Object
.
values
(
this
.
aggregatedSuggestions
),
[
'
weight
'
,
'
id
'
],
[
'
desc
'
,
'
asc
'
])
let
self
=
this
let
suggestions
=
this
.
allSuggestions
.
filter
((
s
)
=>
{
let
f
=
true
if
(
self
.
filters
.
retributeOnly
)
{
f
=
!!
this
.
retributeProfiles
[
s
.
fullId
]
}
return
f
})
return
orderBy
(
suggestions
,
[
'
weight
'
,
'
id
'
],
[
'
desc
'
,
'
asc
'
])
},
missingRetributeProfiles
()
{
return
this
.
filtered
Suggestions
.
filter
((
s
)
=>
{
return
this
.
all
Suggestions
.
filter
((
s
)
=>
{
return
this
.
retributeProfiles
[
s
.
fullId
]
===
undefined
})
},
isLoading
()
{
return
this
.
isLoadingSources
||
this
.
isLoadingRetribute
}
},
methods
:
{
clearCache
()
{
this
.
isLoading
=
false
this
.
isLoadingSources
=
false
this
.
isLoadingRetribute
=
false
this
.
results
=
{}
this
.
aggregatedSuggestions
=
{}
this
.
retributeProfiles
=
{}
...
...
@@ -129,7 +148,7 @@ export default {
this
.
retributeProfiles
=
{}
this
.
loadingRetributeProfiles
=
[]
}
this
.
isLoading
=
true
this
.
isLoading
Sources
=
true
accounts
.
forEach
((
a
)
=>
{
let
r
=
{
isLoading
:
true
,
progress
:
'
indeterminate
'
,
status
:
''
}
let
promise
=
a
.
_source
.
fetch
({
account
:
a
,
store
:
this
.
$store
,
results
:
r
,
vue
:
this
})
...
...
@@ -139,15 +158,18 @@ export default {
for
(
let
i
=
0
;
i
<
keys
.
length
;
i
++
){
await
this
.
results
[
keys
[
i
]].
promise
}
this
.
isLoading
=
false
this
.
isLoading
Sources
=
false
},
async
lookupAll
()
{
this
.
isLoading
=
true
const
chunkSize
=
10
let
self
=
this
const
toLoad
=
this
.
missingRetributeProfiles
.
filter
((
p
)
=>
{
return
self
.
loadingRetributeProfiles
.
indexOf
(
p
.
fullId
)
===
-
1
})
if
(
toLoad
.
length
===
0
)
{
return
}
this
.
isLoadingRetribute
=
true
const
chunkSize
=
10
// lock
toLoad
.
forEach
((
p
)
=>
{
self
.
loadingRetributeProfiles
.
push
(
p
.
fullId
)
...
...
@@ -160,7 +182,7 @@ export default {
})
await
this
.
lookups
(
ids
)
}
this
.
isLoading
=
false
this
.
isLoading
Retribute
=
false
},
async
lookups
(
ids
)
{
...
...
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