Merge branch 'hotfix/v6.4.2' into release/v7.0.0

This commit is contained in:
Maxim Kadushkin 2021-10-31 22:26:35 +03:00
commit 27d024bde5
25 changed files with 99 additions and 34 deletions

View file

@ -239,7 +239,7 @@
display: block; display: block;
width: 100px; width: 100px;
height: 20px; height: 20px;
background: data-uri('../../../../common/embed/resources/img/logo.svg') no-repeat; background: url(../../../../common/embed/resources/img/logo.svg) no-repeat;
} }
// Control buttons // Control buttons

View file

@ -18,7 +18,8 @@ const PageAbout = props => {
const logoCustomer = customer ? customer.logo : null; const logoCustomer = customer ? customer.logo : null;
const publisherUrl = __PUBLISHER_URL__, const publisherUrl = __PUBLISHER_URL__,
publisherPrintUrl = publisherUrl.replace(/https?:\/{2}|\/$/,""); publisherPrintUrl = publisherUrl.replace(/https?:\/{2}|\/$/g,"");
const publisherName = __PUBLISHER_NAME__.replace(/\\"/g, '"');
const editors = { const editors = {
de: 'DOCUMENT EDITOR', de: 'DOCUMENT EDITOR',
@ -79,7 +80,7 @@ const PageAbout = props => {
<p> <p>
<label>{_t.textPoweredBy}</label> <label>{_t.textPoweredBy}</label>
</p> </p>
<h3 className="vendor">{__PUBLISHER_NAME__}</h3> <h3 className="vendor">{publisherName}</h3>
<p> <p>
<Link className="external" target="_blank" href={publisherUrl}>{publisherPrintUrl}</Link> <Link className="external" target="_blank" href={publisherUrl}>{publisherPrintUrl}</Link>
</p> </p>
@ -95,7 +96,7 @@ const PageAbout = props => {
<h3>{_t.textVersion} {__PRODUCT_VERSION__}</h3> <h3>{_t.textVersion} {__PRODUCT_VERSION__}</h3>
</div> </div>
<div className="content-block"> <div className="content-block">
<h3 id="settings-about-name" className="vendor">{__PUBLISHER_NAME__}</h3> <h3 id="settings-about-name" className="vendor">{publisherName}</h3>
<p> <p>
<label>{_t.textAddress}:</label> <label>{_t.textAddress}:</label>
<a id="settings-about-address" className="external">{__PUBLISHER_ADDRESS__}</a> <a id="settings-about-address" className="external">{__PUBLISHER_ADDRESS__}</a>

View file

@ -1,4 +1,5 @@
@text-normal: #000; @text-normal: #000;
// @common-image-about-path - defined in webpack config
.about { .about {
.page-content { .page-content {
@ -36,6 +37,6 @@
display: inline-block; display: inline-block;
width: 100%; width: 100%;
height: 55px; height: 55px;
background: url('../../../../common/main/resources/img/about/logo_s.svg') no-repeat center; background: ~"url(@{common-image-about-path}/logo_s.svg) no-repeat center";
} }
} }

View file

@ -1,3 +1,5 @@
// @common-image-header-path - defined in webpack config
.device-ios { .device-ios {
i.icon { i.icon {
&.icon_mask { &.icon_mask {
@ -6,7 +8,7 @@
&.icon-logo { &.icon-logo {
width: 100px; width: 100px;
height: 14px; height: 14px;
background: url('../../img/header/logo-ios.svg') no-repeat center; background: ~"url(@{common-image-header-path}/logo-ios.svg)" no-repeat center;
} }
&.icon-prev { &.icon-prev {
width: 22px; width: 22px;

View file

@ -1,3 +1,5 @@
// @common-image-header-path - defined in webpack config
.device-android { .device-android {
i.icon { i.icon {
&.icon_mask { &.icon_mask {
@ -6,7 +8,7 @@
&.icon-logo { &.icon-logo {
width: 100px; width: 100px;
height: 14px; height: 14px;
background: url('../../img/header/logo-android.svg') no-repeat center; background: ~"url(@{common-image-header-path}/logo-android.svg) no-repeat center";
} }
&.icon-prev { &.icon-prev {
width: 20px; width: 20px;

View file

@ -287,7 +287,7 @@
<link rel="stylesheet" type="text/css" href="../../../apps/documenteditor/main/resources/css/app.css"> <link rel="stylesheet" type="text/css" href="../../../apps/documenteditor/main/resources/css/app.css">
</head> </head>
<body> <body>
<script src="../../common/main/lib/util/htmlutils.js"></script> <script src="../../../../../apps/common/main/lib/util/htmlutils.js?__inline=true"></script>
<script> <script>
window.requireTimeourError = function(){ window.requireTimeourError = function(){

View file

@ -59,12 +59,13 @@
return urlParams; return urlParams;
}; };
window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
let params = getUrlParams(), let params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0]; lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];
window.Common.Locale.currentLang = lang;
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];
window.Common = {Locale: {currentLang: lang}};
</script> </script>
<script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script> <script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>

View file

@ -6,7 +6,7 @@ i18n.use(initReactI18next)
.use(Fetch) .use(Fetch)
.init({ .init({
lng: Common.Locale.currentLang, lng: Common.Locale.currentLang,
fallbackLng: "en", fallbackLng: Common.Locale.defaultLang,
escapeValue: false, escapeValue: false,
backend: { backend: {
loadPath: './locale/{{lng}}.json' loadPath: './locale/{{lng}}.json'

View file

@ -86,7 +86,12 @@ class MainPage extends Component {
render() { render() {
const appOptions = this.props.storeAppOptions; const appOptions = this.props.storeAppOptions;
const config = appOptions.config; const config = appOptions.config;
const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
let showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
if ( !Object.keys(config).length ) {
showLogo = !/&(?:logo)=/.test(window.location.search);
}
const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo));
return ( return (
<Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}> <Page name="home" className={`editor${ showLogo ? ' page-with-logo' : ''}`}>

View file

@ -287,7 +287,7 @@
<link rel="stylesheet" type="text/css" href="../../../apps/presentationeditor/main/resources/css/app.css"> <link rel="stylesheet" type="text/css" href="../../../apps/presentationeditor/main/resources/css/app.css">
</head> </head>
<body> <body>
<script src="../../common/main/lib/util/htmlutils.js"></script> <script src="../../../../../apps/common/main/lib/util/htmlutils.js?__inline=true"></script>
<script> <script>
window.requireTimeourError = function(){ window.requireTimeourError = function(){

View file

@ -59,8 +59,9 @@
return urlParams; return urlParams;
} }
window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
let params = getUrlParams(), let params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0]; lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];

View file

@ -489,7 +489,7 @@
&.icon-logo { &.icon-logo {
width: 100px; width: 100px;
height: 14px; 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 { &.icon-undo {

View file

@ -6,7 +6,7 @@ i18n.use(initReactI18next)
.use(Fetch) .use(Fetch)
.init({ .init({
lng: Common.Locale.currentLang, lng: Common.Locale.currentLang,
fallbackLng: "en", fallbackLng: Common.Locale.defaultLang,
escapeValue: false, escapeValue: false,
backend: { backend: {
loadPath: './locale/{{lng}}.json' loadPath: './locale/{{lng}}.json'

View file

@ -92,7 +92,12 @@ class MainPage extends Component {
render() { render() {
const appOptions = this.props.storeAppOptions; const appOptions = this.props.storeAppOptions;
const config = appOptions.config; const config = appOptions.config;
const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
let showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
if ( !Object.keys(config).length ) {
showLogo = !/&(?:logo)=/.test(window.location.search);
}
const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo));
return ( return (
<Fragment> <Fragment>

View file

@ -287,7 +287,7 @@
<link rel="stylesheet" type="text/css" href="../../../apps/spreadsheeteditor/main/resources/css/app.css"> <link rel="stylesheet" type="text/css" href="../../../apps/spreadsheeteditor/main/resources/css/app.css">
</head> </head>
<body> <body>
<script src="../../common/main/lib/util/htmlutils.js"></script> <script src="../../../../../apps/common/main/lib/util/htmlutils.js?__inline=true"></script>
<script> <script>
window.requireTimeourError = function(){ window.requireTimeourError = function(){
var reqerr; var reqerr;

View file

@ -59,8 +59,9 @@
return urlParams; return urlParams;
} }
window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
let params = getUrlParams(), let params = getUrlParams(),
lang = (params["lang"] || 'en').split(/[\-\_]/)[0]; lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];
window.frameEditorId = params["frameEditorId"]; window.frameEditorId = params["frameEditorId"];
window.parentOrigin = params["parentOrigin"]; window.parentOrigin = params["parentOrigin"];

View file

@ -414,7 +414,7 @@
&.icon-logo { &.icon-logo {
width: 100px; width: 100px;
height: 14px; 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 { &.icon-undo {
width: 22px; width: 22px;

View file

@ -6,7 +6,7 @@ i18n.use(initReactI18next)
.use(Fetch) .use(Fetch)
.init({ .init({
lng: Common.Locale.currentLang, lng: Common.Locale.currentLang,
fallbackLng: "en", fallbackLng: Common.Locale.defaultLang,
escapeValue: false, escapeValue: false,
backend: { backend: {
loadPath: './locale/{{lng}}.json' loadPath: './locale/{{lng}}.json'

View file

@ -92,7 +92,12 @@ class MainPage extends Component {
const wsProps = storeWorksheets.wsProps; const wsProps = storeWorksheets.wsProps;
const wsLock = storeWorksheets.wsLock; const wsLock = storeWorksheets.wsLock;
const config = appOptions.config; const config = appOptions.config;
const showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
let showLogo = !(appOptions.canBrandingExt && (config.customization && (config.customization.loaderName || config.customization.loaderLogo)));
if ( !Object.keys(config).length ) {
showLogo = !/&(?:logo)=/.test(window.location.search);
}
const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo)); const showPlaceholder = !appOptions.isDocReady && (!config.customization || !(config.customization.loaderName || config.customization.loaderLogo));
return ( return (

View file

@ -284,6 +284,7 @@ module.exports = function(grunt) {
doRegisterTask('es6-promise'); doRegisterTask('es6-promise');
doRegisterTask('jszip'); doRegisterTask('jszip');
doRegisterTask('jsziputils'); doRegisterTask('jsziputils');
doRegisterTask('common-embed');
doRegisterTask('requirejs', function(defaultConfig, packageFile) { doRegisterTask('requirejs', function(defaultConfig, packageFile) {
return { return {
uglify: { uglify: {
@ -655,6 +656,7 @@ module.exports = function(grunt) {
grunt.registerTask('deploy-jsziputils', ['jsziputils-init', 'clean', 'copy']); grunt.registerTask('deploy-jsziputils', ['jsziputils-init', 'clean', 'copy']);
grunt.registerTask('deploy-requirejs', ['requirejs-init', 'clean', 'uglify']); grunt.registerTask('deploy-requirejs', ['requirejs-init', 'clean', 'uglify']);
grunt.registerTask('deploy-es6-promise', ['es6-promise-init', 'clean', 'copy']); 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', grunt.registerTask('deploy-app-main', ['prebuild-icons-sprite', 'main-app-init', 'clean:prebuild', 'imagemin', 'less',
'requirejs', 'concat', 'copy', 'svgmin', 'inline', 'json-minify', 'requirejs', 'concat', 'copy', 'svgmin', 'inline', 'json-minify',

View file

@ -267,6 +267,17 @@
"dest": "../deploy/web-apps/vendor/requirejs/require.js" "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": { "tasks": {
"deploy": [ "deploy": [
"increment-build", "increment-build",
@ -284,7 +295,8 @@
"deploy-fetch", "deploy-fetch",
"deploy-jszip", "deploy-jszip",
"deploy-jsziputils", "deploy-jsziputils",
"deploy-es6-promise" "deploy-es6-promise",
"deploy-common-embed"
] ]
} }
} }

View file

@ -293,6 +293,12 @@
"cwd": "../apps/common/mobile/resources/img/", "cwd": "../apps/common/mobile/resources/img/",
"src": "**", "src": "**",
"dest": "../deploy/web-apps/apps/documenteditor/mobile/resources/img/" "dest": "../deploy/web-apps/apps/documenteditor/mobile/resources/img/"
},
{
"expand": true,
"cwd": "../apps/common/main/resources/img/about",
"src": "**",
"dest": "../deploy/web-apps/apps/documenteditor/mobile/resources/img/about"
} }
], ],
"assets": [ "assets": [

View file

@ -309,6 +309,12 @@
"cwd": "../apps/common/mobile/resources/img/", "cwd": "../apps/common/mobile/resources/img/",
"src": "**", "src": "**",
"dest": "../deploy/web-apps/apps/presentationeditor/mobile/resources/img/" "dest": "../deploy/web-apps/apps/presentationeditor/mobile/resources/img/"
},
{
"expand": true,
"cwd": "../apps/common/main/resources/img/about",
"src": "**",
"dest": "../deploy/web-apps/apps/presentationeditor/mobile/resources/img/about"
} }
] ]
} }

View file

@ -319,7 +319,13 @@
"images-common": [ "images-common": [
{ {
"expand": true, "expand": true,
"cwd": "../apps/common/mobile/resources/img/about", "cwd": "../apps/common/mobile/resources/img/",
"src": "**",
"dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/resources/img/"
},
{
"expand": true,
"cwd": "../apps/common/main/resources/img/about",
"src": "**", "src": "**",
"dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/resources/img/about" "dest": "../deploy/web-apps/apps/spreadsheeteditor/mobile/resources/img/about"
} }

View file

@ -51,7 +51,7 @@ module.exports = {
jquery: 'jQuery' 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: { optimization: {
minimizer: [new TerserPlugin({ minimizer: [new TerserPlugin({
})], })],
@ -116,7 +116,7 @@ module.exports = {
publicPath: '../' publicPath: '../'
} }
}), }),
'css-loader', 'css-loader?url=false',
{ {
loader: 'postcss-loader', loader: 'postcss-loader',
options: { options: {
@ -129,7 +129,11 @@ module.exports = {
loader: "less-loader", loader: "less-loader",
options: { options: {
lessOptions: { lessOptions: {
javascriptEnabled: true javascriptEnabled: true,
globalVars: {
"common-image-header-path": env === 'production' ? `../../../${editor}/mobile/resources/img/header` : '../../common/mobile/resources/img/header',
"common-image-about-path": env === 'production' ? `../../../${editor}/mobile/resources/img/about` : '../../common/main/resources/img/about',
}
} }
} }
}, },
@ -161,14 +165,14 @@ module.exports = {
'process.env.NODE_ENV': JSON.stringify(env), 'process.env.NODE_ENV': JSON.stringify(env),
'process.env.TARGET': JSON.stringify(target), 'process.env.TARGET': JSON.stringify(target),
__PRODUCT_VERSION__: JSON.stringify(process.env.PRODUCT_VERSION ? process.env.PRODUCT_VERSION : '6.2.0d'), __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'), __PUBLISHER_ADDRESS__: JSON.stringify(process.env.PUBLISHER_ADDRESS || '20A-12 Ernesta Birznieka-Upisha street, Riga, Latvia, EU, LV-1050'),
__SUPPORT_EMAIL__: JSON.stringify('support@onlyoffice.com'), __SUPPORT_EMAIL__: JSON.stringify(process.env.SUPPORT_EMAIL || 'support@onlyoffice.com'),
__PUBLISHER_PHONE__: JSON.stringify('+371 633-99867'), __PUBLISHER_PHONE__: JSON.stringify(process.env.PUBLISHER_PHONE || '+371 633-99867'),
__PUBLISHER_URL__: JSON.stringify('https://www.onlyoffice.com'), __PUBLISHER_URL__: JSON.stringify(process.env.PUBLISHER_URL || 'https://www.onlyoffice.com'),
__PUBLISHER_NAME__: JSON.stringify('Ascensio System SIA'), __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'), __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'), __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`), new webpack.BannerPlugin(`\n* Version: ${process.env.PRODUCT_VERSION} (build: ${process.env.BUILD_NUMBER})\n`),
@ -200,6 +204,11 @@ module.exports = {
removeStyleLinkTypeAttributes: true, removeStyleLinkTypeAttributes: true,
useShortDoctype: true useShortDoctype: true
} : false, } : false,
system: {
env: {
defaultLang: JSON.stringify(process.env.DEFAULT_LANG || "en"),
}
},
}), }),
new MiniCssExtractPlugin({ new MiniCssExtractPlugin({
filename: 'css/[name].css', filename: 'css/[name].css',