From 3f5f9a83143d13ff21272d1a48e5aa4ddcac1419 Mon Sep 17 00:00:00 2001 From: badaev Date: Mon, 26 Oct 2020 14:39:54 +0800 Subject: [PATCH 1/4] =?UTF-8?q?RocketChat#751=20[EDIT]=20=D0=9F=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF=D0=BE=20=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=83=20"=D0=9C=D0=B5=D1=80=D0=BE=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D1=8F=D1=82=D0=B8=D1=8F"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/councils/client/views/Council.js | 14 ++++++++------ app/councils/client/views/Councils.js | 4 +++- app/councils/client/views/index.js | 4 +++- .../server/methods/downloadCouncilParticipants.js | 2 +- client/components/GenericTable.js | 2 +- packages/rocketchat-i18n/i18n/ru.i18n.json | 6 ++++-- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/councils/client/views/Council.js b/app/councils/client/views/Council.js index 70fab23aef0a..8c90ac7ff711 100644 --- a/app/councils/client/views/Council.js +++ b/app/councils/client/views/Council.js @@ -1,5 +1,5 @@ import React, { useMemo, useState } from 'react'; -import { Box, Button, Field, Label, Table } from '@rocket.chat/fuselage'; +import { Box, Button, Field, Label, Table, TextInput } from '@rocket.chat/fuselage'; import Page from '../../../../client/components/basic/Page'; import { useTranslation } from '../../../../client/contexts/TranslationContext'; @@ -12,7 +12,7 @@ import { useMethod } from '../../../../client/contexts/ServerContext'; import { settings } from '../../../../app/settings/client'; import moment from 'moment'; -const style = { whiteSpace: 'nowrap', textOverflow: 'ellipsis', overflow: 'hidden' }; +const style = { textOverflow: 'ellipsis', overflow: 'hidden' }; export function CouncilPage() { const t = useTranslation(); @@ -61,9 +61,11 @@ export function CouncilPage() { mediaQuery && {t('Joined_at')} ], [mediaQuery]); + const styleTableRow = { 'word-wrap': 'break-word' }; + const renderRow = (invitedUser) => { const iu = invitedUser; - return + return {iu.lastName} {iu.firstName} {iu.patronymic} {iu.position} { mediaQuery && {iu.contactPersonLastName} {iu.contactPersonFirstName} {iu.contactPersonPatronymicName}} @@ -81,13 +83,13 @@ export function CouncilPage() { {t('Date')} - {formatDateAndTime(data.d)} + {formatDateAndTime(data.d)} {t('Description')} - {data.desc} + {data.desc} @@ -99,7 +101,7 @@ export function CouncilPage() { {t('Council_Invited_Users')} - diff --git a/app/councils/client/views/Councils.js b/app/councils/client/views/Councils.js index 31e1cba20085..a17e82cd8fed 100644 --- a/app/councils/client/views/Councils.js +++ b/app/councils/client/views/Councils.js @@ -82,9 +82,11 @@ export function Councils({ const formatDateAndTime = useFormatDateAndTime(); + const styleTr = { 'border-bottom-width': '10px', 'border-bottom-color': 'white' }; + const renderRow = (council) => { const { _id, d: date, desc, ts } = council; - return + return {formatDateAndTime(date)} {statusCouncil(date)} {desc} { mediaQuery && {formatDateAndTime(ts)}} diff --git a/app/councils/client/views/index.js b/app/councils/client/views/index.js index 68625dae2fc7..3a04cc85b14d 100644 --- a/app/councils/client/views/index.js +++ b/app/councils/client/views/index.js @@ -75,10 +75,12 @@ export function CouncilsPage() { setCache(new Date()); }, []); + const styleButton = { 'font-size': '1.3rem', 'background-color': 'var(--button-primary-background)', color: 'var(--button-primary-text-color)' }; + return - diff --git a/app/councils/server/methods/downloadCouncilParticipants.js b/app/councils/server/methods/downloadCouncilParticipants.js index 45a819b74f1b..2dbf700bff25 100644 --- a/app/councils/server/methods/downloadCouncilParticipants.js +++ b/app/councils/server/methods/downloadCouncilParticipants.js @@ -113,7 +113,7 @@ Meteor.methods({ }, }), new TableCell({ - children: [new Paragraph({ text: `${ value.lastName } ${ value.firstName } ${ value.patronymic }`.trim(), alignment: AlignmentType.CENTER })], + children: [new Paragraph({ text: `${ value.lastName.toUpperCase() } ${ value.firstName } ${ value.patronymic }`.trim(), alignment: AlignmentType.CENTER })], verticalAlign: VerticalAlign.CENTER, alignment: AlignmentType.CENTER, width: { diff --git a/client/components/GenericTable.js b/client/components/GenericTable.js index efd134ed07bd..ed6824d5ca69 100644 --- a/client/components/GenericTable.js +++ b/client/components/GenericTable.js @@ -67,7 +67,7 @@ export const GenericTable = forwardRef(function GenericTable({ return Array.from({ length: 10 }, (_, i) => ); }, [header]); - const showingResultsLabel = useCallback(({ count, current, itemsPerPage }) => t('Showing results %s - %s of %s', current + 1, Math.min(current + itemsPerPage, count), count), [t]); + const showingResultsLabel = useCallback(({ count, current, itemsPerPage }) => t('Showing_results %s - %s of %s', current + 1, Math.min(current + itemsPerPage, count), count), [t]); const itemsPerPageLabel = useCallback(() => t('Items_per_page:'), [t]); diff --git a/packages/rocketchat-i18n/i18n/ru.i18n.json b/packages/rocketchat-i18n/i18n/ru.i18n.json index 64a64a559d75..3b281795f046 100755 --- a/packages/rocketchat-i18n/i18n/ru.i18n.json +++ b/packages/rocketchat-i18n/i18n/ru.i18n.json @@ -1908,6 +1908,7 @@ "It_works": "Оно работает", "italic": "Курсивный", "italics": "курсив", + "Items_per_page": "Элементов на странице", "Mobex_sms_gateway_address": "Mobex SMS Gateway Адрес", "Mobex_sms_gateway_address_desc": "IP или хост вашего сервиса Mobex с указанным портом. Например. `http: //192.168.1.1:1401` или` https: //www.example.com:1401`", "Mobex_sms_gateway_from_number": "От", @@ -1986,7 +1987,7 @@ "Launched_successfully": "Успешно запущен", "Layout": "Внешний вид", "Layout_Home_Body": "Текст на главной странице", - "Layout_Home_Title": "Заголовок на главной странице", + "Layout_Home_Title": "Рабочий стол", "Layout_Login_Terms": "Правила составления имения пользователя", "Layout_Privacy_Policy": "Политика конфиденциальности", "Layout_Sidenav_Footer": "Колонтитул навигационной панели", @@ -3017,7 +3018,8 @@ "Show_the_keyboard_shortcut_list": "Показывать список горячих клавиш", "Showing_archived_results": "

Показано %s архивных результатов

", "Showing_online_users": "Показано: __total_showing__. Подключенных: __online__. Всего: __total__ пользователей", - "Showing_results": "

Показано %s результатов

", + "Showing_results": "Показано результатов", + "Showing_results %s - %s of %s": "Показано результатов %s - %s из %s", "Sidebar": "Боковая панель", "Sidebar_list_mode": "Режим отображения списка каналов", "Sign_in_to_start_talking": "Войдите, чтобы начать разговор", From bbd8970727561a06d5ff6ab90422c3f116c27b47 Mon Sep 17 00:00:00 2001 From: badaev Date: Tue, 27 Oct 2020 10:27:38 +0800 Subject: [PATCH 2/4] =?UTF-8?q?RocketChat#751=20[EDIT]=20=D0=9F=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BA=D0=B8=20=D0=BF=D0=BE=20=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D1=83=20"=D0=A0=D0=B0=D0=B1=D0=BE=D1=87?= =?UTF-8?q?=D0=B8=D0=B9=20=D1=81=D1=82=D0=BE=D0=BB"=20|=20=D0=98=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D1=8B=20=D0=B8=D0=BA=D0=BE=D0=BD?= =?UTF-8?q?=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/ui-master/public/icons.svg | 188 +++++++++++++++++- .../public/icons/errands_from_me.svg | 76 +++++++ app/ui-master/public/icons/errands_to_me.svg | 1 + app/ui-master/public/icons/events.svg | 2 + app/ui-master/public/icons/working_group.svg | 1 + .../public/icons/working_group_meetings.svg | 135 +++++++++++++ app/ui-sidenav/client/sideNav.html | 9 - app/ui-sidenav/client/sideNav.js | 3 +- app/ui-sidenav/client/sidebarHeader.js | 69 +++---- app/ui/client/views/app/home.js | 14 +- private/public/icons.svg | 188 +++++++++++++++++- 11 files changed, 627 insertions(+), 59 deletions(-) create mode 100644 app/ui-master/public/icons/errands_from_me.svg create mode 100644 app/ui-master/public/icons/errands_to_me.svg create mode 100644 app/ui-master/public/icons/events.svg create mode 100644 app/ui-master/public/icons/working_group.svg create mode 100644 app/ui-master/public/icons/working_group_meetings.svg diff --git a/app/ui-master/public/icons.svg b/app/ui-master/public/icons.svg index 46bd22d16210..bfd043b673e6 100644 --- a/app/ui-master/public/icons.svg +++ b/app/ui-master/public/icons.svg @@ -115,6 +115,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -400,4 +489,101 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/ui-master/public/icons/errands_from_me.svg b/app/ui-master/public/icons/errands_from_me.svg new file mode 100644 index 000000000000..0a65f9e0e507 --- /dev/null +++ b/app/ui-master/public/icons/errands_from_me.svg @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/ui-master/public/icons/errands_to_me.svg b/app/ui-master/public/icons/errands_to_me.svg new file mode 100644 index 000000000000..fbd52a10f1e8 --- /dev/null +++ b/app/ui-master/public/icons/errands_to_me.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/ui-master/public/icons/events.svg b/app/ui-master/public/icons/events.svg new file mode 100644 index 000000000000..a4449e819ae5 --- /dev/null +++ b/app/ui-master/public/icons/events.svg @@ -0,0 +1,2 @@ + + diff --git a/app/ui-master/public/icons/working_group.svg b/app/ui-master/public/icons/working_group.svg new file mode 100644 index 000000000000..6dd346375df6 --- /dev/null +++ b/app/ui-master/public/icons/working_group.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/ui-master/public/icons/working_group_meetings.svg b/app/ui-master/public/icons/working_group_meetings.svg new file mode 100644 index 000000000000..a3771d0d0ab3 --- /dev/null +++ b/app/ui-master/public/icons/working_group_meetings.svg @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/ui-sidenav/client/sideNav.html b/app/ui-sidenav/client/sideNav.html index a6244b98316d..9eee221558e5 100755 --- a/app/ui-sidenav/client/sideNav.html +++ b/app/ui-sidenav/client/sideNav.html @@ -7,16 +7,7 @@ {{_ "More_unreads"}} - - - - - -
- - - {{#each roomType}} {{> Template.dynamic template=template data=data }} {{/each}} diff --git a/app/ui-sidenav/client/sideNav.js b/app/ui-sidenav/client/sideNav.js index 3d58a39cd336..712ffe8b8ba0 100755 --- a/app/ui-sidenav/client/sideNav.js +++ b/app/ui-sidenav/client/sideNav.js @@ -23,7 +23,8 @@ Template.sideNav.helpers({ }, roomType() { - return roomTypes.getTypes().map((roomType) => ({ + const arr = roomTypes.getTypes().filter((item) => item._identifier !== 'c'); + return arr.map((roomType) => ({ template: roomType.customTemplate || 'roomList', data: { header: roomType.header, diff --git a/app/ui-sidenav/client/sidebarHeader.js b/app/ui-sidenav/client/sidebarHeader.js index 8e63226115c2..bdb8e6bcbd2b 100644 --- a/app/ui-sidenav/client/sidebarHeader.js +++ b/app/ui-sidenav/client/sidebarHeader.js @@ -38,47 +38,38 @@ export const toolbarSearch = { const toolbarButtons = (/* user */) => [ { - name: t('Home'), - icon: 'home', - condition: () => settings.get('Layout_Show_Home_Button'), - action: () => { - menu.close(); - FlowRouter.go('home'); - }, -}, -{ - name: t('Search'), - icon: 'magnifier', - action: () => { - toolbarSearch.show(false); - }, -}, -{ - name: t('Send_email'), - icon: 'mail', - condition: () => hasPermission('send-mail-manually'), - action: () => { - menu.close(); - FlowRouter.go('manual-mail-sender'); + name: t('Home'), + icon: 'home', + condition: () => settings.get('Layout_Show_Home_Button'), + action: () => { + menu.close(); + FlowRouter.go('home'); + }, }, -}, -{ - name: t('Sort'), - icon: 'sort', - hasPopup: true, - action: async (e) => { - const options = []; - const config = { - template: createTemplateForComponent('SortList', () => import('../../../client/components/SortList')), - currentTarget: e.currentTarget, - data: { - options, - }, - offsetVertical: e.currentTarget.clientHeight + 10, - }; - popover.open(config); + { + name: t('Search'), + icon: 'magnifier', + action: () => { + toolbarSearch.show(false); + }, }, -}]; + { + name: t('Sort'), + icon: 'sort', + hasPopup: true, + action: async (e) => { + const options = []; + const config = { + template: createTemplateForComponent('SortList', () => import('../../../client/components/SortList')), + currentTarget: e.currentTarget, + data: { + options, + }, + offsetVertical: e.currentTarget.clientHeight + 10, + }; + popover.open(config); + }, + }]; Template.sidebarHeader.helpers({ myUserInfo() { const id = Meteor.userId(); diff --git a/app/ui/client/views/app/home.js b/app/ui/client/views/app/home.js index 37769fcb6131..e4c27557714a 100644 --- a/app/ui/client/views/app/home.js +++ b/app/ui/client/views/app/home.js @@ -27,7 +27,7 @@ const toolbarButtons = () => [ }, { name: t('Councils'), - icon: 'team', + icon: 'events', condition: () => hasPermission('manage-councils'), action: () => { menu.close(); @@ -36,7 +36,7 @@ const toolbarButtons = () => [ }, { name: t('Working_group'), - icon: 'team', + icon: 'working_group', condition: () => hasPermission('manage-working-group'), action: () => { menu.close(); @@ -54,7 +54,7 @@ const toolbarButtons = () => [ }, { name: t('Working_group_meetings'), - icon: 'team', + icon: 'working_group_meetings', condition: () => hasPermission('manage-working-group'), action: () => { menu.close(); @@ -141,8 +141,7 @@ const toolbarButtons = () => [ }, { name: t('Errands_from_me'), - icon: 'errand', - //condition: () => hasPermission('manage-working-errand'), + icon: 'errands_from_me', action: () => { menu.close(); FlowRouter.go('/errands/initiated_by_me'); @@ -150,8 +149,7 @@ const toolbarButtons = () => [ }, { name: t('Errands_for_me'), - icon: 'errand', - //condition: () => hasPermission('manage-working-errand'), + icon: 'errands_to_me', action: () => { menu.close(); FlowRouter.go('/errands/charged_to_me'); @@ -160,7 +158,7 @@ const toolbarButtons = () => [ Template.home.helpers({ title() { - return settings.get('Layout_Home_Title'); + return t('Layout_Home_Title'); }, body() { return settings.get('Layout_Home_Body'); diff --git a/private/public/icons.svg b/private/public/icons.svg index 46bd22d16210..bfd043b673e6 100644 --- a/private/public/icons.svg +++ b/private/public/icons.svg @@ -115,6 +115,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -400,4 +489,101 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From fed0acedff7ec9e2e2f4974d0fbfe2991f27aa09 Mon Sep 17 00:00:00 2001 From: badaev Date: Tue, 27 Oct 2020 11:33:08 +0800 Subject: [PATCH 3/4] =?UTF-8?q?RocketChat#589=20[EDIT]=20=D0=94=D0=BE?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F=20=D0=B2?= =?UTF-8?q?=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/server/functions/saveUser.js | 61 ++++++++++++++++++++ app/lib/server/functions/saveUserIdentity.js | 10 ++-- client/admin/users/AddUser.js | 5 ++ client/admin/users/UserForm.js | 40 +++++++++++++ client/admin/users/UsersTable.js | 1 - 5 files changed, 111 insertions(+), 6 deletions(-) diff --git a/app/lib/server/functions/saveUser.js b/app/lib/server/functions/saveUser.js index ca88e82d45ef..f2e9bc37285b 100644 --- a/app/lib/server/functions/saveUser.js +++ b/app/lib/server/functions/saveUser.js @@ -197,6 +197,57 @@ function validateUserEditing(userId, userData) { } } +const handleOrganization = (updateUser, organization) => { + if (organization) { + if (organization.trim()) { + if (typeof organization !== 'string' || organization.length > 260) { + throw new Meteor.Error('error-invalid-field', 'organization', { + method: 'saveUserProfile', + }); + } + updateUser.$set = updateUser.$set || {}; + updateUser.$set.organization = organization; + } else { + updateUser.$unset = updateUser.$unset || {}; + updateUser.$unset.organization = 1; + } + } +}; + +const handlePosition = (updateUser, position) => { + if (position) { + if (position.trim()) { + if (typeof position !== 'string' || position.length > 260) { + throw new Meteor.Error('error-invalid-field', 'position', { + method: 'saveUserProfile', + }); + } + updateUser.$set = updateUser.$set || {}; + updateUser.$set.position = position; + } else { + updateUser.$unset = updateUser.$unset || {}; + updateUser.$unset.position = 1; + } + } +}; + +const handlePhone = (updateUser, phone) => { + if (phone) { + if (phone.trim()) { + if (typeof phone !== 'string' || phone.length > 15) { + throw new Meteor.Error('error-invalid-field', 'phone', { + method: 'saveUserProfile', + }); + } + updateUser.$set = updateUser.$set || {}; + updateUser.$set.phone = phone; + } else { + updateUser.$unset = updateUser.$unset || {}; + updateUser.$unset.phone = 1; + } + } +}; + const handleBio = (updateUser, bio) => { if (bio) { if (bio.trim()) { @@ -263,7 +314,9 @@ export const saveUser = function(userId, userData) { const updateUser = { $set: { roles: userData.roles || ['user'], + surname: userData.surname, ...typeof userData.name !== 'undefined' && { name: userData.name }, + ...typeof userData.patronymic !== 'undefined' && { patronymic: userData.patronymic }, settings: userData.settings || {}, }, }; @@ -276,6 +329,9 @@ export const saveUser = function(userId, userData) { updateUser.$set['emails.0.verified'] = userData.verified; } + handleOrganization(updateUser, userData.organization); + handlePosition(updateUser, userData.position); + handlePhone(updateUser, userData.phone); handleBio(updateUser, userData.bio); handleNickname(updateUser, userData.nickname); @@ -312,6 +368,8 @@ export const saveUser = function(userId, userData) { _id: userData._id, username: userData.username, name: userData.name, + surname: userData.surname, + patronymic: userData.patronymic, })) { throw new Meteor.Error('error-could-not-save-identity', 'Could not save user identity', { method: 'saveUser' }); } @@ -336,6 +394,9 @@ export const saveUser = function(userId, userData) { $set: {}, }; + handleOrganization(updateUser, userData.organization); + handlePosition(updateUser, userData.position); + handlePhone(updateUser, userData.phone); handleBio(updateUser, userData.bio); handleNickname(updateUser, userData.nickname); diff --git a/app/lib/server/functions/saveUserIdentity.js b/app/lib/server/functions/saveUserIdentity.js index 743313105e2f..699e50f62828 100644 --- a/app/lib/server/functions/saveUserIdentity.js +++ b/app/lib/server/functions/saveUserIdentity.js @@ -51,11 +51,11 @@ export function saveUserIdentity(userId, { _id, name: rawName, username: rawUser } } - if (typeof rawPatronymc !== 'undefined' && patronymicChanged) { - if (!setPatronymic(_id, patronymic, user)) { - return false; - } - } + // if (typeof rawPatronymc !== 'undefined' && patronymicChanged) { + // if (!setPatronymic(_id, patronymic, user)) { + // return false; + // } + // } // if coming from old username, update all references if (previousUsername && usernameChanged) { diff --git a/client/admin/users/AddUser.js b/client/admin/users/AddUser.js index e5717f293546..0101ecf5c017 100644 --- a/client/admin/users/AddUser.js +++ b/client/admin/users/AddUser.js @@ -23,9 +23,14 @@ export function AddUser({ roles, ...props }) { hasUnsavedChanges, } = useForm({ roles: [], + surname: '', name: '', + patronymic: '', username: '', statusText: '', + organization: '', + position: '', + phone: '', bio: '', nickname: '', email: '', diff --git a/client/admin/users/UserForm.js b/client/admin/users/UserForm.js index 0f8693befe47..24c0ef3c4dfa 100644 --- a/client/admin/users/UserForm.js +++ b/client/admin/users/UserForm.js @@ -11,11 +11,16 @@ export default function UserForm({ formValues, formHandlers, availableRoles, app const [hasCustomFields, setHasCustomFields] = useState(false); const { + surname, name, + patronymic, username, email, verified, statusText, + organization, + position, + phone, bio, nickname, password, @@ -28,11 +33,16 @@ export default function UserForm({ formValues, formHandlers, availableRoles, app } = formValues; const { + handleSurname, handleName, + handlePatronymic, handleUsername, handleEmail, handleVerified, handleStatusText, + handleOrganization, + handlePosition, + handlePhone, handleBio, handleNickname, handlePassword, @@ -49,18 +59,48 @@ export default function UserForm({ formValues, formHandlers, availableRoles, app return e.preventDefault(), [])} { ...props }> { prepend } + {useMemo(() => + {t('Surname')} + + + + , [t, surname, handleSurname])} {useMemo(() => {t('Name')} , [t, name, handleName])} + {useMemo(() => + {t('Patronymic')} + + + + , [t, patronymic, handlePatronymic])} {useMemo(() => {t('Username')} }/> , [t, username, handleUsername])} + {useMemo(() => + {t('Organization')} + + + + , [t, organization, handleOrganization])} + {useMemo(() => + {t('Position')} + + + + , [t, position, handlePosition])} + {useMemo(() => + {t('Phone_number')} + + + + , [t, phone, handlePhone])} {useMemo(() => {t('Email')} diff --git a/client/admin/users/UsersTable.js b/client/admin/users/UsersTable.js index 9696e7483ce8..7e7de8996dc9 100644 --- a/client/admin/users/UsersTable.js +++ b/client/admin/users/UsersTable.js @@ -85,7 +85,6 @@ export function UsersTable() { const query = useQuery(debouncedParams, debouncedSort); const data = useEndpointData('users.list', query) || {}; - console.log(data); const usersRoute = useRoute('admin-users'); From 189dcf8e7411b31808ef5cb37cd673361f2c865d Mon Sep 17 00:00:00 2001 From: badaev Date: Tue, 27 Oct 2020 11:51:11 +0800 Subject: [PATCH 4/4] =?UTF-8?q?RocketChat#589=20[EDIT]=20=D0=94=D0=BE?= =?UTF-8?q?=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BA=D0=B0=20=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8F=20=D0=B2=20=D0=B0=D0=B4=D0=BC=D0=B8=D0=BD?= =?UTF-8?q?=D0=BA=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/lib/server/functions/saveUser.js | 2 +- client/admin/users/EditUser.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/lib/server/functions/saveUser.js b/app/lib/server/functions/saveUser.js index f2e9bc37285b..b792a5ee25c1 100644 --- a/app/lib/server/functions/saveUser.js +++ b/app/lib/server/functions/saveUser.js @@ -316,7 +316,7 @@ export const saveUser = function(userId, userData) { roles: userData.roles || ['user'], surname: userData.surname, ...typeof userData.name !== 'undefined' && { name: userData.name }, - ...typeof userData.patronymic !== 'undefined' && { patronymic: userData.patronymic }, + patronymic: userData.patronymic, settings: userData.settings || {}, }, }; diff --git a/client/admin/users/EditUser.js b/client/admin/users/EditUser.js index 03e1867585b0..bba598be3b44 100644 --- a/client/admin/users/EditUser.js +++ b/client/admin/users/EditUser.js @@ -29,10 +29,15 @@ export function EditUserWithData({ uid, ...props }) { const getInitialValue = (data) => ({ roles: data.roles, + surname: data.surname, name: data.name ?? '', + patronymic: data.patronymic, password: '', username: data.username, status: data.status, + organization: data.organization, + position: data.position, + phone: data.phone, bio: data.bio ?? '', nickname: data.nickname ?? '', email: (data.emails && data.emails[0].address) || '',