Skip to content

Commit

Permalink
use credentials partial
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderZagaynov committed Sep 5, 2019
1 parent c212eea commit 56cbc66
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 45 deletions.
24 changes: 0 additions & 24 deletions app/views/layouts/angular-bootstrap/_any_field.html.haml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,30 @@
- vm_scope ||= false
- validate_button ||= true
- main_scope = vm_scope ? "$parent.vm" : "$parent"
- ng_show_service_account ||= false
- service_account_label ||= _("Service account")

%div{"ng-controller" => "CredentialsController as vm", "vm-scope" => "$parent.vm.model ? $parent.vm : $parent"}
%div{"ng-show" => "#{ng_show} && #{ng_show_service_account}"}
.form-group{"ng-class" => "{'has-error': angularForm.service_account.$invalid}"}
%label.col-md-2.control-label{"for" => "#{prefix}_service_account"}
= service_account_label
.col-md-4
- hash_for_service_account = {"type" => "text",
"id" => "#{prefix}_service_account",
"ng-required" => false,
"ng-disabled" => false,
"name" => "service_account",
"ng-model" => "#{main_scope}.#{ng_model}.service_account",
"checkchange" => "",
"ng-trim" => false,
"detect_spaces" => "",
"prefix" => "#{prefix}",
"main-scope" => "#{main_scope}",
"reset-validation-status" => "#{prefix}_auth_status"}
%input.form-control{hash_for_service_account}

%div{"ng-show" => "#{ng_show} && #{ng_show_userid}"}
.form-group{"ng-class" => "{'has-error': angularForm.#{prefix}_userid.$invalid}"}
%label.col-md-2.control-label{"for" => "#{prefix}_userid"}
Expand Down Expand Up @@ -75,6 +97,7 @@
= change_stored_password
%a{:href => "", "ng-show" => "vm.bChangeStoredPassword", "ng-click" => "vm.cancelPasswordChange()"}
= cancel_password_change

%div{"ng-show" => "#{ng_show}", "ng-if" => "#{validate_button}"}
.form-group
%label.col-md-2
Expand Down
38 changes: 17 additions & 21 deletions app/views/layouts/angular/_multi_auth_credentials.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,24 @@
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'ec2'"}
= render :partial => "layouts/angular-bootstrap/endpoints_for_url",
:locals => {:prefix => "default", :ng_model => "#{ng_model}"}
= render :partial => "layouts/angular-bootstrap/any_field",
:locals => {:prefix => "",
:input_name => "service_account",
:input_desc => _("Assume role ARN"),
:input_emsg => _("Invalid ARN"),
:ng_model => "#{ng_model}"}
= render :partial => "layouts/angular-bootstrap/auth_credentials_angular_bootstrap",
:locals => {:ng_show => true,
:ng_model => "#{ng_model}",
:ng_reqd_userid => true,
:ng_reqd_password => true,
:validate_url => validate_url,
:userid_label => _("Access Key ID"),
:password_label => _("Secret Access Key"),
:verify_label => _("Confirm Secret Access Key"),
:passwd_mismatch => _("Secret Access Keys do not match"),
:change_stored_password => _("Change stored secret access key"),
:cancel_password_change => _("Cancel secret access key change"),
:id => record.id,
:prefix => "default",
:verify_title_off => _("Access Key ID and matching Secret Access Key fields are needed to perform verification of credentials"),
:basic_info_needed => true}
:locals => {:ng_show => true,
:ng_model => "#{ng_model}",
:ng_reqd_userid => true,
:ng_reqd_password => true,
:validate_url => validate_url,
:userid_label => _("Access Key ID"),
:password_label => _("Secret Access Key"),
:verify_label => _("Confirm Secret Access Key"),
:passwd_mismatch => _("Secret Access Keys do not match"),
:change_stored_password => _("Change stored secret access key"),
:cancel_password_change => _("Cancel secret access key change"),
:ng_show_service_account => true,
:service_account_label => _("Assume role ARN"),
:id => record.id,
:prefix => "default",
:verify_title_off => _("Access Key ID and matching Secret Access Key fields are needed to perform verification of credentials"),
:basic_info_needed => true}
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'gce'"}
= render :partial => "layouts/angular/auth_service_account_angular",
:locals => {:ng_show => true,
Expand Down

0 comments on commit 56cbc66

Please sign in to comment.