-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1652 from enoodle/container_provider_settings
Add the ability to edit options settings for providers
- Loading branch information
Showing
15 changed files
with
444 additions
and
23 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
app/assets/javascripts/components/provider-option-field-input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
ManageIQ.angular.app.component('providerOptionFieldInput', { | ||
bindings: { | ||
option: '<', | ||
sectionName: '@', | ||
}, | ||
|
||
controller: function() { | ||
var ctrl = this; | ||
|
||
ctrl.$onInit = function() { | ||
ctrl.elemID = "provider_options_" + ctrl.sectionName + "_" + ctrl.option.name; | ||
}; | ||
}, | ||
|
||
templateUrl: '/static/provider_option_field_input.html.haml', | ||
}); |
11 changes: 11 additions & 0 deletions
11
app/assets/javascripts/components/provier-option-section.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ManageIQ.angular.app.component('providerOptionSection', { | ||
bindings: { | ||
settings: '<', | ||
label: '@', | ||
helpText: '@', | ||
sectionName: '@', | ||
}, | ||
|
||
templateUrl: '/static/provider_option_section.html.haml', | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
app/views/layouts/angular-bootstrap/_provider_advanced_settings.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%provider-option-section{"ng-repeat" => "section in emsOptionsModel.provider_options.advanced_settings.settings", | ||
"label" => "{{ section.label }}", | ||
"help_text" => "{{ section.help_text }}", | ||
"section_name" => "{{ section.section_name }}", | ||
"settings" => "section.settings"} |
4 changes: 4 additions & 0 deletions
4
app/views/layouts/angular-bootstrap/_provider_proxy_settings.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
%provider-option-section{"label" => "{{ emsOptionsModel.provider_options.proxy_settings.label }}", | ||
"help_text" => "{{ emsOptionsModel.provider_options.proxy_settings.help_text }}", | ||
"section_name" => "{{ emsOptionsModel.provider_options.proxy_settings.section_name }}", | ||
"settings" => "emsOptionsModel.provider_options.proxy_settings.settings"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
app/views/layouts/angular/_per_provider_settings.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#settings_tabs | ||
%h3 | ||
= _("Settings") | ||
%ul.nav.nav-tabs | ||
= miq_tab_header('proxy_settings', nil, 'ng-click' => "changeAuthTab('proxy_settings')", | ||
'ng-if' => "emsOptionsModel.provider_options.hasOwnProperty('proxy_settings')") do | ||
%i{"error-on-tab" => "proxy_settings", :style => "color:#cc0000"} | ||
= _("Proxy") | ||
= miq_tab_header('advanced_settings', nil, 'ng-click' => "changeAuthTab('advanced_settings')", | ||
'ng-if' => "emsOptionsModel.provider_options.hasOwnProperty('advanced_settings')") do | ||
%i{"error-on-tab" => "advanced_settings", :style => "color:#cc0000"} | ||
= _("Advanced") | ||
|
||
.tab-content | ||
= miq_tab_content('proxy_settings', 'proxy_settings', "ng-if".to_sym => "emsOptionsModel.provider_options.hasOwnProperty('proxy_settings')") do | ||
.form-group | ||
.col-md-12.col-md-12 | ||
= render :partial => "layouts/angular-bootstrap/provider_proxy_settings" | ||
= miq_tab_content('advanced_settings', 'proxy_settings', "ng-if".to_sym => "emsOptionsModel.provider_options.hasOwnProperty('advanced_settings')") do | ||
.form-group | ||
.col-md-12.col-md-12 | ||
= render :partial => "layouts/angular-bootstrap/provider_advanced_settings" | ||
|
||
:javascript | ||
miq_tabs_init('#settings_tabs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
.form-group{"ng-class" => "{{ \"{'has_error': angularForm.\" + $ctrl.elemID + \".$invalid}\" }}"} | ||
%label.col-md-2.control-label{"for" => "{{ $ctrl.elemID }}"} | ||
{{ $ctrl.option.label }} | ||
.col-md-4 | ||
%input.form-control{"type" => "text", | ||
"id" => "{{ $ctrl.elemID }}", | ||
"name" => "{{ $ctrl.elemID }}", | ||
"ng-model" => "$ctrl.option.value", | ||
"ng-trim" => false, | ||
"detect_spaces" => "", | ||
"placeholder" => "{{ $ctrl.option.global_default }}", | ||
"title" => "{{ $ctrl.option.help_text }}", | ||
"prefix" => "{{ 'provider_options_' + $ctrl.sectionName }}"} | ||
%span.help-block{"ng-show" => '{{ "angularForm." + $ctrl.elemID + ".$error.detectedSpaces" }}'} | ||
= _("Spaces are prohibited") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
%provider-option-field-input{"ng-repeat" => "option in $ctrl.settings", | ||
"option" => "option", | ||
"section-name" => "{{ $ctrl.sectionName }}"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.