From d5ad5a273798b086cfe72ee3d0b518e516abb5d8 Mon Sep 17 00:00:00 2001 From: njkim Date: Thu, 27 Jul 2023 17:38:24 -0700 Subject: [PATCH 1/5] Add spinner while getting preview, #9845 --- .../views/components/etl_modules/base-bulk-string-editor.js | 5 +++++ .../views/components/etl_modules/base-bulk-string-editor.htm | 1 + 2 files changed, 6 insertions(+) diff --git a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js index 2bd6764e97c..cd58c589b43 100644 --- a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js +++ b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js @@ -33,6 +33,7 @@ define([ this.alert = params.alert; this.moduleId = params.etlmoduleid; this.loading(true); + this.previewing = ko.observable(); this.languages = ko.observable(arches.languages); this.selectedLanguage = ko.observable(); this.graphs = ko.observable(); @@ -147,6 +148,9 @@ define([ if (!self.ready()) { return; } + + self.previewing(true); + if (self.operation() === 'replace' && (!self.oldText() || !self.newText())){ self.alert( new AlertViewModel( @@ -169,6 +173,7 @@ define([ }).fail(function(err) { console.log(err); }).always(function() { + self.previewing(false); self.deleteAllFormData(); }); }; diff --git a/arches/app/templates/views/components/etl_modules/base-bulk-string-editor.htm b/arches/app/templates/views/components/etl_modules/base-bulk-string-editor.htm index 8265a1c0c93..07ecd3ea67b 100644 --- a/arches/app/templates/views/components/etl_modules/base-bulk-string-editor.htm +++ b/arches/app/templates/views/components/etl_modules/base-bulk-string-editor.htm @@ -128,6 +128,7 @@

From 5233fce98e68d1b8506d461714596307afbd809d Mon Sep 17 00:00:00 2001 From: njkim Date: Thu, 27 Jul 2023 17:39:48 -0700 Subject: [PATCH 2/5] Disable the button, #9845 --- .../js/views/components/etl_modules/base-bulk-string-editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js index cd58c589b43..2a38b5ad634 100644 --- a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js +++ b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js @@ -84,6 +84,7 @@ define([ this.ready = ko.computed(() => { const ready = !!self.selectedGraph() && !!self.selectedNode() && + !self.previewing() && ((self.operation() == 'replace' && !!self.oldText() && !!self.newText() || self.operation() != 'replace')); return ready; }); From 558a382294f268bcd55d45c1267e031e6e8695e6 Mon Sep 17 00:00:00 2001 From: njkim Date: Thu, 27 Jul 2023 17:40:47 -0700 Subject: [PATCH 3/5] Initialize the array when restart, #9845 --- .../js/views/components/etl_modules/base-bulk-string-editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js index 2a38b5ad634..b955c60fb1a 100644 --- a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js +++ b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js @@ -151,6 +151,7 @@ define([ } self.previewing(true); + self.previewValue([]); if (self.operation() === 'replace' && (!self.oldText() || !self.newText())){ self.alert( From 9dba3855df5a794764c950cf98eb7a065404680b Mon Sep 17 00:00:00 2001 From: Alexei Peters Date: Fri, 28 Jul 2023 11:12:27 -0700 Subject: [PATCH 4/5] clear results when previewing, re #9845 --- .../js/views/components/etl_modules/base-bulk-string-editor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js index b955c60fb1a..0b991b4f0f9 100644 --- a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js +++ b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js @@ -151,6 +151,7 @@ define([ } self.previewing(true); + self.showPreview(false); self.previewValue([]); if (self.operation() === 'replace' && (!self.oldText() || !self.newText())){ From f7ffb0c717918a3991357b42f084e77d1cac7f3a Mon Sep 17 00:00:00 2001 From: Alexei Peters Date: Fri, 28 Jul 2023 12:20:26 -0700 Subject: [PATCH 5/5] nit #9845 --- .../js/views/components/etl_modules/base-bulk-string-editor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js index 0b991b4f0f9..1e4e00f0742 100644 --- a/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js +++ b/arches/app/media/js/views/components/etl_modules/base-bulk-string-editor.js @@ -202,7 +202,6 @@ define([ self.loading(true); self.submit('write').then(data => { params.activeTab("import"); - console.log(data.result); }).fail( function(err) { self.alert( new JsonErrorAlertViewModel(