People.Client: Home: applied real custom names

This commit is contained in:
Daniil Senkiv 2020-01-22 10:17:05 +03:00
parent 68a6e7261a
commit 48218df13b
4 changed files with 28 additions and 38 deletions

View File

@ -5,11 +5,6 @@ import { fetchPeople } from "../../../../../store/people/actions";
import find from "lodash/find"; import find from "lodash/find";
import result from "lodash/result"; import result from "lodash/result";
import { withTranslation } from "react-i18next"; import { withTranslation } from "react-i18next";
import {
typeGuest,
typeUser,
department
} from "./../../../../../helpers/customNames";
import { withRouter } from "react-router"; import { withRouter } from "react-router";
import { getFilterByLocation } from "../../../../../helpers/converters"; import { getFilterByLocation } from "../../../../../helpers/converters";
import { store } from 'asc-web-common'; import { store } from 'asc-web-common';
@ -98,7 +93,8 @@ class SectionFilterContent extends React.Component {
}; };
getData = () => { getData = () => {
const { user, groups, t } = this.props; const { user, groups, t, settings } = this.props;
const { guestCaption, userCaption, groupCaption } = settings.customNames;
const options = !isAdmin(user) const options = !isAdmin(user)
? [] ? []
@ -158,12 +154,12 @@ class SectionFilterContent extends React.Component {
{ {
key: "user", key: "user",
group: "filter-type", group: "filter-type",
label: t("CustomTypeUser", { typeUser }) label: t("CustomTypeUser", { userCaption })
}, },
{ {
key: "guest", key: "guest",
group: "filter-type", group: "filter-type",
label: t("CustomTypeGuest", { typeGuest }) label: t("CustomTypeGuest", { guestCaption })
}, },
{ {
key: "filter-other", key: "filter-other",
@ -175,7 +171,7 @@ class SectionFilterContent extends React.Component {
key: "filter-type-group", key: "filter-type-group",
group: "filter-other", group: "filter-other",
subgroup: "filter-group", subgroup: "filter-group",
label: t("CustomDepartment", { department }), label: groupCaption,
defaultSelectLabel: t("DefaultSelectLabel") defaultSelectLabel: t("DefaultSelectLabel")
}, },
...groupOptions ...groupOptions

View File

@ -19,11 +19,6 @@ import {
updateUserType, updateUserType,
fetchPeople fetchPeople
} from "../../../../../store/people/actions"; } from "../../../../../store/people/actions";
import {
typeUser,
typeGuest,
department
} from "../../../../../helpers/../helpers/customNames";
import { deleteGroup } from "../../../../../store/group/actions"; import { deleteGroup } from "../../../../../store/group/actions";
import { store, api, constants } from 'asc-web-common'; import { store, api, constants } from 'asc-web-common';
import { InviteDialog } from '../../../../dialogs'; import { InviteDialog } from '../../../../dialogs';
@ -133,12 +128,12 @@ const SectionHeaderContent = props => {
onSelect: item => onSelect(item.key) onSelect: item => onSelect(item.key)
}, },
{ {
label: t("CustomMakeUser", { typeUser }), label: t("CustomMakeUser", { userCaption: settings.customNames.userCaption }),
disabled: !selection.length, disabled: !selection.length,
onClick: onSetEmployee onClick: onSetEmployee
}, },
{ {
label: t("CustomMakeGuest", { typeGuest }), label: t("CustomMakeGuest", { guestCaption: settings.customNames.guestCaption }),
disabled: !selection.length, disabled: !selection.length,
onClick: onSetGuest onClick: onSetGuest
}, },
@ -212,20 +207,21 @@ const SectionHeaderContent = props => {
); );
const getContextOptionsPlus = useCallback(() => { const getContextOptionsPlus = useCallback(() => {
const { guestCaption, userCaption, groupCaption } = settings.customNames;
return [ return [
{ {
key: "new-employee", key: "new-employee",
label: t("CustomNewEmployee", { typeUser }), label: t("CustomNewEmployee", { userCaption }),
onClick: goToEmployeeCreate onClick: goToEmployeeCreate
}, },
{ {
key: "new-guest", key: "new-guest",
label: t("CustomNewGuest", { typeGuest }), label: t("CustomNewGuest", { guestCaption }),
onClick: goToGuestCreate onClick: goToGuestCreate
}, },
{ {
key: "new-group", key: "new-group",
label: t("CustomNewDepartment", { department }), label: t("CustomNewDepartment", { groupCaption }),
onClick: goToGroupCreate onClick: goToGroupCreate
}, },
{ key: 'separator', isSeparator: true }, { key: 'separator', isSeparator: true },
@ -240,7 +236,7 @@ const SectionHeaderContent = props => {
onClick: onSentInviteAgain onClick: onSentInviteAgain
} */ } */
]; ];
}, [t, goToEmployeeCreate, goToGuestCreate, goToGroupCreate, onInvitationDialogClick/* , onSentInviteAgain */]); }, [settings, t, goToEmployeeCreate, goToGuestCreate, goToGroupCreate, onInvitationDialogClick/* , onSentInviteAgain */]);
return ( return (
<StyledContainer> <StyledContainer>
@ -278,7 +274,7 @@ const SectionHeaderContent = props => {
</> </>
) : ( ) : (
<> <>
<Headline className='headline-header' truncate={true} type="content">Departments</Headline> <Headline className='headline-header' truncate={true} type="content">{settings.customNames.groupsCaption}</Headline>
{isAdmin && ( {isAdmin && (
<> <>
<ContextMenuButton <ContextMenuButton

View File

@ -42,11 +42,10 @@
"MessageEmailActivationInstuctionsSentOnEmail": "The email activation instructions have been sent to the <1>{{email}}</1> email address", "MessageEmailActivationInstuctionsSentOnEmail": "The email activation instructions have been sent to the <1>{{email}}</1> email address",
"CustomHeadOfDepartment": " {{headOfDepartment}}", "CustomHeadOfDepartment": " {{headOfDepartment}}",
"CustomTypeGuest": "{{typeGuest}}", "CustomTypeGuest": "{{guestCaption}}",
"CustomTypeUser": "{{typeUser}}", "CustomTypeUser": "{{userCaption}}",
"CustomMakeUser": "Make {{typeUser, lowercase}}", "CustomMakeUser": "Make {{userCaption, lowercase}}",
"CustomMakeGuest": "Make {{typeGuest, lowercase}}", "CustomMakeGuest": "Make {{guestCaption, lowercase}}",
"CustomDepartment": "{{department}}",
"CountPerPage": "{{count}} per page", "CountPerPage": "{{count}} per page",
"PageOfTotalPage": "{{page}} of {{totalPage}}", "PageOfTotalPage": "{{page}} of {{totalPage}}",
@ -57,9 +56,9 @@
"FilterPlaceholder": "Search", "FilterPlaceholder": "Search",
"CustomNewEmployee": "New {{typeUser, lowercase}}", "CustomNewEmployee": "New {{userCaption, lowercase}}",
"CustomNewGuest": "New {{typeGuest, lowercase}}", "CustomNewGuest": "New {{guestCaption, lowercase}}",
"CustomNewDepartment": "New {{department, lowercase}}", "CustomNewDepartment": "New {{groupCaption, lowercase}}",
"MakeInvitationLink": "Make invitation link", "MakeInvitationLink": "Make invitation link",
"SendInvitationAgain": "Send invitation once" "SendInvitationAgain": "Send invitation once"
} }

View File

@ -36,17 +36,16 @@
"LblInviteAgain": "Выслать прилашение ещё раз", "LblInviteAgain": "Выслать прилашение ещё раз",
"ByFirstNameSorting": "По имени", "ByFirstNameSorting": "По имени",
"ByLastNameSorting": "По фамилии", "ByLastNameSorting": "По фамилии",
"LblInvited": "Invited", "LblInvited": "Приглашен",
"LblSetActive": "Разблокировать", "LblSetActive": "Разблокировать",
"LblSetDisabled": "Заблокировать", "LblSetDisabled": "Заблокировать",
"MessageEmailActivationInstuctionsSentOnEmail": "Инструкции по активации электронной почты были отправлены на адрес <1>{{email}}</1>", "MessageEmailActivationInstuctionsSentOnEmail": "Инструкции по активации электронной почты были отправлены на адрес <1>{{email}}</1>",
"CustomHeadOfDepartment": " {{headOfDepartment}}", "CustomHeadOfDepartment": " {{headOfDepartment}}",
"CustomTypeGuest": "{{typeGuest}}", "CustomTypeGuest": "{{guestCaption}}",
"CustomTypeUser": "{{typeUser}}", "CustomTypeUser": "{{userCaption}}",
"CustomMakeUser": "Сделать {{typeUser, lowercase}}", "CustomMakeUser": "Сделать {{userCaption, lowercase}}",
"CustomMakeGuest": "Сделать {{typeGuest, lowercase}}", "CustomMakeGuest": "Сделать {{guestCaption, lowercase}}",
"CustomDepartment": "{{department}}",
"CountPerPage": "{{count}} на странице", "CountPerPage": "{{count}} на странице",
"PageOfTotalPage": "{{page}} из {{totalPage}}", "PageOfTotalPage": "{{page}} из {{totalPage}}",
@ -57,9 +56,9 @@
"FilterPlaceholder": "Поиск", "FilterPlaceholder": "Поиск",
"CustomNewEmployee": "Новый {{typeUser, lowercase}}", "CustomNewEmployee": "Новый {{userCaption, lowercase}}",
"CustomNewGuest": "Новый {{typeGuest, lowercase}}", "CustomNewGuest": "Новый {{guestCaption, lowercase}}",
"CustomNewDepartment": "Новый {{department, lowercase}}", "CustomNewDepartment": "Новый {{groupCaption, lowercase}}",
"MakeInvitationLink": "Создать пригласительную ссылку", "MakeInvitationLink": "Создать пригласительную ссылку",
"SendInvitationAgain": "Отправить приглашение ещё раз" "SendInvitationAgain": "Отправить приглашение ещё раз"
} }