From c2a3849212716501a8547cdb4e553f0e71024db3 Mon Sep 17 00:00:00 2001 From: Thomas Prouvot <35368290+tprouvot@users.noreply.github.com> Date: Mon, 24 Apr 2023 08:28:10 +0200 Subject: [PATCH] [fix] Import action auto update (#74) Fix #73 --- CHANGES.md | 1 + addon/data-import.js | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index c378c52a..5c629838 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,7 @@ Version 1.17 General ------- +* Fix auto update action on data import ([issue 73](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/73) ) * Restore focus on suggested fields when pressing tab key in query editor ([issue 66](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/66) created by [Enrique Muñoz](https://github.com/emunoz-at-wiris)) * Update shortcut indication for mac users diff --git a/addon/data-import.js b/addon/data-import.js index 68af2877..cc90e8df 100644 --- a/addon/data-import.js +++ b/addon/data-import.js @@ -18,6 +18,7 @@ class Model { this.dataError = ""; this.useToolingApi = false; this.dataFormat = "excel"; + this.importActionSelected = false; this.importAction = "create"; this.importActionName = "Insert"; this.importType = "Account"; @@ -132,7 +133,7 @@ class Model { this.importType = sobj; } //automatically select update if header contains id - if (this.hasIdColumn(header)) { + if (this.hasIdColumn(header) && !this.importActionSelected) { this.importAction = "update"; } } @@ -723,6 +724,7 @@ class App extends React.Component { let { model } = this.props; model.importAction = e.target.value; model.importActionName = e.target.options[e.target.selectedIndex].text; + model.importActionSelected = true; model.didUpdate(); } onImportTypeChange(e) {