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,19 +548,21 @@ const EditShape = props => {
onBorderColor: props.onBorderColor onBorderColor: props.onBorderColor
}}></ListItem> }}></ListItem>
: null} : null}
<ListItem title={_t.textWrap} link='/edit-shape-wrap/' routeProps={{ { !isFromGroup &&
onWrapType: props.onWrapType, <ListItem title={_t.textWrap} link='/edit-shape-wrap/' routeProps={{
onShapeAlign: props.onShapeAlign, onWrapType: props.onWrapType,
onMoveText: props.onMoveText, onShapeAlign: props.onShapeAlign,
onOverlap: props.onOverlap, onMoveText: props.onMoveText,
onWrapDistance: props.onWrapDistance onOverlap: props.onOverlap,
}}></ListItem> onWrapDistance: props.onWrapDistance
}}></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>
} }
<ListItem title={_t.textReorder} link="/edit-reorder-shape/" routeProps={{ { !isSmartArtInternal &&
onReorder: props.onReorder <ListItem title={_t.textReorder} link="/edit-reorder-shape/" routeProps={{
}}></ListItem> onReorder: props.onReorder
}}></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>