updates to credential types forms and lists

This commit is contained in:
John Mitchell 2017-04-28 17:08:59 -04:00
parent 7f48da9114
commit 879f98df2a
5 changed files with 34 additions and 24 deletions

View File

@ -72,7 +72,14 @@ export default ['i18n', function(i18n) {
default: '---',
showParseTypeToggle: true,
parseTypeName: 'parseTypeInputs',
awPopOver: '<p>TODO: input config helper text</p>',
awPopOver: "<p>Enter inputs using either JSON or YAML syntax. Use the " +
"radio button to toggle between the two.</p>" +
"JSON:<br />\n" +
"<blockquote>{<br />&emsp; \"somevar\": \"somevalue\",<br />&emsp;\"password\": \"magic\"<br /> }</blockquote>\n" +
"YAML:<br />\n" +
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
dataTitle: i18n._('Input Configuration'),
dataPlacement: 'right',
dataContainer: "body",
@ -86,7 +93,14 @@ export default ['i18n', function(i18n) {
default: '---',
showParseTypeToggle: true,
parseTypeName: 'parseTypeInjectors',
awPopOver: '<p>TODO: injector config helper text</p>',
awPopOver: "<p>Enter injectors using either JSON or YAML syntax. Use the " +
"radio button to toggle between the two.</p>" +
"JSON:<br />\n" +
"<blockquote>{<br />&emsp; \"somevar\": \"somevalue\",<br />&emsp;\"password\": \"magic\"<br /> }</blockquote>\n" +
"YAML:<br />\n" +
"<blockquote>---<br />somevar: somevalue<br />password: magic<br /></blockquote>\n" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://docs.ansible.com/YAMLSyntax.html" target="_blank">docs.ansible.com</a></p>',
dataTitle: i18n._('Injector Configuration'),
dataPlacement: 'right',
dataContainer: "body",

View File

@ -20,13 +20,9 @@ export default ['i18n', function(i18n){
key: true,
label: i18n._('Name'),
columnClass: 'col-md-3 col-sm-9 col-xs-9',
modalColumnClass: 'col-md-8'
},
// TODO: update to tooltip on name
description: {
label: i18n._('Description'),
excludeModal: true,
columnClass: 'col-md-4 hidden-sm hidden-xs'
modalColumnClass: 'col-md-8',
awToolTip: '{{credential_type.description}}',
dataPlacement: 'top'
},
kind: {
label: i18n._('Type'),

View File

@ -91,24 +91,24 @@ export default ['$rootScope', '$scope', 'Wait', 'CredentialTypesList',
// iterate over the list and add fields like type label, after the
// OPTIONS request returns, or the list is sorted/paginated/searched
function optionsRequestDataProcessing(){
if($scope.list.name === 'credential_types'){
if ($scope[list.name] !== undefined) {
$scope[list.name].forEach(function(item, item_idx) {
var itm = $scope[list.name][item_idx];
// Set the item type label
if (list.fields.kind && $scope.options &&
$scope.options.kind) {
$scope.options.kind.choices.forEach(function(choice) {
$scope.optionsDefer.promise.then(function(options) {
if($scope.list.name === 'credential_types'){
if ($scope[list.name] !== undefined) {
$scope[list.name].forEach(function(item, item_idx) {
var itm = $scope[list.name][item_idx];
// Set the item type label
if (list.fields.kind && options && options.actions && options.actions.GET && options.actions.GET.kind) {
options.actions.GET.kind.choices.forEach(function(choice) {
if (choice[0] === item.kind) {
itm.kind_label = choice[1];
}
});
}
}
});
});
}
}
}
});
}
$scope.$watchCollection(`${$scope.list.name}`, function() {

View File

@ -721,7 +721,7 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
variable = params.variable,
callback = params.callback,
choice_name = params.choice_name,
options = params.options
options = params.options;
if (scope[variable]) {
scope[variable].length = 0;
@ -756,7 +756,7 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
if (callback) {
scope.$emit(callback);
}
}
};
if (!options) {
Rest.setUrl(url);

View File

@ -675,7 +675,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
<label ng-class="${toggleLeftClass}" class="btn btn-xs">
<input type="radio" value="yaml" ng-model="${parseTypeName}" ng-change="parseTypeChange('${parseTypeName}', '${fld}')" />YAML
</label>
<label ng-class="${toggleRightClass}" class="btn btn-xs btn-default">
<label ng-class="${toggleRightClass}" class="btn btn-xs">
<input type="radio" value="json" ng-model="${parseTypeName}" ng-change="parseTypeChange('${parseTypeName}', '${fld}')" />JSON
</label>
</div>