From cc01608f0afe14c7249a8eb626652caba98b5360 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 26 Jan 2018 22:26:52 -0800 Subject: [PATCH] Fixed: Show error message when manual import fails to load Fixes #2384 --- src/UI/ManualImport/ErrorView.js | 5 +++++ src/UI/ManualImport/ErrorViewTemplate.hbs | 1 + src/UI/ManualImport/ManualImportLayout.js | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 src/UI/ManualImport/ErrorView.js create mode 100644 src/UI/ManualImport/ErrorViewTemplate.hbs diff --git a/src/UI/ManualImport/ErrorView.js b/src/UI/ManualImport/ErrorView.js new file mode 100644 index 000000000..8d2a47b80 --- /dev/null +++ b/src/UI/ManualImport/ErrorView.js @@ -0,0 +1,5 @@ +var Marionette = require('marionette'); + +module.exports = Marionette.CompositeView.extend({ + template : 'ManualImport/ErrorViewTemplate' +}); diff --git a/src/UI/ManualImport/ErrorViewTemplate.hbs b/src/UI/ManualImport/ErrorViewTemplate.hbs new file mode 100644 index 000000000..e547d4f88 --- /dev/null +++ b/src/UI/ManualImport/ErrorViewTemplate.hbs @@ -0,0 +1 @@ +Unable to load files for manual import. Check logs for more details. diff --git a/src/UI/ManualImport/ManualImportLayout.js b/src/UI/ManualImport/ManualImportLayout.js index ba5a139fc..fbcfa96de 100644 --- a/src/UI/ManualImport/ManualImportLayout.js +++ b/src/UI/ManualImport/ManualImportLayout.js @@ -4,6 +4,7 @@ var Marionette = require('marionette'); var Backgrid = require('backgrid'); var CommandController = require('../Commands/CommandController'); var EmptyView = require('./EmptyView'); +var ErrorView = require('./ErrorView'); var SelectFolderView = require('./Folder/SelectFolderView'); var LoadingView = require('../Shared/LoadingView'); var ManualImportRow = require('./ManualImportRow'); @@ -122,8 +123,11 @@ module.exports = Marionette.Layout.extend({ }, _loadCollection : function () { + var self = this; this.manualImportCollection = new ManualImportCollection({ folder: this.folder, downloadId: this.downloadId }); - this.manualImportCollection.fetch(); + this.manualImportCollection.fetch().fail(function () { + self.workspace.show(new ErrorView()); + }); this.listenTo(this.manualImportCollection, 'sync', this._showTable); this.listenTo(this.manualImportCollection, 'backgrid:selected', this._updateButtons); @@ -256,4 +260,4 @@ module.exports = Marionette.Layout.extend({ hideAfter : 5 }); } -}); \ No newline at end of file +});