Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving display of results status messages and removing orphaned ta… #2209

Merged
merged 1 commit into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/scripts/directives/create/nextSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
createdBuildConfig: '<',
onContinue: '<',
showProjectName: '<',
name: '<',
isDialog: '<'
name: '<'
},
templateUrl: 'views/directives/next-steps.html'
});
Expand Down
10 changes: 0 additions & 10 deletions app/scripts/directives/tasks.js

This file was deleted.

1 change: 1 addition & 0 deletions app/styles/_core.less
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,7 @@ label.checkbox {
.template-message {
background-color: transparent;
border: 1px solid @color-pf-black-300;
margin-top: 21px !important;
.resource-description {
font-family: @font-family-monospace;
// Consistent font-size with the CLI examples in code blocks below the template message.
Expand Down
40 changes: 0 additions & 40 deletions app/views/_tasks.html

This file was deleted.

3 changes: 1 addition & 2 deletions app/views/directives/deploy-image-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
login-base-url="$ctrl.loginBaseUrl"
on-continue="$ctrl.close"
show-project-name="$ctrl.showProjectName"
name="$ctrl.appName"
is-dialog="true">
name="$ctrl.appName">
</next-steps>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions app/views/directives/from-file-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@
login-base-url="$ctrl.loginBaseUrl"
on-continue="$ctrl.close"
show-project-name="$ctrl.showProjectName"
name="$ctrl.name"
is-dialog="true">
name="$ctrl.name">
</next-steps>
</div>
</div>
Expand Down
71 changes: 23 additions & 48 deletions app/views/directives/next-steps.html
Original file line number Diff line number Diff line change
@@ -1,85 +1,60 @@
<div ng-controller="TasksController">
<div ng-if="$ctrl.pendingTasks(tasks()).length">
<div class="results-status">
<span class="spinner spinner-sm" aria-hidden="true"></span>
<span class="fa fa-clock-o text-muted" aria-hidden="true"></span>
<span class="sr-only">Pending</span>
<h1 class="results-message h3">
<strong>{{$ctrl.name}}</strong> is being created<span ng-if="$ctrl.showProjectName && $ctrl.projectName"> in <strong>{{$ctrl.projectName}}</strong></span>.
</h1>
<div class="results-message">
<h1 class="h3">
<strong>{{$ctrl.name}}</strong> is being created<span ng-if="$ctrl.showProjectName && $ctrl.projectName"> in <strong>{{$ctrl.projectName}}</strong></span>.
</h1>
</div>
</div>
</div>
<div class="results-failure" ng-if="!$ctrl.pendingTasks(tasks()).length && $ctrl.erroredTasks(tasks()).length">
<div class="results-status">
<span class="pficon pficon-error-circle-o text-danger" aria-hidden="true"></span>
<span class="sr-only">Error</span>
<h1 class="results-message h3">
<strong>{{$ctrl.name}}</strong> failed to be created<span ng-if="$ctrl.showProjectName && $ctrl.projectName"> in <strong>{{$ctrl.projectName}}</strong></span>.
</h1>
<div class="results-message">
<h1 class="h3">
<strong>{{$ctrl.name}}</strong> failed to be created<span ng-if="$ctrl.showProjectName && $ctrl.projectName"> in <strong>{{$ctrl.projectName}}</strong></span>.
</h1>
</div>
</div>
</div>
<!-- if the user refreshes the next steps page -->
<div ng-if="!tasks().length">
<div class="results-status">
<span class="pficon pficon-ok" aria-hidden="true"></span>
<span class="sr-only">Success</span>
<h1 class="results-message h3">
<strong>{{$ctrl.name}}</strong> has been created<span ng-if="$ctrl.showProjectName && $ctrl.projectName"> in <strong>{{$ctrl.projectName}}</strong> successfully</span>.
</h1>
<div class="results-status results-status-unknown">
<div class="results-message">
<h1 class="h3">
<strong>{{$ctrl.name}}</strong> completed.
</h1>
</div>
</div>
</div>
<div ng-if="tasks().length && $ctrl.allTasksSuccessful(tasks())">
<div class="results-status">
<span class="pficon pficon-ok" aria-hidden="true"></span>
<span class="sr-only">Success</span>
<h1 class="results-message h3">
<strong>{{$ctrl.name}}</strong> has been created<span ng-if="$ctrl.showProjectName && $ctrl.projectName"> in <strong>{{$ctrl.projectName}}</strong> successfully</span>.
</h1>
<div class="results-message">
<h1 class="h3">
<strong>{{$ctrl.name}}</strong> has been created<span ng-if="$ctrl.showProjectName && $ctrl.projectName"> in <strong>{{$ctrl.projectName}}</strong> successfully</span>.
</h1>
</div>
</div>
</div>

<p ng-if="!$ctrl.pendingTasks(tasks()).length && !$ctrl.erroredTasks(tasks()).length">
<a href="" ng-click="$ctrl.goToOverview()">Continue to the project overview</a>.
</p>

<!-- Show a simple bulleted list of errors if the tasks list is displayed in a dialog. -->
<div ng-if="$ctrl.isDialog && hasTaskWithError()">
<div ng-if="hasTaskWithError()">
<ul ng-repeat="task in tasks()">
<li ng-repeat="alert in task.alerts" ng-if="alert.type === 'error' || alert.type === 'warning'">
{{alert.message}}
{{alert.details}}
</li>
</ul>
</div>

<!-- Show a larger message if full page. -->
<div ng-repeat="task in tasks()" ng-if="!$ctrl.isDialog && tasks().length && !$ctrl.allTasksSuccessful(tasks())">
<div class="tasks" ng-class="hasTaskWithError() ? 'failure' : 'success'">
<div class="task-content">
<i class="pficon task-icon" ng-class="task.hasErrors ? 'pficon-error-circle-o' : 'pficon-ok'"></i>
<div class="task-info">
{{ task | taskTitle }}.
</div>
</div>
<div class="alerts task-expanded-details">
<div ng-repeat="alert in task.alerts">
<div ng-switch="alert.type">
<div ng-switch-when="error" class="alert alert-danger">
<span class="pficon pficon-error-circle-o"></span>
<span ng-if="alert.message">{{alert.message}}</span><span ng-if="alert.details">{{alert.details}}.</span>
</div>
<div ng-switch-when="warning" class="alert alert-warning">
<span class="pficon pficon-warning-triangle-o"></span>
<span ng-if="alert.message">{{alert.message}}</span><span ng-if="alert.details">{{alert.details}}.</span>
</div>
<div ng-switch-when="success" class="alert alert-success">
<span class="pficon pficon-ok"></span>
<span ng-if="alert.message">{{alert.message}}</span><span ng-if="alert.details">{{alert.details}}.</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<div class="alert alert-info template-message" ng-if="$ctrl.templateMessage.length">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
login-base-url="$ctrl.loginBaseUrl"
on-continue="$ctrl.close"
show-project-name="$ctrl.showProjectName"
name="$ctrl.template | displayName"
is-dialog="true">
name="$ctrl.template | displayName">
</next-steps>
</div>
1 change: 0 additions & 1 deletion app/views/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ <h2>Welcome to project {{projectName}}.</h2>
</div>
<div class="middle-content">
<div class="container-fluid">
<tasks></tasks>
<alerts alerts="overview.state.alerts"></alerts>
<div ng-if="overview.everythingFiltered && overview.viewBy !== 'pipeline'">
<div class="empty-state-message text-center h2">
Expand Down
4 changes: 2 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"angular-moment": "1.0.0",
"angular-utf8-base64": "0.0.5",
"file-saver": "1.3.3",
"origin-web-common": "0.0.62",
"origin-web-catalog": "0.0.51"
"origin-web-common": "0.0.63",
"origin-web-catalog": "0.0.52"
},
"devDependencies": {
"angular-mocks": "1.5.11",
Expand Down
8 changes: 1 addition & 7 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11070,11 +11070,6 @@ angular.element("#" + e).focus();
};
}
};
}), angular.module("openshiftConsole").directive("tasks", function() {
return {
restrict: "E",
templateUrl: "views/_tasks.html"
};
}), angular.module("openshiftConsole").directive("catalog", [ "CatalogService", "Constants", "KeywordService", "Logger", function(e, t, n, a) {
return {
restrict: "E",
Expand Down Expand Up @@ -13257,8 +13252,7 @@ fromSampleRepo: "<",
createdBuildConfig: "<",
onContinue: "<",
showProjectName: "<",
name: "<",
isDialog: "<"
name: "<"
},
templateUrl: "views/directives/next-steps.html"
});
Expand Down
Loading