Skip to content

Commit

Permalink
Making next steps/results messaging consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamilto committed Sep 29, 2017
1 parent 8498bca commit 6f50f95
Show file tree
Hide file tree
Showing 19 changed files with 339 additions and 266 deletions.
1 change: 1 addition & 0 deletions app/scripts/controllers/create/nextSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ angular.module("openshiftConsole")

$scope.projectName = $routeParams.project;
$scope.fromSampleRepo = $routeParams.fromSample;
$scope.name = $routeParams.breadcrumbTitle || $routeParams.name;

$scope.breadcrumbs = [
{
Expand Down
5 changes: 4 additions & 1 deletion app/scripts/directives/create/nextSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
loginBaseUrl: '<',
fromSampleRepo: '<',
createdBuildConfig: '<',
onContinue: '<'
onContinue: '<',
showProjectName: '<',
name: '<',
isDialog: '<'
},
templateUrl: 'views/directives/next-steps.html'
});
Expand Down
8 changes: 7 additions & 1 deletion app/scripts/directives/deployImageDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
angular.module('openshiftConsole').component('deployImageDialog', {
controller: [
'$scope',
'$routeParams',
'DataService',
DeployImageDialog
],
Expand All @@ -16,12 +17,16 @@
templateUrl: 'views/directives/deploy-image-dialog.html'
});

function DeployImageDialog($scope, DataService) {
function DeployImageDialog($scope, $routeParams, DataService) {
var ctrl = this;

ctrl.$onInit = function() {
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl();
ctrl.currentStep = "Image";
// if on the landing page, show the project name in next-steps
if (!$routeParams.project) {
ctrl.showProjectName = true;
}
};

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

$scope.$on('deployImageNewAppCreated', function(event, message) {
ctrl.selectedProject = message.project;
ctrl.appName = message.appName;
ctrl.deployImageNewAppCreated = true;
ctrl.currentStep = "Results";
});
Expand Down
26 changes: 16 additions & 10 deletions app/scripts/directives/fromFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,11 +350,14 @@ angular.module("openshiftConsole")
DataService.create(APIService.kindToResource(resource.kind), null, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
// create resource success
function() {
var kind = humanizeKind(resource.kind);
NotificationsService.addNotification({
type: "success",
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully created."
});
if (!$scope.isDialog) {
var kind = humanizeKind(resource.kind);
NotificationsService.addNotification({
type: "success",
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully created."
});
}

redirect();
},
// create resource failure
Expand All @@ -371,11 +374,14 @@ angular.module("openshiftConsole")
DataService.update(APIService.kindToResource(resource.kind), resource.metadata.name, resource, {namespace: $scope.input.selectedProject.metadata.name}).then(
// update resource success
function() {
var kind = humanizeKind(resource.kind);
NotificationsService.addNotification({
type: "success",
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully updated."
});
if (!$scope.isDialog) {
var kind = humanizeKind(resource.kind);
NotificationsService.addNotification({
type: "success",
message: _.capitalize(kind) + " " + resource.metadata.name + " was successfully updated."
});
}

redirect();
},
// update resource failure
Expand Down
12 changes: 10 additions & 2 deletions app/scripts/directives/fromFileDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
controller: [
'$scope',
'$timeout',
'$routeParams',
'$filter',
'DataService',
FromFileDialog
],
Expand All @@ -17,12 +19,16 @@
templateUrl: 'views/directives/from-file-dialog.html'
});

function FromFileDialog($scope, $timeout, DataService) {
function FromFileDialog($scope, $timeout, $routeParams, $filter, DataService) {
var ctrl = this;

ctrl.$onInit = function() {
ctrl.alerts = {};
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl();
// if on the landing page, show the project name in next-steps
if (!$routeParams.project) {
ctrl.showProjectName = true;
}
};

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

$scope.$on('templateInstantiated', function(event, message) {
ctrl.selectedProject = message.project;
ctrl.name = $filter('displayName')(ctrl.template);
ctrl.currentStep = "Results";
});

Expand All @@ -73,7 +81,7 @@
}
};

ctrl.currentStep = "JSON / YAML";
ctrl.currentStep = "YAML / JSON";

ctrl.nextCallback = function (step) {
if (step.stepId === 'file') {
Expand Down
7 changes: 6 additions & 1 deletion app/scripts/directives/processTemplateDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
controller: [
'$scope',
'$filter',
'$routeParams',
'Catalog',
'DataService',
'KeywordService',
Expand All @@ -25,6 +26,7 @@

function ProcessTemplateDialog($scope,
$filter,
$routeParams,
Catalog,
DataService,
KeywordService,
Expand Down Expand Up @@ -78,7 +80,6 @@
onShow: showResults
};


ctrl.$onInit = function() {
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl();
ctrl.preSelectedProject = ctrl.selectedProject = ctrl.project;
Expand Down Expand Up @@ -113,6 +114,10 @@
appliedFilters: [],
onFilterChange: filterChange
};
// if on the landing page, show the project name in next-steps
if (!$routeParams.project) {
ctrl.showProjectName = true;
}
};

ctrl.$onChanges = function(changes) {
Expand Down
9 changes: 3 additions & 6 deletions app/styles/_core.less
Original file line number Diff line number Diff line change
Expand Up @@ -703,16 +703,13 @@ label.checkbox {
}

.template-message {
background-color: #d9edf7;
border-color: #31708f;
border-style: solid;
border-width: 1px;
color: black;
background-color: transparent;
border: 1px solid @color-pf-black-300;
.resource-description {
margin-bottom: 0;
font-family: @font-family-monospace;
// Consistent font-size with the CLI examples in code blocks below the template message.
font-size: (@font-size-base - 1);
margin-bottom: 0;
}
}

Expand Down
23 changes: 12 additions & 11 deletions app/views/create/next-steps.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<div class="middle surface-shaded">
<div class="middle-content">
<div class="container-fluid next-steps">
<breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>
<div class="middle-content">
<div class="container-fluid next-steps">
<breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>

<next-steps
project="project"
project-name="projectName"
login-base-url="loginBaseUrl"
from-sample-repo="fromSampleRepo"
created-build-config="createdBuildConfig"></next-steps>
<next-steps
project="project"
project-name="projectName"
login-base-url="loginBaseUrl"
from-sample-repo="fromSampleRepo"
created-build-config="createdBuildConfig"
name="name"></next-steps>

</div>
</div><!-- /middle-content -->
</div>
</div><!-- /middle-content -->
</div><!-- /middle -->
5 changes: 4 additions & 1 deletion app/views/directives/deploy-image-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@
<next-steps project="$ctrl.selectedProject"
project-name="$ctrl.selectedProject.metadata.name"
login-base-url="$ctrl.loginBaseUrl"
on-continue="$ctrl.close">
on-continue="$ctrl.close"
show-project-name="$ctrl.showProjectName"
name="$ctrl.appName"
is-dialog="true">
</next-steps>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions app/views/directives/from-file-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
on-step-changed="$ctrl.stepChanged(step)"
step-class="order-service-wizard-step">
<pf-wizard-step
step-title="JSON / YAML"
step-title="YAML / JSON"
step-id="file"
step-priority="1"
substeps="false"
Expand Down Expand Up @@ -84,7 +84,10 @@
<next-steps ng-if="$ctrl.currentStep === 'Results'" project="$ctrl.selectedProject"
project-name="$ctrl.selectedProject.metadata.name"
login-base-url="$ctrl.loginBaseUrl"
on-continue="$ctrl.close">
on-continue="$ctrl.close"
show-project-name="$ctrl.showProjectName"
name="$ctrl.name"
is-dialog="true">
</next-steps>
</div>
</div>
Expand Down

0 comments on commit 6f50f95

Please sign in to comment.