This commit is contained in:
Andrey Savihin 2019-12-26 16:55:30 +03:00
commit d1099fdb79
6 changed files with 24 additions and 8 deletions

View File

@ -26,6 +26,21 @@ class PureArticleMainButtonContent extends React.Component {
this.props.history.push(link);
};
goToEmployeeCreate = () => {
const { history, settings } = this.props;
history.push(`${settings.homepage}/create/user`);
};
goToGuestCreate = () => {
const { history, settings } = this.props;
history.push(`${settings.homepage}/create/guest`);
}
goToGroupCreate = () => {
const { history, settings } = this.props;
history.push(`${settings.homepage}/group/create`);
}
onNotImplementedClick = (text) => {
toastr.success(text);
};
@ -47,17 +62,17 @@ class PureArticleMainButtonContent extends React.Component {
<DropDownItem
icon="CatalogEmployeeIcon"
label={t('CustomNewEmployee', { typeUser })}
onClick={this.onDropDownItemClick.bind(this, `${settings.homepage}/create/user`)}
onClick={this.goToEmployeeCreate}
/>
<DropDownItem
icon="CatalogGuestIcon"
label={t('CustomNewGuest', { typeGuest })}
onClick={this.onDropDownItemClick.bind(this, `${settings.homepage}/create/guest`)}
onClick={this.goToGuestCreate}
/>
<DropDownItem
icon="CatalogDepartmentsIcon"
label={t('CustomNewDepartment', { department })}
onClick={this.onDropDownItemClick.bind(this, `${settings.homepage}/group/create`)}
onClick={this.goToGroupCreate}
/>
<DropDownItem isSeparator />
<DropDownItem

View File

@ -1,6 +1,6 @@
{
"name": "asc-web-common",
"version": "1.0.26",
"version": "1.0.28",
"description": "Ascensio System SIA common components and solutions library",
"license": "AGPL-3.0",
"files": [

View File

@ -65,7 +65,8 @@ const PrivateRoute = ({ component: Component, ...rest }) => {
restricted,
allowForMe,
currentUser,
userId
userId,
Component
]
);

View File

@ -20,7 +20,7 @@ export const PublicRoute = ({ component: Component, ...rest }) => {
}
return <Component {...props} />;
}, [token]);
}, [token, Component]);
return (
<Route

View File

@ -1,6 +1,6 @@
{
"name": "asc-web-components",
"version": "1.0.275",
"version": "1.0.276",
"description": "Ascensio System SIA component library",
"license": "AGPL-3.0",
"main": "dist/asc-web-components.js",

View File

@ -17,7 +17,7 @@ const StyledFilterItem = styled.div`
margin-bottom: ${props => props.block ? '8px' : '0'};
position: relative;
height: 100%;
padding: 3px 22px 3px 7px;
padding: 4px 22px 2px 7px;
margin-right: 2px;
border: 1px solid #ECEEF1;
border-radius: 3px;