Merge pull request #643 from ONLYOFFICE/fix/bug-48118

Fix/bug 48118
This commit is contained in:
Julia Radzhabova 2020-12-28 15:35:51 +03:00 committed by GitHub
commit 22b7c727c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 33 additions and 4 deletions

View file

@ -358,10 +358,10 @@ define([
return true;
},
showError: function(errors) {
showError: function(errors, isWarning) {
var me = this;
if (!_.isEmpty(errors)) {
me.cmpEl.addClass('error');
me.cmpEl.addClass(isWarning ? 'warning' : 'error');
var errorBadge = me.cmpEl.find('.input-error'),
modalParents = errorBadge.closest('.asc-window'),
@ -380,7 +380,12 @@ define([
}
} else {
me.cmpEl.removeClass('error');
me.cmpEl.removeClass('warning');
}
},
showWarning: function(errors) {
this.showError(errors, true);
}
}
})());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

@ -200,7 +200,7 @@
@common-controls-width: 100px;
.img-commonctrl,
.dropdown-menu li .checked:before, .input-error:before,
.dropdown-menu li .checked:before, .input-error:before, .input-warning:before,
.btn-toolbar .icon.img-commonctrl, .list-item div.checked:before
{
background-image: if(@icon-src-base64, data-uri(%("%s",'@{common-image-path}/@{common-controls}')), ~"url(@{common-image-const-path}/@{common-controls})");

View file

@ -61,6 +61,18 @@
display: block;
}
}
&.warning {
input:not([disabled]) + .input-error {
display: block;
}
.input-error {
&:before {
background-position: @input-warning-offset-x @input-warning-offset-y;
}
}
}
}
input:required:focus:invalid,

View file

@ -771,6 +771,10 @@
@input-error-offset-x: -73px;
@input-error-offset-y: -170px;
// Input warning
@input-warning-offset-x: -57px;
@input-warning-offset-y: -170px;
// Spinner
@spinner-offset-x: -41px;
@spinner-offset-y: -187px;

View file

@ -247,6 +247,10 @@ define([
me.codesList.deselectAll();
me.Format = me.api.asc_convertNumFormatLocal2NumFormat(value);
me.lblExample.text(me.api.asc_getLocaleExample(me.Format));
if (!me._state.warning) {
input.showWarning([me.txtCustomWarning]);
me._state.warning = true;
}
});
this._decimalPanel = this.$window.find('.format-decimal');
@ -423,6 +427,8 @@ define([
this.Format = record.get('format');
this.lblExample.text(this.api.asc_getLocaleExample(this.Format));
this.inputCustomFormat.setValue(record.get('value'));
this.inputCustomFormat.showWarning();
this._state.warning = false;
},
onFormatSelect: function(combo, record, e, initFormatInfo) {
@ -565,7 +571,8 @@ define([
txtAs10: 'As tenths (5/10)',
txtAs100: 'As hundredths (50/100)',
txtSample: 'Sample:',
txtNone: 'None'
txtNone: 'None',
txtCustomWarning: 'Please enter the custom number format carefully. Spreadsheet Editor does not check custom formats for errors that may affect the xlsx file.'
}, SSE.Views.FormatSettingsDialog || {}))
});

View file

@ -1923,6 +1923,7 @@
"SSE.Views.FormatSettingsDialog.txtUpto1": "Up to one digit (1/3)",
"SSE.Views.FormatSettingsDialog.txtUpto2": "Up to two digits (12/25)",
"SSE.Views.FormatSettingsDialog.txtUpto3": "Up to three digits (131/135)",
"SSE.Views.FormatSettingsDialog.txtCustomWarning": "Please enter the custom number format carefully. Spreadsheet Editor does not check custom formats for errors that may affect the xlsx file.",
"SSE.Views.FormulaDialog.sDescription": "Description",
"SSE.Views.FormulaDialog.textGroupDescription": "Select Function Group",
"SSE.Views.FormulaDialog.textListDescription": "Select Function",