Skip to content
Snippets Groups Projects
Commit 418e89a9 authored by !! Julian Keck (old Account; do not use) !!'s avatar !! Julian Keck (old Account; do not use) !! :ghost:
Browse files

UPD refactor group service to use union

Closes #708
parent 055f05af
No related branches found
No related tags found
No related merge requests found
Pipeline #303141 passed with warnings
......@@ -46,19 +46,14 @@ export default {
},
get_by_name (config, name) {
const ta = [
{ name: 'cntl.group.list', old: { name: name } },
{ name: 'cntl.group.list', idx: 'main_groups', old: { name: name } },
{ name: 'cntl.group.list', idx: 'subgroups', old: { is_sub: true }, inner_join_ref: {main_groups: 'api_fkey_cntl_group_sub'} },
{ name: 'cntl.group.list', idx: 'group_list', union_join_ref: {main_groups: 'self', subgroups: 'self'} },
{ name: 'cntl.mgr2group.list', inner_join_ref: { group_list: 'default'}, old: { sorting_params_list: ['group_name asc', 'mgr_login_name asc'] }},
{ name: 'nd.bcd2group.list', inner_join_ref: { group_list: 'default'}, old: { sorting_params_list: ['group_name asc', 'bcd_name asc'] }},
{ name: 'dns.fqdn2group.list', inner_join_ref: { group_list: 'default'}, old: { sorting_params_list: ['group_name', 'fqdn_value'] } },
{ name: 'cntl.mgr.list', inner_join_ref: { mgr2group_list: 'default'} },
{ name: 'nd.bcd.list', inner_join_ref: { bcd2group_list: 'default'} },
// subgroups, as union is currently not possible
{ name: 'cntl.group.list', idx: 'subgroups', old: { is_sub: true }, inner_join_ref: {group_list: 'api_fkey_cntl_group_sub'} },
{ idx: 'sub_mgr2group_list', name: 'cntl.mgr2group.list', inner_join_ref: { subgroups: 'default'}, old: { sorting_params_list: ['group_name asc', 'mgr_login_name asc'] }},
{ idx: 'sub_bcd2group_list', name: 'nd.bcd2group.list', inner_join_ref: { subgroups: 'default'}, old: { sorting_params_list: ['group_name asc', 'bcd_name asc'] }},
{ idx: 'sub_fqdn2group_list', name: 'dns.fqdn2group.list', inner_join_ref: { subgroups: 'default'}, old: { sorting_params_list: ['group_name', 'fqdn_value'] } },
{ idx: 'sub_mgr_list', name: 'cntl.mgr.list', inner_join_ref: { sub_mgr2group_list: 'default'} },
{ idx: 'sub_bcd_list', name: 'nd.bcd.list', inner_join_ref: { sub_bcd2group_list: 'default'} }
]
return TransactionService.execute(config, ta)
}
......
......@@ -190,10 +190,10 @@ export default {
if (!this.entry && this.groups.length > 0) {
this.$store.commit('setNavigationRefreshHandle', { gpk: this.groups[0].gpk, objType: 'cntl.group' })
}
this.bcds = this.merged_dict_of_lists_by_value_of_array([res.bcd_list, res.sub_bcd_list], 'name')
this.bcds2grp = this.merged_dict_of_lists_by_value_of_array([res.bcd2group_list, res.sub_bcd2group_list], 'group_name')
this.mgrs2grp = this.merged_dict_of_lists_by_value_of_array([res.mgr2group_list, res.sub_mgr2group_list], 'group_name')
this.fqdn2grp = this.merged_dict_of_lists_by_value_of_array([res.fqdn2group_list, res.sub_fqdn2group_list], 'group_name')
this.bcds = apiutil.dict_of_lists_by_value_of_array(res.bcd_list, 'name')
this.bcds2grp = apiutil.dict_of_lists_by_value_of_array(res.bcd2group_list, 'group_name')
this.mgrs2grp = apiutil.dict_of_lists_by_value_of_array(res.mgr2group_list, 'group_name')
this.fqdn2grp = apiutil.dict_of_lists_by_value_of_array(res.fqdn2group_list, 'group_name')
this.mgrs = Object.assign({}, apiutil.dict_by_value_of_array(res.mgr_list, 'login_name'), apiutil.dict_by_value_of_array(res.sub_mgr_list || [], 'login_name'))
const subgroups = res.group_list.filter(group => group.is_sub)
if (!this.entry) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment