Merge pull request #2909 from leigh-johnson/2862

Fix tag search / filter by 'type' in Job > related Schedules list view
This commit is contained in:
Shane McDonald 2016-07-11 13:14:01 -04:00 committed by GitHub
commit d9e31c53eb
2 changed files with 12 additions and 6 deletions

View File

@ -45,14 +45,17 @@ export default
sourceModel: 'unified_job_template',
sourceField: 'unified_job_type',
ngBind: 'schedule.type_label',
searchField: 'unified_job_template__name',
searchLable: 'Type',
searchField: 'unified_job_template__polymorphic_ctype__model',
filterBySearchField: true,
searchLabel: 'Type',
searchable: true,
searchType: 'select',
searchOptions: [
{ value: 'inventory source', label: 'Inventory Sync' },
{ value: 'job template', label: 'Playbook Run' },
{ value: 'project', label: 'SCM Update' }
{ value: 'inventorysource', label: 'Inventory Sync' },
{ value: 'jobtemplate', label: 'Playbook Run' },
{ value: 'project', label: 'SCM Update' },
{ value: 'systemjobtemplate', label: 'Management Job'}
]
},
next_run: {

View File

@ -6,7 +6,10 @@ export default ['Rest', '$q', 'GetBasePath', 'Wait', 'ProcessErrors', '$log', fu
var obj = {};
// build the value (key)
var value;
if (field.sourceModel && field.sourceField) {
if (field.searchField && field.filterBySearchField === true){
value = field.searchField;
}
else if (field.sourceModel && field.sourceField) {
value = field.sourceModel + '__' + field.sourceField;
obj.related = true;
} else if (typeof(field.key) === String) {