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

Added 'no projects and cant create' empty states #2296

Merged
merged 1 commit into from Oct 25, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/scripts/directives/deployImage.js
Expand Up @@ -25,6 +25,7 @@ angular.module("openshiftConsole")
controller: function($scope) {
// Must be initialized the controller. The link function is too late.
$scope.forms = {};
$scope.noProjectsCantCreate = false;
},
link: function($scope) {
$scope.input = {
Expand All @@ -44,6 +45,10 @@ angular.module("openshiftConsole")
value: ''
}];

$scope.$on('no-projects-cannot-create', function() {
$scope.noProjectsCantCreate = true;
});

var orderByDisplayName = $filter('orderByDisplayName');
var getErrorDetails = $filter('getErrorDetails');

Expand Down
4 changes: 4 additions & 0 deletions app/scripts/directives/deployImageDialog.js
Expand Up @@ -27,6 +27,10 @@
if (!$routeParams.project) {
ctrl.showProjectName = true;
}
$scope.$on('no-projects-cannot-create', function() {
ctrl.deployForm.$setValidity('required', false);
ctrl.deployImageNewAppCreated = false;
});
};

ctrl.deployImage = function() {
Expand Down
6 changes: 6 additions & 0 deletions app/scripts/directives/fromFile.js
Expand Up @@ -23,10 +23,16 @@ angular.module("openshiftConsole")
templateUrl: "views/directives/from-file.html",
controller: function($scope) {
var aceEditorSession;
$scope.noProjectsCantCreate = false;

var humanizeKind = $filter('humanizeKind');
var getErrorDetails = $filter('getErrorDetails');
TaskList.clear();

$scope.$on('no-projects-cannot-create', function() {
$scope.noProjectsCantCreate = true;
});

$scope.input = {
selectedProject: $scope.project
};
Expand Down
3 changes: 3 additions & 0 deletions app/scripts/directives/fromFileDialog.js
Expand Up @@ -31,6 +31,9 @@
if (!$routeParams.project) {
ctrl.showProjectName = true;
}
$scope.$on('no-projects-cannot-create', function() {
ctrl.importForm.$setValidity('required', false);
});
};

function getIconClass() {
Expand Down
7 changes: 7 additions & 0 deletions app/scripts/directives/processTemplate.js
Expand Up @@ -50,6 +50,8 @@
var displayName = $filter('displayName');
var humanize = $filter('humanize');

ctrl.noProjectsCantCreate = false;

function getHelpLinks(template) {
var helpLinkName = /^helplink\.(.*)\.title$/;
var helpLinkURL = /^helplink\.(.*)\.url$/;
Expand Down Expand Up @@ -80,6 +82,11 @@
ctrl.template = angular.copy(ctrl.template);
ctrl.templateDisplayName = displayName(ctrl.template);
ctrl.selectedProject = ctrl.project;

$scope.$on('no-projects-cannot-create', function() {
ctrl.noProjectsCantCreate = true;
});

setTemplateParams();
};

Expand Down
7 changes: 6 additions & 1 deletion app/scripts/directives/processTemplateDialog.js
Expand Up @@ -91,6 +91,11 @@
}
listProjects();

ctrl.noProjectsCantCreate = false;
$scope.$on('no-projects-cannot-create', function() {
ctrl.noProjectsCantCreate = true;
});

ctrl.projectEmptyState = {
title: 'No Project Selected',
info: 'Please select a project from the dropdown to load Templates from that project.'
Expand Down Expand Up @@ -272,7 +277,7 @@
ctrl.resultsStep.allowed = ctrl.configStep.valid;

validityWatcher = $scope.$watch("$ctrl.form.$valid", function(isValid) {
ctrl.configStep.valid = isValid && ctrl.selectedProject;
ctrl.configStep.valid = isValid && !ctrl.noProjectsCantCreate && ctrl.selectedProject;
ctrl.resultsStep.allowed = isValid;
});
}
Expand Down