(state, collectionId)
| 203 | } |
| 204 | |
| 205 | export function selectCollection(state, collectionId) { |
| 206 | const collection = selectObject(state, state.collections, collectionId); |
| 207 | const status = collection.status || {}; |
| 208 | status.pending = status.pending || 0; |
| 209 | status.running = status.running || 0; |
| 210 | status.finished = status.finished || 0; |
| 211 | status.active = status.pending + status.running; |
| 212 | status.total = status.active + status.finished; |
| 213 | status.progress = status.finished / status.total; |
| 214 | status.percent = Math.round(status.progress * 100); |
| 215 | collection.status = status; |
| 216 | return collection; |
| 217 | } |
| 218 | |
| 219 | export function selectEntity(state, entityId) { |
| 220 | const entity = selectObject(state, state.entities, entityId); |
no test coverage detected