Add file attachments

This commit is contained in:
Maksim Eltyshev
2020-04-21 05:04:34 +05:00
parent 202abacaec
commit 6a68ec9c1e
103 changed files with 1847 additions and 305 deletions

View File

@@ -336,6 +336,30 @@ export const tasksForCurrentCardSelector = createSelector(
},
);
export const attachmentsForCurrentCardSelector = createSelector(
orm,
(state) => pathSelector(state).cardId,
({ Card }, id) => {
if (!id) {
return id;
}
const cardModel = Card.withId(id);
if (!cardModel) {
return cardModel;
}
return cardModel
.getOrderedAttachmentsQuerySet()
.toRefArray()
.map((attachment) => ({
...attachment,
isPersisted: !isLocalId(attachment.id),
}));
},
);
export const actionsForCurrentCardSelector = createSelector(
orm,
(state) => pathSelector(state).cardId,