[DE][PE] Update external links on open

This commit is contained in:
Julia Radzhabova
2023-10-26 12:42:34 +03:00
parent c917a36b99
commit 41bbcbb542
6 changed files with 15 additions and 5 deletions

View File

@ -79,10 +79,8 @@ define([
setApi: function(api) {
this.api = api;
if ((this.toolbar.mode.canRequestReferenceData || this.toolbar.mode.isOffline) && this.api) {
if (!!window.SSE) {
this.api.asc_registerCallback('asc_onNeedUpdateExternalReferenceOnOpen', _.bind(this.onNeedUpdateExternalReferenceOnOpen, this));
this.api.asc_registerCallback('asc_onNeedUpdateExternalReference', _.bind(this.onNeedUpdateExternalReference, this));
}
!!window.SSE && this.api.asc_registerCallback('asc_onNeedUpdateExternalReference', _.bind(this.onNeedUpdateExternalReference, this));
this.api.asc_registerCallback('asc_onNeedUpdateExternalReferenceOnOpen', _.bind(this.onNeedUpdateExternalReferenceOnOpen, this));
this.api.asc_registerCallback('asc_onStartUpdateExternalReference', _.bind(this.onStartUpdateExternalReference, this));
this.api.asc_registerCallback('asc_onUpdateExternalReference', _.bind(this.onUpdateExternalReference, this));
this.api.asc_registerCallback('asc_onErrorUpdateExternalReference', _.bind(this.onErrorUpdateExternalReference, this));
@ -192,7 +190,7 @@ define([
onNeedUpdateExternalReferenceOnOpen: function() {
Common.UI.warning({
msg: this.warnUpdateExternalData,
msg: !!window.SSE ? this.warnUpdateExternalData : !!window.PE ? this.warnUpdateExternalDataPE : this.warnUpdateExternalDataDE,
buttons: [{value: 'ok', caption: this.textUpdate, primary: true}, {value: 'cancel', caption: this.textDontUpdate}],
maxwidth: 600,
callback: _.bind(function(btn) {
@ -251,6 +249,8 @@ define([
txtErrorExternalLink: 'Error: updating is failed',
warnUpdateExternalData: 'This workbook contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.',
warnUpdateExternalDataDE: 'This document contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.',
warnUpdateExternalDataPE: 'This presentation contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.',
textUpdate: 'Update',
textDontUpdate: 'Don\'t Update',
textAddExternalData: 'The link to an external source has been added. You can update such links in the Data tab.'

View File

@ -1050,6 +1050,8 @@ define([
onStartUpdateExternalReference: function(status) {
this._state.isUpdatingReference = status;
if (this._initSettings) return;
var externalRef = this.chartProps.getExternalReference();
this.btnEditData.setDisabled(this._locked || externalRef && this._state.isUpdatingReference);
this.btnUpdateData.setDisabled(this._locked || this._state.isUpdatingReference);

View File

@ -12,6 +12,8 @@
"Common.Controllers.ExternalLinks.textUpdate": "Update",
"Common.Controllers.ExternalLinks.txtErrorExternalLink": "Error: updating is failed",
"Common.Controllers.ExternalLinks.warnUpdateExternalData": "This workbook contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalLinks.warnUpdateExternalDataDE": "This document contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalLinks.warnUpdateExternalDataPE": "This presentation contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalMergeEditor.textAnonymous": "Anonymous",
"Common.Controllers.ExternalMergeEditor.textClose": "Close",
"Common.Controllers.ExternalMergeEditor.warningText": "The object is disabled because it is being edited by another user.",

View File

@ -956,6 +956,8 @@ define([
onStartUpdateExternalReference: function(status) {
this._state.isUpdatingReference = status;
if (this._initSettings) return;
var externalRef = this.chartProps.getExternalReference();
this.btnEditData.setDisabled(this._locked || externalRef && this._state.isUpdatingReference);
this.btnUpdateData.setDisabled(this._locked || this._state.isUpdatingReference);

View File

@ -12,6 +12,8 @@
"Common.Controllers.ExternalLinks.textUpdate": "Update",
"Common.Controllers.ExternalLinks.txtErrorExternalLink": "Error: updating is failed",
"Common.Controllers.ExternalLinks.warnUpdateExternalData": "This workbook contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalLinks.warnUpdateExternalDataDE": "This document contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalLinks.warnUpdateExternalDataPE": "This presentation contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalOleEditor.textAnonymous": "Anonymous",
"Common.Controllers.ExternalOleEditor.textClose": "Close",
"Common.Controllers.ExternalOleEditor.warningText": "The object is disabled because it is being edited by another user.",

View File

@ -9,6 +9,8 @@
"Common.Controllers.ExternalLinks.textUpdate": "Update",
"Common.Controllers.ExternalLinks.txtErrorExternalLink": "Error: updating is failed",
"Common.Controllers.ExternalLinks.warnUpdateExternalData": "This workbook contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalLinks.warnUpdateExternalDataDE": "This document contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.ExternalLinks.warnUpdateExternalDataPE": "This presentation contains links to one or more external sources that could be unsafe.<br>If you trust the links, update them to get the latest data.",
"Common.Controllers.History.notcriticalErrorTitle": "Warning",
"Common.define.chartData.textArea": "Area",
"Common.define.chartData.textAreaStacked": "Stacked area",