diff --git a/client/src/components/CardModal/CardModal.jsx b/client/src/components/CardModal/CardModal.jsx index ff77aa97..0c3a5fab 100755 --- a/client/src/components/CardModal/CardModal.jsx +++ b/client/src/components/CardModal/CardModal.jsx @@ -1,4 +1,4 @@ -import React, { useCallback, useRef } from 'react'; +import React, { useCallback, useRef, useState } from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { useTranslation } from 'react-i18next'; @@ -83,6 +83,7 @@ const CardModal = React.memo( const [t] = useTranslation(); const isGalleryOpened = useRef(false); + const [isLinkCopied, setIsLinkCopied] = useState(false); const handleToggleStopwatchClick = useCallback(() => { onUpdate({ @@ -162,6 +163,14 @@ const CardModal = React.memo( onClose(); }, [onClose]); + const handleLinkCopyClick = useCallback(() => { + navigator.clipboard.writeText(window.location.href); + setIsLinkCopied(true); + setTimeout(() => { + setIsLinkCopied(false); + }, 5000); + }, []); + const AttachmentAddPopup = usePopup(AttachmentAddStep); const BoardMembershipsPopup = usePopup(BoardMembershipsStep); const LabelsPopup = usePopup(LabelsStep); @@ -517,6 +526,10 @@ const CardModal = React.memo( {t('action.delete')} + )} diff --git a/client/src/locales/de/core.js b/client/src/locales/de/core.js index 0b743de5..cdc5a408 100644 --- a/client/src/locales/de/core.js +++ b/client/src/locales/de/core.js @@ -201,6 +201,8 @@ export default { hideDetails: 'Details ausblenden', leaveBoard: 'Board verlassen', leaveProject: 'Projekt verlassen', + linkCopy: 'Link kopieren', + linkIsCopied: 'Link kopiert', logOut_title: 'Ausloggen', makeCover_title: 'Als Vorschau festlegen', move: 'Verschieben', diff --git a/client/src/locales/en/core.js b/client/src/locales/en/core.js index 2fd51243..07dedde7 100644 --- a/client/src/locales/en/core.js +++ b/client/src/locales/en/core.js @@ -220,6 +220,8 @@ export default { import: 'Import', leaveBoard: 'Leave board', leaveProject: 'Leave project', + linkCopy: 'Copy link', + linkIsCopied: 'Link is copied', logOut_title: 'Log Out', makeCover_title: 'Make Cover', move: 'Move', diff --git a/server/api/helpers/boards/import-from-trello.js b/server/api/helpers/boards/import-from-trello.js index a7b54238..c67db959 100644 --- a/server/api/helpers/boards/import-from-trello.js +++ b/server/api/helpers/boards/import-from-trello.js @@ -82,8 +82,12 @@ module.exports = { const importComments = async (plankaCard, trelloCard) => { const trelloComments = getTrelloCommentsOfCard(trelloCard.id); trelloComments.sort((a, b) => new Date(a.date).getTime() - new Date(b.date).getTime()); + if (trelloCard.id === '64e5c9be1f2b91b351be443b') { + console.log(trelloComments); + } + console.log('trelloComments', trelloComments.length); - return Promise.all( + const result = Promise.allSettled( trelloComments.map(async (trelloComment) => { return Action.create({ cardId: plankaCard.id, @@ -94,9 +98,23 @@ module.exports = { `${trelloComment.data.text}\n\n---\n*Note: imported comment, originally posted by ` + `\n${trelloComment.memberCreator.fullName} (${trelloComment.memberCreator.username}) on ${trelloComment.date}*`, }, - }).fetch(); + }) + .fetch() + .catch((err) => { + console.log('err', err); + }); }), ); + const res = await result; + if (res.length > 0) { + for (let i = 0; i < res.length; i++) { + if (res[i].status === 'rejected') { + console.log('res[i].reason', res[i].reason); + } + } + } + + return result; }; const importCards = async (plankaList, trelloList) => {