Inventory refactor from 1.4.11

Includes commits from release_1.4.11 branch up to and including d434e675a7c9727af900d7c21de5e542aef0eb98. That should be everything. What remains is testing.
This commit is contained in:
Chris Houseknecht 2014-06-02 18:14:30 -04:00
parent 527e7c6943
commit 2c95b75960
4 changed files with 13 additions and 45 deletions

View File

@ -62,16 +62,7 @@ angular.module('InventoryGroupsHelpDefinition', [])
},
box: "<div class=\"text-left\">First, select a group. Then click <i class=\"fa fa-plus\"></i> to create a new group. The new group " +
"will be added to the selected group.</div>"
}, {
intro: 'Copy or move groups:',
img: {
src: 'groups006.png',
maxWidth: 263,
maxHeight: 211
},
box: "<div class=\"text-left\">Copy or move a group by dragging and dropping its name onto another group name. A dialog will appear " +
"asking if the group should be coppied or moved.</div>"
}, {
},{
intro: 'Adding hosts:',
img: {
src: 'groups007.png',

View File

@ -450,7 +450,8 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
ParseVariableString, CreateDialog, TextareaResize) {
return function(params) {
var parent_scope = params.parent_scope,
var parent_scope = params.host_scope,
group_scope = params.group_scope,
host_id = params.host_id,
inventory_id = params.inventory_id,
mode = params.mode, // 'add' or 'edit'
@ -458,7 +459,7 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
generator = GenerateForm,
form = HostForm,
defaultUrl,
scope = params.host_scope,
scope = parent_scope.$new(),
master = {},
relatedSets = {},
buttons, url;
@ -614,36 +615,7 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
scope.removeSaveCompleted();
}
scope.removeSaveCompleted = scope.$on('saveCompleted', function() {
var host, old_name;
if (mode === 'edit') {
// Update the name on the list
host = Find({ list: scope.hosts, key: 'id', val: host_id });
old_name = host.name;
host.name = scope.name;
host.enabled = (scope.enabled) ? true : false;
host.enabled_flag = host.enabled;
SetStatus({ scope: scope, host: host });
// Update any titles attributes created by ApplyEllipsis
if (old_name) {
setTimeout(function() {
$('#hosts_table .host-name a[title="' + old_name + '"]').attr('title', host.name);
ApplyEllipsis('#hosts_table .host-name a');
// Close modal
$('#host-modal-dialog').dialog('close');
}, 2000);
}
else {
// Close modal
$('#host-modal-dialog').dialog('close');
}
}
else {
$('#host-modal-dialog').dialog('close');
parent_scope.refreshHosts();
}
// Restore ellipsis response to window resize
//WatchInventoryWindowResize();
scope.cancelModal();
});
// Save changes to the parent
@ -701,7 +673,8 @@ function($rootScope, $location, $log, $routeParams, Rest, Alert, HostForm, Gener
catch(err) {
// ignore
}
parent_scope.refreshHosts();
group_scope.refreshHosts();
scope.$destroy();
};
};

View File

@ -331,8 +331,10 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
view = GenerateList,
base = $location.path().replace(/^\//, '').split('/')[0],
parent_scope = params.scope,
PreviousSearchParams = Store('CurrentSearchParams'),
search_iterator = params.search_iterator, // use to get correct current_search_params from local store
PreviousSearchParams = (search_iterator) ? Store(search_iterator + '_current_search_params') : Store('CurrentSearchParams'),
inventory_name = (params && params.inventory_name) ? params.inventory_name : null,
onClose = params.onClose, // optional callback to $emit after AS closes
url = (params && params.url) ? params.url : null,
type, paths, itm, scope;
@ -402,6 +404,9 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti
if (inUrl) {
$location.path(inUrl);
}
else if (onClose) {
parent_scope.$emit(onClose);
}
scope.$destroy();
};

View File

@ -907,7 +907,6 @@ input[type="checkbox"].checkbox-no-label {
.table-hover tbody tr:hover > td,
.table-hover tbody tr:hover > th {
background-color: #fff;
border-top: 1px solid #ddd;
}
.table-hover-inverse tbody tr:hover > td,