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

Adding vendor (publisher) to info screens, adds docUrl and supportUrl to info screens that lacked it #2243

Merged
merged 1 commit into from
Oct 13, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions app/scripts/directives/fromFileDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@

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

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

function getImage() {
var iconClass = _.get(ctrl, 'template.metadata.annotations.iconClass', 'fa fa-clone');
return imageForIconClass(iconClass);
}

ctrl.importFile = function() {
$scope.$broadcast('importFileFromYAMLOrJSON');
};
Expand All @@ -48,6 +55,10 @@
ctrl.selectedProject = message.project;
ctrl.template = message.template;
ctrl.iconClass = getIconClass();
ctrl.image = getImage();
ctrl.vendor = annotation(message.template, "template.openshift.io/provider-display-name");
ctrl.docUrl = annotation(ctrl.template, "template.openshift.io/documentation-url");
ctrl.supportUrl = annotation(ctrl.template, "template.openshift.io/support-url");
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
Expand Down
4 changes: 4 additions & 0 deletions app/scripts/directives/processTemplateDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
ctrl.image = getImage();
ctrl.docUrl = annotation(ctrl.template, "template.openshift.io/documentation-url");
ctrl.supportUrl = annotation(ctrl.template, "template.openshift.io/support-url");
ctrl.vendor = annotation(ctrl.template, "template.openshift.io/provider-display-name");
}
}
if (changes.useProjectTemplate) {
Expand Down Expand Up @@ -179,6 +180,9 @@
ctrl.selectStep.valid = !!template;
ctrl.iconClass = getIconClass();
ctrl.image = getImage();
ctrl.docUrl = annotation(ctrl.template, "template.openshift.io/documentation-url");
ctrl.supportUrl = annotation(ctrl.template, "template.openshift.io/support-url");
ctrl.vendor = annotation(ctrl.template, "template.openshift.io/provider-display-name");
};

ctrl.templateProjectChange = function () {
Expand Down
16 changes: 14 additions & 2 deletions app/views/directives/from-file-dialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,31 @@
next-enabled="!$ctrl.templateForm.$invalid">
<div class="wizard-pf-main-inner-shadow-covers" ng-if="$ctrl.template">
<div class="order-service-details">
<div class="order-service-details-top">
<div class="order-service-details-top" ng-class="{'order-service-details-top-icon-top': ($ctrl.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}">
<div class="service-icon">
<span class="icon {{$ctrl.iconClass}}"></span>
<span ng-if="$ctrl.image" class="image"><img ng-src="{{$ctrl.image}}" alt=""></span>
<span ng-if="!$ctrl.image" class="icon {{$ctrl.iconClass}}" aria-hidden="true"></span>
</div>
<div class="service-title-area">
<div class="service-title">
{{$ctrl.template | displayName}}
</div>
<div ng-if="$ctrl.vendor" class="service-vendor">
{{$ctrl.vendor}}
</div>
<div class="order-service-tags">
<span ng-repeat="tag in $ctrl.template.metadata.annotations.tags.split(',')" class="tag">
{{tag}}
</span>
</div>
<ul ng-if="$ctrl.docUrl || $ctrl.supportUrl" class="list-inline order-service-documentation-url">
<li ng-if="$ctrl.docUrl" >
<a ng-href="{{$ctrl.docUrl}}" target="_blank" class="learn-more-link">View Documentation <i class="fa fa-external-link" aria-hidden="true"></i></a>
</li>
<li ng-if="$ctrl.supportUrl" >
<a ng-href="{{$ctrl.supportUrl}}" target="_blank" class="learn-more-link">Get Support <i class="fa fa-external-link" aria-hidden="true"></i></a>
</li>
</ul>
</div>
</div>
<div class="order-service-description-block">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="order-service-details">
<div class="order-service-details-top">
<div class="order-service-details-top" ng-class="{'order-service-details-top-icon-top': ($ctrl.serviceClass.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}">
<div class="service-icon">
<span ng-if="$ctrl.image" class="image"><img ng-src="{{$ctrl.image}}" alt=""></span>
<span ng-if="!$ctrl.image" class="icon {{$ctrl.iconClass}}" aria-hidden="true"></span>
Expand All @@ -8,6 +8,9 @@
<div class="service-title">
{{$ctrl.template | displayName}}
</div>
<div ng-if="$ctrl.vendor" class="service-vendor">
{{$ctrl.vendor}}
</div>
<div class="order-service-tags">
<span ng-repeat="tag in $ctrl.template.metadata.annotations.tags.split(',')" class="tag">
{{tag}}
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"angular-utf8-base64": "0.0.5",
"file-saver": "1.3.3",
"origin-web-common": "0.0.66",
"origin-web-catalog": "0.0.54"
"origin-web-catalog": "0.0.55"
},
"devDependencies": {
"angular-mocks": "1.5.11",
Expand Down
42 changes: 23 additions & 19 deletions dist/scripts/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -13158,7 +13158,7 @@ appliedFilters: [],
onFilterChange: g
}, n.project || (b.showProjectName = !0);
}, b.$onChanges = function(e) {
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();
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();
}, e.$on("templateInstantiated", function(e, t) {
b.selectedProject = t.project, b.currentStep = b.resultsStep.label;
}), b.$onDestroy = function() {
Expand All @@ -13171,7 +13171,7 @@ _.isFunction(e) && e();
}, b.onProjectSelected = function(t) {
b.selectedProject = t, b.configStep.valid = e.$ctrl.form.$valid && b.selectedProject;
}, b.templateSelected = function(e) {
b.selectedTemplate = e, b.template = _.get(e, "resource"), b.selectStep.valid = !!e, b.iconClass = l(), b.image = u();
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");
}, b.templateProjectChange = function() {
b.templateProjectName = _.get(b.templateProject, "metadata.name"), b.catalogItems = {}, b.templateSelected(), a.getProjectCatalogItems(b.templateProjectName, !1, !0).then(_.spread(function(e, t) {
b.catalogItems = e, b.totalCount = b.catalogItems.length, g(), t && i.addNotification({
Expand Down Expand Up @@ -13225,30 +13225,34 @@ templateUrl: "views/directives/deploy-image-dialog.html"
angular.module("openshiftConsole").component("fromFileDialog", {
controller: [ "$scope", "$timeout", "$routeParams", "$filter", "DataService", function(e, t, n, a, r) {
function o() {
var e = _.get(i, "template.metadata.annotations.iconClass", "fa fa-clone");
var e = _.get(s, "template.metadata.annotations.iconClass", "fa fa-clone");
return -1 !== e.indexOf("icon-") ? "font-icon " + e : e;
}
var i = this;
i.$onInit = function() {
i.alerts = {}, i.loginBaseUrl = r.openshiftAPIBaseUrl(), n.project || (i.showProjectName = !0);
}, i.importFile = function() {
function i() {
var e = _.get(s, "template.metadata.annotations.iconClass", "fa fa-clone");
return l(e);
}
var s = this, c = a("annotation"), l = a("imageForIconClass");
s.$onInit = function() {
s.alerts = {}, s.loginBaseUrl = r.openshiftAPIBaseUrl(), n.project || (s.showProjectName = !0);
}, s.importFile = function() {
e.$broadcast("importFileFromYAMLOrJSON");
}, i.instantiateTemplate = function() {
}, s.instantiateTemplate = function() {
e.$broadcast("instantiateTemplate");
}, e.$on("fileImportedFromYAMLOrJSON", function(e, n) {
i.selectedProject = n.project, i.template = n.template, i.iconClass = o(), i.name = "YAML / JSON", t(function() {
i.currentStep = i.template ? "Template Configuration" : "Results";
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() {
s.currentStep = s.template ? "Template Configuration" : "Results";
}, 0);
}), e.$on("templateInstantiated", function(e, t) {
i.selectedProject = t.project, i.name = a("displayName")(i.template), i.currentStep = "Results";
}), i.close = function() {
i.template = null;
var e = i.onDialogClosed();
return _.isFunction(e) && e(), i.wizardDone = !1, !0;
}, i.stepChanged = function(e) {
"results" === e.stepId ? (i.nextButtonTitle = "Close", i.wizardDone = !0) : i.nextButtonTitle = "Create";
}, i.currentStep = "YAML / JSON", i.nextCallback = function(e) {
return "file" === e.stepId ? (i.importFile(), !1) : "template" === e.stepId ? (i.instantiateTemplate(), !1) : "results" !== e.stepId || (i.close(), !1);
s.selectedProject = t.project, s.name = a("displayName")(s.template), s.currentStep = "Results";
}), s.close = function() {
s.template = null;
var e = s.onDialogClosed();
return _.isFunction(e) && e(), s.wizardDone = !1, !0;
}, s.stepChanged = function(e) {
"results" === e.stepId ? (s.nextButtonTitle = "Close", s.wizardDone = !0) : s.nextButtonTitle = "Create";
}, s.currentStep = "YAML / JSON", s.nextCallback = function(e) {
return "file" === e.stepId ? (s.importFile(), !1) : "template" === e.stepId ? (s.instantiateTemplate(), !1) : "results" !== e.stepId || (s.close(), !1);
};
} ],
controllerAs: "$ctrl",
Expand Down
21 changes: 18 additions & 3 deletions dist/scripts/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -7018,19 +7018,31 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<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" +
"<div class=\"wizard-pf-main-inner-shadow-covers\" ng-if=\"$ctrl.template\">\n" +
"<div class=\"order-service-details\">\n" +
"<div class=\"order-service-details-top\">\n" +
"<div class=\"order-service-details-top\" ng-class=\"{'order-service-details-top-icon-top': ($ctrl.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}\">\n" +
"<div class=\"service-icon\">\n" +
"<span class=\"icon {{$ctrl.iconClass}}\"></span>\n" +
"<span ng-if=\"$ctrl.image\" class=\"image\"><img ng-src=\"{{$ctrl.image}}\" alt=\"\"></span>\n" +
"<span ng-if=\"!$ctrl.image\" class=\"icon {{$ctrl.iconClass}}\" aria-hidden=\"true\"></span>\n" +
"</div>\n" +
"<div class=\"service-title-area\">\n" +
"<div class=\"service-title\">\n" +
"{{$ctrl.template | displayName}}\n" +
"</div>\n" +
"<div ng-if=\"$ctrl.vendor\" class=\"service-vendor\">\n" +
"{{$ctrl.vendor}}\n" +
"</div>\n" +
"<div class=\"order-service-tags\">\n" +
"<span ng-repeat=\"tag in $ctrl.template.metadata.annotations.tags.split(',')\" class=\"tag\">\n" +
"{{tag}}\n" +
"</span>\n" +
"</div>\n" +
"<ul ng-if=\"$ctrl.docUrl || $ctrl.supportUrl\" class=\"list-inline order-service-documentation-url\">\n" +
"<li ng-if=\"$ctrl.docUrl\">\n" +
"<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" +
"</li>\n" +
"<li ng-if=\"$ctrl.supportUrl\">\n" +
"<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" +
"</li>\n" +
"</ul>\n" +
"</div>\n" +
"</div>\n" +
"<div class=\"order-service-description-block\">\n" +
Expand Down Expand Up @@ -8846,7 +8858,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(

$templateCache.put('views/directives/process-template-dialog/process-template-info.html',
"<div class=\"order-service-details\">\n" +
"<div class=\"order-service-details-top\">\n" +
"<div class=\"order-service-details-top\" ng-class=\"{'order-service-details-top-icon-top': ($ctrl.serviceClass.vendor || ($ctrl.docUrl || $ctrl.supportUrl))}\">\n" +
"<div class=\"service-icon\">\n" +
"<span ng-if=\"$ctrl.image\" class=\"image\"><img ng-src=\"{{$ctrl.image}}\" alt=\"\"></span>\n" +
"<span ng-if=\"!$ctrl.image\" class=\"icon {{$ctrl.iconClass}}\" aria-hidden=\"true\"></span>\n" +
Expand All @@ -8855,6 +8867,9 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"<div class=\"service-title\">\n" +
"{{$ctrl.template | displayName}}\n" +
"</div>\n" +
"<div ng-if=\"$ctrl.vendor\" class=\"service-vendor\">\n" +
"{{$ctrl.vendor}}\n" +
"</div>\n" +
"<div class=\"order-service-tags\">\n" +
"<span ng-repeat=\"tag in $ctrl.template.metadata.annotations.tags.split(',')\" class=\"tag\">\n" +
"{{tag}}\n" +
Expand Down
Loading