Merge pull request #1628 from ONLYOFFICE/feature/fix-bug-react

[DE PE SSE] Fix Bug 55970
This commit is contained in:
maxkadushkin 2022-03-17 11:17:00 +03:00 committed by GitHub
commit ba2a62786d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 18 deletions

View file

@ -511,11 +511,14 @@ const EditShape = props => {
const wrapType = props.storeShapeSettings.getWrapType(shapeObject); const wrapType = props.storeShapeSettings.getWrapType(shapeObject);
const shapeType = shapeObject.get_ShapeProperties().asc_getType(); const shapeType = shapeObject.get_ShapeProperties().asc_getType();
const hideChangeType = shapeObject.get_ShapeProperties().get_FromChart() || shapeType=='line' || shapeType=='bentConnector2' || shapeType=='bentConnector3' const hideChangeType = shapeObject.get_ShapeProperties().get_FromChart() || shapeObject.get_ShapeProperties().get_FromSmartArt()
|| shapeType=='line' || shapeType=='bentConnector2' || shapeType=='bentConnector3'
|| shapeType=='bentConnector4' || shapeType=='bentConnector5' || shapeType=='curvedConnector2' || shapeType=='bentConnector4' || shapeType=='bentConnector5' || shapeType=='curvedConnector2'
|| shapeType=='curvedConnector3' || shapeType=='curvedConnector4' || shapeType=='curvedConnector5' || shapeType=='curvedConnector3' || shapeType=='curvedConnector4' || shapeType=='curvedConnector5'
|| shapeType=='straightConnector1'; || shapeType=='straightConnector1';
const isSmartArtInternal = shapeObject.get_ShapeProperties().get_FromSmartArtInternal();
const isFromGroup = shapeObject.get_ShapeProperties().get_FromGroup();
const inControl = api.asc_IsContentControl(); const inControl = api.asc_IsContentControl();
const controlProps = (api && inControl) ? api.asc_GetContentControlProperties() : null; const controlProps = (api && inControl) ? api.asc_GetContentControlProperties() : null;
const lockType = controlProps ? controlProps.get_Lock() : Asc.c_oAscSdtLockType.Unlocked; const lockType = controlProps ? controlProps.get_Lock() : Asc.c_oAscSdtLockType.Unlocked;
@ -545,6 +548,7 @@ const EditShape = props => {
onBorderColor: props.onBorderColor onBorderColor: props.onBorderColor
}}></ListItem> }}></ListItem>
: null} : null}
{ !isFromGroup &&
<ListItem title={_t.textWrap} link='/edit-shape-wrap/' routeProps={{ <ListItem title={_t.textWrap} link='/edit-shape-wrap/' routeProps={{
onWrapType: props.onWrapType, onWrapType: props.onWrapType,
onShapeAlign: props.onShapeAlign, onShapeAlign: props.onShapeAlign,
@ -552,12 +556,13 @@ const EditShape = props => {
onOverlap: props.onOverlap, onOverlap: props.onOverlap,
onWrapDistance: props.onWrapDistance onWrapDistance: props.onWrapDistance
}}></ListItem> }}></ListItem>
}
{(!hideChangeType && !fixedSize) && {(!hideChangeType && !fixedSize) &&
<ListItem title={_t.textReplace} link='/edit-shape-replace/' routeProps={{ <ListItem title={_t.textReplace} link='/edit-shape-replace/' routeProps={{
onReplace: props.onReplace onReplace: props.onReplace
}}></ListItem> }}></ListItem>
} }
{wrapType !== 'inline' && <ListItem title={_t.textReorder} link='/edit-shape-reorder/' routeProps={{ { (wrapType !== 'inline' && !isSmartArtInternal) && <ListItem title={_t.textReorder} link='/edit-shape-reorder/' routeProps={{
onReorder: props.onReorder onReorder: props.onReorder
}}></ListItem> } }}></ListItem> }
</List> </List>

View file

@ -13,11 +13,13 @@ const EditShape = props => {
const canFill = shapeObject && shapeObject.get_CanFill(); const canFill = shapeObject && shapeObject.get_CanFill();
const shapeType = shapeObject.asc_getType(); const shapeType = shapeObject.asc_getType();
const hideChangeType = shapeObject.get_FromChart() || shapeType=='line' || shapeType=='bentConnector2' || shapeType=='bentConnector3' const hideChangeType = shapeObject.get_FromChart() || shapeObject.get_FromSmartArt()
|| shapeType=='line' || shapeType=='bentConnector2' || shapeType=='bentConnector3'
|| shapeType=='bentConnector4' || shapeType=='bentConnector5' || shapeType=='curvedConnector2' || shapeType=='bentConnector4' || shapeType=='bentConnector5' || shapeType=='curvedConnector2'
|| shapeType=='curvedConnector3' || shapeType=='curvedConnector4' || shapeType=='curvedConnector5' || shapeType=='curvedConnector3' || shapeType=='curvedConnector4' || shapeType=='curvedConnector5'
|| shapeType=='straightConnector1'; || shapeType=='straightConnector1';
const isSmartArtInternal = shapeObject.get_FromSmartArtInternal();
let disableRemove = !!props.storeFocusObjects.paragraphObject; let disableRemove = !!props.storeFocusObjects.paragraphObject;
return ( return (
@ -41,10 +43,11 @@ const EditShape = props => {
onReplace: props.onReplace onReplace: props.onReplace
}}></ListItem> }}></ListItem>
} }
{ !isSmartArtInternal &&
<ListItem title={_t.textReorder} link="/edit-reorder-shape/" routeProps={{ <ListItem title={_t.textReorder} link="/edit-reorder-shape/" routeProps={{
onReorder: props.onReorder onReorder: props.onReorder
}}></ListItem> }}></ListItem>
}
<ListItem title={_t.textAlign} link="/edit-align-shape/" routeProps={{ <ListItem title={_t.textAlign} link="/edit-align-shape/" routeProps={{
onAlign: props.onAlign onAlign: props.onAlign
}}></ListItem> }}></ListItem>

View file

@ -13,11 +13,13 @@ const EditShape = props => {
const canFill = shapeObject && shapeObject.get_ShapeProperties().asc_getCanFill(); const canFill = shapeObject && shapeObject.get_ShapeProperties().asc_getCanFill();
const shapeType = shapeObject.get_ShapeProperties().asc_getType(); const shapeType = shapeObject.get_ShapeProperties().asc_getType();
const hideChangeType = shapeObject.get_ShapeProperties().get_FromChart() || shapeType=='line' || shapeType=='bentConnector2' || shapeType=='bentConnector3' const hideChangeType = shapeObject.get_ShapeProperties().get_FromChart() || shapeObject.get_ShapeProperties().get_FromSmartArt()
|| shapeType=='line' || shapeType=='bentConnector2' || shapeType=='bentConnector3'
|| shapeType=='bentConnector4' || shapeType=='bentConnector5' || shapeType=='curvedConnector2' || shapeType=='bentConnector4' || shapeType=='bentConnector5' || shapeType=='curvedConnector2'
|| shapeType=='curvedConnector3' || shapeType=='curvedConnector4' || shapeType=='curvedConnector5' || shapeType=='curvedConnector3' || shapeType=='curvedConnector4' || shapeType=='curvedConnector5'
|| shapeType=='straightConnector1'; || shapeType=='straightConnector1';
const isSmartArtInternal = shapeObject.get_ShapeProperties().get_FromSmartArtInternal();
let disableRemove = storeFocusObjects.selections.indexOf('text') > -1; let disableRemove = storeFocusObjects.selections.indexOf('text') > -1;
return ( return (
@ -41,9 +43,11 @@ const EditShape = props => {
onReplace: props.onReplace onReplace: props.onReplace
}}></ListItem> }}></ListItem>
} }
{ !isSmartArtInternal &&
<ListItem title={_t.textReorder} link="/edit-reorder-shape/" routeProps={{ <ListItem title={_t.textReorder} link="/edit-reorder-shape/" routeProps={{
onReorder: props.onReorder onReorder: props.onReorder
}}></ListItem> }}></ListItem>
}
</List> </List>
<List className="buttons-list"> <List className="buttons-list">
<ListButton className={`button-red button-fill button-raised${disableRemove ? ' disabled' : ''}`} onClick={props.onRemoveShape}>{_t.textRemoveShape}</ListButton> <ListButton className={`button-red button-fill button-raised${disableRemove ? ' disabled' : ''}`} onClick={props.onRemoveShape}>{_t.textRemoveShape}</ListButton>