MCPcopy Create free account
hub / github.com/alephdata/aleph / selectCollection

Function selectCollection

ui/src/selectors.js:205–217  ·  view source on GitHub ↗
(state, collectionId)

Source from the content-addressed store, hash-verified

203}
204
205export 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
219export function selectEntity(state, entityId) {
220 const entity = selectObject(state, state.entities, entityId);

Callers 15

mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90
mapStateToPropsFunction · 0.90

Calls 1

selectObjectFunction · 0.85

Tested by

no test coverage detected