Web: Client: Redesign access rights page

This commit is contained in:
Alexey Kostenko 2021-04-16 12:19:19 +03:00
parent cd831d3f93
commit d7930f9a8b
4 changed files with 61 additions and 65 deletions

View File

@ -1,7 +1,6 @@
{
"PortalOwner": "Portal Owner",
"AccessRightsOwnerCan": "Portal owner can",
"AccessRightsOwnerOpportunities": "Do the same as module administrators|Appoint module administrators|Set modules access rights|Manage portal configuration|Manage user accounts|Change portal owner|Backup portal data|Deactivate or delete portal",
"AccessRightsOwnerOpportunities": "Portal owner can: do the same as module administrators, appoint module administrators, set modules access rights, manage portal configuration, manage user accounts, change portal owner, backup portal data, deactivate or delete portal.",
"AdminSettings": "Administrators",
"ProjectsProduct": "Projects",
"CrmProduct": "CRM",
@ -62,9 +61,8 @@
"ChangeLogoButton": "Change Logo",
"BrowserNoCanvasSupport": "Your browser does not support the HTML5 canvas tag.",
"AccessRightsChangeOwnerText": "To change the Portal owner please choose the Name of the new Portal owner below.",
"ChooseOwner": "Choose owner",
"DnsChangeMsg": "A link to confirm the operation has been sent to {{email}} (the email address of the portal owner).",
"AccessRightsChangeOwnerConfirmText": "Changes will be applied after the confirmation via email.",
"ChooseOwner": "Change the portal owner",
"AccessRightsChangeOwnerConfirmText": "email confirmation required",
"NotFoundTitle": "Nothing found",
"NotFoundDescription": "Change filter settings or add people to the section.",
"ClearButton": "Reset filter",
@ -110,5 +108,8 @@
"YouHaveUnsavedChanges": "You have unsaved changes",
"CustomTitles": "Custom titles",
"LanguageAndTimeZoneSettingsDescription": "Language and time zone settings is a way to change the language of the whole portal for all portal users and to configure the time zone so that all the events of the portal will be shown with the correct date and time.",
"CustomTitlesSettingsDescription": "Custom welcome page title will be displayed on the welcome page of your portal. The same name is also used for the From field of your portal email notifications. Custom domain name is a way to set an alternative URL for your portal. Custom portal name will appear next to the onlyoffice.com/onlyoffice.eu portal address."
"CustomTitlesSettingsDescription": "Custom welcome page title will be displayed on the welcome page of your portal. The same name is also used for the From field of your portal email notifications. Custom domain name is a way to set an alternative URL for your portal. Custom portal name will appear next to the onlyoffice.com/onlyoffice.eu portal address.",
"PortalAdmins": "Portal admins",
"PortalAdminsDescription": "Have the same access rights as the portal owner, except the right to: change portal owner; deactivate or delete portal.",
"ConfirmEmailSended": "Confirmation e-mail has been sent to {{ownerName}}"
}

View File

@ -1,7 +1,6 @@
{
"PortalOwner": "Владелец портала",
"AccessRightsOwnerCan": "Владелец портала может",
"AccessRightsOwnerOpportunities": "Делать то же самое, что и администраторы модулей|Назначать администраторов модулей|Задавать права доступа в модулях|Управлять настройками портала|Управлять учетными записями пользователей|Cменить владельца портала|Выполнять резервное копирование данных портала|Отключить или удалить портал",
"AccessRightsOwnerOpportunities": "Владелец портала может делать то же самое, что и администраторы модулей: назначать администраторов модулей, задавать права доступа в модулях, управлять настройками портала, управлять учетными записями пользователей, сменить владельца портала, выполнять резервное копирование данных портала, отключить или удалить портал",
"AdminSettings": "Администраторы",
"ProjectsProduct": "Проекты",
"CrmProduct": "CRM",
@ -61,9 +60,8 @@
"ChangeLogoButton": "Сменить логотип",
"BrowserNoCanvasSupport": "Ваш браузер не поддерживает тег HTML5 canvas.",
"AccessRightsChangeOwnerText": "Чтобы сменить владельца портала, выберите имя нового владельца портала ниже.",
"ChooseOwner": "Выбрать владельца",
"DnsChangeMsg": "Ссылка для подтверждения операции была отправлена на {{email}} (адрес электронной почты владельца портала).",
"AccessRightsChangeOwnerConfirmText": "Изменения будут применены после подтверждения по электронной почте.",
"ChooseOwner": "Сменить владельца портала",
"AccessRightsChangeOwnerConfirmText": "требует подтверждения по электронной почте",
"NotFoundTitle": "Ничего не найдено",
"NotFoundDescription": "Измените настройки фильтра или добавьте людей в раздел.",
"ClearButton": "Сбросить фильтр",
@ -110,5 +108,8 @@
"YouHaveUnsavedChanges": "Имеются несохраненные изменения",
"CustomTitles": "Пользовательские заголовки",
"LanguageAndTimeZoneSettingsDescription": "Настройки языка и часового пояса - это способ изменить язык всего портала для всех пользователей портала и настроить часовой пояс, чтобы все события портала отображались с правильной датой и временем.",
"CustomTitlesSettingsDescription": "Пользовательский заголовок страницы приветствия будет отображаться на странице приветствия вашего портала. Это же имя используется для поля 'От' вашего электронного уведомления портала. Пользовательское доменное имя - это способ установить альтернативный URL-адрес для вашего портала. Пользовательское имя портала будет отображаться рядом с адресом портала onlyoffice.com/onlyoffice.eu."
"CustomTitlesSettingsDescription": "Пользовательский заголовок страницы приветствия будет отображаться на странице приветствия вашего портала. Это же имя используется для поля 'От' вашего электронного уведомления портала. Пользовательское доменное имя - это способ установить альтернативный URL-адрес для вашего портала. Пользовательское имя портала будет отображаться рядом с адресом портала onlyoffice.com/onlyoffice.eu.",
"PortalAdmins": "Администраторы портала",
"PortalAdminsDescription": "Имеет те же права доступа, что и владелец портала, за исключением права: менять владельца портала; деактивировать или удалить портал.",
"ConfirmEmailSended": "Письмо с подтверждением отправлено {{ownerName}}"
}

View File

@ -98,7 +98,7 @@ class AccessRights extends PureComponent {
return (
<MainContainer>
<OwnerSettings />
<div className="category-item-wrapper">
{/*<div className="category-item-wrapper">
<div className="category-item-heading">
<Link
className="inherit-title-link header"
@ -120,7 +120,7 @@ class AccessRights extends PureComponent {
<Text className="category-item-description">
{t("PortalAdminsDescription")}
</Text>
</div>
</div>*/}
</MainContainer>
);
}

View File

@ -8,8 +8,7 @@ import Text from "@appserver/components/text";
import Avatar from "@appserver/components/avatar";
import Link from "@appserver/components/link";
import toastr from "@appserver/components/toast/toastr";
import Button from "@appserver/components/button";
import Heading from "@appserver/components/heading";
import HelpButton from "@appserver/components/help-button";
import PeopleSelector from "people/PeopleSelector";
import isEmpty from "lodash/isEmpty";
import { inject } from "mobx-react";
@ -21,6 +20,15 @@ const StyledWrapper = styled.div`
margin-left: 16px;
overflow: hidden;
width: 100%;
display: flex;
flex-flow: column;
justify-content: center;
}
.portal-owner-name {
display: flex;
align-items: center;
flex-wrap: wrap;
}
`;
@ -40,40 +48,32 @@ const OwnerContainer = styled.div`
flex: none;
}
.avatar_text {
margin-right: 3px;
}
.portal-owner-heading {
margin: 0;
margin-bottom: 4px;
}
.portal-owner-info {
margin-bottom: 9px;
}
.group-wrapper {
display: inline-block;
margin-left: 3px;
margin-right: 3px;
}
}
.link_style {
margin-right: 16px;
}
.text-body_wrapper {
margin-bottom: 16px;
margin-right: 3px;
}
.advanced-selector {
position: relative;
}
.text-body_inline {
display: inline-flex;
}
.button_offset {
margin-right: 16px;
}
.chooseOwnerWrap {
margin-top: 16px;
padding-top: 16px;
border-top: 1px solid #eceef1;
margin-top: 8px;
}
`;
@ -108,7 +108,6 @@ class PureOwnerSettings extends Component {
isLoading: false,
showSelector: false,
showLocalLoader: true,
selectedOwner: null,
};
}
@ -124,11 +123,18 @@ class PureOwnerSettings extends Component {
}
}
onChangeOwner = () => {
ownerInfo = () => (
<Text>{this.props.t("AccessRightsOwnerOpportunities")}</Text>
);
changeOwner = (selectedOwner) => {
const { sendOwnerChange } = this.props;
const { selectedOwner } = this.state;
sendOwnerChange(selectedOwner.key)
.then((res) => toastr.success(res.message)) //toastr.success(t("DnsChangeMsg", { email: owner.email })))
.then(() =>
toastr.success(
`${t("ConfirmEmailSended", { ownerName: owner.displayName })}`
)
)
.catch((err) => toastr.error(err));
};
@ -146,7 +152,7 @@ class PureOwnerSettings extends Component {
onSelect = (items) => {
this.onShowSelector(false);
this.setState({ selectedOwner: items[0] });
this.changeOwner(items[0]);
};
render() {
@ -171,13 +177,10 @@ class PureOwnerSettings extends Component {
</Link>
<div className="portal-owner-description">
<Heading className="portal-owner-heading" level={3} size="small">
{t("PortalOwner")}
</Heading>
<div className="portal-owner-info">
<div className="portal-owner-name">
<Link
className="avatar_text"
fontSize="13px"
fontSize="16px"
fontWeight={600}
isBold={true}
color="#316DAA"
@ -185,39 +188,30 @@ class PureOwnerSettings extends Component {
>
{owner.displayName}
</Link>
{owner.groups && (
<div className="group-wrapper">
<Text as="span">(</Text>
{formattedDepartments}
<Text as="span">)</Text>
</div>
)}
<div className="group-wrapper">
<Text fontSize="16px" as="span">{`(${t(
"PortalOwner"
)})`}</Text>
</div>
<HelpButton
place="right"
className="option-info"
offsetRight={0}
tooltipContent={this.ownerInfo()}
/>
</div>
<Text className="PortalOwnerDescription" color="#555F65">
{t("PortalOwnerDescription")}
</Text>
<div className="chooseOwnerWrap">
<Link
className="link_style"
isHovered={true}
onClick={this.onShowSelector.bind(this, !showSelector)}
fontSize="12px"
type="action"
>
{selectedOwner ? selectedOwner.label : t("ChooseOwner")}
</Link>
<Button
className="button_offset"
size="medium"
primary={true}
label={t("AccessRightsChangeOwnerButtonText")}
isDisabled={!isLoading ? selectedOwner === null : false}
onClick={this.onChangeOwner}
/>
<Text
className="text-body_inline"
fontSize="12px"
color="#A3A9AE"
>
<Text as="span" fontSize="12px" color="#A3A9AE">
{t("AccessRightsChangeOwnerConfirmText")}
</Text>
</div>