summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b32fabb)
items() is ready immediately, and returns [] until the first results
arrive.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg@veritasgenetics.com>
m('th', 'last modified'),
])),
m('tbody', [
m('th', 'last modified'),
])),
m('tbody', [
- loader.items() && loader.items().map(function(item) {
+ loader.items().map(function(item) {
return m('tr', [
m('td', m('a.btn.btn-xs.btn-default', {href: item.session.baseURL.replace('://', '://workbench.')+'collections/'+item.uuid}, 'Show')),
m('td.arvados-uuid', item.uuid),
return m('tr', [
m('td', m('a.btn.btn-xs.btn-default', {href: item.session.baseURL.replace('://', '://workbench.')+'collections/'+item.uuid}, 'Show')),
m('td.arvados-uuid', item.uuid),
? m('span.label.label-xs.label-danger', 'none')
: vnode.state.loader.children.map(function(child) {
return [m('span.label.label-xs', {
? m('span.label.label-xs.label-danger', 'none')
: vnode.state.loader.children.map(function(child) {
return [m('span.label.label-xs', {
- className: child.items() ? 'label-success' : 'label-warning',
+ className: child.state == child.LOADING ? 'label-warning' : 'label-success',
}, child.sessionKey), ' ']
}),
' ',
}, child.sessionKey), ' ']
}),
' ',
LOADING: 'loading',
READY: 'ready',
LOADING: 'loading',
READY: 'ready',
thresholdItem: null,
loadMore: function() {
if (loader.state == loader.DONE || loader.state == loader.LOADING)
thresholdItem: null,
loadMore: function() {
if (loader.state == loader.DONE || loader.state == loader.LOADING)
] : []
loader.state = loader.LOADING
loader.loadFunc(filters).then(function(resp) {
] : []
loader.state = loader.LOADING
loader.loadFunc(filters).then(function(resp) {
- var items = loader.items() || []
+ var items = loader.items()
Array.prototype.push.apply(items, resp.items)
if (resp.items.length == 0) {
loader.state = loader.DONE
Array.prototype.push.apply(items, resp.items)
if (resp.items.length == 0) {
loader.state = loader.DONE
var loader = this
Object.assign(loader, config, {
// Sorted items ready to display, merged from all children.
var loader = this
Object.assign(loader, config, {
// Sorted items ready to display, merged from all children.
state: 'ready',
DONE: 'done',
LOADING: 'loading',
state: 'ready',
DONE: 'done',
LOADING: 'loading',
// cutoff is the topmost (recent) of {bottom (oldest) entry of
// any child that still has more pages left to fetch}
var cutoff
// cutoff is the topmost (recent) of {bottom (oldest) entry of
// any child that still has more pages left to fetch}
var cutoff
+ var cutoffUnknown = false
loader.children.forEach(function(child) {
loader.children.forEach(function(child) {
+ if (child.state == child.DONE)
+ return
var items = child.items()
var items = child.items()
- if (items.length == 0 || child.state == child.DONE)
+ if (items.length == 0) {
+ // No idea what's coming in the next page.
+ cutoffUnknown = true
var last = items[items.length-1].modified_at
if (!cutoff || cutoff < last)
cutoff = last
})
var last = items[items.length-1].modified_at
if (!cutoff || cutoff < last)
cutoff = last
})
+ if (cutoffUnknown)
+ return
var combined = []
loader.children.forEach(function(child) {
child.itemsDisplayed = 0
var combined = []
loader.children.forEach(function(child) {
child.itemsDisplayed = 0