Skip to content

Commit 6f50f95

Browse files
committed
Making next steps/results messaging consistent
1 parent 8498bca commit 6f50f95

19 files changed

+339
-266
lines changed

app/scripts/controllers/create/nextSteps.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ angular.module("openshiftConsole")
3333

3434
$scope.projectName = $routeParams.project;
3535
$scope.fromSampleRepo = $routeParams.fromSample;
36+
$scope.name = $routeParams.breadcrumbTitle || $routeParams.name;
3637

3738
$scope.breadcrumbs = [
3839
{

app/scripts/directives/create/nextSteps.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@
1313
loginBaseUrl: '<',
1414
fromSampleRepo: '<',
1515
createdBuildConfig: '<',
16-
onContinue: '<'
16+
onContinue: '<',
17+
showProjectName: '<',
18+
name: '<',
19+
isDialog: '<'
1720
},
1821
templateUrl: 'views/directives/next-steps.html'
1922
});

app/scripts/directives/deployImageDialog.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
angular.module('openshiftConsole').component('deployImageDialog', {
55
controller: [
66
'$scope',
7+
'$routeParams',
78
'DataService',
89
DeployImageDialog
910
],
@@ -16,12 +17,16 @@
1617
templateUrl: 'views/directives/deploy-image-dialog.html'
1718
});
1819

19-
function DeployImageDialog($scope, DataService) {
20+
function DeployImageDialog($scope, $routeParams, DataService) {
2021
var ctrl = this;
2122

2223
ctrl.$onInit = function() {
2324
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl();
2425
ctrl.currentStep = "Image";
26+
// if on the landing page, show the project name in next-steps
27+
if (!$routeParams.project) {
28+
ctrl.showProjectName = true;
29+
}
2530
};
2631

2732
ctrl.deployImage = function() {
@@ -30,6 +35,7 @@
3035

3136
$scope.$on('deployImageNewAppCreated', function(event, message) {
3237
ctrl.selectedProject = message.project;
38+
ctrl.appName = message.appName;
3339
ctrl.deployImageNewAppCreated = true;
3440
ctrl.currentStep = "Results";
3541
});

app/scripts/directives/fromFile.js

+16-10
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,14 @@ angular.module("openshiftConsole")
350350
DataService.create(APIService.kindToResource(resource.kind), null, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
351351
// create resource success
352352
function() {
353-
var kind = humanizeKind(resource.kind);
354-
NotificationsService.addNotification({
355-
type: "success",
356-
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully created."
357-
});
353+
if (!$scope.isDialog) {
354+
var kind = humanizeKind(resource.kind);
355+
NotificationsService.addNotification({
356+
type: "success",
357+
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully created."
358+
});
359+
}
360+
358361
redirect();
359362
},
360363
// create resource failure
@@ -371,11 +374,14 @@ angular.module("openshiftConsole")
371374
DataService.update(APIService.kindToResource(resource.kind), resource.metadata.name, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
372375
// update resource success
373376
function() {
374-
var kind = humanizeKind(resource.kind);
375-
NotificationsService.addNotification({
376-
type: "success",
377-
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully updated."
378-
});
377+
if (!$scope.isDialog) {
378+
var kind = humanizeKind(resource.kind);
379+
NotificationsService.addNotification({
380+
type: "success",
381+
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully updated."
382+
});
383+
}
384+
379385
redirect();
380386
},
381387
// update resource failure

app/scripts/directives/fromFileDialog.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
controller: [
66
'$scope',
77
'$timeout',
8+
'$routeParams',
9+
'$filter',
810
'DataService',
911
FromFileDialog
1012
],
@@ -17,12 +19,16 @@
1719
templateUrl: 'views/directives/from-file-dialog.html'
1820
});
1921

20-
function FromFileDialog($scope, $timeout, DataService) {
22+
function FromFileDialog($scope, $timeout, $routeParams, $filter, DataService) {
2123
var ctrl = this;
2224

2325
ctrl.$onInit = function() {
2426
ctrl.alerts = {};
2527
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl();
28+
// if on the landing page, show the project name in next-steps
29+
if (!$routeParams.project) {
30+
ctrl.showProjectName = true;
31+
}
2632
};
2733

2834
function getIconClass() {
@@ -42,6 +48,7 @@
4248
ctrl.selectedProject = message.project;
4349
ctrl.template = message.template;
4450
ctrl.iconClass = getIconClass();
51+
ctrl.name = "YAML / JSON";
4552
// Need to let the current digest loop finish so the template config step becomes visible or the wizard will throw an error
4653
// from the change to currentStep
4754
$timeout(function() {
@@ -51,6 +58,7 @@
5158

5259
$scope.$on('templateInstantiated', function(event, message) {
5360
ctrl.selectedProject = message.project;
61+
ctrl.name = $filter('displayName')(ctrl.template);
5462
ctrl.currentStep = "Results";
5563
});
5664

@@ -73,7 +81,7 @@
7381
}
7482
};
7583

76-
ctrl.currentStep = "JSON / YAML";
84+
ctrl.currentStep = "YAML / JSON";
7785

7886
ctrl.nextCallback = function (step) {
7987
if (step.stepId === 'file') {

app/scripts/directives/processTemplateDialog.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
controller: [
66
'$scope',
77
'$filter',
8+
'$routeParams',
89
'Catalog',
910
'DataService',
1011
'KeywordService',
@@ -25,6 +26,7 @@
2526

2627
function ProcessTemplateDialog($scope,
2728
$filter,
29+
$routeParams,
2830
Catalog,
2931
DataService,
3032
KeywordService,
@@ -78,7 +80,6 @@
7880
onShow: showResults
7981
};
8082

81-
8283
ctrl.$onInit = function() {
8384
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl();
8485
ctrl.preSelectedProject = ctrl.selectedProject = ctrl.project;
@@ -113,6 +114,10 @@
113114
appliedFilters: [],
114115
onFilterChange: filterChange
115116
};
117+
// if on the landing page, show the project name in next-steps
118+
if (!$routeParams.project) {
119+
ctrl.showProjectName = true;
120+
}
116121
};
117122

118123
ctrl.$onChanges = function(changes) {

app/styles/_core.less

+3-6
Original file line numberDiff line numberDiff line change
@@ -703,16 +703,13 @@ label.checkbox {
703703
}
704704

705705
.template-message {
706-
background-color: #d9edf7;
707-
border-color: #31708f;
708-
border-style: solid;
709-
border-width: 1px;
710-
color: black;
706+
background-color: transparent;
707+
border: 1px solid @color-pf-black-300;
711708
.resource-description {
712-
margin-bottom: 0;
713709
font-family: @font-family-monospace;
714710
// Consistent font-size with the CLI examples in code blocks below the template message.
715711
font-size: (@font-size-base - 1);
712+
margin-bottom: 0;
716713
}
717714
}
718715

app/views/create/next-steps.html

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
<div class="middle surface-shaded">
2-
<div class="middle-content">
3-
<div class="container-fluid next-steps">
4-
<breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>
2+
<div class="middle-content">
3+
<div class="container-fluid next-steps">
4+
<breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>
55

6-
<next-steps
7-
project="project"
8-
project-name="projectName"
9-
login-base-url="loginBaseUrl"
10-
from-sample-repo="fromSampleRepo"
11-
created-build-config="createdBuildConfig"></next-steps>
6+
<next-steps
7+
project="project"
8+
project-name="projectName"
9+
login-base-url="loginBaseUrl"
10+
from-sample-repo="fromSampleRepo"
11+
created-build-config="createdBuildConfig"
12+
name="name"></next-steps>
1213

13-
</div>
14-
</div><!-- /middle-content -->
14+
</div>
15+
</div><!-- /middle-content -->
1516
</div><!-- /middle -->

app/views/directives/deploy-image-dialog.html

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@
4141
<next-steps project="$ctrl.selectedProject"
4242
project-name="$ctrl.selectedProject.metadata.name"
4343
login-base-url="$ctrl.loginBaseUrl"
44-
on-continue="$ctrl.close">
44+
on-continue="$ctrl.close"
45+
show-project-name="$ctrl.showProjectName"
46+
name="$ctrl.appName"
47+
is-dialog="true">
4548
</next-steps>
4649
</div>
4750
</div>

app/views/directives/from-file-dialog.html

+5-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
on-step-changed="$ctrl.stepChanged(step)"
1111
step-class="order-service-wizard-step">
1212
<pf-wizard-step
13-
step-title="JSON / YAML"
13+
step-title="YAML / JSON"
1414
step-id="file"
1515
step-priority="1"
1616
substeps="false"
@@ -84,7 +84,10 @@
8484
<next-steps ng-if="$ctrl.currentStep === 'Results'" project="$ctrl.selectedProject"
8585
project-name="$ctrl.selectedProject.metadata.name"
8686
login-base-url="$ctrl.loginBaseUrl"
87-
on-continue="$ctrl.close">
87+
on-continue="$ctrl.close"
88+
show-project-name="$ctrl.showProjectName"
89+
name="$ctrl.name"
90+
is-dialog="true">
8891
</next-steps>
8992
</div>
9093
</div>

0 commit comments

Comments
 (0)