mirror of
https://github.com/ansible/awx.git
synced 2026-01-17 04:31:21 -03:30
AC-726 Improved search filter, eliminating need for reset button. Fixed drop-down menu on jobs detail page, replacing summary with host summary. Fixed error message on job templates and jobs when list of playbooks cannot be found- message is now informational rather than cryptic error.
This commit is contained in:
parent
5b48bea8c9
commit
fae51d12f0
@ -358,8 +358,8 @@ function JobTemplatesEdit ($scope, $rootScope, $compile, $location, $log, $route
|
||||
}
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, form,
|
||||
{ hdr: 'Error!', msg: 'Failed to get playbook list for ' + url +'. GET returned status: ' + status });
|
||||
Alert('Missing Playbooks', 'Unable to retrieve the list of playbooks for this project. Choose a different ' +
|
||||
' project or make the playbooks available on the file system.', 'alert-info');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,8 +215,11 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
|
||||
}
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, form,
|
||||
{ hdr: 'Error!', msg: 'Failed to get playbook list for ' + url +'. GET returned status: ' + status });
|
||||
//ProcessErrors(scope, data, status, form,
|
||||
// { hdr: 'Error!', msg: 'Failed to get playbook list for ' + url +'. GET returned status: ' + status });
|
||||
|
||||
// Ignore the error. We get this error when the project or playbook has been deleted
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -274,7 +274,7 @@ angular.module('CredentialFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
|
||||
@ -246,7 +246,7 @@ angular.module('GroupFormDefinition', [])
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
'class': "btn btn-default",
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
},
|
||||
|
||||
@ -47,7 +47,7 @@ angular.module('HostGroupsFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ angular.module('HostFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ angular.module('InventoryFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
|
||||
@ -277,7 +277,7 @@ angular.module('JobTemplateFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
|
||||
@ -27,15 +27,15 @@ angular.module('JobFormDefinition', [])
|
||||
active: true,
|
||||
ngShow: "job_id !== null"
|
||||
},
|
||||
hosts: {
|
||||
href: "/#/jobs/{{ job_id }}/job_host_summaries",
|
||||
label: 'Summary',
|
||||
icon: 'icon-laptop'
|
||||
},
|
||||
events: {
|
||||
href: "/#/jobs/{{ job_id }}/job_events",
|
||||
label: 'Events',
|
||||
icon: 'icon-list-ul'
|
||||
},
|
||||
hosts: {
|
||||
href: "/#/jobs/{{ job_id }}/job_host_summaries",
|
||||
label: 'Host Summary',
|
||||
icon: 'icon-laptop'
|
||||
}
|
||||
},
|
||||
|
||||
@ -292,7 +292,7 @@ angular.module('JobFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-remove',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ angular.module('OrganizationFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
@ -75,15 +75,6 @@ angular.module('OrganizationFormDefinition', [])
|
||||
label: 'Add',
|
||||
icon: 'icon-plus',
|
||||
awToolTip: 'Add a new user'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('user')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
@ -130,15 +121,6 @@ angular.module('OrganizationFormDefinition', [])
|
||||
icon: 'icon-plus',
|
||||
label: 'Add',
|
||||
awToolTip: 'Add new administrator'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('admin')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
fields: {
|
||||
|
||||
@ -108,7 +108,7 @@ angular.module('PermissionFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ angular.module('ProjectFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
@ -228,15 +228,6 @@ angular.module('ProjectFormDefinition', [])
|
||||
icon: 'icon-plus',
|
||||
label: 'Add',
|
||||
awToolTip: 'Add an organization'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('organization')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ angular.module('TeamFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
@ -87,15 +87,6 @@ angular.module('TeamFormDefinition', [])
|
||||
icon: 'icon-plus',
|
||||
label: 'Add',
|
||||
add: 'Add a new credential'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('credential')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
@ -140,15 +131,6 @@ angular.module('TeamFormDefinition', [])
|
||||
label: 'Add',
|
||||
awToolTip: 'Add a permission for this user',
|
||||
ngShow: 'PermissionAddAllowed'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('permission')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
@ -207,15 +189,6 @@ angular.module('TeamFormDefinition', [])
|
||||
ngClick: "add('projects')",
|
||||
icon: 'icon-plus',
|
||||
label: 'Add'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('project')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
@ -259,15 +232,6 @@ angular.module('TeamFormDefinition', [])
|
||||
icon: 'icon-plus',
|
||||
label: 'Add',
|
||||
awToolTip: 'Add a user'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('user')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -111,7 +111,7 @@ angular.module('UserFormDefinition', [])
|
||||
reset: {
|
||||
ngClick: 'formReset()',
|
||||
label: 'Reset',
|
||||
icon: 'icon-trash',
|
||||
icon: 'icon-undo',
|
||||
'class': 'btn btn-default',
|
||||
ngDisabled: true //Disabled when $pristine
|
||||
}
|
||||
@ -131,15 +131,6 @@ angular.module('UserFormDefinition', [])
|
||||
icon: 'icon-plus',
|
||||
label: 'Add',
|
||||
awToolTip: 'Add a credential for this user'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('credential')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
@ -184,15 +175,6 @@ angular.module('UserFormDefinition', [])
|
||||
label: 'Add',
|
||||
awToolTip: 'Add a permission for this user',
|
||||
ngShow: 'PermissionAddAllowed'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('permission')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
@ -249,15 +231,6 @@ angular.module('UserFormDefinition', [])
|
||||
base: '/organizations',
|
||||
|
||||
actions: {
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('adminof')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
@ -278,15 +251,6 @@ angular.module('UserFormDefinition', [])
|
||||
open: false,
|
||||
|
||||
actions: {
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('organization')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
@ -307,15 +271,6 @@ angular.module('UserFormDefinition', [])
|
||||
open: false,
|
||||
|
||||
actions: {
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('team')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
@ -336,15 +291,6 @@ angular.module('UserFormDefinition', [])
|
||||
open: false,
|
||||
|
||||
actions: {
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch('project')",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
fields: {
|
||||
|
||||
@ -42,16 +42,16 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat
|
||||
scope[iterator + 'SearchTypeLabel'] = 'Contains';
|
||||
scope[iterator + 'SearchValue'] = null;
|
||||
scope[iterator + 'SelectShow'] = false;
|
||||
scope[iterator + 'HideSearchType'] = false;
|
||||
//scope[iterator + 'HideSearchType'] = false;
|
||||
scope[iterator + 'ShowStartBtn'] = true;
|
||||
scope[iterator + 'HideAllStartBtn'] = false;
|
||||
|
||||
f = scope[iterator + 'SearchField']
|
||||
if (form.related[set].fields[f].searchType && ( form.related[set].fields[f].searchType == 'boolean'
|
||||
|| form.related[set].fields[f].searchType == 'select')) {
|
||||
scope[iterator + 'SelectShow'] = true;
|
||||
scope[iterator + 'SearchSelectOpts'] = list.fields[f].searchOptions;
|
||||
}
|
||||
if (form.related[set].fields[f].searchType && form.related[set].fields[f].searchType == 'int') {
|
||||
scope[iterator + 'HideSearchType'] = true;
|
||||
}
|
||||
if (form.related[set].fields[f].searchType && form.related[set].fields[f].searchType == 'gtzero') {
|
||||
scope[iterator + "InputHide"] = true;
|
||||
}
|
||||
@ -79,11 +79,13 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat
|
||||
scope[iterator + 'SearchField'] = fld;
|
||||
scope[iterator + 'SearchValue'] = '';
|
||||
scope[iterator + 'SelectShow'] = false;
|
||||
scope[iterator + 'HideSearchType'] = false;
|
||||
//scope[iterator + 'HideSearchType'] = false;
|
||||
scope[iterator + 'InputHide'] = false;
|
||||
scope[iterator + 'ShowStartBtn'] = true;
|
||||
|
||||
if (f.searchType !== undefined && f.searchType == 'gtzero') {
|
||||
scope[iterator + "InputHide"] = true;
|
||||
scope[iterator + 'ShowStartBtn'] = false;
|
||||
}
|
||||
if (f.searchType !== undefined && (f.searchType == 'boolean'
|
||||
|| f.searchType == 'select')) {
|
||||
@ -91,7 +93,8 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat
|
||||
scope[iterator + 'SearchSelectOpts'] = f.searchOptions;
|
||||
}
|
||||
if (f.searchType !== undefined && f.searchType == 'int') {
|
||||
scope[iterator + 'HideSearchType'] = true;
|
||||
//scope[iterator + 'HideSearchType'] = true;
|
||||
scope[model + 'SearchType'] = 'int';
|
||||
}
|
||||
|
||||
scope.search(iterator);
|
||||
@ -116,6 +119,11 @@ angular.module('RelatedSearchHelper', ['RestServices', 'Utilities','RefreshRelat
|
||||
Wait('start');
|
||||
scope[iterator + 'Loading'] = true;
|
||||
scope[iterator + 'HoldInput'] = true;
|
||||
|
||||
if (scope[iterator + 'SearchValue']) {
|
||||
// User typed a value in input field
|
||||
scope[iterator + 'ShowStartBtn'] = false;
|
||||
}
|
||||
|
||||
if (iterator == 'host') {
|
||||
if (scope['hostSearchField'] == 'has_active_failures') {
|
||||
|
||||
@ -80,6 +80,8 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
scope[iterator + 'HideSearchType' + modifier] = false;
|
||||
scope[iterator + 'InputDisable' + modifier] = false;
|
||||
scope[iterator + 'ExtraParms' + modifier] = '';
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = true;
|
||||
scope[iterator + 'HideAllStartBtn' + modifier] = false;
|
||||
|
||||
scope[iterator + 'SearchPlaceholder' + modifier] =
|
||||
(list.fields[scope[iterator + 'SearchField' + modifier]] &&
|
||||
@ -128,9 +130,12 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
scope[iterator + 'SearchType' + modifier] = 'icontains';
|
||||
scope[iterator + 'SearchPlaceholder' + modifier] = (list.fields[fld].searchPlaceholder) ? list.fields[fld].searchPlaceholder : 'Search';
|
||||
scope[iterator + 'InputDisable' + modifier] = (list.fields[fld].searchObject == 'all') ? true : false;
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = true;
|
||||
|
||||
if (list.fields[fld].searchType && list.fields[fld].searchType == 'gtzero') {
|
||||
scope[iterator + "InputDisable" + modifier] = true;
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
||||
scope.search(iterator);
|
||||
}
|
||||
else if (list.fields[fld].searchSingleValue){
|
||||
// Query a specific attribute for one specific value
|
||||
@ -149,11 +154,13 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
else {
|
||||
scope[iterator + "SearchSelectValue" + modifier] = { value: list.fields[fld].searchValue };
|
||||
}
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
||||
}
|
||||
else if (list.fields[fld].searchType == 'in') {
|
||||
scope[iterator + "SearchType" + modifier] = 'in';
|
||||
scope[iterator + "SearchValue" + modifier] = list.fields[fld].searchValue;
|
||||
scope[iterator + "InputDisable" + modifier] = true;
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
||||
}
|
||||
else if (list.fields[fld].searchType && (list.fields[fld].searchType == 'boolean'
|
||||
|| list.fields[fld].searchType == 'select' || list.fields[fld].searchType == 'select_or')) {
|
||||
@ -161,14 +168,18 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
scope[iterator + 'SearchSelectOpts' + modifier] = list.fields[fld].searchOptions;
|
||||
}
|
||||
else if (list.fields[fld].searchType && list.fields[fld].searchType == 'int') {
|
||||
scope[iterator + 'HideSearchType' + modifier] = true;
|
||||
//scope[iterator + 'HideSearchType' + modifier] = true;
|
||||
scope[iterator + 'SearchType' + modifier] = 'int';
|
||||
}
|
||||
else if (list.fields[fld].searchType && list.fields[fld].searchType == 'isnull') {
|
||||
scope[iterator + 'SearchType' + modifier] = 'isnull';
|
||||
scope[iterator + 'InputDisable' + modifier] = true;
|
||||
scope[iterator + 'SearchValue' + modifier] = 'true';
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
||||
}
|
||||
scope.search(iterator);
|
||||
|
||||
scope.search(iterator);
|
||||
|
||||
}
|
||||
|
||||
scope.resetSearch = function(iterator) {
|
||||
@ -247,7 +258,7 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
}
|
||||
scope.removePrepareSearch = scope.$on('prepareSearch', function(e, iterator, page, load, spin) {
|
||||
//
|
||||
// Start build the search key/value pairs. This will process search widget, if the
|
||||
// Start building the search key/value pairs. This will process each search widget, if the
|
||||
// selected field is an object type (used on activity stream).
|
||||
//
|
||||
Wait('start');
|
||||
@ -273,37 +284,45 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
var modifier = (i == 1) ? '' : i;
|
||||
if ( $('#search-widget-container' + modifier) ) {
|
||||
if (list.fields[scope[iterator + 'SearchField' + modifier]] &&
|
||||
list.fields[scope[iterator + 'SearchField' + modifier]].searchObject &&
|
||||
list.fields[scope[iterator + 'SearchField' + modifier]].searchObject !== 'all') {
|
||||
if (scope[iterator + 'SearchValue' + modifier]) {
|
||||
var objs = list.fields[scope[iterator + 'SearchField' + modifier]].searchObject;
|
||||
var objUrl = GetBasePath('base') + objs + '/?name__icontains=' + scope[iterator + 'SearchValue' + modifier];
|
||||
Rest.setUrl(objUrl);
|
||||
Rest.setHeader({ widget: i });
|
||||
Rest.setHeader({ object: objs });
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
var pk='';
|
||||
//limit result set to 30
|
||||
var len = (data.results.length > 30) ? 30 : data.results.length;
|
||||
for (var j=0; j < len; j++) {
|
||||
pk += "," + data.results[j].id;
|
||||
}
|
||||
pk = pk.replace(/^\,/,'');
|
||||
scope.$emit('foundObject', iterator, page, load, spin, config.headers['widget'], pk);
|
||||
if (data.results.length > 30) {
|
||||
scope.$emit('resultWarning', config.headers['object'], data.results.length);
|
||||
}
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
Wait('stop');
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Retrieving list of ' + objs + ' where name contains: ' + scope[iterator + 'SearchValue' + modifier] +
|
||||
' GET returned status: ' + status });
|
||||
});
|
||||
list.fields[scope[iterator + 'SearchField' + modifier]].searchObject) {
|
||||
if (list.fields[scope[iterator + 'SearchField' + modifier]].searchObject !== 'all') {
|
||||
scope[iterator + 'HideAllStartBtn' + modifier] = false;
|
||||
if (scope[iterator + 'SearchValue' + modifier]) {
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
||||
var objs = list.fields[scope[iterator + 'SearchField' + modifier]].searchObject;
|
||||
var objUrl = GetBasePath('base') + objs + '/?name__icontains=' + scope[iterator + 'SearchValue' + modifier];
|
||||
Rest.setUrl(objUrl);
|
||||
Rest.setHeader({ widget: i });
|
||||
Rest.setHeader({ object: objs });
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
var pk='';
|
||||
//limit result set to 30
|
||||
var len = (data.results.length > 30) ? 30 : data.results.length;
|
||||
for (var j=0; j < len; j++) {
|
||||
pk += "," + data.results[j].id;
|
||||
}
|
||||
pk = pk.replace(/^\,/,'');
|
||||
scope.$emit('foundObject', iterator, page, load, spin, config.headers['widget'], pk);
|
||||
if (data.results.length > 30) {
|
||||
scope.$emit('resultWarning', config.headers['object'], data.results.length);
|
||||
}
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
Wait('stop');
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Retrieving list of ' + objs + ' where name contains: ' + scope[iterator + 'SearchValue' + modifier] +
|
||||
' GET returned status: ' + status });
|
||||
});
|
||||
}
|
||||
else {
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = true;
|
||||
scope.$emit('foundObject', iterator, page, load, spin, i, null);
|
||||
}
|
||||
}
|
||||
else {
|
||||
scope.$emit('foundObject', iterator, page, load, spin, i, null);
|
||||
// Object Type set to All
|
||||
scope[iterator + 'HideAllStartBtn' + modifier] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -330,6 +349,11 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
!list.fields[scope[iterator + 'SearchField' + modifier]].searchObject) {
|
||||
|
||||
// if the search widget exists and its value is not an object, add its parameters to the query
|
||||
|
||||
if (scope[iterator + 'SearchValue' + modifier]) {
|
||||
// if user typed a value in the input box, show the reset link
|
||||
scope[iterator + 'ShowStartBtn' + modifier] = false;
|
||||
}
|
||||
|
||||
if ( (!scope[iterator + 'SelectShow' + modifier] && !Empty(scope[iterator + 'SearchValue' + modifier])) ||
|
||||
(scope[iterator + 'SelectShow' + modifier] && scope[iterator + 'SearchSelectValue' + modifier]) ||
|
||||
|
||||
@ -62,15 +62,6 @@ angular.module('CredentialsListDefinition', [])
|
||||
"class": 'btn-success btn-xs',
|
||||
awToolTip: 'Create a new credential'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -110,15 +110,6 @@ angular.module('HomeGroupListDefinition', [])
|
||||
},
|
||||
|
||||
actions: {
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -81,15 +81,6 @@ angular.module('HomeHostListDefinition', [])
|
||||
},
|
||||
|
||||
actions: {
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -89,15 +89,6 @@ angular.module('InventoriesListDefinition', [])
|
||||
"class": 'btn-xs btn-success',
|
||||
awToolTip: 'Create a new inventory'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -136,15 +136,6 @@ angular.module('InventorySummaryDefinition', [])
|
||||
ngClick: "refresh()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -94,15 +94,6 @@ angular.module('JobEventsListDefinition', [])
|
||||
awToolTip: "Refresh the page",
|
||||
ngClick: "refresh()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -128,15 +128,6 @@ angular.module('JobHostDefinition', [])
|
||||
awToolTip: "Refresh the page",
|
||||
ngClick: "refresh()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -38,15 +38,6 @@ angular.module('JobTemplatesListDefinition', [])
|
||||
basePaths: ['job_templates'],
|
||||
awToolTip: 'Create a new template'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -83,15 +83,6 @@ angular.module('JobsListDefinition', [])
|
||||
awToolTip: "Refresh the page",
|
||||
ngClick: "refresh()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@ -36,15 +36,6 @@ angular.module('OrganizationListDefinition', [])
|
||||
"class": 'btn-success btn-xs',
|
||||
awToolTip: 'Create a new organization'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -51,15 +51,6 @@ angular.module('PermissionListDefinition', [])
|
||||
awToolTip: 'Add a new permission',
|
||||
ngShow: 'PermissionAddAllowed'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -37,7 +37,7 @@ angular.module('ProjectsListDefinition', [])
|
||||
nosort: true
|
||||
},
|
||||
status: {
|
||||
label: 'Update Status',
|
||||
label: 'Status',
|
||||
ngClick: 'showSCMStatus(\{\{ project.id \}\})',
|
||||
awToolTip: 'View details of last SCM Update',
|
||||
dataPlacement: 'top',
|
||||
@ -92,15 +92,6 @@ angular.module('ProjectsListDefinition', [])
|
||||
ngClick: "refresh()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -213,15 +213,6 @@ angular.module('StreamListDefinition', [])
|
||||
ngClick: "refreshStream()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
close: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-arrow-left",
|
||||
|
||||
@ -43,15 +43,6 @@ angular.module('TeamsListDefinition', [])
|
||||
"class": 'btn-xs btn-success',
|
||||
awToolTip: 'Create a new team'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -43,15 +43,6 @@ angular.module('UserListDefinition', [])
|
||||
"class": 'btn-success btn-xs',
|
||||
awToolTip: 'Create a new user'
|
||||
},
|
||||
reset: {
|
||||
dataPlacement: 'top',
|
||||
icon: "icon-undo",
|
||||
mode: 'all',
|
||||
'class': 'btn-xs btn-primary',
|
||||
awToolTip: "Reset the search filter",
|
||||
ngClick: "resetSearch()",
|
||||
iconSize: 'large'
|
||||
},
|
||||
stream: {
|
||||
'class': "btn-primary btn-xs activity-btn",
|
||||
ngClick: "showActivity()",
|
||||
|
||||
@ -489,16 +489,37 @@ select.page-size {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.search-widget {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
/* Search Widget */
|
||||
.search-widget {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.search-widget label {
|
||||
display: inline-block;
|
||||
padding-right: 15px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#search_value_input {
|
||||
padding-right: 25px;
|
||||
}
|
||||
|
||||
.search-widget label {
|
||||
display: inline-block;
|
||||
padding-right: 15px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.search-reset-start {
|
||||
color: @grey;
|
||||
float: right;
|
||||
position: relative;
|
||||
top: -25px;
|
||||
left: -10px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.search-reset-start:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ui-widget-content a.search-reset-start {
|
||||
color: @grey;
|
||||
}
|
||||
|
||||
/* breadcrumbs */
|
||||
.nav-path {
|
||||
|
||||
@ -491,7 +491,7 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
||||
html += "<div class=\"";
|
||||
html += (params.size) ? params.size : "col-lg-4 col-md-6 col-sm-11 col-xs-11";
|
||||
html += "\" id=\"search-widget-container" + modifier + "\">\n";
|
||||
//html += (form.searchWidgetLabel) ? "<label style=\"display:block\">" + form.searchWidgetLabel +"</label>" : "";
|
||||
|
||||
html += "<div class=\"input-group";
|
||||
html += (useMini) ? " input-group-sm" : " input-group-sm";
|
||||
html += "\">\n";
|
||||
@ -529,21 +529,36 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
||||
html += "ng-options=\"c.name for c in " + iterator + "SearchSelectOpts" + modifier + "\" class=\"form-control search-select";
|
||||
html += "\"></select>\n";
|
||||
|
||||
html += "<input id=\"search_value_input\" type=\"text\" ng-hide=\"" + iterator + "SelectShow || " + iterator + "InputHide\" " +
|
||||
|
||||
html += "<input id=\"search_value_input\" type=\"text\" ng-hide=\"" + iterator + "SelectShow" + modifier + " || " +
|
||||
iterator + "InputHide" + modifier + "\" " +
|
||||
"class=\"form-control\" ng-model=\"" + iterator + "SearchValue" + modifier + "\" " +
|
||||
"aw-placeholder=\"" + iterator + "SearchPlaceholder" + modifier + "\" type=\"text\" ng-disabled=\"" + iterator +
|
||||
"InputDisable" + modifier + " || " + iterator + "HoldInput" + modifier + "\" ng-keypress=\"startSearch($event,'" +
|
||||
iterator + "')\">\n";
|
||||
|
||||
// Go button
|
||||
html += "<div class=\"input-group-btn\">\n";
|
||||
html += "<button type=\"button\" class=\"btn btn-default btn-small\" ng-click=\"search('" + iterator + "')\" " +
|
||||
"aw-tool-tip=\"Start the search\" data-placement=\"top\" ng-hide=\"" + iterator + "SelectShow || " + iterator +
|
||||
"InputHide\" ng-disabled=\"" + iterator + "InputDisable" + modifier + " || " + iterator + "HoldInput" + modifier +
|
||||
"\">Go!</button>\n";
|
||||
|
||||
// Reset button for drop-down
|
||||
html += "<div class=\"input-group-btn\" ng-show=\"" + iterator + "SelectShow" + modifier + "\" >\n";
|
||||
html += "<button type=\"button\" class=\"btn btn-default btn-small\" ng-click=\"resetSearch('" + iterator + "')\" " +
|
||||
"aw-tool-tip=\"Clear the search\" data-placement=\"top\"><i class=\"icon-remove\"></i></button>\n";
|
||||
html += "</div><!-- input-group-btn -->\n";
|
||||
|
||||
html += "</div><!-- input-group -->\n";
|
||||
|
||||
html += "<a class=\"search-reset-start\" ng-click=\"resetSearch('" + iterator + "')\"" +
|
||||
"ng-hide=\"" + iterator + "SelectShow" + modifier + " || " + iterator + "InputHide" + modifier + " || " +
|
||||
iterator + "ShowStartBtn" + modifier + " || " +
|
||||
iterator + "HoldInput" + modifier + " || " +
|
||||
iterator + "HideAllStartBtn" + modifier + "\"" +
|
||||
"><i class=\"icon-remove\"></i></a>\n";
|
||||
|
||||
html += "<a class=\"search-reset-start\" ng-click=\"search('" + iterator + "')\"" +
|
||||
"ng-hide=\"" + iterator + "SelectShow" + modifier + " || " + iterator + "InputHide" + modifier + " || " +
|
||||
"!" + iterator + "ShowStartBtn" + modifier + " || " +
|
||||
iterator + "HoldInput" + modifier + " || " +
|
||||
iterator + "HideAllStartBtn" + modifier + "\"" +
|
||||
"><i class=\"icon-search\"></i></a>\n";
|
||||
|
||||
html += "</div><!-- col-lg-x -->\n";
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user