mirror of
https://github.com/plankanban/planka.git
synced 2025-08-10 07:55:27 +02:00
chore: lint-fix
This commit is contained in:
parent
a974078289
commit
7b3155efe5
6 changed files with 53 additions and 48 deletions
|
@ -127,5 +127,5 @@ export default {
|
|||
deleteList,
|
||||
handleListDelete,
|
||||
sortList,
|
||||
handleListSort
|
||||
handleListSort,
|
||||
};
|
||||
|
|
|
@ -8,7 +8,7 @@ import { useSteps } from '../../hooks';
|
|||
import DeleteStep from '../DeleteStep';
|
||||
|
||||
import styles from './ActionsStep.module.scss';
|
||||
import SortStep from "../SortStep";
|
||||
import SortStep from '../SortStep';
|
||||
|
||||
const StepTypes = {
|
||||
DELETE: 'DELETE',
|
||||
|
@ -38,25 +38,19 @@ const ActionsStep = React.memo(({ onNameEdit, onCardAdd, onDelete, onSort, onClo
|
|||
}, [openStep]);
|
||||
|
||||
if (step && step.type) {
|
||||
switch (step.type){
|
||||
switch (step.type) {
|
||||
case StepTypes.DELETE:
|
||||
return (
|
||||
<DeleteStep
|
||||
title="common.deleteList"
|
||||
content="common.areYouSureYouWantToDeleteThisList"
|
||||
buttonContent="action.deleteList"
|
||||
onConfirm={onDelete}
|
||||
onBack={handleBack}
|
||||
/>
|
||||
<DeleteStep
|
||||
title="common.deleteList"
|
||||
content="common.areYouSureYouWantToDeleteThisList"
|
||||
buttonContent="action.deleteList"
|
||||
onConfirm={onDelete}
|
||||
onBack={handleBack}
|
||||
/>
|
||||
);
|
||||
case StepTypes.SORT:
|
||||
return (
|
||||
<SortStep
|
||||
title="common.sortList"
|
||||
onSort={onSort}
|
||||
onBack={handleBack}
|
||||
/>
|
||||
);
|
||||
return <SortStep title="common.sortList" onSort={onSort} onBack={handleBack} />;
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,18 @@ import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-ic
|
|||
import styles from './List.module.scss';
|
||||
|
||||
const List = React.memo(
|
||||
({ id, index, name, isPersisted, cardIds, canEdit, onUpdate, onDelete, onSort, onCardCreate }) => {
|
||||
({
|
||||
id,
|
||||
index,
|
||||
name,
|
||||
isPersisted,
|
||||
cardIds,
|
||||
canEdit,
|
||||
onUpdate,
|
||||
onDelete,
|
||||
onSort,
|
||||
onCardCreate,
|
||||
}) => {
|
||||
const [t] = useTranslation();
|
||||
const [isAddCardOpened, setIsAddCardOpened] = useState(false);
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {Button, Menu} from 'semantic-ui-react';
|
||||
import { Menu } from 'semantic-ui-react';
|
||||
import { Popup } from '../../lib/custom-ui';
|
||||
|
||||
import styles from './SortStep.module.scss';
|
||||
|
@ -9,7 +9,7 @@ import styles from './SortStep.module.scss';
|
|||
const SortStep = React.memo(({ title, onSort, onBack }) => {
|
||||
const [t] = useTranslation();
|
||||
|
||||
const handeClick = (sortType) => onSort({sortType})
|
||||
const handeClick = (sortType) => onSort({ sortType });
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -19,28 +19,28 @@ const SortStep = React.memo(({ title, onSort, onBack }) => {
|
|||
})}
|
||||
</Popup.Header>
|
||||
<Popup.Content>
|
||||
<Menu secondary vertical className={styles.menu}>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_asc')}>
|
||||
{t('action.sort.createdFirst', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_desc')}>
|
||||
{t('action.sort.createdLast', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('name_asc')}>
|
||||
{t('action.sort.name', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('duedate_asc')}>
|
||||
{t('action.sort.due', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
<Menu secondary vertical className={styles.menu}>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_asc')}>
|
||||
{t('action.sort.createdFirst', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_desc')}>
|
||||
{t('action.sort.createdLast', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('name_asc')}>
|
||||
{t('action.sort.name', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
<Menu.Item className={styles.menuItem} onClick={() => handeClick('duedate_asc')}>
|
||||
{t('action.sort.due', {
|
||||
context: 'title',
|
||||
})}
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
</Popup.Content>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -52,13 +52,14 @@ const handleListDelete = (list) => ({
|
|||
});
|
||||
|
||||
const sortList = (id, data) => {
|
||||
return ({
|
||||
return {
|
||||
type: EntryActionTypes.LIST_SORT,
|
||||
payload: {
|
||||
id,
|
||||
data
|
||||
data,
|
||||
},
|
||||
})};
|
||||
};
|
||||
};
|
||||
|
||||
const handleListSort = (list) => ({
|
||||
type: EntryActionTypes.LIST_SORT_HANDLE,
|
||||
|
@ -67,7 +68,6 @@ const handleListSort = (list) => ({
|
|||
},
|
||||
});
|
||||
|
||||
|
||||
export default {
|
||||
createListInCurrentBoard,
|
||||
handleListCreate,
|
||||
|
|
|
@ -18,10 +18,10 @@ export default function* listsWatchers() {
|
|||
services.handleListUpdate(list),
|
||||
),
|
||||
takeEvery(EntryActionTypes.LIST_SORT, ({ payload: { id, data } }) =>
|
||||
services.sortList(id, data),
|
||||
services.sortList(id, data),
|
||||
),
|
||||
takeEvery(EntryActionTypes.LIST_SORT_HANDLE, ({ payload: { list } }) =>
|
||||
services.handleListSort(list),
|
||||
services.handleListSort(list),
|
||||
),
|
||||
takeEvery(EntryActionTypes.LIST_MOVE, ({ payload: { id, index } }) =>
|
||||
services.moveList(id, index),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue