Skip to content

Commit

Permalink
Use v_workflow_class attribute to adjust labels in the catalog tab
Browse files Browse the repository at this point in the history
  • Loading branch information
AparnaKarve committed Jan 16, 2017
1 parent 2424cbd commit e0492a6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.component('requestWorkflow', {
bindings: {
workflow: '=?',
workflowClass: '=?',
},
controller: requestWorkflowController,
controllerAs: 'vm',
Expand Down Expand Up @@ -71,8 +72,9 @@
vm.customizedWorkflow.dialogs[key].panelTitle[0] = (__("Select Tags to apply"));
break;
case 'service':
// revisit this after https://github.com/ManageIQ/manageiq/pull/13441 is merged
if (lodash.includes(vm.customizedWorkflow.values.miq_request_dialog_name, "redhat")) {
if(lodash.every(["Redhat", "InfraManager"], function(value, key) {
return lodash.includes(vm.workflowClass, value);
})) {
vm.customizedWorkflow.dialogs[key].panelTitle[0] = (__("Selected VM"));
} else {
vm.customizedWorkflow.dialogs[key].panelTitle[0] = (__("Select"));
Expand All @@ -82,7 +84,11 @@
} else if (lodash.includes(vm.customizedWorkflow.values.provision_type, "iso")) {
vm.customizedWorkflow.dialogs[key].panelTitle[1] = (__("ISO"));
}
vm.customizedWorkflow.dialogs[key].panelTitle[1] = (__("Number of VMs"));
if (lodash.includes(vm.workflowClass, "CloudManager")) {
vm.customizedWorkflow.dialogs[key].panelTitle[1] = (__("Number of Instances"));
} else {
vm.customizedWorkflow.dialogs[key].panelTitle[1] = (__("Number of VMs"));
}
vm.customizedWorkflow.dialogs[key].panelTitle[2] = (__("Naming"));
fields = serviceFields();
break;
Expand Down Expand Up @@ -136,8 +142,9 @@

function serviceFields() {
var serviceFields = {};
// revisit this after https://github.com/ManageIQ/manageiq/pull/13441 is merged
if (lodash.includes(vm.customizedWorkflow.values.miq_request_dialog_name, "redhat")) {
if(lodash.every(["Redhat", "InfraManager"], function(value, key) {
return lodash.includes(vm.workflowClass, value);
})) {
serviceFields = {
srcVmId: {label: 'src_vm_id', panel: 0, order: 0},
provisionType: {label: 'provision_type', panel: 0, order: 1},
Expand Down
2 changes: 1 addition & 1 deletion client/app/states/requests/details/details.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h4>{{ ::vm.request.options.long_description || vm.request.description }}</h4>
<div class="panel-body">
<section class="ss-details-section">
<dialog-content ng-if="!vm.request.workflow" dialog="vm.request.provision_dialog" input-disabled="vm.editingDisabled" options="vm.request.options.dialog"></dialog-content>
<request-workflow workflow="vm.request.workflow"></request-workflow>
<request-workflow workflow="vm.request.workflow" workflow_class="vm.request.v_workflow_class.instance_logger.klass"></request-workflow>
</section>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/app/states/requests/details/details.state.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

/** @ngInject */
function resolveRequest($stateParams, CollectionsApi) {
var options = {attributes: ['provision_dialog', 'picture', 'picture.image_href', 'workflow']};
var options = {attributes: ['provision_dialog', 'picture', 'picture.image_href', 'workflow', 'v_workflow_class']};

return CollectionsApi.get('requests', $stateParams.requestId, options);
}
Expand Down

0 comments on commit e0492a6

Please sign in to comment.