chore: lint-fix

pull/717/head
Samuel 2 years ago
parent a974078289
commit 7b3155efe5

@ -127,5 +127,5 @@ export default {
deleteList, deleteList,
handleListDelete, handleListDelete,
sortList, sortList,
handleListSort handleListSort,
}; };

@ -8,7 +8,7 @@ import { useSteps } from '../../hooks';
import DeleteStep from '../DeleteStep'; import DeleteStep from '../DeleteStep';
import styles from './ActionsStep.module.scss'; import styles from './ActionsStep.module.scss';
import SortStep from "../SortStep"; import SortStep from '../SortStep';
const StepTypes = { const StepTypes = {
DELETE: 'DELETE', DELETE: 'DELETE',
@ -38,25 +38,19 @@ const ActionsStep = React.memo(({ onNameEdit, onCardAdd, onDelete, onSort, onClo
}, [openStep]); }, [openStep]);
if (step && step.type) { if (step && step.type) {
switch (step.type){ switch (step.type) {
case StepTypes.DELETE: case StepTypes.DELETE:
return ( return (
<DeleteStep <DeleteStep
title="common.deleteList" title="common.deleteList"
content="common.areYouSureYouWantToDeleteThisList" content="common.areYouSureYouWantToDeleteThisList"
buttonContent="action.deleteList" buttonContent="action.deleteList"
onConfirm={onDelete} onConfirm={onDelete}
onBack={handleBack}
/>
);
case StepTypes.SORT:
return (
<SortStep
title="common.sortList"
onSort={onSort}
onBack={handleBack} onBack={handleBack}
/> />
); );
case StepTypes.SORT:
return <SortStep title="common.sortList" onSort={onSort} onBack={handleBack} />;
default: default:
} }
} }

@ -16,7 +16,18 @@ import { ReactComponent as PlusMathIcon } from '../../assets/images/plus-math-ic
import styles from './List.module.scss'; import styles from './List.module.scss';
const List = React.memo( 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 [t] = useTranslation();
const [isAddCardOpened, setIsAddCardOpened] = useState(false); const [isAddCardOpened, setIsAddCardOpened] = useState(false);

@ -1,7 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { useTranslation } from 'react-i18next'; 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 { Popup } from '../../lib/custom-ui';
import styles from './SortStep.module.scss'; import styles from './SortStep.module.scss';
@ -9,7 +9,7 @@ import styles from './SortStep.module.scss';
const SortStep = React.memo(({ title, onSort, onBack }) => { const SortStep = React.memo(({ title, onSort, onBack }) => {
const [t] = useTranslation(); const [t] = useTranslation();
const handeClick = (sortType) => onSort({sortType}) const handeClick = (sortType) => onSort({ sortType });
return ( return (
<> <>
@ -19,28 +19,28 @@ const SortStep = React.memo(({ title, onSort, onBack }) => {
})} })}
</Popup.Header> </Popup.Header>
<Popup.Content> <Popup.Content>
<Menu secondary vertical className={styles.menu}> <Menu secondary vertical className={styles.menu}>
<Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_asc')}> <Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_asc')}>
{t('action.sort.createdFirst', { {t('action.sort.createdFirst', {
context: 'title', context: 'title',
})} })}
</Menu.Item> </Menu.Item>
<Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_desc')}> <Menu.Item className={styles.menuItem} onClick={() => handeClick('createdat_desc')}>
{t('action.sort.createdLast', { {t('action.sort.createdLast', {
context: 'title', context: 'title',
})} })}
</Menu.Item> </Menu.Item>
<Menu.Item className={styles.menuItem} onClick={() => handeClick('name_asc')}> <Menu.Item className={styles.menuItem} onClick={() => handeClick('name_asc')}>
{t('action.sort.name', { {t('action.sort.name', {
context: 'title', context: 'title',
})} })}
</Menu.Item> </Menu.Item>
<Menu.Item className={styles.menuItem} onClick={() => handeClick('duedate_asc')}> <Menu.Item className={styles.menuItem} onClick={() => handeClick('duedate_asc')}>
{t('action.sort.due', { {t('action.sort.due', {
context: 'title', context: 'title',
})} })}
</Menu.Item> </Menu.Item>
</Menu> </Menu>
</Popup.Content> </Popup.Content>
</> </>
); );

@ -52,13 +52,14 @@ const handleListDelete = (list) => ({
}); });
const sortList = (id, data) => { const sortList = (id, data) => {
return ({ return {
type: EntryActionTypes.LIST_SORT, type: EntryActionTypes.LIST_SORT,
payload: { payload: {
id, id,
data data,
}, },
})}; };
};
const handleListSort = (list) => ({ const handleListSort = (list) => ({
type: EntryActionTypes.LIST_SORT_HANDLE, type: EntryActionTypes.LIST_SORT_HANDLE,
@ -67,7 +68,6 @@ const handleListSort = (list) => ({
}, },
}); });
export default { export default {
createListInCurrentBoard, createListInCurrentBoard,
handleListCreate, handleListCreate,

@ -18,10 +18,10 @@ export default function* listsWatchers() {
services.handleListUpdate(list), services.handleListUpdate(list),
), ),
takeEvery(EntryActionTypes.LIST_SORT, ({ payload: { id, data } }) => takeEvery(EntryActionTypes.LIST_SORT, ({ payload: { id, data } }) =>
services.sortList(id, data), services.sortList(id, data),
), ),
takeEvery(EntryActionTypes.LIST_SORT_HANDLE, ({ payload: { list } }) => takeEvery(EntryActionTypes.LIST_SORT_HANDLE, ({ payload: { list } }) =>
services.handleListSort(list), services.handleListSort(list),
), ),
takeEvery(EntryActionTypes.LIST_MOVE, ({ payload: { id, index } }) => takeEvery(EntryActionTypes.LIST_MOVE, ({ payload: { id, index } }) =>
services.moveList(id, index), services.moveList(id, index),

Loading…
Cancel
Save