From 76110f9577ed2fb4d0271207e80527cdb66c9cd2 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Tue, 28 Feb 2023 13:38:31 +0400 Subject: [PATCH 1/5] [DE PE SSE mobile] For Bug 59658 --- apps/documenteditor/mobile/src/page/main.jsx | 29 +++++++---- .../mobile/src/page/main.jsx | 28 ++++++---- .../mobile/src/page/main.jsx | 52 +++++++++++-------- 3 files changed, 66 insertions(+), 43 deletions(-) diff --git a/apps/documenteditor/mobile/src/page/main.jsx b/apps/documenteditor/mobile/src/page/main.jsx index 9eef8105eb..99781564ca 100644 --- a/apps/documenteditor/mobile/src/page/main.jsx +++ b/apps/documenteditor/mobile/src/page/main.jsx @@ -137,22 +137,29 @@ class MainPage extends Component { const isProtected = appOptions.isProtected; const isFabShow = isViewer && !disabledSettings && !disabledControls && !isDisconnected && isAvailableExt && isEdit && !isProtected; const config = appOptions.config; + const isShowPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); - let showLogo = !(config.customization && (config.customization.loaderName || config.customization.loaderLogo)); - if (!Object.keys(config).length) { - showLogo = !/&(?:logo)=/.test(window.location.search); + let isHideLogo = true, + isCustomization = true, + isBranding = true; + + if (!appOptions.isDisconnected && config?.customization) { + isCustomization = !!(config.customization && (config.customization.loaderName || config.customization.loaderLogo)); + isBranding = appOptions.canBranding || appOptions.canBrandingExt; + + if (!Object.keys(config).length) { + isCustomization = !/&(?:logo)=/.test(window.location.search); + } + + isHideLogo = isCustomization && isBranding; } - - const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); - const isBranding = appOptions.canBranding || appOptions.canBrandingExt; - return ( - + {/* Top Navbar */} - {(!isBranding && showLogo) && + className={`main-navbar${!isHideLogo ? ' navbar-with-logo' : ''}`}> + {!isHideLogo &&
{ window.open(`${__PUBLISHER_URL__}`, "_blank"); }}>
} @@ -168,7 +175,7 @@ class MainPage extends Component { - {showPlaceholder ? + {isShowPlaceholder ?
diff --git a/apps/presentationeditor/mobile/src/page/main.jsx b/apps/presentationeditor/mobile/src/page/main.jsx index d3e8d3af3b..9dbcb97581 100644 --- a/apps/presentationeditor/mobile/src/page/main.jsx +++ b/apps/presentationeditor/mobile/src/page/main.jsx @@ -112,23 +112,31 @@ class MainPage extends Component { render() { const appOptions = this.props.storeAppOptions; const config = appOptions.config; + const isShowPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); - let showLogo = !(config.customization && (config.customization.loaderName || config.customization.loaderLogo)); - if ( !Object.keys(config).length ) { - showLogo = !/&(?:logo)=/.test(window.location.search); + let isHideLogo = true, + isCustomization = true, + isBranding = true; + + if (!appOptions.isDisconnected && config?.customization) { + isCustomization = !!(config.customization && (config.customization.loaderName || config.customization.loaderLogo)); + isBranding = appOptions.canBranding || appOptions.canBrandingExt; + + if (!Object.keys(config).length) { + isCustomization = !/&(?:logo)=/.test(window.location.search); + } + + isHideLogo = isCustomization && isBranding; } - const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); - const isBranding = appOptions.canBranding || appOptions.canBrandingExt; - return ( {!this.state.previewVisible ? null : } - + {/* Top Navbar */} - {(!isBranding && showLogo) &&
{ + className={`main-navbar${!isHideLogo ? ' navbar-with-logo' : ''}`}> + {!isHideLogo &&
{ window.open(`${__PUBLISHER_URL__}`, "_blank"); }}>
} @@ -140,7 +148,7 @@ class MainPage extends Component { {/* Page content */} - {showPlaceholder ? + {isShowPlaceholder ?
diff --git a/apps/spreadsheeteditor/mobile/src/page/main.jsx b/apps/spreadsheeteditor/mobile/src/page/main.jsx index b49c1ba358..6d0979df3c 100644 --- a/apps/spreadsheeteditor/mobile/src/page/main.jsx +++ b/apps/spreadsheeteditor/mobile/src/page/main.jsx @@ -100,31 +100,39 @@ class MainPage extends Component { }, 1); }; - render() { - const appOptions = this.props.storeAppOptions; - const storeWorksheets = this.props.storeWorksheets; - const wsProps = storeWorksheets.wsProps; - const wsLock = storeWorksheets.wsLock; - const config = appOptions.config; + render() { + const appOptions = this.props.storeAppOptions; + const storeWorksheets = this.props.storeWorksheets; + const wsProps = storeWorksheets.wsProps; + const wsLock = storeWorksheets.wsLock; + const config = appOptions.config; + const isShowPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); - let showLogo = !(config.customization && (config.customization.loaderName || config.customization.loaderLogo)); - if ( !Object.keys(config).length ) { - showLogo = !/&(?:logo)=/.test(window.location.search); - } + let isHideLogo = true, + isCustomization = true, + isBranding = true; - const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); - const isBranding = appOptions.canBranding || appOptions.canBrandingExt; + if (!appOptions.isDisconnected && config?.customization) { + isCustomization = !!(config.customization && (config.customization.loaderName || config.customization.loaderLogo)); + isBranding = appOptions.canBranding || appOptions.canBrandingExt; - if ( $$('.skl-container').length ) { - $$('.skl-container').remove(); - } + if (!Object.keys(config).length) { + isCustomization = !/&(?:logo)=/.test(window.location.search); + } - return ( - + isHideLogo = isCustomization && isBranding; + } + + if ($$('.skl-container').length) { + $$('.skl-container').remove(); + } + + return ( + {/* Top Navbar */} - {(!isBranding && showLogo) &&
{ + className={`main-navbar${!isHideLogo ? ' navbar-with-logo' : ''}`}> + {!isHideLogo &&
{ window.open(`${__PUBLISHER_URL__}`, "_blank"); }}>
} @@ -137,7 +145,7 @@ class MainPage extends Component { this.handleClickToOpenOptions('add', {panels: panels, button: button})}/> {/* Page content */} - {showPlaceholder ? + {isShowPlaceholder ?
@@ -181,8 +189,8 @@ class MainPage extends Component { {/* hidden component*/} - ) - } + ) + } } export default inject("storeAppOptions", "storeWorksheets")(observer(MainPage)); \ No newline at end of file From 284ce8506d31a97ba3143b8790081457d23a78e8 Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Tue, 28 Feb 2023 17:54:26 +0400 Subject: [PATCH 2/5] [DE PE SSE mobile] Fix Bug 61396 --- apps/documenteditor/mobile/src/controller/ContextMenu.jsx | 4 ++-- apps/presentationeditor/mobile/src/controller/ContextMenu.jsx | 2 +- apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx index 9ceb25d483..c1a797643b 100644 --- a/apps/documenteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/documenteditor/mobile/src/controller/ContextMenu.jsx @@ -138,8 +138,8 @@ class ContextMenu extends ContextMenuController { checkShapeSelection() { const objects = this.props.objects; const contextMenuElem = document.querySelector('#idx-context-menu-popover'); - - if(objects.indexOf('shape') > -1) { + + if(objects?.indexOf('shape') > -1) { contextMenuElem.style.top = `${+(contextMenuElem.style.top.replace(/px$/, '')) - 40}px`; } } diff --git a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx index 478b8f9170..ce463fb69f 100644 --- a/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/presentationeditor/mobile/src/controller/ContextMenu.jsx @@ -111,7 +111,7 @@ class ContextMenu extends ContextMenuController { const objects = this.props.objects; const contextMenuElem = document.querySelector('#idx-context-menu-popover'); - if(objects.indexOf('shape') > -1) { + if(objects?.indexOf('shape') > -1) { contextMenuElem.style.top = `${+(contextMenuElem.style.top.replace(/px$/, '')) - 40}px`; } } diff --git a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx index 8c4bb505a0..4d4270edd3 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/ContextMenu.jsx @@ -314,7 +314,7 @@ class ContextMenu extends ContextMenuController { const focusOn = this.props.focusOn; const contextMenuElem = document.querySelector('#idx-context-menu-popover'); - if(objects.indexOf('shape') > -1 && focusOn === 'obj') { + if(objects?.indexOf('shape') > -1 && focusOn === 'obj') { contextMenuElem.style.top = `${+(contextMenuElem.style.top.replace(/px$/, '')) - 40}px`; } } From 1ed3ef1537274358104565e00e9eb05a84b57aae Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Wed, 1 Mar 2023 13:36:36 +0400 Subject: [PATCH 3/5] [DE PE SSE mobile] Changed app options settings --- apps/documenteditor/mobile/src/store/appOptions.js | 4 ++-- apps/presentationeditor/mobile/src/store/appOptions.js | 4 ++-- apps/spreadsheeteditor/mobile/src/store/appOptions.js | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/mobile/src/store/appOptions.js b/apps/documenteditor/mobile/src/store/appOptions.js index 1d2aa0d3b2..537f7df89a 100644 --- a/apps/documenteditor/mobile/src/store/appOptions.js +++ b/apps/documenteditor/mobile/src/store/appOptions.js @@ -72,8 +72,8 @@ export class storeAppOptions { this.readerMode = !this.readerMode; } - canBrandingExt = false; - canBranding = false; + canBrandingExt = true; + canBranding = true; isDocReady = false; changeDocReady (value) { diff --git a/apps/presentationeditor/mobile/src/store/appOptions.js b/apps/presentationeditor/mobile/src/store/appOptions.js index 91c0077cb5..abf97ac028 100644 --- a/apps/presentationeditor/mobile/src/store/appOptions.js +++ b/apps/presentationeditor/mobile/src/store/appOptions.js @@ -21,8 +21,8 @@ export class storeAppOptions { isEdit = false; canViewComments = false; - canBrandingExt = false; - canBranding = false; + canBrandingExt = true; + canBranding = true; config = {}; lostEditingRights = false; diff --git a/apps/spreadsheeteditor/mobile/src/store/appOptions.js b/apps/spreadsheeteditor/mobile/src/store/appOptions.js index 1e8685ccc0..0e15323217 100644 --- a/apps/spreadsheeteditor/mobile/src/store/appOptions.js +++ b/apps/spreadsheeteditor/mobile/src/store/appOptions.js @@ -11,7 +11,9 @@ export class storeAppOptions { lostEditingRights: observable, changeEditingRights: action, + canBranding: observable, + canBrandingExt: observable, isDocReady: observable, changeDocReady: action @@ -26,7 +28,9 @@ export class storeAppOptions { this.canViewComments = value; } - canBranding = undefined; + canBranding = true; + canBrandingExt = true; + lostEditingRights = false; changeEditingRights (value) { this.lostEditingRights = value; From 7e1f6c47b224f49fb3a8b4cf57deab1a408f6e4f Mon Sep 17 00:00:00 2001 From: SergeyEzhin Date: Wed, 1 Mar 2023 15:40:08 +0400 Subject: [PATCH 4/5] [DE mobile] Fix Bug 58866 --- apps/documenteditor/mobile/src/view/Toolbar.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documenteditor/mobile/src/view/Toolbar.jsx b/apps/documenteditor/mobile/src/view/Toolbar.jsx index e813b89bc6..e5de507955 100644 --- a/apps/documenteditor/mobile/src/view/Toolbar.jsx +++ b/apps/documenteditor/mobile/src/view/Toolbar.jsx @@ -62,7 +62,7 @@ const ToolbarView = props => { onRedoClick: props.onRedo })} {/*isAvailableExt && !props.disabledControls &&*/} - {((isViewer || !Device.phone) && isAvailableExt) && { + {((isViewer || !Device.phone) && isAvailableExt && !props.disabledControls) && { props.changeMobileView(); props.openOptions('snackbar'); }}>} From 53048b7b01b241a804705d7d351ecc2f5e760ab2 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Wed, 1 Mar 2023 19:10:15 +0300 Subject: [PATCH 5/5] [mobile] correct skeleton toolbar height --- apps/common/mobile/resources/css/skeleton.css | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/common/mobile/resources/css/skeleton.css b/apps/common/mobile/resources/css/skeleton.css index b2824cfc08..2e4109c042 100644 --- a/apps/common/mobile/resources/css/skeleton.css +++ b/apps/common/mobile/resources/css/skeleton.css @@ -17,7 +17,7 @@ body.theme-type-dark { } .skl-navbar { - --box-logo-height: 26px; + --box-logo-height: 0; --skl-navbar-height: 44px; --skl-pixel-ratio: 1; } @@ -36,6 +36,10 @@ body.theme-type-dark { position: relative; } +.navbar.main-navbar { + height: 0; +} + .skl-navbar.skl-navbar--md { /*height: calc(56px + 26px);*/ } @@ -142,14 +146,17 @@ body.theme-type-dark { .md .word-editor { --f7-navbar-bg-color: var(--background-navbar-word, #446995); --f7-subnavbar-bg-color: var(--background-navbar-word, #446995); + --f7-subnavbar-height: 56px; } .md .cell-editor { --f7-navbar-bg-color: var(--background-navbar-word, #40865c); --f7-subnavbar-bg-color: var(--background-navbar-word, #40865c); + --f7-subnavbar-height: 56px; } .md .slide-editor { --f7-navbar-bg-color: var(--background-navbar-word, #aa5252); --f7-subnavbar-bg-color: var(--background-navbar-word, #aa5252); -} \ No newline at end of file + --f7-subnavbar-height: 56px; +}