diff --git a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx index 8b1f8d95c..1b36d7070 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Toolbar.jsx @@ -15,6 +15,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn const isDisconnected = props.users.isDisconnected; const storeFocusObjects = props.storeFocusObjects; + const focusOn = storeFocusObjects.focusOn; const isObjectLocked = storeFocusObjects.isLocked; const isEditCell = storeFocusObjects.isEditCell; const editFormulaMode = storeFocusObjects.editFormulaMode; @@ -157,6 +158,7 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeSpreadsheetIn onEditDocument={onEditDocument} isDisconnected={isDisconnected} worksheetProtection={worksheetProtection} + focusOn={focusOn} /> ) })); diff --git a/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx b/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx index b168becbe..0dbfae927 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/add/AddOther.jsx @@ -30,6 +30,8 @@ class AddOtherController extends Component { return ( ) } diff --git a/apps/spreadsheeteditor/mobile/src/page/main.jsx b/apps/spreadsheeteditor/mobile/src/page/main.jsx index 5af097530..686a41248 100644 --- a/apps/spreadsheeteditor/mobile/src/page/main.jsx +++ b/apps/spreadsheeteditor/mobile/src/page/main.jsx @@ -88,6 +88,10 @@ class MainPage extends Component { render() { const appOptions = this.props.storeAppOptions; + const storeWorksheets = this.props.storeWorksheets; + const worksheetProtection = storeWorksheets.worksheetProtection; + const wsLock = worksheetProtection.wsLock; + const wsProps = worksheetProtection.wsProps; const config = appOptions.config; const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo))); const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); @@ -115,11 +119,11 @@ class MainPage extends Component { { !this.state.editOptionsVisible ? null : - + } { !this.state.addOptionsVisible ? null : - + } { !this.state.settingsVisible ? null : @@ -145,4 +149,4 @@ class MainPage extends Component { } } -export default inject("storeAppOptions")(observer(MainPage)); \ No newline at end of file +export default inject("storeAppOptions", "storeWorksheets")(observer(MainPage)); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/view/Toolbar.jsx b/apps/spreadsheeteditor/mobile/src/view/Toolbar.jsx index ef26744a9..fe064bd66 100644 --- a/apps/spreadsheeteditor/mobile/src/view/Toolbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/Toolbar.jsx @@ -6,6 +6,7 @@ import EditorUIController from '../lib/patch' const ToolbarView = props => { const isDisconnected = props.isDisconnected; const worksheetProtection = props.worksheetProtection; + const focusOn = props.focusOn; const undo_box = props.isEdit && EditorUIController.toolbarOptions ? EditorUIController.toolbarOptions.getUndoRedo({ disabledUndo: !props.isCanUndo || isDisconnected, disabledRedo: !props.isCanRedo || isDisconnected, @@ -28,6 +29,7 @@ const ToolbarView = props => { {props.isEdit && EditorUIController.toolbarOptions && EditorUIController.toolbarOptions.getEditOptions({ disabled: props.disabledEditControls || props.disabledControls || isDisconnected, worksheetProtection, + focusOn, onEditClick: () => props.openOptions('edit'), onAddClick: () => props.openOptions('add') })} diff --git a/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx b/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx index 8721cad25..1c29e6639 100644 --- a/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/add/Add.jsx @@ -57,6 +57,7 @@ const routes = [ const AddLayoutNavbar = ({ tabs, inPopover }) => { const isAndroid = Device.android; + return ( {tabs.length > 1 ? @@ -67,7 +68,7 @@ const AddLayoutNavbar = ({ tabs, inPopover }) => { )} {isAndroid && } : - { tabs[0].caption } + {tabs[0].caption} } { !inPopover && } @@ -89,50 +90,54 @@ const AddLayoutContent = ({ tabs }) => { const AddTabs = props => { const { t } = useTranslation(); const _t = t('View.Add', {returnObjects: true}); + const wsProps = props.wsProps; const showPanels = props.showPanels; const tabs = []; - if (!showPanels) { - tabs.push({ - caption: _t.textChart, - id: 'add-chart', - icon: 'icon-add-chart', - component: - }); + if(!wsProps.Objects) { + if (!showPanels) { + tabs.push({ + caption: _t.textChart, + id: 'add-chart', + icon: 'icon-add-chart', + component: + }); + } + if (!showPanels || showPanels === 'function') { + tabs.push({ + caption: _t.textFunction, + id: 'add-function', + icon: 'icon-add-formula', + component: + }); + } + if (!showPanels || showPanels.indexOf('shape') > 0) { + tabs.push({ + caption: _t.textShape, + id: 'add-shape', + icon: 'icon-add-shape', + component: + }); + } + if (showPanels && showPanels.indexOf('image') !== -1) { + tabs.push({ + caption: _t.textImage, + id: 'add-image', + icon: 'icon-add-image', + component: + }); + } } - if (!showPanels || showPanels === 'function') { - tabs.push({ - caption: _t.textFunction, - id: 'add-function', - icon: 'icon-add-formula', - component: - }); - } - if (!showPanels || showPanels.indexOf('shape') > 0) { - tabs.push({ - caption: _t.textShape, - id: 'add-shape', - icon: 'icon-add-shape', - component: - }); - } - if (showPanels && showPanels.indexOf('image') !== -1) { - tabs.push({ - caption: _t.textImage, - id: 'add-image', - icon: 'icon-add-image', - component: - }); - } - if (!showPanels) { + if (!showPanels && (!wsProps.InsertHyperlinks || !wsProps.Objects)) { tabs.push({ caption: _t.textOther, id: 'add-other', icon: 'icon-add-other', - component: + component: }); } - if ((showPanels && showPanels === 'hyperlink') || props.isAddShapeHyperlink) { + if (((showPanels && showPanels === 'hyperlink') || props.isAddShapeHyperlink) && !wsProps.InsertHyperlinks) { tabs.push({ caption: _t.textAddLink, id: 'add-link', @@ -164,10 +169,10 @@ class AddView extends Component { return ( show_popover ? this.props.onclosed()}> - + : this.props.onclosed()}> - + ) } @@ -186,6 +191,7 @@ const Add = props => { // component will unmount } }); + const onviewclosed = () => { if ( props.onclosed ) props.onclosed(); @@ -221,6 +227,7 @@ const Add = props => { onclosed={onviewclosed} showPanels={options ? options.panels : undefined} isAddShapeHyperlink = {isAddShapeHyperlink} + wsProps={props.wsProps} /> }; diff --git a/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx b/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx index 0bd00a652..a34d5e747 100644 --- a/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/add/AddOther.jsx @@ -6,23 +6,26 @@ const AddOther = props => { const { t } = useTranslation(); const _t = t('View.Add', {returnObjects: true}); const hideAddComment = props.hideAddComment(); + const wsPropsHyperlinks = props.wsPropsHyperlinks; + const wsPropsObjects = props.wsPropsObjects; + return ( - + - {!hideAddComment && { + {(!hideAddComment && !wsPropsObjects) && { props.closeModal(); Common.Notifications.trigger('addcomment'); }}> } - - - - + + + + ) }; diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx index 3b126b9c2..d2e4d301f 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/Edit.jsx @@ -329,6 +329,7 @@ const EditTabs = props => { const { t } = useTranslation(); const _t = t('View.Edit', {returnObjects: true}); const store = props.storeFocusObjects; + const wsProps = props.wsProps; const settings = !store.focusOn ? [] : (store.focusOn === 'obj' ? store.objects : store.selections); let editors = []; @@ -345,41 +346,43 @@ const EditTabs = props => { component: }) } - if (settings.indexOf('shape') > -1) { - editors.push({ - caption: _t.textShape, - id: 'edit-shape', - component: - }) - } - if (settings.indexOf('image') > -1) { - editors.push({ - caption: _t.textImage, - id: 'edit-image', - component: - }) - } - if (settings.indexOf('text') > -1) { - editors.push({ - caption: _t.textText, - id: 'edit-text', - component: - }) - } - if (settings.indexOf('chart') > -1) { - editors.push({ - caption: _t.textChart, - id: 'edit-chart', - component: - }) - } - if (settings.indexOf('hyperlink') > -1 || (props.hyperinfo && props.isAddShapeHyperlink)) { - editors.push({ - caption: _t.textHyperlink, - id: 'edit-link', - component: - }) - } + if(!wsProps.Objects) { + if (settings.indexOf('shape') > -1) { + editors.push({ + caption: _t.textShape, + id: 'edit-shape', + component: + }) + } + if (settings.indexOf('image') > -1) { + editors.push({ + caption: _t.textImage, + id: 'edit-image', + component: + }) + } + if (settings.indexOf('text') > -1) { + editors.push({ + caption: _t.textText, + id: 'edit-text', + component: + }) + } + if (settings.indexOf('chart') > -1) { + editors.push({ + caption: _t.textChart, + id: 'edit-chart', + component: + }) + } + if (settings.indexOf('hyperlink') > -1 || (props.hyperinfo && props.isAddShapeHyperlink)) { + editors.push({ + caption: _t.textHyperlink, + id: 'edit-link', + component: + }) + } + } } return ( @@ -403,10 +406,10 @@ const EditView = props => { return ( show_popover ? props.onClosed()}> - + : props.onClosed()}> - + ) }; @@ -433,7 +436,7 @@ const EditOptions = props => { const isAddShapeHyperlink = api.asc_canAddShapeHyperlink(); return ( - + ) }; diff --git a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx index 49bf1c17c..b1d018046 100644 --- a/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx +++ b/apps/spreadsheeteditor/mobile/src/view/edit/EditCell.jsx @@ -44,7 +44,7 @@ const EditCell = props => { onFontSize: props.onFontSize, onFontClick: props.onFontClick }}/> - {!wsLock || !wsProps.FormatCells && + {(!wsLock || !wsProps.FormatCells) && <>