From 1f2ee4e3fcf4a526abee1d2bf7042b8f5429c706 Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Mon, 21 May 2018 11:02:12 +0100 Subject: [PATCH] Show error if refresh fails --- services/web/app/views/project/editor/binary-file.pug | 4 ++++ .../ide/binary-files/controllers/BinaryFileController.coffee | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/services/web/app/views/project/editor/binary-file.pug b/services/web/app/views/project/editor/binary-file.pug index 5171483d24..35d75c9fb3 100644 --- a/services/web/app/views/project/editor/binary-file.pug +++ b/services/web/app/views/project/editor/binary-file.pug @@ -74,3 +74,7 @@ div.binary-file.full-size( i.fa.fa-fw.fa-download | | #{translate("download")} + div(ng-if="refreshError") + br + .alert.alert-danger.col-md-6.col-md-offset-3 + | Error: {{ refreshError}} diff --git a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee index 31b0f93f03..3ccffc9123 100644 --- a/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee +++ b/services/web/public/coffee/ide/binary-files/controllers/BinaryFileController.coffee @@ -31,6 +31,7 @@ define [ data: null $scope.refreshing = false + $scope.refreshError = null MAX_URL_LENGTH = 60 FRONT_OF_URL_LENGTH = 35 @@ -48,6 +49,7 @@ define [ $scope.refreshFile = (file) -> $scope.refreshing = true + $scope.refreshError = null ide.fileTreeManager.refreshLinkedFile(file) .then (response) -> { data } = response @@ -57,6 +59,9 @@ define [ ide.binaryFilesManager.openFileById(new_file_id) , 1000 ) + $scope.refreshError = null + .catch (response) -> + $scope.refreshError = response.data .finally () -> $scope.refreshing = false