feat: Add ability to copy/cut cards with shortcut support

This commit is contained in:
Maksim Eltyshev
2025-12-09 14:58:01 +01:00
parent 52acc9de90
commit 9e6e38fcf7
113 changed files with 1616 additions and 259 deletions
@@ -7,7 +7,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { Icon, Message } from 'semantic-ui-react';
const FileIsTooBig = React.memo(() => {
const FileIsTooBigToast = React.memo(() => {
const [t] = useTranslation();
return (
@@ -18,4 +18,4 @@ const FileIsTooBig = React.memo(() => {
);
});
export default FileIsTooBig;
export default FileIsTooBigToast;
@@ -7,7 +7,7 @@ import React from 'react';
import { useTranslation } from 'react-i18next';
import { Icon, Message } from 'semantic-ui-react';
const NotEnoughStorage = React.memo(() => {
const NotEnoughStorageToast = React.memo(() => {
const [t] = useTranslation();
return (
@@ -18,4 +18,4 @@ const NotEnoughStorage = React.memo(() => {
);
});
export default NotEnoughStorage;
export default NotEnoughStorageToast;
@@ -0,0 +1,21 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Icon, Message } from 'semantic-ui-react';
const SourceCardNotCopyableToast = React.memo(() => {
const [t] = useTranslation();
return (
<Message visible negative size="tiny">
<Icon name="paste" />
{t('common.sourceCardIsNoLongerAvailableForCopying')}
</Message>
);
});
export default SourceCardNotCopyableToast;
@@ -0,0 +1,21 @@
/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Icon, Message } from 'semantic-ui-react';
const SourceCardNotMovableToast = React.memo(() => {
const [t] = useTranslation();
return (
<Message visible negative size="tiny">
<Icon name="paste" />
{t('common.sourceCardIsNoLongerAvailableForMoving')}
</Message>
);
});
export default SourceCardNotMovableToast;
@@ -7,14 +7,18 @@ import React from 'react';
import { Toaster as HotToaster, ToastBar as HotToastBar } from 'react-hot-toast';
import ToastTypes from '../../../constants/ToastTypes';
import FileIsTooBig from './FileIsTooBig';
import NotEnoughStorage from './NotEnoughStorage';
import FileIsTooBigToast from './FileIsTooBigToast';
import NotEnoughStorageToast from './NotEnoughStorageToast';
import EmptyTrashToast from './EmptyTrashToast';
import SourceCardNotCopyableToast from './SourceCardNotCopyableToast';
import SourceCardNotMovableToast from './SourceCardNotMovableToast';
const TOAST_BY_TYPE = {
[ToastTypes.FILE_IS_TOO_BIG]: FileIsTooBig,
[ToastTypes.NOT_ENOUGH_STORAGE]: NotEnoughStorage,
[ToastTypes.FILE_IS_TOO_BIG]: FileIsTooBigToast,
[ToastTypes.NOT_ENOUGH_STORAGE]: NotEnoughStorageToast,
[ToastTypes.EMPTY_TRASH]: EmptyTrashToast,
[ToastTypes.SOURCE_CARD_NOT_COPYABLE]: SourceCardNotCopyableToast,
[ToastTypes.SOURCE_CARD_NOT_MOVABLE]: SourceCardNotMovableToast,
};
const Toaster = React.memo(() => (