From 3c4c18fbb445ebbb07053272c02c2900e51a71c3 Mon Sep 17 00:00:00 2001 From: Andrey Savihin Date: Thu, 26 Dec 2019 14:37:57 +0300 Subject: [PATCH 01/13] ASC.Web.Components: field-container: indentation fixed --- .../src/components/field-container/index.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/web/ASC.Web.Components/src/components/field-container/index.js b/web/ASC.Web.Components/src/components/field-container/index.js index 92428a3a53..f9e8c50c01 100644 --- a/web/ASC.Web.Components/src/components/field-container/index.js +++ b/web/ASC.Web.Components/src/components/field-container/index.js @@ -41,21 +41,24 @@ function getVerticalCss() { margin: 0 0 16px 0; .field-label { - line-height: unset; - margin: 0 0 4px 0; + line-height: 13px; + height: 15px; + display: inline-block; } .field-label-icon { display: inline-flex; width: 100%; - line-height: 1.5; + margin: 0 0 8px 0; } .field-body { width: 100%; } .icon-button { position: relative; - line-height: unset; - margin-top: -12px; + margin: 0; + padding: 1px 6px; + width: 13px; + height: 13px; } `; } From 619615a2ada6ef10d6c107462eea38cade8be13d Mon Sep 17 00:00:00 2001 From: Andrey Savihin Date: Thu, 26 Dec 2019 14:51:14 +0300 Subject: [PATCH 02/13] ASC.People: customNames: Fixed translations --- products/ASC.People/Client/src/helpers/customNames.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/products/ASC.People/Client/src/helpers/customNames.js b/products/ASC.People/Client/src/helpers/customNames.js index 31116ebb4a..a55025b5fb 100644 --- a/products/ASC.People/Client/src/helpers/customNames.js +++ b/products/ASC.People/Client/src/helpers/customNames.js @@ -5,4 +5,4 @@ export const employedSinceDate = 'Employed since'; export const typeGuest = 'Guest'; export const typeGuests = 'Guests'; export const typeUser = 'Employee'; -export const headOfDepartment = 'Head of Department'; +export const headOfDepartment = 'Head of department'; From 5240824094dd140f901168c200f12e03e16aec44 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 26 Dec 2019 15:00:45 +0300 Subject: [PATCH 03/13] Web: Components: fixed modal-dialog exit-icon color --- .../src/components/modal-dialog/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/ASC.Web.Components/src/components/modal-dialog/index.js b/web/ASC.Web.Components/src/components/modal-dialog/index.js index 789495e6b0..d9d7e57a68 100644 --- a/web/ASC.Web.Components/src/components/modal-dialog/index.js +++ b/web/ASC.Web.Components/src/components/modal-dialog/index.js @@ -45,6 +45,13 @@ const CloseButton = styled.a` width: 16px; height: 16px; + &:hover { + &:before, + &:after { + background-color: #657077; + } + } + &:before, &:after { position: absolute; From c13eb3711d6afb358cd185a8321611cd0755f362 Mon Sep 17 00:00:00 2001 From: gopienkonikita Date: Thu, 26 Dec 2019 15:01:23 +0300 Subject: [PATCH 04/13] web: components: bump version --- web/ASC.Web.Components/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Components/package.json b/web/ASC.Web.Components/package.json index 647701bc10..0d4d2b282c 100644 --- a/web/ASC.Web.Components/package.json +++ b/web/ASC.Web.Components/package.json @@ -1,6 +1,6 @@ { "name": "asc-web-components", - "version": "1.0.273", + "version": "1.0.274", "description": "Ascensio System SIA component library", "license": "AGPL-3.0", "main": "dist/asc-web-components.js", From edd654a2a4d975cde9c54039e174772bd64ef2a3 Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Thu, 26 Dec 2019 15:10:39 +0300 Subject: [PATCH 05/13] web: People: Change IconButton to ContextMenuButton with more actions --- .../pages/Home/Section/Header/index.js | 83 ++++++++++++++++--- .../pages/Home/locales/en/translation.json | 8 +- .../pages/Home/locales/ru/translation.json | 8 +- 3 files changed, 84 insertions(+), 15 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js b/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js index a3a2bfadde..76b377bc4c 100644 --- a/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js +++ b/products/ASC.People/Client/src/components/pages/Home/Section/Header/index.js @@ -1,12 +1,11 @@ -import React, { useCallback } from "react"; +import React, { useCallback, useState } from "react"; import styled from "styled-components"; import { withRouter } from "react-router"; import { GroupButtonsMenu, DropDownItem, toastr, - ContextMenuButton, - IconButton + ContextMenuButton } from "asc-web-components"; import { Headline } from 'asc-web-common'; import { connect } from "react-redux"; @@ -22,10 +21,13 @@ import { } from "../../../../../store/people/actions"; import { typeUser, - typeGuest + typeGuest, + department } from "../../../../../helpers/../helpers/customNames"; import { deleteGroup } from "../../../../../store/group/actions"; import { store, api, constants } from 'asc-web-common'; +import { InviteDialog } from '../../../../dialogs'; + const { isAdmin } = store.auth.selectors; const { resendUserInvites, deleteUsers } = api.people; const { EmployeeStatus, EmployeeType } = constants; @@ -53,6 +55,8 @@ const StyledContainer = styled.div` `; const SectionHeaderContent = props => { + const [dialogVisible, setDialogVisible] = useState(false); + const { isHeaderVisible, isHeaderIndeterminate, @@ -175,7 +179,7 @@ const SectionHeaderContent = props => { ); }, [deleteGroup, group]); - const getContextOptions = useCallback(() => { + const getContextOptionsGroup = useCallback(() => { return [ { key: "edit-group", @@ -190,10 +194,53 @@ const SectionHeaderContent = props => { ]; }, [t, onEditGroup, onDeleteGroup]); - const onAddDepartmentsClick = useCallback(() => { + const goToEmployeeCreate = useCallback(() => { + history.push(`${settings.homepage}/create/user`); + }, [history, settings]); + + const goToGuestCreate = useCallback(() => { + history.push(`${settings.homepage}/create/guest`); + }, [history, settings]); + + const goToGroupCreate = useCallback(() => { history.push(`${settings.homepage}/group/create`); }, [history, settings]); + const onInvitationDialogClick = useCallback(() => + setDialogVisible(!dialogVisible), [dialogVisible] + ); + + const getContextOptionsPlus = useCallback(() => { + return [ + { + key: "new-employee", + label: t("CustomNewEmployee", { typeUser }), + onClick: goToEmployeeCreate + }, + { + key: "new-guest", + label: t("CustomNewGuest", { typeGuest }), + onClick: goToGuestCreate + }, + { + key: "new-group", + label: t("CustomNewDepartment", { department }), + onClick: goToGroupCreate + }, + { key: 'separator', isSeparator: true }, + { + key: "make-invitation-link", + label: t("MakeInvitationLink"), + onClick: onInvitationDialogClick + }/* , + { + key: "send-invitation", + label: t("SendInvitationAgain"), + onClick: onSentInviteAgain + } */ + ]; + }, [t, goToEmployeeCreate, goToGuestCreate, goToGroupCreate, onInvitationDialogClick/* , onSentInviteAgain */]); + return ( {isHeaderVisible ? ( @@ -223,7 +270,7 @@ const SectionHeaderContent = props => { iconName="VerticalDotsIcon" size={16} color="#A3A9AE" - getData={getContextOptions.bind(this, t)} + getData={getContextOptionsGroup} isDisabled={false} /> )} @@ -232,15 +279,25 @@ const SectionHeaderContent = props => { <> Departments {isAdmin && ( - + + {dialogVisible && + + } + )} )} diff --git a/products/ASC.People/Client/src/components/pages/Home/locales/en/translation.json b/products/ASC.People/Client/src/components/pages/Home/locales/en/translation.json index f7a9ac2a10..f450f30c5c 100644 --- a/products/ASC.People/Client/src/components/pages/Home/locales/en/translation.json +++ b/products/ASC.People/Client/src/components/pages/Home/locales/en/translation.json @@ -55,5 +55,11 @@ "DefaultSelectLabel": "Select", - "FilterPlaceholder": "Search" + "FilterPlaceholder": "Search", + + "CustomNewEmployee": "New {{typeUser, lowercase}}", + "CustomNewGuest": "New {{typeGuest, lowercase}}", + "CustomNewDepartment": "New {{department, lowercase}}", + "MakeInvitationLink": "Make invitation link", + "SendInvitationAgain": "Send invitation once" } \ No newline at end of file diff --git a/products/ASC.People/Client/src/components/pages/Home/locales/ru/translation.json b/products/ASC.People/Client/src/components/pages/Home/locales/ru/translation.json index cb0a86a16d..3e72c30964 100644 --- a/products/ASC.People/Client/src/components/pages/Home/locales/ru/translation.json +++ b/products/ASC.People/Client/src/components/pages/Home/locales/ru/translation.json @@ -55,5 +55,11 @@ "DefaultSelectLabel": "Выберите", - "FilterPlaceholder": "Поиск" + "FilterPlaceholder": "Поиск", + + "CustomNewEmployee": "Новый {{typeUser, lowercase}}", + "CustomNewGuest": "Новый {{typeGuest, lowercase}}", + "CustomNewDepartment": "Новый {{department, lowercase}}", + "MakeInvitationLink": "Создать пригласительную ссылку", + "SendInvitationAgain": "Отправить приглашение ещё раз" } \ No newline at end of file From 91c528a8e368bc61ee7d5a88b63c945c5518a28a Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Thu, 26 Dec 2019 15:11:24 +0300 Subject: [PATCH 06/13] web: People: Hidden not implemented InviteAgain action --- .../Client/src/components/Article/MainButton/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/ASC.People/Client/src/components/Article/MainButton/index.js b/products/ASC.People/Client/src/components/Article/MainButton/index.js index 85672e42f4..0688fd04cc 100644 --- a/products/ASC.People/Client/src/components/Article/MainButton/index.js +++ b/products/ASC.People/Client/src/components/Article/MainButton/index.js @@ -65,11 +65,11 @@ class PureArticleMainButtonContent extends React.Component { label={t('InviteLinkTitle')} onClick={this.onInvitationDialogClick} /> - + /> */} {false && Date: Thu, 26 Dec 2019 15:11:38 +0300 Subject: [PATCH 07/13] ASC.People: GroupAction: Fixed translations --- .../src/components/pages/GroupAction/Section/Body/index.js | 4 ++-- .../components/pages/GroupAction/locales/en/translation.json | 3 ++- .../components/pages/GroupAction/locales/ru/translation.json | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js index fcbec39da5..7a13060545 100644 --- a/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js @@ -64,7 +64,7 @@ const MainContainer = styled.div` } .buttons_container { - margin-top: 60px; + margin-top: 40px; .cancel-button { margin-left: 8px; @@ -320,7 +320,7 @@ class SectionBodyContent extends React.Component { isDisabled={inLoading} selectedOption={{ key: 0, - label: t("CustomAddEmployee", { typeUser }) + label: t("AddMembers") }} scaled={true} size="content" diff --git a/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json b/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json index db08768428..9b22a4c2e3 100644 --- a/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json +++ b/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json @@ -9,5 +9,6 @@ "CustomNewDepartment": "New {{department, lowercase}}", "CustomEditDepartment": "Edit {{department, lowercase}}", "CustomDepartmentName": "{{department}} name", - "Members": "Members" + "Members": "Members", + "AddMembers": "Add members" } \ No newline at end of file diff --git a/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json b/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json index 9ddeb9d2da..db9ceb7060 100644 --- a/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json +++ b/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json @@ -9,5 +9,6 @@ "CustomNewDepartment": "Новый {{department, lowercase}}", "CustomEditDepartment": "Редактирование {{department, lowercase}}", "CustomDepartmentName": "Имя {{department}}", - "Members": "Участники" + "Members": "Участники", + "AddMembers": "Добавить участников" } \ No newline at end of file From 87bfe9ffbe5ec00b60cf104e7dc3460b534eb896 Mon Sep 17 00:00:00 2001 From: Andrey Savihin Date: Thu, 26 Dec 2019 15:26:07 +0300 Subject: [PATCH 08/13] ASC.People: GroupAction: indentation fixed --- .../pages/GroupAction/Section/Body/index.js | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js index 7a13060545..3dc739f0d7 100644 --- a/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js @@ -45,10 +45,11 @@ const MainContainer = styled.div` .members_container { position: relative; max-width: 320px; + margin: 0; } .search_container { - margin-top: 16px; + margin-top: 32px; } .selected-members_container { @@ -337,30 +338,32 @@ class SectionBodyContent extends React.Component { /> {groupMembers && groupMembers.length > 0 && ( -
- -
+ <> +
+ +
+
+ {groupMembers.map(member => ( + + ))} +
+ )} -
- {groupMembers.map(member => ( - - ))} -
-
{error && {error}}
+ {error &&
{error}
}
); }, - [groups, currentGroup, isMultiSelect, selectedGroupList, allowGroupSelection] + [ + groups, + currentGroup, + isMultiSelect, + selectedGroupList, + allowGroupSelection + ] ); const hasSelected = useCallback(() => { @@ -524,11 +533,7 @@ const Selector = props => { allowGroupSelection={allowGroupSelection} hasSelected={hasSelected()} > - +
{ size="content" onSelect={onGroupSelect} /> - {isMultiSelect && allowGroupSelection && options && options.length > 0 && ( - - )} + {isMultiSelect && + allowGroupSelection && + options && + options.length > 0 && ( + + )} )}
- - {({ onItemsRendered, ref }) => ( - - {({ width, height }) => ( + + {({ width, height }) => ( + + {({ onItemsRendered, ref }) => ( { {renderOption} )} - + )} - + + {!hasNextPage && itemCount === 0 && (
@@ -609,11 +618,7 @@ const Selector = props => { {displayType === "dropdown" && groups && groups.length > 0 && ( - +
{groupsHeaderLabel} From d4afb34e2b9cb7157be6df8001866dde9199447d Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Thu, 26 Dec 2019 16:02:15 +0300 Subject: [PATCH 12/13] web: common: bump version --- web/ASC.Web.Common/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/ASC.Web.Common/package.json b/web/ASC.Web.Common/package.json index c807a2185c..419d60d437 100644 --- a/web/ASC.Web.Common/package.json +++ b/web/ASC.Web.Common/package.json @@ -1,6 +1,6 @@ { "name": "asc-web-common", - "version": "1.0.25", + "version": "1.0.26", "description": "Ascensio System SIA common components and solutions library", "license": "AGPL-3.0", "files": [ From a7ad25fee586165075b8140b9a5fa2b8d012db46 Mon Sep 17 00:00:00 2001 From: Andrey Savihin Date: Thu, 26 Dec 2019 16:08:24 +0300 Subject: [PATCH 13/13] ASC.People: GroupAction: Fixed translations --- .../src/components/pages/GroupAction/Section/Body/index.js | 2 +- .../components/pages/GroupAction/locales/en/translation.json | 3 ++- .../components/pages/GroupAction/locales/ru/translation.json | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js b/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js index 3dc739f0d7..14ef81615c 100644 --- a/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js +++ b/products/ASC.People/Client/src/components/pages/GroupAction/Section/Body/index.js @@ -344,7 +344,7 @@ class SectionBodyContent extends React.Component { id="member-search" isDisabled={inLoading} scale={true} - placeholder="Search" + placeholder={t("SearchAddedMembers")} value={searchValue} onChange={this.onSearchChange} /> diff --git a/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json b/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json index 9b22a4c2e3..c19031ed12 100644 --- a/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json +++ b/products/ASC.People/Client/src/components/pages/GroupAction/locales/en/translation.json @@ -10,5 +10,6 @@ "CustomEditDepartment": "Edit {{department, lowercase}}", "CustomDepartmentName": "{{department}} name", "Members": "Members", - "AddMembers": "Add members" + "AddMembers": "Add members", + "SearchAddedMembers": "Search added members" } \ No newline at end of file diff --git a/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json b/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json index db9ceb7060..126235426b 100644 --- a/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json +++ b/products/ASC.People/Client/src/components/pages/GroupAction/locales/ru/translation.json @@ -10,5 +10,6 @@ "CustomEditDepartment": "Редактирование {{department, lowercase}}", "CustomDepartmentName": "Имя {{department}}", "Members": "Участники", - "AddMembers": "Добавить участников" + "AddMembers": "Добавить участников", + "SearchAddedMembers": "Поиск добавленных участников" } \ No newline at end of file