Skip to content

Commit 3107f25

Browse files
Merge pull request #2243 from rhamilto/issue-479
Automatic merge from submit-queue. Adding vendor (publisher) to info screens, adds docUrl and supportUrl to info screens that lacked it Fixes openshift/origin-web-catalog#479 And fixes #2242 Requires openshift/origin-web-catalog#485 <img width="915" alt="screen shot 2017-10-10 at 2 32 50 pm" src="https://user-images.githubusercontent.com/895728/31404030-dde2fe2c-adc8-11e7-9a73-68bd4e1ed138.PNG"> <img width="925" alt="screen shot 2017-10-10 at 2 32 56 pm" src="https://user-images.githubusercontent.com/895728/31404031-ddf83dd2-adc8-11e7-8ec8-13aca55d70f3.PNG"> <img width="909" alt="screen shot 2017-10-10 at 2 33 06 pm" src="https://user-images.githubusercontent.com/895728/31404032-de091102-adc8-11e7-9253-9211cc3064f1.PNG"> <img width="926" alt="screen shot 2017-10-10 at 2 33 12 pm" src="https://user-images.githubusercontent.com/895728/31404035-de237bf0-adc8-11e7-9eb8-060ffc45435f.PNG">
2 parents ce05a60 + bd0f1df commit 3107f25

File tree

9 files changed

+81
-30
lines changed

9 files changed

+81
-30
lines changed

app/scripts/directives/fromFileDialog.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121

2222
function FromFileDialog($scope, $timeout, $routeParams, $filter, DataService) {
2323
var ctrl = this;
24+
var annotation = $filter('annotation');
25+
var imageForIconClass = $filter('imageForIconClass');
2426

2527
ctrl.$onInit = function() {
2628
ctrl.alerts = {};
@@ -36,6 +38,11 @@
3638
return (icon.indexOf('icon-') !== -1) ? 'font-icon ' + icon : icon;
3739
}
3840

41+
function getImage() {
42+
var iconClass = _.get(ctrl, 'template.metadata.annotations.iconClass', 'fa fa-clone');
43+
return imageForIconClass(iconClass);
44+
}
45+
3946
ctrl.importFile = function() {
4047
$scope.$broadcast('importFileFromYAMLOrJSON');
4148
};
@@ -48,6 +55,10 @@
4855
ctrl.selectedProject = message.project;
4956
ctrl.template = message.template;
5057
ctrl.iconClass = getIconClass();
58+
ctrl.image = getImage();
59+
ctrl.vendor = annotation(message.template, "template.openshift.io/provider-display-name");
60+
ctrl.docUrl = annotation(ctrl.template, "template.openshift.io/documentation-url");
61+
ctrl.supportUrl = annotation(ctrl.template, "template.openshift.io/support-url");
5162
ctrl.name = "YAML / JSON";
5263
// Need to let the current digest loop finish so the template config step becomes visible or the wizard will throw an error
5364
// from the change to currentStep

app/scripts/directives/processTemplateDialog.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
ctrl.image = getImage();
131131
ctrl.docUrl = annotation(ctrl.template, "template.openshift.io/documentation-url");
132132
ctrl.supportUrl = annotation(ctrl.template, "template.openshift.io/support-url");
133+
ctrl.vendor = annotation(ctrl.template, "template.openshift.io/provider-display-name");
133134
}
134135
}
135136
if (changes.useProjectTemplate) {
@@ -179,6 +180,9 @@
179180
ctrl.selectStep.valid = !!template;
180181
ctrl.iconClass = getIconClass();
181182
ctrl.image = getImage();
183+
ctrl.docUrl = annotation(ctrl.template, "template.openshift.io/documentation-url");
184+
ctrl.supportUrl = annotation(ctrl.template, "template.openshift.io/support-url");
185+
ctrl.vendor = annotation(ctrl.template, "template.openshift.io/provider-display-name");
182186
};
183187

184188
ctrl.templateProjectChange = function () {

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,31 @@
3838
next-enabled="!$ctrl.templateForm.$invalid">
3939
<div class="wizard-pf-main-inner-shadow-covers" ng-if="$ctrl.template">
4040
<div class="order-service-details">
41-
<div class="order-service-details-top">
41+
<div class="order-service-details-top" ng-class="{'order-service-details-top-icon-top': ($ctrl.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}">
4242
<div class="service-icon">
43-
<span class="icon {{$ctrl.iconClass}}"></span>
43+
<span ng-if="$ctrl.image" class="image"><img ng-src="{{$ctrl.image}}" alt=""></span>
44+
<span ng-if="!$ctrl.image" class="icon {{$ctrl.iconClass}}" aria-hidden="true"></span>
4445
</div>
4546
<div class="service-title-area">
4647
<div class="service-title">
4748
{{$ctrl.template | displayName}}
4849
</div>
50+
<div ng-if="$ctrl.vendor" class="service-vendor">
51+
{{$ctrl.vendor}}
52+
</div>
4953
<div class="order-service-tags">
5054
<span ng-repeat="tag in $ctrl.template.metadata.annotations.tags.split(',')" class="tag">
5155
{{tag}}
5256
</span>
5357
</div>
58+
<ul ng-if="$ctrl.docUrl || $ctrl.supportUrl" class="list-inline order-service-documentation-url">
59+
<li ng-if="$ctrl.docUrl" >
60+
<a ng-href="{{$ctrl.docUrl}}" target="_blank" class="learn-more-link">View Documentation <i class="fa fa-external-link" aria-hidden="true"></i></a>
61+
</li>
62+
<li ng-if="$ctrl.supportUrl" >
63+
<a ng-href="{{$ctrl.supportUrl}}" target="_blank" class="learn-more-link">Get Support <i class="fa fa-external-link" aria-hidden="true"></i></a>
64+
</li>
65+
</ul>
5466
</div>
5567
</div>
5668
<div class="order-service-description-block">

app/views/directives/process-template-dialog/process-template-info.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="order-service-details">
2-
<div class="order-service-details-top">
2+
<div class="order-service-details-top" ng-class="{'order-service-details-top-icon-top': ($ctrl.serviceClass.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}">
33
<div class="service-icon">
44
<span ng-if="$ctrl.image" class="image"><img ng-src="{{$ctrl.image}}" alt=""></span>
55
<span ng-if="!$ctrl.image" class="icon {{$ctrl.iconClass}}" aria-hidden="true"></span>
@@ -8,6 +8,9 @@
88
<div class="service-title">
99
{{$ctrl.template | displayName}}
1010
</div>
11+
<div ng-if="$ctrl.vendor" class="service-vendor">
12+
{{$ctrl.vendor}}
13+
</div>
1114
<div class="order-service-tags">
1215
<span ng-repeat="tag in $ctrl.template.metadata.annotations.tags.split(',')" class="tag">
1316
{{tag}}

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"angular-utf8-base64": "0.0.5",
4848
"file-saver": "1.3.3",
4949
"origin-web-common": "0.0.66",
50-
"origin-web-catalog": "0.0.54"
50+
"origin-web-catalog": "0.0.55"
5151
},
5252
"devDependencies": {
5353
"angular-mocks": "1.5.11",

dist/scripts/scripts.js

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13174,7 +13174,7 @@ appliedFilters: [],
1317413174
onFilterChange: g
1317513175
}, n.project || (b.showProjectName = !0);
1317613176
}, b.$onChanges = function(e) {
13177-
e.template && b.template && (d(), b.iconClass = l(), b.image = u(), b.docUrl = S(b.template, "template.openshift.io/documentation-url"), b.supportUrl = S(b.template, "template.openshift.io/support-url")), e.useProjectTemplate && d();
13177+
e.template && b.template && (d(), b.iconClass = l(), b.image = u(), b.docUrl = S(b.template, "template.openshift.io/documentation-url"), b.supportUrl = S(b.template, "template.openshift.io/support-url"), b.vendor = S(b.template, "template.openshift.io/provider-display-name")), e.useProjectTemplate && d();
1317813178
}, e.$on("templateInstantiated", function(e, t) {
1317913179
b.selectedProject = t.project, b.currentStep = b.resultsStep.label;
1318013180
}), b.$onDestroy = function() {
@@ -13187,7 +13187,7 @@ _.isFunction(e) && e();
1318713187
}, b.onProjectSelected = function(t) {
1318813188
b.selectedProject = t, b.configStep.valid = e.$ctrl.form.$valid && b.selectedProject;
1318913189
}, b.templateSelected = function(e) {
13190-
b.selectedTemplate = e, b.template = _.get(e, "resource"), b.selectStep.valid = !!e, b.iconClass = l(), b.image = u();
13190+
b.selectedTemplate = e, b.template = _.get(e, "resource"), b.selectStep.valid = !!e, b.iconClass = l(), b.image = u(), b.docUrl = S(b.template, "template.openshift.io/documentation-url"), b.supportUrl = S(b.template, "template.openshift.io/support-url"), b.vendor = S(b.template, "template.openshift.io/provider-display-name");
1319113191
}, b.templateProjectChange = function() {
1319213192
b.templateProjectName = _.get(b.templateProject, "metadata.name"), b.catalogItems = {}, b.templateSelected(), a.getProjectCatalogItems(b.templateProjectName, !1, !0).then(_.spread(function(e, t) {
1319313193
b.catalogItems = e, b.totalCount = b.catalogItems.length, g(), t && i.addNotification({
@@ -13241,30 +13241,34 @@ templateUrl: "views/directives/deploy-image-dialog.html"
1324113241
angular.module("openshiftConsole").component("fromFileDialog", {
1324213242
controller: [ "$scope", "$timeout", "$routeParams", "$filter", "DataService", function(e, t, n, a, r) {
1324313243
function o() {
13244-
var e = _.get(i, "template.metadata.annotations.iconClass", "fa fa-clone");
13244+
var e = _.get(s, "template.metadata.annotations.iconClass", "fa fa-clone");
1324513245
return -1 !== e.indexOf("icon-") ? "font-icon " + e : e;
1324613246
}
13247-
var i = this;
13248-
i.$onInit = function() {
13249-
i.alerts = {}, i.loginBaseUrl = r.openshiftAPIBaseUrl(), n.project || (i.showProjectName = !0);
13250-
}, i.importFile = function() {
13247+
function i() {
13248+
var e = _.get(s, "template.metadata.annotations.iconClass", "fa fa-clone");
13249+
return l(e);
13250+
}
13251+
var s = this, c = a("annotation"), l = a("imageForIconClass");
13252+
s.$onInit = function() {
13253+
s.alerts = {}, s.loginBaseUrl = r.openshiftAPIBaseUrl(), n.project || (s.showProjectName = !0);
13254+
}, s.importFile = function() {
1325113255
e.$broadcast("importFileFromYAMLOrJSON");
13252-
}, i.instantiateTemplate = function() {
13256+
}, s.instantiateTemplate = function() {
1325313257
e.$broadcast("instantiateTemplate");
1325413258
}, e.$on("fileImportedFromYAMLOrJSON", function(e, n) {
13255-
i.selectedProject = n.project, i.template = n.template, i.iconClass = o(), i.name = "YAML / JSON", t(function() {
13256-
i.currentStep = i.template ? "Template Configuration" : "Results";
13259+
s.selectedProject = n.project, s.template = n.template, s.iconClass = o(), s.image = i(), s.vendor = c(n.template, "template.openshift.io/provider-display-name"), s.docUrl = c(s.template, "template.openshift.io/documentation-url"), s.supportUrl = c(s.template, "template.openshift.io/support-url"), s.name = "YAML / JSON", t(function() {
13260+
s.currentStep = s.template ? "Template Configuration" : "Results";
1325713261
}, 0);
1325813262
}), e.$on("templateInstantiated", function(e, t) {
13259-
i.selectedProject = t.project, i.name = a("displayName")(i.template), i.currentStep = "Results";
13260-
}), i.close = function() {
13261-
i.template = null;
13262-
var e = i.onDialogClosed();
13263-
return _.isFunction(e) && e(), i.wizardDone = !1, !0;
13264-
}, i.stepChanged = function(e) {
13265-
"results" === e.stepId ? (i.nextButtonTitle = "Close", i.wizardDone = !0) : i.nextButtonTitle = "Create";
13266-
}, i.currentStep = "YAML / JSON", i.nextCallback = function(e) {
13267-
return "file" === e.stepId ? (i.importFile(), !1) : "template" === e.stepId ? (i.instantiateTemplate(), !1) : "results" !== e.stepId || (i.close(), !1);
13263+
s.selectedProject = t.project, s.name = a("displayName")(s.template), s.currentStep = "Results";
13264+
}), s.close = function() {
13265+
s.template = null;
13266+
var e = s.onDialogClosed();
13267+
return _.isFunction(e) && e(), s.wizardDone = !1, !0;
13268+
}, s.stepChanged = function(e) {
13269+
"results" === e.stepId ? (s.nextButtonTitle = "Close", s.wizardDone = !0) : s.nextButtonTitle = "Create";
13270+
}, s.currentStep = "YAML / JSON", s.nextCallback = function(e) {
13271+
return "file" === e.stepId ? (s.importFile(), !1) : "template" === e.stepId ? (s.instantiateTemplate(), !1) : "results" !== e.stepId || (s.close(), !1);
1326813272
};
1326913273
} ],
1327013274
controllerAs: "$ctrl",

dist/scripts/templates.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7029,19 +7029,31 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
70297029
"<pf-wizard-step wz-disabled=\"{{!$ctrl.template}}\" step-title=\"Template Configuration\" step-id=\"template\" step-priority=\"2\" substeps=\"false\" ok-to-nav-away=\"true\" allow-click-nav=\"false\" next-enabled=\"!$ctrl.templateForm.$invalid\">\n" +
70307030
"<div class=\"wizard-pf-main-inner-shadow-covers\" ng-if=\"$ctrl.template\">\n" +
70317031
"<div class=\"order-service-details\">\n" +
7032-
"<div class=\"order-service-details-top\">\n" +
7032+
"<div class=\"order-service-details-top\" ng-class=\"{'order-service-details-top-icon-top': ($ctrl.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}\">\n" +
70337033
"<div class=\"service-icon\">\n" +
7034-
"<span class=\"icon {{$ctrl.iconClass}}\"></span>\n" +
7034+
"<span ng-if=\"$ctrl.image\" class=\"image\"><img ng-src=\"{{$ctrl.image}}\" alt=\"\"></span>\n" +
7035+
"<span ng-if=\"!$ctrl.image\" class=\"icon {{$ctrl.iconClass}}\" aria-hidden=\"true\"></span>\n" +
70357036
"</div>\n" +
70367037
"<div class=\"service-title-area\">\n" +
70377038
"<div class=\"service-title\">\n" +
70387039
"{{$ctrl.template | displayName}}\n" +
70397040
"</div>\n" +
7041+
"<div ng-if=\"$ctrl.vendor\" class=\"service-vendor\">\n" +
7042+
"{{$ctrl.vendor}}\n" +
7043+
"</div>\n" +
70407044
"<div class=\"order-service-tags\">\n" +
70417045
"<span ng-repeat=\"tag in $ctrl.template.metadata.annotations.tags.split(',')\" class=\"tag\">\n" +
70427046
"{{tag}}\n" +
70437047
"</span>\n" +
70447048
"</div>\n" +
7049+
"<ul ng-if=\"$ctrl.docUrl || $ctrl.supportUrl\" class=\"list-inline order-service-documentation-url\">\n" +
7050+
"<li ng-if=\"$ctrl.docUrl\">\n" +
7051+
"<a ng-href=\"{{$ctrl.docUrl}}\" target=\"_blank\" class=\"learn-more-link\">View Documentation <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>\n" +
7052+
"</li>\n" +
7053+
"<li ng-if=\"$ctrl.supportUrl\">\n" +
7054+
"<a ng-href=\"{{$ctrl.supportUrl}}\" target=\"_blank\" class=\"learn-more-link\">Get Support <i class=\"fa fa-external-link\" aria-hidden=\"true\"></i></a>\n" +
7055+
"</li>\n" +
7056+
"</ul>\n" +
70457057
"</div>\n" +
70467058
"</div>\n" +
70477059
"<div class=\"order-service-description-block\">\n" +
@@ -8857,7 +8869,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
88578869

88588870
$templateCache.put('views/directives/process-template-dialog/process-template-info.html',
88598871
"<div class=\"order-service-details\">\n" +
8860-
"<div class=\"order-service-details-top\">\n" +
8872+
"<div class=\"order-service-details-top\" ng-class=\"{'order-service-details-top-icon-top': ($ctrl.serviceClass.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}\">\n" +
88618873
"<div class=\"service-icon\">\n" +
88628874
"<span ng-if=\"$ctrl.image\" class=\"image\"><img ng-src=\"{{$ctrl.image}}\" alt=\"\"></span>\n" +
88638875
"<span ng-if=\"!$ctrl.image\" class=\"icon {{$ctrl.iconClass}}\" aria-hidden=\"true\"></span>\n" +
@@ -8866,6 +8878,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
88668878
"<div class=\"service-title\">\n" +
88678879
"{{$ctrl.template | displayName}}\n" +
88688880
"</div>\n" +
8881+
"<div ng-if=\"$ctrl.vendor\" class=\"service-vendor\">\n" +
8882+
"{{$ctrl.vendor}}\n" +
8883+
"</div>\n" +
88698884
"<div class=\"order-service-tags\">\n" +
88708885
"<span ng-repeat=\"tag in $ctrl.template.metadata.annotations.tags.split(',')\" class=\"tag\">\n" +
88718886
"{{tag}}\n" +

0 commit comments

Comments
 (0)