From ae071c427dad20560d1ca281bb32fb8b31d4372c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 17 Jan 2024 21:33:07 +0300 Subject: [PATCH 1/4] [SSE] Bug 65923 --- .../main/app/view/FillSeriesDialog.js | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js index 195fcc08d7..bea22c982a 100644 --- a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js @@ -305,16 +305,6 @@ define([ }, getSettings: function () { - if (this.isStepChanged) { - var value = this.inputStep.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - this._changedProps.asc_setStepValue(value!=='' ? parseFloat(value) : null); - } - if (this.isStopChanged) { - var value = this.inputStop.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - this._changedProps.asc_setStopValue(value!=='' ? parseFloat(value) : null); - } return this._changedProps; }, @@ -338,26 +328,25 @@ define([ }, isValid: function() { - var regstr = new RegExp('^\s*[+-]?([0-9]+([.][0-9]*)?|[.][0-9]+)\s*$'); if (this.isStepChanged) { - var value = this.inputStep.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - if (value!=='' && (!regstr.test(value.trim()) || isNaN(parseFloat(value)))) { + var res = this._changedProps.asc_isValidStepValue(this.inputStep.getValue()); + if (res[0]!==Asc.c_oAscError.ID.No || res[1]===null) { this.inputStep.showError([this.txtErrorNumber]); this.inputStep.focus(); this.isInputStepFirstChange = true; return false; - } + } else + this._changedProps.asc_setStepValue(res[1]); } if (this.isStopChanged) { - var value = this.inputStop.getValue(); - (typeof value === 'string') && (value = value.replace(',','.')); - if (value!=='' && (!regstr.test(value.trim()) || isNaN(parseFloat(value)))) { + var res = this._changedProps.asc_isValidStepValue(this.inputStop.getValue()); + if (res[0]!==Asc.c_oAscError.ID.No || res[1]===null) { this.inputStop.showError([this.txtErrorNumber]); this.inputStop.focus(); this.isInputStopFirstChange = true; return false; - } + } else + this._changedProps.asc_setStopValue(res[1]); } return true; }, From 62a20347cb130cf8217c44243e0efbf7a0940b03 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Jan 2024 10:45:32 +0300 Subject: [PATCH 2/4] [SSE] Fix check series --- apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js index bea22c982a..40937cebcf 100644 --- a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js @@ -330,7 +330,7 @@ define([ isValid: function() { if (this.isStepChanged) { var res = this._changedProps.asc_isValidStepValue(this.inputStep.getValue()); - if (res[0]!==Asc.c_oAscError.ID.No || res[1]===null) { + if (res[0]!==Asc.c_oAscError.ID.No) { this.inputStep.showError([this.txtErrorNumber]); this.inputStep.focus(); this.isInputStepFirstChange = true; @@ -340,7 +340,7 @@ define([ } if (this.isStopChanged) { var res = this._changedProps.asc_isValidStepValue(this.inputStop.getValue()); - if (res[0]!==Asc.c_oAscError.ID.No || res[1]===null) { + if (res[0]!==Asc.c_oAscError.ID.No) { this.inputStop.showError([this.txtErrorNumber]); this.inputStop.focus(); this.isInputStopFirstChange = true; From 2f53bc57dfc37b14a924b209878a40d7d870a677 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Jan 2024 12:10:29 +0300 Subject: [PATCH 3/4] [PDF] Fix tooltip for forms (loading in FF) --- apps/pdfeditor/main/app/controller/Toolbar.js | 66 +++++++++++-------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/apps/pdfeditor/main/app/controller/Toolbar.js b/apps/pdfeditor/main/app/controller/Toolbar.js index 28c0a013d7..1d1c128f9b 100644 --- a/apps/pdfeditor/main/app/controller/Toolbar.js +++ b/apps/pdfeditor/main/app/controller/Toolbar.js @@ -76,7 +76,8 @@ define([ this.addListeners({ 'Toolbar': { 'change:compact' : this.onClickChangeCompact, - 'home:open' : this.onHomeOpen + 'home:open' : this.onHomeOpen, + 'tab:active' : this.onActiveTab }, 'FileMenu': { 'menu:hide': this.onFileMenu.bind(this, 'hide'), @@ -215,34 +216,6 @@ define([ toolbar.btnNextForm.on('click', _.bind(this.onGoToForm, this, 'next')); toolbar.btnSubmit && toolbar.btnSubmit.on('click', _.bind(this.onSubmitClick, this)); toolbar.btnSaveForm && toolbar.btnSaveForm.on('click', _.bind(this.onSaveFormClick, this)); - if (toolbar.btnSubmit && !this.api.asc_IsAllRequiredFormsFilled()) { - toolbar.lockToolbar(Common.enumLock.requiredNotFilled, true, {array: [toolbar.btnSubmit]}); - if (!Common.localStorage.getItem("pdfe-embed-hide-submittip")) { - var requiredTooltip = new Common.UI.SynchronizeTip({ - extCls: 'colored', - placement: 'bottom-right', - target: toolbar.btnSubmit.$el, - text: this.textRequired, - showLink: false, - closable: false, - showButton: true, - textButton: this.textGotIt - }); - var onclose = function () { - requiredTooltip.hide(); - me.api && me.api.asc_MoveToFillingForm(true, true, true); - toolbar.btnSubmit.updateHint(me.textRequired); - }; - requiredTooltip.on('buttonclick', function () { - onclose(); - Common.localStorage.setItem("pdfe-embed-hide-submittip", 1); - }); - requiredTooltip.on('closeclick', onclose); - requiredTooltip.show(); - } else { - toolbar.btnSubmit.updateHint(me.textRequired); - } - } } }, @@ -941,6 +914,34 @@ define([ })).then(function () { (config.isEdit || config.isRestrictedEdit) && me.toolbar && me.toolbar.btnHandTool.toggle(true, true); me.api && me.api.asc_setViewerTargetType('hand'); + if (config.isRestrictedEdit && me.toolbar && me.toolbar.btnSubmit && me.api && !me.api.asc_IsAllRequiredFormsFilled()) { + me.toolbar.lockToolbar(Common.enumLock.requiredNotFilled, true, {array: [me.toolbar.btnSubmit]}); + if (!Common.localStorage.getItem("pdfe-embed-hide-submittip")) { + me.requiredTooltip = new Common.UI.SynchronizeTip({ + extCls: 'colored', + placement: 'bottom-right', + target: me.toolbar.btnSubmit.$el, + text: me.textRequired, + showLink: false, + closable: false, + showButton: true, + textButton: me.textGotIt + }); + var onclose = function () { + me.requiredTooltip.hide(); + me.api.asc_MoveToFillingForm(true, true, true); + me.toolbar.btnSubmit.updateHint(me.textRequired); + }; + me.requiredTooltip.on('buttonclick', function () { + onclose(); + Common.localStorage.setItem("pdfe-embed-hide-submittip", 1); + }); + me.requiredTooltip.on('closeclick', onclose); + me.requiredTooltip.show(); + } else { + me.toolbar.btnSubmit.updateHint(me.textRequired); + } + } }); }, @@ -958,6 +959,13 @@ define([ } }, + onActiveTab: function(tab) { + if (tab !== 'file' && tab !== 'home' && this.requiredTooltip) { + this.requiredTooltip.close(); + this.requiredTooltip = undefined; + } + }, + applySettings: function() { this.toolbar && this.toolbar.chShowComments && this.toolbar.chShowComments.setValue(Common.Utils.InternalSettings.get("pdfe-settings-livecomment"), true); }, From 792c7ce8d528573110a28d4c379a13aff35c3f5c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 18 Jan 2024 12:41:52 +0300 Subject: [PATCH 4/4] Fix --- apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js index 40937cebcf..1341a38c37 100644 --- a/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FillSeriesDialog.js @@ -339,7 +339,7 @@ define([ this._changedProps.asc_setStepValue(res[1]); } if (this.isStopChanged) { - var res = this._changedProps.asc_isValidStepValue(this.inputStop.getValue()); + var res = this._changedProps.asc_isValidStopValue(this.inputStop.getValue()); if (res[0]!==Asc.c_oAscError.ID.No) { this.inputStop.showError([this.txtErrorNumber]); this.inputStop.focus();