From d0b68335f2499ee96da9e44778a865a954efecda Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Thu, 21 Sep 2017 18:27:20 -0700 Subject: [PATCH] fix(pipelines): show loading message while fetching version history (#4131) --- .../src/pipeline/config/actions/pipelineConfigActions.html | 6 +++--- .../modules/core/src/pipeline/config/pipelineConfigurer.js | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html b/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html index 1044d2fe1c3..9cb364ffbe2 100644 --- a/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html +++ b/app/scripts/modules/core/src/pipeline/config/actions/pipelineConfigActions.html @@ -12,8 +12,8 @@
  • Show JSON
  • Edit as JSON
  • - -
  • Show Revision History
  • -
  • No version history found
  • +
  • Loading History...
  • +
  • Show Revision History
  • +
  • No version history found
  • diff --git a/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js b/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js index 552abca1822..309f2576335 100644 --- a/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js +++ b/app/scripts/modules/core/src/pipeline/config/pipelineConfigurer.js @@ -44,9 +44,9 @@ module.exports = angular.module('spinnaker.core.pipeline.config.pipelineConfigur pipelineConfigService.getHistory($scope.pipeline.id, 2).then(history => { if (history && history.length > 1) { $scope.viewState.hasHistory = true; - this.setViewState({ hasHistory: true }); + this.setViewState({ hasHistory: true, loadingHistory: false }); } - }); + }).finally(() => this.setViewState({loadingHistory: false})); var configViewStateCache = viewStateCache.get('pipelineConfig'); @@ -60,6 +60,8 @@ module.exports = angular.module('spinnaker.core.pipeline.config.pipelineConfigur loading: false, }; + $scope.viewState.loadingHistory = true; + let setOriginal = (pipeline) => { $scope.viewState.original = angular.toJson(pipeline); $scope.viewState.originalRenderablePipeline = angular.toJson($scope.renderablePipeline);