diff --git a/app/scripts/controllers/landingPage.js b/app/scripts/controllers/landingPage.js
index 5faa9b4ad8..e2b087d32d 100644
--- a/app/scripts/controllers/landingPage.js
+++ b/app/scripts/controllers/landingPage.js
@@ -85,6 +85,10 @@ angular.module('openshiftConsole')
_.set($scope, 'ordering.panelName', 'fromFile');
};
+ $scope.fromProjectSelected = function() {
+ _.set($scope, 'ordering.panelName', 'fromProject');
+ };
+
AuthService.withUser().then(function() {
var includeTemplates = !_.get(Constants, 'ENABLE_TECH_PREVIEW_FEATURE.template_service_broker');
Catalog.getCatalogItems(includeTemplates).then(_.spread(function(items, errorMessage) {
diff --git a/app/scripts/directives/processTemplate.js b/app/scripts/directives/processTemplate.js
index 485876360a..dc50216206 100644
--- a/app/scripts/directives/processTemplate.js
+++ b/app/scripts/directives/processTemplate.js
@@ -22,6 +22,8 @@
bindings: {
template: '<',
project: '<',
+ onProjectSelected: '<',
+ availableProjects: '<',
prefillParameters: '<',
isDialog: '<'
},
diff --git a/app/scripts/directives/processTemplateDialog.js b/app/scripts/directives/processTemplateDialog.js
index b99f376f19..d9914bb5d0 100644
--- a/app/scripts/directives/processTemplateDialog.js
+++ b/app/scripts/directives/processTemplateDialog.js
@@ -4,21 +4,46 @@
angular.module('openshiftConsole').component('processTemplateDialog', {
controller: [
'$scope',
+ '$filter',
+ 'Catalog',
'DataService',
+ 'KeywordService',
+ 'NotificationsService',
+ 'ProjectsService',
+ 'RecentlyViewedProjectsService',
ProcessTemplateDialog
],
controllerAs: '$ctrl',
bindings: {
template: '<',
+ project: '<',
+ useProjectTemplate: '<',
onDialogClosed: '&'
},
templateUrl: 'views/directives/process-template-dialog.html'
});
- function ProcessTemplateDialog($scope, DataService) {
+ function ProcessTemplateDialog($scope,
+ $filter,
+ Catalog,
+ DataService,
+ KeywordService,
+ NotificationsService,
+ ProjectsService,
+ RecentlyViewedProjectsService) {
var ctrl = this;
var validityWatcher;
+ ctrl.selectStep = {
+ id: 'projectTemplates',
+ label: 'Selection',
+ view: 'views/directives/process-template-dialog/process-template-select.html',
+ hidden: ctrl.useProjectTemplate !== true,
+ allowed: true,
+ valid: false,
+ onShow: showSelect
+ };
+
ctrl.configStep = {
id: 'configuration',
label: 'Configuration',
@@ -43,6 +68,38 @@
ctrl.$onInit = function() {
ctrl.loginBaseUrl = DataService.openshiftAPIBaseUrl();
+ ctrl.preSelectedProject = ctrl.selectedProject = ctrl.project;
+ listProjects();
+
+ ctrl.projectEmptyState = {
+ icon: 'pficon pficon-info',
+ title: 'No Project Selected',
+ info: 'Please select a project from the dropdown to load Templates from that project.'
+ };
+
+ ctrl.templatesEmptyState = {
+ icon: 'pficon pficon-info',
+ title: 'No Templates',
+ info: 'The selected project has no templates available to import.'
+ };
+
+ ctrl.filterConfig = {
+ fields: [
+ {
+ id: 'keyword',
+ title: 'Keyword',
+ placeholder: 'Filter by Keyword',
+ filterType: 'text'
+ }
+ ],
+ inlineResults: true,
+ showTotalCountResults: true,
+ itemsLabel: 'Item',
+ itemsLabelPlural: 'Items',
+ resultsCount: 0,
+ appliedFilters: [],
+ onFilterChange: filterChange
+ };
};
ctrl.$onChanges = function(changes) {
@@ -52,6 +109,9 @@
ctrl.iconClass = getIconClass();
}
}
+ if (changes.useProjectTemplate) {
+ initializeSteps();
+ }
};
$scope.$on('templateInstantiated', function(event, message) {
@@ -85,13 +145,49 @@
}
};
+ ctrl.onProjectSelected = function(project) {
+ ctrl.selectedProject = project;
+ ctrl.configStep.valid = $scope.$ctrl.form.$valid && ctrl.selectedProject;
+ };
+
+ ctrl.templateSelected = function(template) {
+ ctrl.selectedTemplate = template;
+ ctrl.template = _.get(template, 'resource');
+ ctrl.selectStep.valid = !!template;
+ };
+
+ ctrl.templateProjectChange = function () {
+ ctrl.templateProjectName = _.get(ctrl.templateProject, 'metadata.name');
+
+ // Get the templates for the selected project
+ ctrl.catalogItems = {};
+ ctrl.templateSelected();
+
+ Catalog.getProjectCatalogItems(ctrl.templateProjectName, false, true).then( _.spread(function(catalogServiceItems, errorMessage) {
+ ctrl.catalogItems = catalogServiceItems;
+ ctrl.totalCount = ctrl.catalogItems.length;
+ filterItems();
+
+ if (errorMessage) {
+ NotificationsService.addNotification(
+ {
+ type: "error",
+ message: errorMessage
+ }
+ );
+ }
+ }));
+ };
+
function getIconClass() {
var icon = _.get(ctrl, 'template.metadata.annotations.iconClass', 'fa fa-clone');
return (icon.indexOf('icon-') !== -1) ? 'font-icon ' + icon : icon;
}
function initializeSteps() {
- ctrl.steps = [ctrl.configStep, ctrl.resultsStep];
+ if (!ctrl.steps) {
+ ctrl.steps = [ctrl.selectStep, ctrl.configStep, ctrl.resultsStep];
+ }
}
function clearValidityWatcher() {
@@ -101,19 +197,30 @@
}
}
+ function showSelect() {
+ ctrl.selectStep.selected = true;
+ ctrl.configStep.selected = false;
+ ctrl.resultsStep.selected = false;
+ ctrl.nextTitle = "Next >";
+ clearValidityWatcher();
+ listProjects();
+ }
+
function showConfig() {
+ ctrl.selectStep.selected = false;
ctrl.configStep.selected = true;
ctrl.resultsStep.selected = false;
ctrl.nextTitle = "Create";
ctrl.resultsStep.allowed = ctrl.configStep.valid;
validityWatcher = $scope.$watch("$ctrl.form.$valid", function(isValid) {
- ctrl.configStep.valid = isValid;
+ ctrl.configStep.valid = isValid && ctrl.selectedProject;
ctrl.resultsStep.allowed = isValid;
});
}
function showResults() {
+ ctrl.selectStep.selected = false;
ctrl.configStep.selected = false;
ctrl.resultsStep.selected = true;
ctrl.nextTitle = "Close";
@@ -124,5 +231,60 @@
function instantiateTemplate() {
$scope.$broadcast('instantiateTemplate');
}
+
+ function filterForKeywords(searchText, items) {
+ return KeywordService.filterForKeywords(items, ['name', 'tags'], KeywordService.generateKeywords(searchText));
+ }
+
+ function filterChange(filters) {
+ ctrl.filterConfig.appliedFilters = filters;
+ filterItems();
+ }
+
+ function filterItems() {
+ ctrl.filteredItems = ctrl.catalogItems;
+ if (ctrl.filterConfig.appliedFilters && ctrl.filterConfig.appliedFilters.length > 0) {
+ _.each(ctrl.filterConfig.appliedFilters, function(filter) {
+ ctrl.filteredItems = filterForKeywords(filter.value, ctrl.filteredItems);
+ });
+ }
+
+ // Deselect the currently selected template if it was filtered out
+ if (!_.includes(ctrl.filteredItems, ctrl.selectedTemplate)) {
+ ctrl.templateSelected();
+ }
+
+ updateFilterControls();
+ }
+
+ function updateFilterControls() {
+ ctrl.filterConfig.resultsCount = ctrl.filteredItems.length;
+
+ if (ctrl.totalCount <= 1) {
+ $('.filter-pf.filter-fields input').attr('disabled', '');
+ } else {
+ $('.filter-pf.filter-fields input').removeAttr("disabled");
+ }
+ }
+
+ var updateProjects = function() {
+ var filteredProjects = _.reject(ctrl.unfilteredProjects, 'metadata.deletionTimestamp');
+ var projects = _.sortBy(filteredProjects, $filter('displayName'));
+ ctrl.searchEnabled = !_.isEmpty(filteredProjects);
+
+ ctrl.templateProjects = RecentlyViewedProjectsService.orderByMostRecentlyViewed(projects);
+ };
+
+ function listProjects() {
+ if (!ctrl.unfilteredProjects) {
+ ProjectsService.list().then(function(projectData) {
+ ctrl.unfilteredProjects = _.toArray(projectData.by("metadata.name"));
+ }, function() {
+ ctrl.unfilteredProjects = [];
+ }).finally(function() {
+ updateProjects();
+ });
+ }
+ }
}
})();
diff --git a/app/styles/_core.less b/app/styles/_core.less
index a3c4caecc1..6048cd05e1 100644
--- a/app/styles/_core.less
+++ b/app/styles/_core.less
@@ -1246,3 +1246,51 @@ pre.clipped {
width: 30px;
}
}
+
+.order-service-config {
+ .order-services-filter {
+ margin-left: 0;
+ }
+ .blank-slate-pf {
+ margin-bottom: 0;
+ padding-bottom: 0;
+ }
+ .select-project-for-template {
+ border-bottom: solid 1px @color-pf-black-300;
+ padding-bottom: 10px;
+
+ > h2 {
+ margin-bottom: 20px;
+ margin-top: 0;
+ }
+ .ui-select-container {
+ display: inline-block;
+ width: 275px;
+ }
+ }
+ .services-item {
+ &.show-selection {
+ // Clear focus settings, keep before active settings
+ &:focus {
+ color: @text-color;
+ .services-item-icon:after {
+ border: none;
+ }
+
+ .services-item-name {
+ color: @text-color;
+ }
+ }
+ &.active {
+ color: @link-hover-color;
+ .services-item-icon:after {
+ border: 2px solid @link-color;
+ }
+ .services-item-name {
+ color: @link-hover-color;
+ }
+ }
+ }
+ }
+}
+
diff --git a/app/styles/_overlay-forms.less b/app/styles/_overlay-forms.less
index 1ffd13ee81..4ec4d9fe65 100644
--- a/app/styles/_overlay-forms.less
+++ b/app/styles/_overlay-forms.less
@@ -1,5 +1,8 @@
.order-service-config-single-column {
width: 100%;
+ @media (min-width: 768px) {
+ padding-left: 0;
+ }
}
.wizard-pf-main {
diff --git a/app/views/directives/header/project-header.html b/app/views/directives/header/project-header.html
index 50fba7ed89..d09b96cadd 100644
--- a/app/views/directives/header/project-header.html
+++ b/app/views/directives/header/project-header.html
@@ -38,6 +38,7 @@
Browse Catalog
Deploy Image
Import YAML / JSON
+ Select from Project
+
diff --git a/app/views/directives/process-template-dialog.html b/app/views/directives/process-template-dialog.html
index 71f69fa599..5436c68594 100644
--- a/app/views/directives/process-template-dialog.html
+++ b/app/views/directives/process-template-dialog.html
@@ -2,7 +2,7 @@
+ ng-class="{'pf-wizard-no-back': !$ctrl.useProjectTemplate}">
-
+
-
diff --git a/app/views/directives/process-template-dialog/process-template-config.html b/app/views/directives/process-template-dialog/process-template-config.html
index 7073b3e249..33bb8749d6 100644
--- a/app/views/directives/process-template-dialog/process-template-config.html
+++ b/app/views/directives/process-template-dialog/process-template-config.html
@@ -1,5 +1,5 @@
diff --git a/app/views/directives/process-template-dialog/process-template-results.html b/app/views/directives/process-template-dialog/process-template-results.html
index b4becd3242..90e105e2e3 100644
--- a/app/views/directives/process-template-dialog/process-template-results.html
+++ b/app/views/directives/process-template-dialog/process-template-results.html
@@ -1,5 +1,6 @@
+ login-base-url="$ctrl.loginBaseUrl"
+ on-continue="$ctrl.close">
diff --git a/app/views/directives/process-template-dialog/process-template-select.html b/app/views/directives/process-template-dialog/process-template-select.html
new file mode 100644
index 0000000000..6eb4f701e5
--- /dev/null
+++ b/app/views/directives/process-template-dialog/process-template-select.html
@@ -0,0 +1,39 @@
+
+
+
Select from Project
+
+
+ {{$select.selected | displayName}}
+
+
+
+
+ –
+
+
+
+
+
+
+
+
+
diff --git a/app/views/directives/process-template.html b/app/views/directives/process-template.html
index f56f2f5b3d..ca6192181d 100644
--- a/app/views/directives/process-template.html
+++ b/app/views/directives/process-template.html
@@ -1,7 +1,7 @@
-
+
+
diff --git a/dist/scripts/scripts.js b/dist/scripts/scripts.js
index df512eb8c3..97f63d04f5 100644
--- a/dist/scripts/scripts.js
+++ b/dist/scripts/scripts.js
@@ -53,10 +53,10 @@ return _.get(e, "metadata.name");
return _.get(e, "metadata.uid");
}, W = function() {
return _.size(P.deploymentConfigs) + _.size(P.vanillaReplicationControllers) + _.size(P.deployments) + _.size(P.vanillaReplicaSets) + _.size(P.statefulSets) + _.size(P.monopods) + _.size(P.state.serviceInstances);
-}, G = function() {
-return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
}, K = function() {
-P.size = W(), P.filteredSize = G();
+return _.size(P.filteredDeploymentConfigs) + _.size(P.filteredReplicationControllers) + _.size(P.filteredDeployments) + _.size(P.filteredReplicaSets) + _.size(P.filteredStatefulSets) + _.size(P.filteredMonopods) + _.size(P.filteredServiceInstances);
+}, G = function() {
+P.size = W(), P.filteredSize = K();
var e = 0 === P.size, t = P.deploymentConfigs && P.replicationControllers && P.deployments && P.replicaSets && P.statefulSets && P.pods && P.state.serviceInstances;
V.expandAll = t && 1 === P.size, P.showGetStarted = t && e, P.showLoading = !t && e, P.everythingFiltered = !e && !P.filteredSize, P.hidePipelineOtherResources = "pipeline" === P.viewBy && (P.filterActive || _.isEmpty(P.pipelineBuildConfigs));
}, Q = function(e) {
@@ -119,7 +119,7 @@ case "name":
return !_.isEmpty(V.filterKeywords);
}
}, ie = function() {
-P.filteredDeploymentConfigs = re(P.deploymentConfigs), P.filteredReplicationControllers = re(P.vanillaReplicationControllers), P.filteredDeployments = re(P.deployments), P.filteredReplicaSets = re(P.vanillaReplicaSets), P.filteredStatefulSets = re(P.statefulSets), P.filteredMonopods = re(P.monopods), P.filteredPipelineBuildConfigs = re(P.pipelineBuildConfigs), P.filteredServiceInstances = re(V.orderedServiceInstances), P.filterActive = oe(), Z(), K();
+P.filteredDeploymentConfigs = re(P.deploymentConfigs), P.filteredReplicationControllers = re(P.vanillaReplicationControllers), P.filteredDeployments = re(P.deployments), P.filteredReplicaSets = re(P.vanillaReplicaSets), P.filteredStatefulSets = re(P.statefulSets), P.filteredMonopods = re(P.monopods), P.filteredPipelineBuildConfigs = re(P.pipelineBuildConfigs), P.filteredServiceInstances = re(V.orderedServiceInstances), P.filterActive = oe(), Z(), G();
}, se = n.project + "/overview/view-by";
P.viewBy = localStorage.getItem(se) || "app", e.$watch(function() {
return P.viewBy;
@@ -315,7 +315,7 @@ _.isEmpty(o) || (t = t.concat(o));
qe(), ze();
}, We = function() {
_.each(P.deploymentConfigs, Me);
-}, Ge = function() {
+}, Ke = function() {
if (V.builds && P.buildConfigs) {
P.recentPipelinesByBuildConfig = {}, V.recentBuildsByBuildConfig = {}, V.recentPipelinesByDeploymentConfig = {};
var e = {};
@@ -330,7 +330,7 @@ return i.sortBuilds(e, !0);
return i.sortBuilds(e, !0);
}), We();
}
-}, Ke = function() {
+}, Ge = function() {
k.setGenericQuotaWarning(V.quotas, V.clusterQuotas, n.project, V.alerts);
};
P.clearFilter = function() {
@@ -395,7 +395,7 @@ resource: "deployments"
}, a, function(e) {
E = e.by("metadata.uid"), P.deployments = _.sortBy(E, "metadata.name"), Ne(), $e(P.deployments), $e(P.vanillaReplicaSets), we(P.deployments), Qe(), ie(), h.log("deployments (subscribe)", P.deploymentsByUID);
})), Ye.push(l.watch("builds", a, function(e) {
-V.builds = e.by("metadata.name"), Ge(), h.log("builds (subscribe)", V.builds);
+V.builds = e.by("metadata.name"), Ke(), h.log("builds (subscribe)", V.builds);
})), Ye.push(l.watch({
group: "apps",
resource: "statefulsets"
@@ -415,7 +415,7 @@ P.routes = e.by("metadata.name"), Be(), h.log("routes (subscribe)", P.routes);
poll: R,
pollInterval: 6e4
})), Ye.push(l.watch("buildConfigs", a, function(e) {
-P.buildConfigs = e.by("metadata.name"), Fe(), He(), Ge(), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
+P.buildConfigs = e.by("metadata.name"), Fe(), He(), Ke(), ie(), h.log("buildconfigs (subscribe)", P.buildConfigs);
}, {
poll: R,
pollInterval: 6e4
@@ -434,12 +434,12 @@ T = e.by("metadata.name"), p.buildDockerRefMapForImageStreams(T, V.imageStreamIm
poll: R,
pollInterval: 6e4
})), Ye.push(l.watch("resourcequotas", a, function(e) {
-V.quotas = e.by("metadata.name"), Ke();
+V.quotas = e.by("metadata.name"), Ge();
}, {
poll: !0,
pollInterval: 6e4
})), Ye.push(l.watch("appliedclusterresourcequotas", a, function(e) {
-V.clusterQuotas = e.by("metadata.name"), Ke();
+V.clusterQuotas = e.by("metadata.name"), Ge();
}, {
poll: !0,
pollInterval: 6e4
@@ -4263,6 +4263,8 @@ e.template && (y(), e.template = null), _.set(e, "ordering.panelName", "");
_.set(e, "ordering.panelName", "deployImage");
}, e.fromFileSelected = function() {
_.set(e, "ordering.panelName", "fromFile");
+}, e.fromProjectSelected = function() {
+_.set(e, "ordering.panelName", "fromProject");
}, n.withUser().then(function() {
var t = !_.get(r, "ENABLE_TECH_PREVIEW_FEATURE.template_service_broker");
a.getCatalogItems(t).then(_.spread(function(t, n) {
@@ -12536,6 +12538,8 @@ controllerAs: "$ctrl",
bindings: {
template: "<",
project: "<",
+onProjectSelected: "<",
+availableProjects: "<",
prefillParameters: "<",
isDialog: "<"
},
@@ -12543,33 +12547,66 @@ templateUrl: "views/directives/process-template.html"
});
}(), function() {
angular.module("openshiftConsole").component("processTemplateDialog", {
-controller: [ "$scope", "DataService", function(e, t) {
-function n() {
-var e = _.get(s, "template.metadata.annotations.iconClass", "fa fa-clone");
+controller: [ "$scope", "$filter", "Catalog", "DataService", "KeywordService", "NotificationsService", "ProjectsService", "RecentlyViewedProjectsService", function(e, t, n, a, r, o, i, s) {
+function c() {
+var e = _.get(y, "template.metadata.annotations.iconClass", "fa fa-clone");
return -1 !== e.indexOf("icon-") ? "font-icon " + e : e;
}
-function a() {
-s.steps = [ s.configStep, s.resultsStep ];
+function l() {
+y.steps || (y.steps = [ y.selectStep, y.configStep, y.resultsStep ]);
}
-function r() {
-i && (i(), i = void 0);
+function u() {
+v && (v(), v = void 0);
}
-function o() {
+function d() {
e.$broadcast("instantiateTemplate");
}
-var i, s = this;
-s.configStep = {
+function m(e, t) {
+return r.filterForKeywords(t, [ "name", "tags" ], r.generateKeywords(e));
+}
+function p(e) {
+y.filterConfig.appliedFilters = e, f();
+}
+function f() {
+y.filteredItems = y.catalogItems, y.filterConfig.appliedFilters && y.filterConfig.appliedFilters.length > 0 && _.each(y.filterConfig.appliedFilters, function(e) {
+y.filteredItems = m(e.value, y.filteredItems);
+}), _.includes(y.filteredItems, y.selectedTemplate) || y.templateSelected(), g();
+}
+function g() {
+y.filterConfig.resultsCount = y.filteredItems.length, y.totalCount <= 1 ? $(".filter-pf.filter-fields input").attr("disabled", "") : $(".filter-pf.filter-fields input").removeAttr("disabled");
+}
+function h() {
+y.unfilteredProjects || i.list().then(function(e) {
+y.unfilteredProjects = _.toArray(e.by("metadata.name"));
+}, function() {
+y.unfilteredProjects = [];
+}).finally(function() {
+b();
+});
+}
+var v, y = this;
+y.selectStep = {
+id: "projectTemplates",
+label: "Selection",
+view: "views/directives/process-template-dialog/process-template-select.html",
+hidden: !0 !== y.useProjectTemplate,
+allowed: !0,
+valid: !1,
+onShow: function() {
+y.selectStep.selected = !0, y.configStep.selected = !1, y.resultsStep.selected = !1, y.nextTitle = "Next >", u(), h();
+}
+}, y.configStep = {
id: "configuration",
label: "Configuration",
view: "views/directives/process-template-dialog/process-template-config.html",
valid: !1,
allowed: !0,
onShow: function() {
-s.configStep.selected = !0, s.resultsStep.selected = !1, s.nextTitle = "Create", s.resultsStep.allowed = s.configStep.valid, i = e.$watch("$ctrl.form.$valid", function(e) {
-s.configStep.valid = e, s.resultsStep.allowed = e;
+y.selectStep.selected = !1, y.configStep.selected = !0, y.resultsStep.selected = !1, y.nextTitle = "Create", y.resultsStep.allowed = y.configStep.valid, v = e.$watch("$ctrl.form.$valid", function(e) {
+y.configStep.valid = e && y.selectedProject, y.resultsStep.allowed = e;
});
}
-}, s.resultsStep = {
+}, y.resultsStep = {
id: "results",
label: "Results",
view: "views/directives/process-template-dialog/process-template-results.html",
@@ -12577,26 +12614,65 @@ valid: !0,
allowed: !1,
prevEnabled: !1,
onShow: function() {
-s.configStep.selected = !1, s.resultsStep.selected = !0, s.nextTitle = "Close", r(), s.wizardDone = !0;
-}
-}, s.$onInit = function() {
-s.loginBaseUrl = t.openshiftAPIBaseUrl();
-}, s.$onChanges = function(e) {
-e.template && s.template && (a(), s.iconClass = n());
+y.selectStep.selected = !1, y.configStep.selected = !1, y.resultsStep.selected = !0, y.nextTitle = "Close", u(), y.wizardDone = !0;
+}
+}, y.$onInit = function() {
+y.loginBaseUrl = a.openshiftAPIBaseUrl(), y.preSelectedProject = y.selectedProject = y.project, h(), y.projectEmptyState = {
+icon: "pficon pficon-info",
+title: "No Project Selected",
+info: "Please select a project from the dropdown to load Templates from that project."
+}, y.templatesEmptyState = {
+icon: "pficon pficon-info",
+title: "No Templates",
+info: "The selected project has no templates available to import."
+}, y.filterConfig = {
+fields: [ {
+id: "keyword",
+title: "Keyword",
+placeholder: "Filter by Keyword",
+filterType: "text"
+} ],
+inlineResults: !0,
+showTotalCountResults: !0,
+itemsLabel: "Item",
+itemsLabelPlural: "Items",
+resultsCount: 0,
+appliedFilters: [],
+onFilterChange: p
+};
+}, y.$onChanges = function(e) {
+e.template && y.template && (l(), y.iconClass = c()), e.useProjectTemplate && l();
}, e.$on("templateInstantiated", function(e, t) {
-s.selectedProject = t.project, s.currentStep = s.resultsStep.label;
-}), s.$onDestroy = function() {
-r();
-}, s.next = function(e) {
-return e.stepId === s.configStep.id ? (o(), !1) : e.stepId !== s.resultsStep.id || (s.close(), !1);
-}, s.close = function() {
-var e = s.onDialogClosed();
+y.selectedProject = t.project, y.currentStep = y.resultsStep.label;
+}), y.$onDestroy = function() {
+u();
+}, y.next = function(e) {
+return e.stepId === y.configStep.id ? (d(), !1) : e.stepId !== y.resultsStep.id || (y.close(), !1);
+}, y.close = function() {
+var e = y.onDialogClosed();
_.isFunction(e) && e();
+}, y.onProjectSelected = function(t) {
+y.selectedProject = t, y.configStep.valid = e.$ctrl.form.$valid && y.selectedProject;
+}, y.templateSelected = function(e) {
+y.selectedTemplate = e, y.template = _.get(e, "resource"), y.selectStep.valid = !!e;
+}, y.templateProjectChange = function() {
+y.templateProjectName = _.get(y.templateProject, "metadata.name"), y.catalogItems = {}, y.templateSelected(), n.getProjectCatalogItems(y.templateProjectName, !1, !0).then(_.spread(function(e, t) {
+y.catalogItems = e, y.totalCount = y.catalogItems.length, f(), t && o.addNotification({
+type: "error",
+message: t
+});
+}));
+};
+var b = function() {
+var e = _.reject(y.unfilteredProjects, "metadata.deletionTimestamp"), n = _.sortBy(e, t("displayName"));
+y.searchEnabled = !_.isEmpty(e), y.templateProjects = s.orderByMostRecentlyViewed(n);
};
} ],
controllerAs: "$ctrl",
bindings: {
template: "<",
+project: "<",
+useProjectTemplate: "<",
onDialogClosed: "&"
},
templateUrl: "views/directives/process-template-dialog.html"
diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js
index 3eafcc3d01..0fe258a117 100644
--- a/dist/scripts/templates.js
+++ b/dist/scripts/templates.js
@@ -6914,6 +6914,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"Browse Catalog\n" +
"Deploy Image\n" +
"Import YAML / JSON\n" +
+ "Select from Project\n" +
"\n" +
"\n" +
"
\n" +
@@ -6923,6 +6924,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"
\n" +
"\n" +
"\n" +
+ "\n" +
""
);
@@ -8568,10 +8570,10 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
$templateCache.put('views/directives/process-template-dialog.html',
"
\n" +
- "
\n" +
+ "\n" +
"\n" +
"\n" +
- "
\n" +
+ "
\n" +
"
\n" +
"
\n" +
"
\n" +
@@ -8591,7 +8593,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"
\n" +
"
\n" +
"
\n" +
- "
\n" +
@@ -8604,23 +8606,62 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
$templateCache.put('views/directives/process-template-dialog/process-template-config.html',
"
"
);
$templateCache.put('views/directives/process-template-dialog/process-template-results.html',
- "
\n" +
+ "\n" +
""
);
+ $templateCache.put('views/directives/process-template-dialog/process-template-select.html',
+ "\n" +
+ "
\n" +
+ "
Select from Project
\n" +
+ "\n" +
+ "\n" +
+ "{{$select.selected | displayName}}\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "–\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "\n" +
+ "
\n" +
+ "
\n" +
+ "
\n" +
+ "
"
+ );
+
+
$templateCache.put('views/directives/process-template.html',
"\n" +
"\n" +
"
\n" +
- "\n" +
+ "\n" +
+ "\n" +
"\n" +
"
\n" +
"\n" +
diff --git a/dist/styles/main.css b/dist/styles/main.css
index 83d66332f1..e8ef70612c 100644
--- a/dist/styles/main.css
+++ b/dist/styles/main.css
@@ -4757,6 +4757,7 @@ pre.clipped.scroll{max-height:150px;overflow:auto;width:100%}
.environment-variables.table.table-bordered>tbody>tr>td:last-child .env-var-value a{font-family:"Open Sans",Helvetica,Arial,sans-serif}
.info-popover,.warnings-popover{cursor:help;vertical-align:middle;margin-left:2px}
.info-popover.pficon-info,.warnings-popover.pficon-info{color:#4d5258}
+.order-service-config .services-item.show-selection:focus,.order-service-config .services-item.show-selection:focus .services-item-name{color:#363636}
.label-tech-preview{display:inline-block;margin-top:7px}
@media (min-width:480px){.label-tech-preview{float:right;margin-left:10px}
}
@@ -4765,6 +4766,14 @@ pre.clipped.scroll{max-height:150px;overflow:auto;width:100%}
}
.page-header .label-tech-preview{margin-top:3px}
.icon-row .icon-wrap{text-align:center;width:30px}
+.order-service-config .order-services-filter{margin-left:0}
+.order-service-config .blank-slate-pf{margin-bottom:0;padding-bottom:0}
+.order-service-config .select-project-for-template{border-bottom:solid 1px #d1d1d1;padding-bottom:10px}
+.order-service-config .select-project-for-template>h2{margin-bottom:20px;margin-top:0}
+.order-service-config .select-project-for-template .ui-select-container{display:inline-block;width:275px}
+.order-service-config .services-item.show-selection:focus .services-item-icon:after{border:none}
+.order-service-config .services-item.show-selection.active,.order-service-config .services-item.show-selection.active .services-item-name{color:#00659c}
+.order-service-config .services-item.show-selection.active .services-item-icon:after{border:2px solid #0088ce}
.data-toolbar{padding:5px 0}
.data-toolbar.other-resources-toolbar .data-toolbar-dropdown{min-width:210px}
.data-toolbar .checkbox{margin-bottom:0;margin-top:10px}
@@ -4897,6 +4906,7 @@ h2+.list-view-pf{margin-top:20px}
.navbar-pf-vertical .navbar-iconic>li{display:inline-block}
.navbar-pf-vertical .navbar-toggle{margin:13px 15px}
.navbar-pf-vertical .navbar-toggle .icon-bar{width:22px}
+.order-service-config-single-column{padding-left:0}
}
.order-service-config-single-column,.overview .data-toolbar-filter .name-filter form,.overview .data-toolbar-filter .name-filter input{width:100%}
.navbar-toggle:focus{color:#fff;outline:dotted thin!important;outline:-webkit-focus-ring-color auto 5px!important;outline-offset:-2px!important}