From 7d148d0240c7a6db7c2f92949bea6693cade0d7b Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 29 Sep 2021 18:31:50 +0300 Subject: [PATCH 01/11] [all] fix bug 52849 --- apps/documenteditor/main/index_loader.html.deploy | 2 +- apps/presentationeditor/main/index_loader.html.deploy | 2 +- apps/spreadsheeteditor/main/index_loader.html.deploy | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/index_loader.html.deploy b/apps/documenteditor/main/index_loader.html.deploy index bdda3ff4e..bfd21a24c 100644 --- a/apps/documenteditor/main/index_loader.html.deploy +++ b/apps/documenteditor/main/index_loader.html.deploy @@ -287,7 +287,7 @@ - + + + diff --git a/apps/documenteditor/mobile/src/lib/i18n.js b/apps/documenteditor/mobile/src/lib/i18n.js index b3d3566ee..10a886dd5 100644 --- a/apps/documenteditor/mobile/src/lib/i18n.js +++ b/apps/documenteditor/mobile/src/lib/i18n.js @@ -6,7 +6,7 @@ i18n.use(initReactI18next) .use(Fetch) .init({ lng: Common.Locale.currentLang, - fallbackLng: "en", + fallbackLng: Common.Locale.defaultLang, escapeValue: false, backend: { loadPath: './locale/{{lng}}.json' diff --git a/apps/presentationeditor/mobile/src/index_dev.html b/apps/presentationeditor/mobile/src/index_dev.html index 867a5ff63..cf7dad3ca 100644 --- a/apps/presentationeditor/mobile/src/index_dev.html +++ b/apps/presentationeditor/mobile/src/index_dev.html @@ -60,7 +60,7 @@ } let params = getUrlParams(), - lang = (params["lang"] || 'en').split(/[\-\_]/)[0]; + lang = (params["lang"] || <%= htmlWebpackPlugin.options.system.env.defaultLang %>).split(/[\-\_]/)[0]; window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; diff --git a/apps/presentationeditor/mobile/src/lib/i18n.js b/apps/presentationeditor/mobile/src/lib/i18n.js index b3d3566ee..10a886dd5 100644 --- a/apps/presentationeditor/mobile/src/lib/i18n.js +++ b/apps/presentationeditor/mobile/src/lib/i18n.js @@ -6,7 +6,7 @@ i18n.use(initReactI18next) .use(Fetch) .init({ lng: Common.Locale.currentLang, - fallbackLng: "en", + fallbackLng: Common.Locale.defaultLang, escapeValue: false, backend: { loadPath: './locale/{{lng}}.json' diff --git a/apps/spreadsheeteditor/mobile/src/index_dev.html b/apps/spreadsheeteditor/mobile/src/index_dev.html index 18a92b021..8447a97cb 100644 --- a/apps/spreadsheeteditor/mobile/src/index_dev.html +++ b/apps/spreadsheeteditor/mobile/src/index_dev.html @@ -60,7 +60,7 @@ } let params = getUrlParams(), - lang = (params["lang"] || 'en').split(/[\-\_]/)[0]; + lang = (params["lang"] || <%= htmlWebpackPlugin.options.system.env.defaultLang %>).split(/[\-\_]/)[0]; window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; diff --git a/apps/spreadsheeteditor/mobile/src/lib/i18n.js b/apps/spreadsheeteditor/mobile/src/lib/i18n.js index b3d3566ee..10a886dd5 100644 --- a/apps/spreadsheeteditor/mobile/src/lib/i18n.js +++ b/apps/spreadsheeteditor/mobile/src/lib/i18n.js @@ -6,7 +6,7 @@ i18n.use(initReactI18next) .use(Fetch) .init({ lng: Common.Locale.currentLang, - fallbackLng: "en", + fallbackLng: Common.Locale.defaultLang, escapeValue: false, backend: { loadPath: './locale/{{lng}}.json' diff --git a/vendor/framework7-react/build/webpack.config.js b/vendor/framework7-react/build/webpack.config.js index 66f9eb5ca..781084fd0 100644 --- a/vendor/framework7-react/build/webpack.config.js +++ b/vendor/framework7-react/build/webpack.config.js @@ -204,6 +204,11 @@ module.exports = { removeStyleLinkTypeAttributes: true, useShortDoctype: true } : false, + system: { + env: { + defaultLang: JSON.stringify(process.env.DEFAULT_LANG || "en"), + } + }, }), new MiniCssExtractPlugin({ filename: 'css/[name].css', From b6f00e7b40ce8b1183bb7dd7edcc488f445bd31b Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sat, 23 Oct 2021 11:34:31 +0300 Subject: [PATCH 06/11] [mobile] fix app default lang --- apps/presentationeditor/mobile/src/index_dev.html | 3 ++- apps/spreadsheeteditor/mobile/src/index_dev.html | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/presentationeditor/mobile/src/index_dev.html b/apps/presentationeditor/mobile/src/index_dev.html index cf7dad3ca..60a5d6523 100644 --- a/apps/presentationeditor/mobile/src/index_dev.html +++ b/apps/presentationeditor/mobile/src/index_dev.html @@ -59,8 +59,9 @@ return urlParams; } + window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}}; let params = getUrlParams(), - lang = (params["lang"] || <%= htmlWebpackPlugin.options.system.env.defaultLang %>).split(/[\-\_]/)[0]; + lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0]; window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; diff --git a/apps/spreadsheeteditor/mobile/src/index_dev.html b/apps/spreadsheeteditor/mobile/src/index_dev.html index 8447a97cb..c4686125b 100644 --- a/apps/spreadsheeteditor/mobile/src/index_dev.html +++ b/apps/spreadsheeteditor/mobile/src/index_dev.html @@ -59,8 +59,9 @@ return urlParams; } + window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}}; let params = getUrlParams(), - lang = (params["lang"] || <%= htmlWebpackPlugin.options.system.env.defaultLang %>).split(/[\-\_]/)[0]; + lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0]; window.frameEditorId = params["frameEditorId"]; window.parentOrigin = params["parentOrigin"]; From b828bf616f9f2a0d48590d5e5ea46643844fd3cc Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sat, 23 Oct 2021 11:35:46 +0300 Subject: [PATCH 07/11] [mobile] get "about" info from enviroment variables --- vendor/framework7-react/build/webpack.config.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/vendor/framework7-react/build/webpack.config.js b/vendor/framework7-react/build/webpack.config.js index 781084fd0..75e255341 100644 --- a/vendor/framework7-react/build/webpack.config.js +++ b/vendor/framework7-react/build/webpack.config.js @@ -51,7 +51,7 @@ module.exports = { jquery: 'jQuery' }, - devtool: env === 'production' ? /*false*/'source-map' : 'source-map', // TODO: turn off debugger source map before release + devtool: env === 'production' ? false/*'source-map'*/ : 'source-map', // TODO: turn off debugger source map before release optimization: { minimizer: [new TerserPlugin({ })], @@ -165,14 +165,14 @@ module.exports = { 'process.env.NODE_ENV': JSON.stringify(env), 'process.env.TARGET': JSON.stringify(target), __PRODUCT_VERSION__: JSON.stringify(process.env.PRODUCT_VERSION ? process.env.PRODUCT_VERSION : '6.2.0d'), - __PUBLISHER_ADDRESS__: JSON.stringify('20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050'), - __SUPPORT_EMAIL__: JSON.stringify('support@onlyoffice.com'), - __PUBLISHER_PHONE__: JSON.stringify('+371 633-99867'), - __PUBLISHER_URL__: JSON.stringify('https://www.onlyoffice.com'), - __PUBLISHER_NAME__: JSON.stringify('Ascensio System SIA'), + __PUBLISHER_ADDRESS__: JSON.stringify(process.env.PUBLISHER_ADDRESS || '20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050'), + __SUPPORT_EMAIL__: JSON.stringify(process.env.SUPPORT_EMAIL || 'support@onlyoffice.com'), + __PUBLISHER_PHONE__: JSON.stringify(process.env.PUBLISHER_PHONE || '+371 633-99867'), + __PUBLISHER_URL__: JSON.stringify(process.env.PUBLISHER_URL || 'https://www.onlyoffice.com'), + __PUBLISHER_NAME__: JSON.stringify(process.env.PUBLISHER_NAME || 'Ascensio System SIA'), __APP_TITLE_TEXT__: JSON.stringify(process.env.APP_TITLE_TEXT ? process.env.APP_TITLE_TEXT : 'ONLYOFFICE'), __COMPANY_NAME__: JSON.stringify(process.env.COMPANY_NAME ? process.env.COMPANY_NAME : 'ONLYOFFICE'), - __HELP_URL__: JSON.stringify('https://helpcenter.onlyoffice.com') + __HELP_URL__: JSON.stringify(process.env.HELP_URL || 'https://helpcenter.onlyoffice.com') }), new webpack.BannerPlugin(`\n* Version: ${process.env.PRODUCT_VERSION} (build: ${process.env.BUILD_NUMBER})\n`), From 8abe782d9a0aa80287ec3d670f9a2ae07e06d7d1 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sat, 23 Oct 2021 11:43:09 +0300 Subject: [PATCH 08/11] [mobile] fix header logo --- apps/presentationeditor/mobile/src/less/icons-ios.less | 2 +- apps/presentationeditor/mobile/src/less/icons-material.less | 2 +- apps/spreadsheeteditor/mobile/src/less/icons-ios.less | 2 +- apps/spreadsheeteditor/mobile/src/less/icons-material.less | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/presentationeditor/mobile/src/less/icons-ios.less b/apps/presentationeditor/mobile/src/less/icons-ios.less index b72ce6628..738e6b7cb 100644 --- a/apps/presentationeditor/mobile/src/less/icons-ios.less +++ b/apps/presentationeditor/mobile/src/less/icons-ios.less @@ -4,7 +4,7 @@ &.icon-logo { width: 100px; height: 14px; - background: url('../../../../common/mobile/resources/img/header/logo-ios.svg') no-repeat center; + //background: url('../../../../common/mobile/resources/img/header/logo-ios.svg') no-repeat center; } &.icon-search { diff --git a/apps/presentationeditor/mobile/src/less/icons-material.less b/apps/presentationeditor/mobile/src/less/icons-material.less index ecd71da8f..90ffdba25 100644 --- a/apps/presentationeditor/mobile/src/less/icons-material.less +++ b/apps/presentationeditor/mobile/src/less/icons-material.less @@ -489,7 +489,7 @@ &.icon-logo { width: 100px; height: 14px; - background: url('../../../../common/mobile/resources/img/header/logo-android.svg') no-repeat center; + //background: url('../../../../common/mobile/resources/img/header/logo-android.svg') no-repeat center; } &.icon-undo { diff --git a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less index 9f308f240..af734d8ca 100644 --- a/apps/spreadsheeteditor/mobile/src/less/icons-ios.less +++ b/apps/spreadsheeteditor/mobile/src/less/icons-ios.less @@ -5,7 +5,7 @@ &.icon-logo { width: 100px; height: 14px; - background: url('../../../../common/mobile/resources/img/header/logo-ios.svg') no-repeat center; + //background: url('../../../../common/mobile/resources/img/header/logo-ios.svg') no-repeat center; } &.icon-search { width: 24px; diff --git a/apps/spreadsheeteditor/mobile/src/less/icons-material.less b/apps/spreadsheeteditor/mobile/src/less/icons-material.less index 928c5806f..082c7f232 100644 --- a/apps/spreadsheeteditor/mobile/src/less/icons-material.less +++ b/apps/spreadsheeteditor/mobile/src/less/icons-material.less @@ -414,7 +414,7 @@ &.icon-logo { width: 100px; height: 14px; - background: url('../../../../common/mobile/resources/img/header/logo-android.svg') no-repeat center; + //background: url('../../../../common/mobile/resources/img/header/logo-android.svg') no-repeat center; } &.icon-undo { width: 22px; From 15fb1e9ddabd49f638aed8719ed71b626a889f95 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sat, 23 Oct 2021 16:14:30 +0300 Subject: [PATCH 09/11] [mobile] remove wrong chars in "about" --- apps/common/mobile/lib/view/About.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/common/mobile/lib/view/About.jsx b/apps/common/mobile/lib/view/About.jsx index 039533f22..e1bed1425 100644 --- a/apps/common/mobile/lib/view/About.jsx +++ b/apps/common/mobile/lib/view/About.jsx @@ -18,7 +18,8 @@ const PageAbout = props => { const logoCustomer = customer ? customer.logo : null; const publisherUrl = __PUBLISHER_URL__, - publisherPrintUrl = publisherUrl.replace(/https?:\/{2}|\/$/,""); + publisherPrintUrl = publisherUrl.replace(/https?:\/{2}|\/$/g,""); + const publisherName = __PUBLISHER_NAME__.replace(/\\"/g, '"'); const editors = { de: 'DOCUMENT EDITOR', From 116b4e15ab6a44ecd27a7791d7b65b878ceab3f8 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Sun, 24 Oct 2021 13:25:10 +0300 Subject: [PATCH 10/11] [mobile] fix bug 53325 --- apps/common/mobile/lib/view/About.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/common/mobile/lib/view/About.jsx b/apps/common/mobile/lib/view/About.jsx index e1bed1425..3dd4cac9a 100644 --- a/apps/common/mobile/lib/view/About.jsx +++ b/apps/common/mobile/lib/view/About.jsx @@ -80,7 +80,7 @@ const PageAbout = props => {

-

{__PUBLISHER_NAME__}

+

{publisherName}

{publisherPrintUrl}

@@ -96,7 +96,7 @@ const PageAbout = props => {

{_t.textVersion} {__PRODUCT_VERSION__}

-

{__PUBLISHER_NAME__}

+

{publisherName}

{__PUBLISHER_ADDRESS__} From fb3599293bda23d172f851eecd694f1da903f0ee Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Mon, 25 Oct 2021 00:32:35 +0300 Subject: [PATCH 11/11] [embed] fix bug 53324 --- apps/common/embed/resources/less/common.less | 2 +- build/Gruntfile.js | 2 ++ build/common.json | 14 +++++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/apps/common/embed/resources/less/common.less b/apps/common/embed/resources/less/common.less index 9b525cacd..de8ee589a 100644 --- a/apps/common/embed/resources/less/common.less +++ b/apps/common/embed/resources/less/common.less @@ -239,7 +239,7 @@ display: block; width: 100px; height: 24px; - background: data-uri('../../../../common/embed/resources/img/logo.svg') no-repeat; + background: url(../../../../common/embed/resources/img/logo.svg) no-repeat; } // Control buttons diff --git a/build/Gruntfile.js b/build/Gruntfile.js index 3437ccbd1..a3de8346c 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -252,6 +252,7 @@ module.exports = function(grunt) { doRegisterTask('es6-promise'); doRegisterTask('jszip'); doRegisterTask('jsziputils'); + doRegisterTask('common-embed'); doRegisterTask('requirejs', function(defaultConfig, packageFile) { return { uglify: { @@ -622,6 +623,7 @@ module.exports = function(grunt) { grunt.registerTask('deploy-jsziputils', ['jsziputils-init', 'clean', 'copy']); grunt.registerTask('deploy-requirejs', ['requirejs-init', 'clean', 'uglify']); grunt.registerTask('deploy-es6-promise', ['es6-promise-init', 'clean', 'copy']); + grunt.registerTask('deploy-common-embed', ['common-embed-init', 'clean', 'copy']); grunt.registerTask('deploy-app-main', ['prebuild-icons-sprite', 'main-app-init', 'clean:prebuild', 'imagemin', 'less', 'requirejs', 'concat', 'copy', 'svgmin', 'inline', 'json-minify', diff --git a/build/common.json b/build/common.json index ae094a888..c483c7640 100644 --- a/build/common.json +++ b/build/common.json @@ -227,6 +227,17 @@ "dest": "../deploy/web-apps/vendor/requirejs/require.js" } }, + "common-embed": { + "clean": [ + "../deploy/web-apps/apps/common/embed" + ], + "copy": { + "app-logo": { + "dest": "../deploy/web-apps/apps/common/embed/resources/img/logo.svg", + "src": "../apps/common/embed/resources/img/logo.svg" + } + } + }, "tasks": { "deploy": [ "increment-build", @@ -243,7 +254,8 @@ "deploy-fetch", "deploy-jszip", "deploy-jsziputils", - "deploy-es6-promise" + "deploy-es6-promise", + "deploy-common-embed" ] } } \ No newline at end of file