diff --git a/group_manager/static/group_manager/js/group_manager.js b/group_manager/static/group_manager/js/group_manager.js index cffef2b9..7f243192 100644 --- a/group_manager/static/group_manager/js/group_manager.js +++ b/group_manager/static/group_manager/js/group_manager.js @@ -425,14 +425,6 @@ async function processImportedRow (row) { // if all is complete reload the left pane with data and setup click capability to open newly added groups in the groupmananger if ($('.import-groupname').length === $('.import-groupname-done').length) { - // only enable new groups that have been successfully added - $('.import-csv-group-ok').on('click', function () { - const groupName = 'research-' + $(this).attr('groupname') - $('#dlg-import-groups-csv').modal('hide') - Yoda.groupManager.unfoldToGroup(groupName) - Yoda.groupManager.selectGroup(groupName) - }) - // Renew the data of the left pane as new groups have been added not yet loaded. Yoda.call('group_data').then((groupdata) => { Yoda.groupManager.groupHierarchy = groupdata.group_hierarchy @@ -498,6 +490,13 @@ async function processImportedRow (row) { catIdx = catIdx + 1 } $('#group-list').html(html) + + // Get the selected group if exists and reselect it to get the changes. + // If no active group, no group is selected. + const activeGroupName = Yoda.storage.session.get('selected-group') + if (activeGroupName) { + Yoda.groupManager.selectGroup(activeGroupName) + } }) } }