From 96a1049fb6c0f30fc411bed2849972f446649169 Mon Sep 17 00:00:00 2001 From: Maksim Eltyshev Date: Tue, 22 Oct 2024 21:22:46 +0200 Subject: [PATCH] feat: Description icon on front of cards Closes #563 --- client/src/components/Card/Card.jsx | 12 +++++++++++- client/src/components/Card/Card.module.scss | 7 +++++++ client/src/components/CardModal/CardModal.jsx | 2 +- client/src/containers/CardContainer.js | 14 ++++++++++++-- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/client/src/components/Card/Card.jsx b/client/src/components/Card/Card.jsx index 43708f10..d715ac3c 100755 --- a/client/src/components/Card/Card.jsx +++ b/client/src/components/Card/Card.jsx @@ -23,6 +23,7 @@ const Card = React.memo( id, index, name, + description, dueDate, isDueDateCompleted, stopwatch, @@ -106,7 +107,7 @@ const Card = React.memo( )}
{name}
{tasks.length > 0 && } - {(dueDate || stopwatch || notificationsTotal > 0) && ( + {(description || dueDate || stopwatch || notificationsTotal > 0) && ( {notificationsTotal > 0 && ( )} + {description && ( + + + + + + )} )} {users.length > 0 && ( @@ -221,6 +229,7 @@ Card.propTypes = { id: PropTypes.string.isRequired, index: PropTypes.number.isRequired, name: PropTypes.string.isRequired, + description: PropTypes.string, dueDate: PropTypes.instanceOf(Date), isDueDateCompleted: PropTypes.bool, stopwatch: PropTypes.object, // eslint-disable-line react/forbid-prop-types @@ -256,6 +265,7 @@ Card.propTypes = { }; Card.defaultProps = { + description: undefined, dueDate: undefined, isDueDateCompleted: undefined, stopwatch: undefined, diff --git a/client/src/components/Card/Card.module.scss b/client/src/components/Card/Card.module.scss index 390f0442..be74a587 100644 --- a/client/src/components/Card/Card.module.scss +++ b/client/src/components/Card/Card.module.scss @@ -39,6 +39,13 @@ vertical-align: top; } + .attachmentContent { + color: #6a808b; + font-size: 12px; + line-height: 20px; + padding: 0px 3px; + } + .attachmentLeft { margin-right: 4px; } diff --git a/client/src/components/CardModal/CardModal.jsx b/client/src/components/CardModal/CardModal.jsx index 473664e3..b31a1f05 100755 --- a/client/src/components/CardModal/CardModal.jsx +++ b/client/src/components/CardModal/CardModal.jsx @@ -369,7 +369,7 @@ const CardModal = React.memo( {(description || canEdit) && (
- +
{t('common.description')}
{canEdit ? ( diff --git a/client/src/containers/CardContainer.js b/client/src/containers/CardContainer.js index 16e663bc..898280a3 100755 --- a/client/src/containers/CardContainer.js +++ b/client/src/containers/CardContainer.js @@ -20,8 +20,17 @@ const makeMapStateToProps = () => { const allLabels = selectors.selectLabelsForCurrentBoard(state); const currentUserMembership = selectors.selectCurrentUserMembershipForCurrentBoard(state); - const { name, dueDate, isDueDateCompleted, stopwatch, coverUrl, boardId, listId, isPersisted } = - selectCardById(state, id); + const { + name, + description, + dueDate, + isDueDateCompleted, + stopwatch, + coverUrl, + boardId, + listId, + isPersisted, + } = selectCardById(state, id); const users = selectUsersByCardId(state, id); const labels = selectLabelsByCardId(state, id); @@ -35,6 +44,7 @@ const makeMapStateToProps = () => { id, index, name, + description, dueDate, isDueDateCompleted, stopwatch,