diff --git a/client/src/components/BoardMembershipsStep/BoardMembershipsStep.jsx b/client/src/components/BoardMembershipsStep/BoardMembershipsStep.jsx index af181d73..d6456e1f 100755 --- a/client/src/components/BoardMembershipsStep/BoardMembershipsStep.jsx +++ b/client/src/components/BoardMembershipsStep/BoardMembershipsStep.jsx @@ -12,18 +12,18 @@ import styles from './BoardMembershipsStep.module.scss'; const BoardMembershipsStep = React.memo( ({ items, currentUserIds, title, onUserSelect, onUserDeselect, onBack }) => { const [t] = useTranslation(); - const [searchValue, handleSearchFieldChange] = useField(''); - const search = useMemo(() => searchValue.trim().toLowerCase(), [searchValue]); + const [search, handleSearchChange] = useField(''); + const cleanSearch = useMemo(() => search.trim().toLowerCase(), [search]); const filteredItems = useMemo( () => items.filter( ({ user }) => - user.email.includes(search) || - user.name.toLowerCase().includes(search) || - (user.username && user.username.includes(search)), + user.email.includes(cleanSearch) || + user.name.toLowerCase().includes(cleanSearch) || + (user.username && user.username.includes(cleanSearch)), ), - [items, search], + [items, cleanSearch], ); const searchField = useRef(null); @@ -48,15 +48,19 @@ const BoardMembershipsStep = React.memo( return ( <> - {t(title)} + + {t(title, { + context: 'title', + })} + {filteredItems.length > 0 && ( diff --git a/client/src/components/CardMoveStep/CardMoveStep.jsx b/client/src/components/CardMoveStep/CardMoveStep.jsx index f92b3b10..be8bfe39 100644 --- a/client/src/components/CardMoveStep/CardMoveStep.jsx +++ b/client/src/components/CardMoveStep/CardMoveStep.jsx @@ -36,7 +36,7 @@ const CardMoveStep = React.memo( [selectedBoard, path.listId], ); - const handleBoardIdFieldChange = useCallback( + const handleBoardIdChange = useCallback( (event, data) => { if (selectedProject.boards.find((board) => board.id === data.value).isFetching === null) { onBoardFetch(data.value); @@ -102,7 +102,7 @@ const CardMoveStep = React.memo( } disabled={selectedProject.boards.length === 0} className={styles.field} - onChange={handleBoardIdFieldChange} + onChange={handleBoardIdChange} /> )} diff --git a/client/src/components/Header/NotificationsPopup.jsx b/client/src/components/Header/NotificationsPopup.jsx index e2645d34..ff98a66b 100755 --- a/client/src/components/Header/NotificationsPopup.jsx +++ b/client/src/components/Header/NotificationsPopup.jsx @@ -74,7 +74,11 @@ const NotificationsStep = React.memo(({ items, onDelete, onClose }) => { return ( <> - {t('common.notifications')} + + {t('common.notifications', { + context: 'title', + })} + {items.length > 0 ? items.map((item) => ( diff --git a/client/src/components/LabelsStep/LabelsStep.jsx b/client/src/components/LabelsStep/LabelsStep.jsx index ad39e3c9..9928acfe 100755 --- a/client/src/components/LabelsStep/LabelsStep.jsx +++ b/client/src/components/LabelsStep/LabelsStep.jsx @@ -21,17 +21,17 @@ const LabelsStep = React.memo( ({ items, currentIds, title, onSelect, onDeselect, onCreate, onUpdate, onDelete, onBack }) => { const [t] = useTranslation(); const [step, openStep, handleBack] = useSteps(); - const [searchValue, handleSearchFieldChange] = useField(''); - const search = useMemo(() => searchValue.trim().toLowerCase(), [searchValue]); + const [search, handleSearchChange] = useField(''); + const cleanSearch = useMemo(() => search.trim().toLowerCase(), [search]); const filteredItems = useMemo( () => items.filter( (label) => - (label.name && label.name.toLowerCase().includes(search)) || - label.color.includes(search), + (label.name && label.name.toLowerCase().includes(cleanSearch)) || + label.color.includes(cleanSearch), ), - [items, search], + [items, cleanSearch], ); const searchField = useRef(null); @@ -109,15 +109,19 @@ const LabelsStep = React.memo( return ( <> - {t(title)} + + {t(title, { + context: 'title', + })} + {filteredItems.length > 0 && (
diff --git a/client/src/components/Memberships/AddPopup/AddPopup.jsx b/client/src/components/Memberships/AddPopup/AddPopup.jsx index b01bff13..4c460979 100755 --- a/client/src/components/Memberships/AddPopup/AddPopup.jsx +++ b/client/src/components/Memberships/AddPopup/AddPopup.jsx @@ -17,18 +17,18 @@ const AddStep = React.memo( ({ users, currentUserIds, permissionsSelectStep, title, onCreate, onClose }) => { const [t] = useTranslation(); const [step, openStep, handleBack] = useSteps(); - const [searchValue, handleSearchFieldChange] = useField(''); - const search = useMemo(() => searchValue.trim().toLowerCase(), [searchValue]); + const [search, handleSearchChange] = useField(''); + const cleanSearch = useMemo(() => search.trim().toLowerCase(), [search]); const filteredUsers = useMemo( () => users.filter( (user) => - user.email.includes(search) || - user.name.toLowerCase().includes(search) || - (user.username && user.username.includes(search)), + user.email.includes(cleanSearch) || + user.name.toLowerCase().includes(cleanSearch) || + (user.username && user.username.includes(cleanSearch)), ), - [users, search], + [users, cleanSearch], ); const searchField = useRef(null); @@ -102,10 +102,10 @@ const AddStep = React.memo( {filteredUsers.length > 0 && (
diff --git a/client/src/locales/ru/core.js b/client/src/locales/ru/core.js index e9e88d30..251da210 100644 --- a/client/src/locales/ru/core.js +++ b/client/src/locales/ru/core.js @@ -137,7 +137,7 @@ export default { time: 'Время', timer: 'Таймер', title: 'Название', - userActions_title: 'Действия с пользователем', + userActions: 'Действия с пользователем', userAddedThisCardToList: '<0>{{user}}<1> добавил(а) эту карточку в {{list}}', userLeftNewCommentToCard: '{{user}} оставил(а) комментарий «{{comment}}» к <2>{{card}}', userMovedCardFromListToList: diff --git a/server/db/migrations/20220725150723_add_language_to_user_account_table.js b/server/db/migrations/20220725150723_add_language_to_user_account_table.js index b048a3ab..21db79ba 100644 --- a/server/db/migrations/20220725150723_add_language_to_user_account_table.js +++ b/server/db/migrations/20220725150723_add_language_to_user_account_table.js @@ -1,11 +1,11 @@ -module.exports.up = async (knex) => +module.exports.up = (knex) => knex.schema.table('user_account', (table) => { /* Columns */ table.text('language'); }); -module.exports.down = async (knex) => +module.exports.down = (knex) => knex.schema.table('user_account', (table) => { table.dropColumn('language'); }); diff --git a/server/db/migrations/20220803221221_add_password_changed_at_to_user_account_table.js b/server/db/migrations/20220803221221_add_password_changed_at_to_user_account_table.js index 5d636967..5cf937c1 100644 --- a/server/db/migrations/20220803221221_add_password_changed_at_to_user_account_table.js +++ b/server/db/migrations/20220803221221_add_password_changed_at_to_user_account_table.js @@ -1,11 +1,11 @@ -module.exports.up = async (knex) => +module.exports.up = (knex) => knex.schema.table('user_account', (table) => { /* Columns */ table.timestamp('password_changed_at', true); }); -module.exports.down = async (knex) => +module.exports.down = (knex) => knex.schema.table('user_account', (table) => { table.dropColumn('password_changed_at'); });