Merge pull request #7143 from jlmitch5/forksPlaceholder

Forks placeholder
This commit is contained in:
jlmitch5
2017-07-19 15:43:24 -04:00
committed by GitHub
8 changed files with 59 additions and 22 deletions

View File

@@ -216,6 +216,17 @@
} }
} }
.Form-checkbox--subCheckbox {
font-size: 10px;
color: @default-stdout-txt;
text-transform: uppercase;
margin-top: 2px;
input {
margin-top: 2px;
}
}
.Form-textUneditable { .Form-textUneditable {
.Form-textInput { .Form-textInput {
border: none; border: none;
@@ -733,3 +744,16 @@ input[type='radio']:checked:before {
overflow-wrap: break-word; overflow-wrap: break-word;
white-space: normal; white-space: normal;
} }
::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: @b7grey;
}
::-moz-placeholder { /* Firefox 19+ */
color: @b7grey;
}
:-ms-input-placeholder { /* IE 10+ */
color: @b7grey;
}
:-moz-placeholder { /* Firefox 18- */
color: @b7grey;
}

View File

@@ -42,8 +42,10 @@ function adhocController($q, $scope, $stateParams,
$scope.verbosity = verbosity_options[verbosity]; $scope.verbosity = verbosity_options[verbosity];
} }
} }
$("#forks-number").spinner("value", forks_default); if (forks_default !== 0) {
$scope.forks = forks_default; $("#forks-number").spinner("value", forks_default);
$scope.forks = forks_default;
}
}; };
// set when "working" starts and stops // set when "working" starts and stops

View File

@@ -97,15 +97,15 @@ export default ['i18n', function(i18n) {
id: 'forks-number', id: 'forks-number',
type: 'number', type: 'number',
integer: true, integer: true,
min: 0, min: 1,
spinner: true, spinner: true,
"default": 0,
required: true,
'class': "input-small", 'class': "input-small",
column: 1, column: 1,
awPopOver: '<p>The number of parallel or simultaneous processes to use while executing the command. 0 signifies ' + awPopOver: '<p>' + i18n.sprintf(i18n._('The number of parallel or simultaneous processes to use while executing the playbook. Inputting no value will use ' +
'the default value from the <a id="ansible_forks_docs" href=\"http://docs.ansible.com/intro_configuration.html#the-ansible-configuration-file\" ' + 'the default value from the %sansible configuration file%s.'), '' +
' target=\"_blank\">ansible configuration file</a>.</p>', '<a id="ansible_forks_docs" href=\"http://docs.ansible.com/intro_configuration.html#the-ansible-configuration-file\" ' +
' target=\"_blank\">', '</a>') +'</p>',
placeholder: 'DEFAULT',
dataTitle: i18n._('Forks'), dataTitle: i18n._('Forks'),
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: "body" dataContainer: "body"

View File

@@ -776,7 +776,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
ngModel: field.subCheckbox.variable, ngModel: field.subCheckbox.variable,
ngShow: field.subCheckbox.ngShow, ngShow: field.subCheckbox.ngShow,
ngChange: field.subCheckbox.ngChange, ngChange: field.subCheckbox.ngChange,
ngDisabled: field.ngDisabled || field.subCheckbox.ngDisabled, ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled,
text: field.subCheckbox.text || '' text: field.subCheckbox.text || ''
}; };
} }
@@ -800,7 +800,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
ngShow: field.subCheckbox.ngShow, ngShow: field.subCheckbox.ngShow,
ngChange: field.subCheckbox.ngChange, ngChange: field.subCheckbox.ngChange,
ngModel: field.subCheckbox.variable, ngModel: field.subCheckbox.variable,
ngDisabled: field.ngDisabled, ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled,
text: field.subCheckbox.text || '' text: field.subCheckbox.text || ''
}; };
} }
@@ -1019,7 +1019,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
ngModel: field.subCheckbox.variable, ngModel: field.subCheckbox.variable,
ngShow: field.subCheckbox.ngShow, ngShow: field.subCheckbox.ngShow,
ngChange: field.subCheckbox.ngChange, ngChange: field.subCheckbox.ngChange,
ngDisabled: field.ngDisabled || field.subCheckbox.ngDisabled, ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled,
text: field.subCheckbox.text || '' text: field.subCheckbox.text || ''
}; };
} }
@@ -1074,7 +1074,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
ngShow: field.subCheckbox.ngShow, ngShow: field.subCheckbox.ngShow,
ngModel: field.subCheckbox.variable, ngModel: field.subCheckbox.variable,
ngChange: field.subCheckbox.ngChange, ngChange: field.subCheckbox.ngChange,
ngDisabled: field.subCheckbox.ngDisabled, ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled,
text: field.subCheckbox.text text: field.subCheckbox.text
}; };
} }
@@ -1147,7 +1147,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
ngShow: field.subCheckbox.ngShow, ngShow: field.subCheckbox.ngShow,
ngChange: field.subCheckbox.ngChange, ngChange: field.subCheckbox.ngChange,
ngModel: field.subCheckbox.variable, ngModel: field.subCheckbox.variable,
ngDisabled: field.ngDisabled, ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled,
text: field.subCheckbox.text || '' text: field.subCheckbox.text || ''
}; };
} }
@@ -1171,6 +1171,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
html += "ng-model=\"" + fld + '" '; html += "ng-model=\"" + fld + '" ';
html += 'name="' + fld + '" '; html += 'name="' + fld + '" ';
html += buildId(field, fld, this.form); html += buildId(field, fld, this.form);
html += (field.placeholder) ? this.attr(field, 'placeholder') : "";
html += (field.min || field.min === 0) ? this.attr(field, 'min') : ""; html += (field.min || field.min === 0) ? this.attr(field, 'min') : "";
html += (field.max) ? this.attr(field, 'max') : ""; html += (field.max) ? this.attr(field, 'max') : "";
html += (field.ngChange) ? this.attr(field, 'ngChange') : ""; html += (field.ngChange) ? this.attr(field, 'ngChange') : "";
@@ -1365,7 +1366,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
ngShow: field.subCheckbox.ngShow, ngShow: field.subCheckbox.ngShow,
ngChange: field.subCheckbox.ngChange, ngChange: field.subCheckbox.ngChange,
ngModel: field.subCheckbox.variable, ngModel: field.subCheckbox.variable,
ngDisabled: field.ngDisabled, ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled,
text: field.subCheckbox.text || '' text: field.subCheckbox.text || ''
}; };
} }
@@ -1448,7 +1449,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
ngShow: field.subCheckbox.ngShow, ngShow: field.subCheckbox.ngShow,
ngChange: field.subCheckbox.ngChange, ngChange: field.subCheckbox.ngChange,
ngModel: field.subCheckbox.variable, ngModel: field.subCheckbox.variable,
ngDisabled: field.ngDisabled, ngDisabled: field.subCheckbox.ngDisabled || field.ngDisabled,
text: field.subCheckbox.text || '' text: field.subCheckbox.text || ''
}; };
} }
@@ -2049,7 +2050,7 @@ angular.module('FormGenerator', [GeneratorHelpers.name, 'Utilities', listGenerat
let ngShow = options.ngShow ? `ng-show="${options.ngShow}"` : ''; let ngShow = options.ngShow ? `ng-show="${options.ngShow}"` : '';
return ` return `
<label class="checkbox-inline Form-checkbox" ${ngShow}> <label class="checkbox-inline Form-checkbox Form-checkbox--subCheckbox" ${ngShow}>
<input type="checkbox" id="${options.id}" ${ngModel} ${ngChange} ${ngDisabled} /> <input type="checkbox" id="${options.id}" ${ngModel} ${ngChange} ${ngDisabled} />
${options.text} ${options.text}
</label> `; </label> `;

View File

@@ -261,11 +261,13 @@
} }
else { else {
if (fld !== 'variables' && if (fld !== 'variables' &&
fld !== 'survey') { fld !== 'survey' &&
fld !== 'forks') {
data[fld] = $scope[fld]; data[fld] = $scope[fld];
} }
} }
} }
data.forks = $scope.forks || 0;
data.ask_diff_mode_on_launch = $scope.ask_diff_mode_on_launch ? $scope.ask_diff_mode_on_launch : false; data.ask_diff_mode_on_launch = $scope.ask_diff_mode_on_launch ? $scope.ask_diff_mode_on_launch : false;
data.ask_tags_on_launch = $scope.ask_tags_on_launch ? $scope.ask_tags_on_launch : false; data.ask_tags_on_launch = $scope.ask_tags_on_launch ? $scope.ask_tags_on_launch : false;
data.ask_skip_tags_on_launch = $scope.ask_skip_tags_on_launch ? $scope.ask_skip_tags_on_launch : false; data.ask_skip_tags_on_launch = $scope.ask_skip_tags_on_launch ? $scope.ask_skip_tags_on_launch : false;

View File

@@ -473,12 +473,14 @@ export default
} }
else { else {
if (fld !== 'variables' && if (fld !== 'variables' &&
fld !== 'survey') { fld !== 'survey' &&
fld !== 'forks') {
data[fld] = $scope[fld]; data[fld] = $scope[fld];
} }
} }
} }
data.forks = $scope.forks || 0;
data.ask_diff_mode_on_launch = $scope.ask_diff_mode_on_launch ? $scope.ask_diff_mode_on_launch : false; data.ask_diff_mode_on_launch = $scope.ask_diff_mode_on_launch ? $scope.ask_diff_mode_on_launch : false;
data.ask_tags_on_launch = $scope.ask_tags_on_launch ? $scope.ask_tags_on_launch : false; data.ask_tags_on_launch = $scope.ask_tags_on_launch ? $scope.ask_tags_on_launch : false;
data.ask_skip_tags_on_launch = $scope.ask_skip_tags_on_launch ? $scope.ask_skip_tags_on_launch : false; data.ask_skip_tags_on_launch = $scope.ask_skip_tags_on_launch ? $scope.ask_skip_tags_on_launch : false;

View File

@@ -57,7 +57,7 @@ export default
scope.name = data.name; scope.name = data.name;
var fld, i; var fld, i;
for (fld in form.fields) { for (fld in form.fields) {
if (fld !== 'variables' && fld !== 'survey' && data[fld] !== null && data[fld] !== undefined) { if (fld !== 'variables' && fld !== 'survey' && fld !== 'forks' && data[fld] !== null && data[fld] !== undefined) {
if (form.fields[fld].type === 'select') { if (form.fields[fld].type === 'select') {
if (scope[fld + '_options'] && scope[fld + '_options'].length > 0) { if (scope[fld + '_options'] && scope[fld + '_options'].length > 0) {
for (i = 0; i < scope[fld + '_options'].length; i++) { for (i = 0; i < scope[fld + '_options'].length; i++) {
@@ -76,6 +76,12 @@ export default
} }
master[fld] = scope[fld]; master[fld] = scope[fld];
} }
if (fld === 'forks') {
if (data[fld] !== 0) {
scope[fld] = data[fld];
master[fld] = scope[fld];
}
}
if (fld === 'variables') { if (fld === 'variables') {
// Parse extra_vars, converting to YAML. // Parse extra_vars, converting to YAML.
scope.variables = ParseVariableString(data.extra_vars); scope.variables = ParseVariableString(data.extra_vars);

View File

@@ -153,15 +153,15 @@ function(NotificationsList, CompletedJobsList, i18n) {
id: 'forks-number', id: 'forks-number',
type: 'number', type: 'number',
integer: true, integer: true,
min: 0, min: 1,
spinner: true, spinner: true,
"default": '0',
'class': "input-small", 'class': "input-small",
column: 1, column: 1,
awPopOver: '<p>' + i18n.sprintf(i18n._('The number of parallel or simultaneous processes to use while executing the playbook. 0 signifies ' + awPopOver: '<p>' + i18n.sprintf(i18n._('The number of parallel or simultaneous processes to use while executing the playbook. Inputting no value will use ' +
'the default value from the %sansible configuration file%s.'), '' + 'the default value from the %sansible configuration file%s.'), '' +
'<a id="ansible_forks_docs" href=\"http://docs.ansible.com/intro_configuration.html#the-ansible-configuration-file\" ' + '<a id="ansible_forks_docs" href=\"http://docs.ansible.com/intro_configuration.html#the-ansible-configuration-file\" ' +
' target=\"_blank\">', '</a>') +'</p>', ' target=\"_blank\">', '</a>') +'</p>',
placeholder: 'DEFAULT',
dataTitle: i18n._('Forks'), dataTitle: i18n._('Forks'),
dataPlacement: 'right', dataPlacement: 'right',
dataContainer: "body", dataContainer: "body",