diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 54ed422a8..abff8f9dc 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -63,6 +63,11 @@ "Calculations.Options.range.label": "Range", "Calculations.Options.sum.displayName": "Sum", "Calculations.Options.sum.label": "Sum", + "CalendarCard.untitled": "Untitled", + "CardActionsMenu.copiedLink": "Copied!", + "CardActionsMenu.copyLink": "Copy link", + "CardActionsMenu.delete": "Delete", + "CardActionsMenu.duplicate": "Duplicate", "CardBadges.title-checkboxes": "Checkboxes", "CardBadges.title-comments": "Comments", "CardBadges.title-description": "This card has a description", @@ -87,8 +92,6 @@ "CardDetailProperty.property-deleted": "Deleted {propertyName} successfully!", "CardDetailProperty.property-name-change-subtext": "type from \"{oldPropType}\" to \"{newPropType}\"", "CardDetial.limited-link": "Learn more about our plans.", - "CardDialog.copiedLink": "Copied!", - "CardDialog.copyLink": "Copy link", "CardDialog.delete-confirmation-dialog-button-text": "Delete", "CardDialog.delete-confirmation-dialog-heading": "Confirm card delete!", "CardDialog.editing-template": "You're editing a template.", @@ -144,17 +147,9 @@ "FindBoardsDialog.NoResultsSubtext": "Check the spelling or try another search.", "FindBoardsDialog.SubTitle": "Type to find a board. Use UP/DOWN to browse. ENTER to select, ESC to dismiss", "FindBoardsDialog.Title": "Find Boards", - "GalleryCard.copiedLink": "Copied!", - "GalleryCard.copyLink": "Copy link", - "GalleryCard.delete": "Delete", - "GalleryCard.duplicate": "Duplicate", "GroupBy.hideEmptyGroups": "Hide {count} empty groups", "GroupBy.showHiddenGroups": "Show {count} hidden groups", "GroupBy.ungroup": "Ungroup", - "KanbanCard.copiedLink": "Copied!", - "KanbanCard.copyLink": "Copy link", - "KanbanCard.delete": "Delete", - "KanbanCard.duplicate": "Duplicate", "KanbanCard.untitled": "Untitled", "Mutator.new-board-from-template": "new board from template", "Mutator.new-card-from-template": "new card from template", diff --git a/webapp/src/components/calendar/__snapshots__/fullCalendar.test.tsx.snap b/webapp/src/components/calendar/__snapshots__/fullCalendar.test.tsx.snap index 825fba18b..38e26df3c 100644 --- a/webapp/src/components/calendar/__snapshots__/fullCalendar.test.tsx.snap +++ b/webapp/src/components/calendar/__snapshots__/fullCalendar.test.tsx.snap @@ -727,6 +727,20 @@ exports[`components/calendar/toolbar return calendar, no date property 1`] = `
+
@@ -2987,6 +3001,20 @@ exports[`components/calendar/toolbar return calendar, with date property not set
+
@@ -5945,6 +5973,20 @@ exports[`components/calendar/toolbar return calendar, with date property set 1`]
+
@@ -7513,6 +7555,20 @@ exports[`components/calendar/toolbar return calendar, without permissions 1`] =
+
diff --git a/webapp/src/components/calendar/fullCalendar.tsx b/webapp/src/components/calendar/fullCalendar.tsx index 930ce2a92..b6c7ec678 100644 --- a/webapp/src/components/calendar/fullCalendar.tsx +++ b/webapp/src/components/calendar/fullCalendar.tsx @@ -22,6 +22,11 @@ import {useHasCurrentBoardPermissions} from '../../hooks/permissions' import CardBadges from '../cardBadges' import './fullcalendar.scss' +import MenuWrapper from '../../widgets/menuWrapper' +import IconButton from '../../widgets/buttons/iconButton' +import CardActionsMenu from '../cardActionsMenu/cardActionsMenu' +import OptionsIcon from '../../widgets/icons/options' +import TelemetryClient, {TelemetryActions, TelemetryCategory} from '../../telemetry/telemetryClient' const oneDay = 60 * 60 * 24 * 1000 @@ -121,17 +126,33 @@ const CalendarFullView = (props: Props): JSX.Element|null => { const renderEventContent = (eventProps: EventContentArg): JSX.Element|null => { const {event} = eventProps + const card = cards.find((o) => o.id === event.id) || cards[0] return (
props.showCard(event.id)} > + {!props.readonly && + + }/> + mutator.deleteBlock(card, 'delete card')} + onClickDuplicate={() => { + TelemetryClient.trackEvent(TelemetryCategory, TelemetryActions.DuplicateCard, {board: board.id, card: card.id}) + mutator.duplicateCard(card.id, board.id) + }} + /> + }
{ event.extendedProps.icon ?
{event.extendedProps.icon}
: undefined }
{event.title || intl.formatMessage({id: 'KanbanCard.untitled', defaultMessage: 'Untitled'})}
+ >{event.title || intl.formatMessage({id: 'CalendarCard.untitled', defaultMessage: 'Untitled'})}
{visiblePropertyTemplates.map((template) => ( { o.id === event.id) || cards[0]} + card={card} propertyTemplate={template} showEmptyPlaceholder={false} /> ))} {visibleBadges && - o.id === event.id) || cards[0]}/> } + }
) } diff --git a/webapp/src/components/calendar/fullcalendar.scss b/webapp/src/components/calendar/fullcalendar.scss index 161cecab4..aa5ea3296 100644 --- a/webapp/src/components/calendar/fullcalendar.scss +++ b/webapp/src/components/calendar/fullcalendar.scss @@ -10,6 +10,10 @@ &:hover { background-color: unset; + + .optionsMenu { + display: block; + } } } @@ -19,6 +23,20 @@ align-items: flex-start; } + .optionsMenu { + background-color: rgb(var(--center-channel-bg-rgb)); + border-radius: var(--default-rad); + display: none; + position: absolute; + right: 0; + top: 0; + z-index: 30; + + .IconButton { + background-color: rgba(var(--center-channel-color-rgb), 0.13); + } + } + .octo-tooltip { display: flex; max-width: 100%; @@ -180,7 +198,6 @@ background-color: rgb(var(--center-channel-bg-rgb)); box-shadow: var(--elevation-1); margin: 0 8px 10px; - overflow: hidden; padding: 4px 6px; &:hover::before { diff --git a/webapp/src/components/cardActionsMenu/__snapshots__/cardActionsMenu.test.tsx.snap b/webapp/src/components/cardActionsMenu/__snapshots__/cardActionsMenu.test.tsx.snap new file mode 100644 index 000000000..b2296a3f6 --- /dev/null +++ b/webapp/src/components/cardActionsMenu/__snapshots__/cardActionsMenu.test.tsx.snap @@ -0,0 +1,300 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`components/cardActionsMenu should match snapshot 1`] = ` +
+