1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

feat: Description icon on front of cards

Closes #563
This commit is contained in:
Maksim Eltyshev 2024-10-22 21:22:46 +02:00
parent 13e0dde728
commit 96a1049fb6
4 changed files with 31 additions and 4 deletions

View file

@ -23,6 +23,7 @@ const Card = React.memo(
id,
index,
name,
description,
dueDate,
isDueDateCompleted,
stopwatch,
@ -106,7 +107,7 @@ const Card = React.memo(
)}
<div className={styles.name}>{name}</div>
{tasks.length > 0 && <Tasks items={tasks} />}
{(dueDate || stopwatch || notificationsTotal > 0) && (
{(description || dueDate || stopwatch || notificationsTotal > 0) && (
<span className={styles.attachments}>
{notificationsTotal > 0 && (
<span
@ -135,6 +136,13 @@ const Card = React.memo(
/>
</span>
)}
{description && (
<span className={classNames(styles.attachment, styles.attachmentLeft)}>
<span className={styles.attachmentContent}>
<Icon name="align left" />
</span>
</span>
)}
</span>
)}
{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,

View file

@ -39,6 +39,13 @@
vertical-align: top;
}
.attachmentContent {
color: #6a808b;
font-size: 12px;
line-height: 20px;
padding: 0px 3px;
}
.attachmentLeft {
margin-right: 4px;
}

View file

@ -369,7 +369,7 @@ const CardModal = React.memo(
{(description || canEdit) && (
<div className={styles.contentModule}>
<div className={styles.moduleWrapper}>
<Icon name="align justify" className={styles.moduleIcon} />
<Icon name="align left" className={styles.moduleIcon} />
<div className={styles.moduleHeader}>{t('common.description')}</div>
{canEdit ? (
<DescriptionEdit defaultValue={description} onUpdate={handleDescriptionUpdate}>

View file

@ -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,