Merge branch 'master' of https://github.com/ONLYOFFICE/CommunityServer-AspNetCore
This commit is contained in:
commit
69a2818741
@ -1,9 +1,8 @@
|
||||
import React, { lazy } from "react";
|
||||
import React from "react";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import { withRouter } from "react-router";
|
||||
|
||||
const CustomizationSettings = lazy(() => import("./customization"));
|
||||
const WhiteLabel = lazy(() => import("./whitelabel"));
|
||||
import CustomizationSettings from "./customization";
|
||||
import WhiteLabel from "./whitelabel";
|
||||
|
||||
const Common = ({ match }) => {
|
||||
const basePath = '/settings/common';
|
||||
@ -15,13 +14,11 @@ const Common = ({ match }) => {
|
||||
path={[`${basePath}/customization`, '/common', match.path]}
|
||||
component={CustomizationSettings}
|
||||
/>
|
||||
|
||||
<Route
|
||||
exact
|
||||
path={`${basePath}/whitelabel`}
|
||||
component={WhiteLabel}
|
||||
/>
|
||||
|
||||
</Switch>
|
||||
);
|
||||
};
|
||||
|
@ -1,35 +1,29 @@
|
||||
import React, { lazy } from "react";
|
||||
import React from "react";
|
||||
import { Route, Switch, Redirect } from "react-router-dom";
|
||||
import { withRouter } from "react-router";
|
||||
import Layout from './Layout';
|
||||
|
||||
const CommonSettings = lazy(() => import("./categories/common"));
|
||||
const SecuritySettings = lazy(() => import("./categories/security"));
|
||||
|
||||
import CommonSettings from "./categories/common";
|
||||
import SecuritySettings from "./categories/security";
|
||||
|
||||
const Settings = () => {
|
||||
|
||||
const basePath = '/settings';
|
||||
|
||||
return (
|
||||
<Layout key='1'>
|
||||
<Switch>
|
||||
|
||||
<Route
|
||||
path={`${basePath}/security`}
|
||||
component={SecuritySettings}
|
||||
/>
|
||||
|
||||
<Route
|
||||
path={[`${basePath}/common`, basePath]}
|
||||
component={CommonSettings}
|
||||
/>
|
||||
|
||||
<Redirect
|
||||
to={{
|
||||
pathname: "/error/404",
|
||||
}}
|
||||
/>
|
||||
|
||||
</Switch>
|
||||
</Layout>
|
||||
);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "asc-web-components",
|
||||
"version": "1.0.188",
|
||||
"version": "1.0.189",
|
||||
"description": "Ascensio System SIA component library",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "dist/asc-web-components.js",
|
||||
|
@ -25,6 +25,8 @@ class AvatarEditor extends React.Component {
|
||||
this.onLoadFileError = this.onLoadFileError.bind(this);
|
||||
this.onLoadFile = this.onLoadFile.bind(this);
|
||||
this.onPositionChange = this.onPositionChange.bind(this);
|
||||
this.onSizeChange = this.onSizeChange.bind(this);
|
||||
|
||||
this.onDeleteImage = this.onDeleteImage.bind(this);
|
||||
}
|
||||
|
||||
@ -40,6 +42,9 @@ class AvatarEditor extends React.Component {
|
||||
})
|
||||
if (typeof this.props.onDeleteImage === 'function') this.props.onDeleteImage();
|
||||
}
|
||||
onSizeChange(data){
|
||||
this.setState(data);
|
||||
}
|
||||
onPositionChange(data) {
|
||||
this.setState(data);
|
||||
}
|
||||
@ -83,6 +88,7 @@ class AvatarEditor extends React.Component {
|
||||
<AvatarEditorBody
|
||||
onImageChange={this.onImageChange}
|
||||
onPositionChange={this.onPositionChange}
|
||||
onSizeChange={this.onSizeChange}
|
||||
onLoadFileError={this.onLoadFileError}
|
||||
onLoadFile={this.onLoadFile}
|
||||
deleteImage={this.onDeleteImage}
|
||||
|
@ -190,6 +190,10 @@ class AvatarEditorBody extends React.Component {
|
||||
this.setState({
|
||||
scale: scale < 1 ? 1 : scale > 5 ? 5 : scale
|
||||
});
|
||||
this.props.onSizeChange({
|
||||
width: this.setEditorRef.current.getImage().width,
|
||||
height: this.setEditorRef.current.getImage().height
|
||||
});
|
||||
}
|
||||
}
|
||||
onTouchEnd(evt) {
|
||||
@ -217,6 +221,10 @@ class AvatarEditorBody extends React.Component {
|
||||
this.setState({
|
||||
scale: scale < 1 ? 1 : scale > 5 ? 5 : scale
|
||||
});
|
||||
this.props.onSizeChange({
|
||||
width: this.setEditorRef.current.getImage().width,
|
||||
height: this.setEditorRef.current.getImage().height
|
||||
});
|
||||
}
|
||||
|
||||
handleScale = e => {
|
||||
@ -319,6 +327,7 @@ class AvatarEditorBody extends React.Component {
|
||||
AvatarEditorBody.propTypes = {
|
||||
onImageChange: PropTypes.func,
|
||||
onPositionChange: PropTypes.func,
|
||||
onSizeChange: PropTypes.func,
|
||||
onLoadFileError: PropTypes.func,
|
||||
onLoadFile: PropTypes.func,
|
||||
deleteImage: PropTypes.func,
|
||||
|
@ -50,8 +50,9 @@ export default function createStyledIcon(Component, displayName, fillPath="*", s
|
||||
)
|
||||
}
|
||||
render() {
|
||||
const { isfill, isStroke, color, stroke, fillPath, strokePath, ...props } = this.props;
|
||||
|
||||
var svg = ReactDOMServer.renderToString(<Component {...this.props}></Component>);
|
||||
var svg = ReactDOMServer.renderToString(<Component {...props}></Component>);
|
||||
const matchResult = svg.match(/\s*mask id="(\w*)"\s/);
|
||||
|
||||
if(matchResult != null){
|
||||
@ -62,7 +63,7 @@ export default function createStyledIcon(Component, displayName, fillPath="*", s
|
||||
return reactComponent;
|
||||
}
|
||||
}
|
||||
return (<Component {...this.props}></Component>);
|
||||
return (<Component {...props}></Component>);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user