handle import failures in ImportDialog
authorPhilipp Schüle <p.schuele@metaways.de>
Thu, 11 Feb 2016 16:48:16 +0000 (17:48 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Fri, 12 Feb 2016 09:59:08 +0000 (10:59 +0100)
... like memory problems

Change-Id: If0b7095fa5cc5208d2984229e32f92fa9e172ad1
Reviewed-on: http://gerrit.tine20.com/customers/2702
Tested-by: Jenkins CI (http://ci.tine20.com/)
Reviewed-by: Philipp Schüle <p.schuele@metaways.de>
Tested-by: Philipp Schüle <p.schuele@metaways.de>
tine20/Tinebase/js/widgets/dialog/ImportDialog.js

index a31b553..1508037 100644 (file)
@@ -181,23 +181,23 @@ Tine.widgets.dialog.ImportDialog = Ext.extend(Tine.widgets.dialog.WizardPanel, {
         Tine.log.debug(response);
         
         this.lastImportResponse = response;
-        
-        // load exception store
-        this.exceptionStore.loadData(response.exceptions);
-        this.exceptionStore.filterBy(this.exceptionStoreFilter, this);
-        
-        // update conflict panel
-//            var duplicatecount = response.duplicatecount || 0,
-//                recordsName = this.app.i18n.n_(this.recordClass.getMeta('recordName'), this.recordClass.getMeta('recordsName'), duplicatecount);
-//                
-//            this.conflictsLabel.setText(String.format(this.conflictsLabel.rawText, duplicatecount, recordsName), false);
-        if (this.exceptionStore.getCount()) {
-            this.loadConflict(0);
-        }
-        
-        // finlay apply callback
-        if (Ext.isFunction(callback)) {
-            callback.call(this, request, success, response);
+
+        if (success) {
+            // load exception store
+            this.exceptionStore.loadData(response.exceptions);
+            this.exceptionStore.filterBy(this.exceptionStoreFilter, this);
+
+            if (this.exceptionStore.getCount()) {
+                this.loadConflict(0);
+            }
+
+            // finally apply callback
+            if (Ext.isFunction(callback)) {
+                callback.call(this, request, success, response);
+            }
+        } else {
+            this.checkMask.hide();
+            Tine.Tinebase.ExceptionHandler.handleRequestException(response.data);
         }
     },