Skip to content

Commit

Permalink
renamed function name 'repositoryRequired' to 'fieldsRequired'
Browse files Browse the repository at this point in the history
Made changes to mark fields on Provisioning tab as required fields, fields on Retirement tab are not required for now.

https://www.pivotaltracker.com/story/show/138302747
  • Loading branch information
h-kataria authored and lgalis committed Feb 10, 2017
1 parent b926bd2 commit 1a2a3cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ ManageIQ.angular.app.controller('catalogItemFormController', ['$scope', 'catalog
$scope.catalogItemModel[prefix + "_dialog_existing"] = selected_value
};

$scope.repositoryRequired = function(prefix) {
$scope.fieldsRequired = function(prefix) {
return prefix == "provisioning";
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%select{"ng-model" => "_#{prefix}_repository",
"name" => "#{prefix}_repository_id",
'ng-options' => 'repository as repository.name for repository in repositories',
"ng-required" => "repositoryRequired('#{prefix}')",
"ng-required" => "fieldsRequired('#{prefix}')",
'ng_change' => "repository_changed()",
'pf-select' => true}
%option{"value" => ""}
Expand Down Expand Up @@ -163,22 +163,20 @@
%select{"ng-model" => "_#{prefix}_dialog",
"name" => "#{prefix}_dialog_id",
'ng-options' => 'dialog as dialog.label for dialog in dialogs',
"ng-required" => "#{ng_model}.#{prefix}_dialog_existing == 'existing'",
:miqrequired => true,
"ng-required" => "fieldsRequired('#{prefix}') && #{ng_model}.#{prefix}_dialog_existing == 'existing'",
:checkchange => true,
'pf-select' => true}
%option{"value" => ""}
= "<#{_('Choose')}>"
%span.help-block{"ng-show" => "angularForm.#{prefix}_dialog_id.$error.miqrequired"}
%span.help-block{"ng-show" => "angularForm.#{prefix}_dialog_id.$error.$invalid"}
= _("Required")

.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_dialog_name.$invalid}", "ng-if" => "#{ng_model}.#{prefix}_dialog_existing == 'create'"}
%input.form-control{:type => "text",
'ng-model' => "#{ng_model}.#{prefix}_dialog_name",
:name => "#{prefix}_dialog_name",
:maxlength => 50,
"ng-required" => "#{ng_model}.#{prefix}_dialog_existing == 'create'",
"miqrequired" => "",
"ng-required" => "fieldsRequired('#{prefix}') && #{ng_model}.#{prefix}_dialog_existing == 'create'",
"checkchange" => ""}
%span.help-block{"ng-show" => "angularForm.#{prefix}_dialog_name.$error.miqrequired"}
%span.help-block{"ng-show" => "angularForm.#{prefix}_dialog_name.$error.$invalid"}
= _("Required")

0 comments on commit 1a2a3cd

Please sign in to comment.