Skip to content

Commit

Permalink
more changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jwforres committed May 4, 2017
1 parent 8ae846a commit ffafaf1
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 61 deletions.
13 changes: 11 additions & 2 deletions app/scripts/directives/create/nextSteps.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
angular.module('openshiftConsole').component('nextSteps', {
controller: [
'ProcessedTemplateService',
'Navigate',
NextSteps
],
bindings: {
project: '<',
projectName: '<',
loginBaseUrl: '<',
fromSampleRepo: '<',
createdBuildConfig: '<'
createdBuildConfig: '<',
onContinue: '<'
},
templateUrl: 'views/directives/next-steps.html'
});

function NextSteps(ProcessedTemplateService) {
function NextSteps(ProcessedTemplateService, Navigate) {
var ctrl = this;
ctrl.showParamsTable = false;

Expand Down Expand Up @@ -68,4 +70,11 @@ function NextSteps(ProcessedTemplateService) {
ctrl.showParamsTable = true;
};

ctrl.goToOverview = function() {
if (_.isFunction(ctrl.onContinue)) {
ctrl.onContinue();
}
Navigate.toProjectOverview(ctrl.projectName);
};

}
18 changes: 9 additions & 9 deletions app/scripts/directives/deployImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ angular.module("openshiftConsole")
return {
restrict: 'E',
scope: {
projectName: '=',
project: '=',
context: '=',
alerts: '=',
isDialog: '='
Expand Down Expand Up @@ -52,7 +52,7 @@ angular.module("openshiftConsole")

var configMapDataOrdered = [];
var secretDataOrdered = [];
var context = {namespace: $scope.projectName};
var context = {namespace: $scope.project.metadata.name};
$scope.valueFromObjects = [];

DataService.list("configmaps", context, null, { errorNotification: false }).then(function(configMapData) {
Expand Down Expand Up @@ -213,12 +213,12 @@ angular.module("openshiftConsole")
var generatedResources;
var createResources = function() {
var titles = {
started: "Deploying image " + $scope.app.name + " to project " + $scope.projectName + ".",
success: "Deployed image " + $scope.app.name + " to project " + $scope.projectName + ".",
failure: "Failed to deploy image " + $scope.app.name + " to project " + $scope.projectName + "."
started: "Deploying image " + $scope.app.name + " to project " + $scope.project.metadata.name + ".",
success: "Deployed image " + $scope.app.name + " to project " + $scope.project.metadata.name + ".",
failure: "Failed to deploy image " + $scope.app.name + " to project " + $scope.project.metadata.name + "."
};
TaskList.clear();
TaskList.add(titles, {}, $scope.projectName, function() {
TaskList.add(titles, {}, $scope.project.metadata.name, function() {
var d = $q.defer();
DataService.batch(generatedResources, $scope.context).then(function(result) {
var alerts, hasErrors = !_.isEmpty(result.failure);
Expand Down Expand Up @@ -252,11 +252,11 @@ angular.module("openshiftConsole")
});
if ($scope.isDialog) {
$scope.$emit('deployImageNewAppCreated', {
project: $scope.projectName,
project: $scope.project,
appName: $scope.app.name
});
} else {
Navigate.toNextSteps($scope.app.name, $scope.projectName);
Navigate.toNextSteps($scope.app.name, $scope.project.metadata.name);
}
};

Expand Down Expand Up @@ -303,7 +303,7 @@ angular.module("openshiftConsole")
$scope.alerts = {};
generatedResources = getResources();

var nameTakenPromise = ApplicationGenerator.ifResourcesDontExist(generatedResources, $scope.projectName);
var nameTakenPromise = ApplicationGenerator.ifResourcesDontExist(generatedResources, $scope.project.metadata.name);
var checkQuotaPromise = QuotaService.getLatestQuotaAlerts(generatedResources, $scope.context);
// Don't want to wait for the name checks to finish before making the calls to quota
// so kick off the requests above and then chain the promises here
Expand Down
2 changes: 0 additions & 2 deletions app/scripts/directives/deployImageDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ function DeployImageDialog($scope, DataService) {

$scope.$on('deployImageNewAppCreated', function(event, message) {
ctrl.selectedProject = message.project;
console.log("DEPLOYED IMAGE", message);
// showResults(); go to "Next Steps" wizard step
});

ctrl.close = function() {
Expand Down
4 changes: 2 additions & 2 deletions app/views/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<alerts alerts="alerts"></alerts>
<div class="row">
<div class="col-md-12">
<uib-tabset class="mar-top-none">
<uib-tabset class="mar-top-none" ng-if="project">
<uib-tab active="selectedTab.fromCatalog">
<uib-tab-heading>Browse Catalog</uib-tab-heading>
<catalog
Expand All @@ -27,7 +27,7 @@

<uib-tab active="selectedTab.deployImage">
<uib-tab-heading>Deploy Image</uib-tab-heading>
<deploy-image project="projectName" context="context" alerts="alerts"></deploy-image>
<deploy-image project="project" context="context" alerts="alerts"></deploy-image>
</uib-tab>

<uib-tab active="selectedTab.fromFile">
Expand Down
16 changes: 11 additions & 5 deletions app/views/directives/deploy-image-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,26 @@
allow-click-nav="false"
next-enabled="!$ctrl.deployForm.$invalid">
<div class="wizard-pf-main-inner-shadow-covers">
{{$ctrl.deployForm.$invalid}}
<form name="$ctrl.deployForm">
<deploy-image is-dialog="false" project-name="$ctrl.project" context="$ctrl.context" alerts="$ctrl.alerts"></deploy-image>
<deploy-image is-dialog="true" project="$ctrl.project" context="$ctrl.context" alerts="$ctrl.alerts"></deploy-image>
</form>
</div>
</div>
<div pf-wizard-step
step-title="Next Steps"
step-id="next-steps"
step-title="Results"
step-id="results"
step-priority="2"
substeps="false"
ok-to-nav-away="true"
allow-click-nav="false">
Next Steps goes here....
<div class="wizard-pf-main-inner-shadow-covers">
<next-steps
project="$ctrl.selectedProject"
project-name="$ctrl.selectedProject.metadata.name"
login-base-url="$ctrl.loginBaseUrl"
on-continue="$ctrl.close">
</next-steps>
</div>
</div>
</div>
</overlay-panel>
1 change: 0 additions & 1 deletion app/views/directives/deploy-image.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ <h2>
</label-editor>

<alerts alerts="alerts"></alerts>
{{form.$invalid}}
<div ng-if="!isDialog" class="button-group gutter-bottom" ng-class="{'gutter-top': !alerts.length}">
<button type="submit"
class="btn btn-primary btn-lg"
Expand Down
42 changes: 5 additions & 37 deletions app/views/directives/header/project-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,41 +40,9 @@
<navbar-utility class="hidden-xs"></navbar-utility>
</nav>
<!-- clean up ordering.* -->
<deploy-image-dialog visible="ordering.panelVisible && ordering.panelName === 'deployImage'" project="projectName" context="context" on-dialog-closed="closeOrderingPanel"></deploy-image-dialog>
<!-- <overlay-panel show-panel="ordering.panelVisible" show-close="true" handle-close="closeOrderingPanel">
<div ng-if="ordering.panelName === 'deployImage'">
<div pf-wizard
on-cancel="closeOrderingPanel()"
on-finish="closeOrderingPanel()"
next-title="nextButtonTitle"
next-callback="nextCallback"
content-height="600">
<div pf-wizard-step
step-title="Image"
step-id="image"
step-priority="1"
substeps="false"
ok-to-nav-away="true"
allow-click-nav="false"
next-enabled="">
<div class="wizard-pf-main-inner-shadow-covers">
<deploy-image is-dialog="true" project-name="projectName" context="context" alerts="alerts" on-cancel="closeOrderingPanel"></deploy-image>
</div>
</div>
<div pf-wizard-step
step-title="Next Steps"
step-id="next-steps"
step-priority="2"
substeps="false"
ok-to-nav-away="true"
allow-click-nav="false">
Next Steps goes here....
</div>
</div>
</div>
<div ng-if="ordering.panelName === 'fromFile'">
<h1>Import JSON / YAML</h1>
<from-file project-name="projectName" context="context" on-cancel="closeOrderingPanel"></from-file>
</div>
<deploy-image-dialog visible="ordering.panelVisible && ordering.panelName === 'deployImage'" project="project" context="context" on-dialog-closed="closeOrderingPanel"></deploy-image-dialog>
<!-- TODO switch to wizard -->>
<overlay-panel show-panel="ordering.panelVisible && ordering.panelName === 'fromFile'" show-close="true" handle-close="closeOrderingPanel">
<h1>Import JSON / YAML</h1>
<from-file project-name="projectName" context="context" on-cancel="closeOrderingPanel"></from-file>
</overlay-panel>
-->
6 changes: 3 additions & 3 deletions app/views/directives/next-steps.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div ng-controller="TasksController">
<h1 ng-if="!tasks().length">Completed. <a href="project/{{$ctrl.projectName}}/overview">Go to overview</a>.</h1>
<h1 ng-if="tasks().length && $ctrl.allTasksSuccessful(tasks())">Application created. <a href="project/{{$ctrl.projectName}}/overview">Continue to overview</a>.</h1>
<h1 ng-if="!tasks().length">Completed. <a href="" ng-click="$ctrl.goToOverview()">Go to overview</a>.</h1>
<h1 ng-if="tasks().length && $ctrl.allTasksSuccessful(tasks())">Application created. <a href="" ng-click="$ctrl.goToOverview()">Continue to overview</a>.</h1>
<h1 ng-if="$ctrl.pendingTasks(tasks()).length">Creating...</h1>
<h1 ng-if="!$ctrl.pendingTasks(tasks()).length && $ctrl.erroredTasks(tasks()).length">Completed, with errors</h1>

Expand Down Expand Up @@ -42,7 +42,7 @@ <h1 ng-if="!$ctrl.pendingTasks(tasks()).length && $ctrl.erroredTasks(tasks()).le
<div class="row" ng-controller="TasksController">
<div ng-if="!$ctrl.pendingTasks(tasks()).length && $ctrl.erroredTasks(tasks()).length" class="col-md-12">
<h2>Things you can do</h2>
<p>Go to the <a href="project/{{$ctrl.projectName}}/overview">overview page</a> to see more details about this project. Make sure you don't already have <a href="project/{{$ctrl.projectName}}/browse/services">services</a>, <a href="project/{{$ctrl.projectName}}/browse/builds">build configs</a>, <a href="project/{{$ctrl.projectName}}/browse/deployments">deployment configs</a>, or other resources with the same names you are trying to create. Refer to the <a target="_blank" href="{{'new_app' | helpLink}}">documentation for creating new applications</a> for more information.</p>
<p>Go to the <a href="" ng-click="$ctrl.goToOverview()">overview page</a> to see more details about this project. Make sure you don't already have <a href="project/{{$ctrl.projectName}}/browse/services">services</a>, <a href="project/{{$ctrl.projectName}}/browse/builds">build configs</a>, <a href="project/{{$ctrl.projectName}}/browse/deployments">deployment configs</a>, or other resources with the same names you are trying to create. Refer to the <a target="_blank" href="{{'new_app' | helpLink}}">documentation for creating new applications</a> for more information.</p>
<h3>Command line tools</h3>
<p>You may want to use the <code>oc</code> command line tool to help with troubleshooting. After <a target="_blank" href="command-line">downloading and installing</a> it, you can log in, switch to this particular project, and try some commands :</p>

Expand Down

0 comments on commit ffafaf1

Please sign in to comment.