Skip to content

Commit

Permalink
fix(pipelines): show loading message while fetching version history (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
anotherchrisberry authored Sep 22, 2017
1 parent fba6ad8 commit d0b6833
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<li ng-if="pipeline.locked"><a href ng-click="pipelineConfigurerCtrl.editPipelineJson()">Show JSON</a></li>
<li ng-if="!pipeline.locked"><a href ng-click="pipelineConfigurerCtrl.editPipelineJson()">Edit as JSON</a></li>

<li ng-if="viewState.hasHistory"><a href ng-click="pipelineConfigurerCtrl.showHistory()">Show Revision History</a></li>
<li ng-if="!viewState.hasHistory"><a class="disabled">No version history found</a></li>
<li ng-if="viewState.loadingHistory"><a class="disabled"><em>Loading History...</em></a></li>
<li ng-if="!viewState.loadingHistory && viewState.hasHistory"><a href ng-click="pipelineConfigurerCtrl.showHistory()">Show Revision History</a></li>
<li ng-if="!viewState.loadingHistory && !viewState.hasHistory"><a class="disabled">No version history found</a></li>
</ul>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand All @@ -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);
Expand Down

0 comments on commit d0b6833

Please sign in to comment.