mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-11-02 20:30:26 -06:00
WebUI: Improve subordinate ids user workflow
- add "Subordinate ID Statistics" page - add button for generating subid in "Subordinate ids" tab of user details page - allow to navigate directly to owner details from subordinate id page - adjust i18n strings Ticket: https://pagure.io/freeipa/issue/8361 Signed-off-by: Serhii Tsymbaliuk <stsymbal@redhat.com> Reviewed-By: Francois Cami <fcami@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
1 parent
110940b998
commit
30eceb504a
5 files changed
+121
-20
No files matched your search
@@ -602,6 +602,12 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
|
||||
*/
|
||||
that.facet_group = spec.facet_group || 'settings';
|
||||
|
||||
/**
|
||||
* Indicates if the details facet depends on pkey
|
||||
* @property {boolean}
|
||||
*/
|
||||
that.require_pkey = spec.require_pkey !== undefined ? spec.require_pkey : true;
|
||||
|
||||
/**
|
||||
* Widgets
|
||||
* @property {IPA.widget_container}
|
||||
@@ -1105,7 +1111,7 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
|
||||
*/
|
||||
that.refresh = function(on_success, on_error) {
|
||||
|
||||
if (!that.get_pkey() && that.entity.redirect_facet) {
|
||||
if (that.require_pkey && !that.get_pkey() && that.entity.redirect_facet) {
|
||||
that.redirect();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,24 @@ var nav = {};
|
||||
}
|
||||
]
|
||||
},
|
||||
{ entity: 'subid' }
|
||||
{
|
||||
name: 'subid',
|
||||
label: '@i18n:tabs.subid',
|
||||
children: [
|
||||
{
|
||||
name: 'subid',
|
||||
entity: 'subid',
|
||||
facet: 'search',
|
||||
label: '@i18n:tabs.subid'
|
||||
},
|
||||
{
|
||||
name: 'subid-stats',
|
||||
entity: 'subid',
|
||||
facet: 'stats',
|
||||
label: '@i18n:objects.subid.stats'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ return {
|
||||
},
|
||||
{
|
||||
$type: 'details',
|
||||
disable_facet_tabs: true,
|
||||
sections: [
|
||||
{
|
||||
name: 'details',
|
||||
@@ -38,9 +39,11 @@ return {
|
||||
'ipauniqueid',
|
||||
'description',
|
||||
{
|
||||
$type: 'link',
|
||||
name: 'ipaowner',
|
||||
label: '@i18n:objects.subid.ipaowner',
|
||||
title: '@mo-param:subid:ipaowner:label'
|
||||
title: '@mo-param:subid:ipaowner:label',
|
||||
other_entity: 'user'
|
||||
},
|
||||
{
|
||||
name: 'ipasubgidnumber',
|
||||
@@ -65,6 +68,44 @@ return {
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
$type: 'details',
|
||||
name: 'stats',
|
||||
label: '@i18n:objects.subid.stats',
|
||||
refresh_command_name: 'stats',
|
||||
check_rights: false,
|
||||
no_update: true,
|
||||
disable_facet_tabs: true,
|
||||
disable_breadcrumb: true,
|
||||
require_pkey: false,
|
||||
fields: [
|
||||
{
|
||||
name: 'assigned_subids',
|
||||
label: '@i18n:objects.subid.assigned_subids',
|
||||
read_only: true
|
||||
},
|
||||
{
|
||||
name: 'baseid',
|
||||
label: '@i18n:objects.subid.baseid',
|
||||
read_only: true
|
||||
},
|
||||
{
|
||||
name: 'dna_remaining',
|
||||
label: '@i18n:objects.subid.dna_remaining',
|
||||
read_only: true
|
||||
},
|
||||
{
|
||||
name: 'rangesize',
|
||||
label: '@i18n:objects.subid.rangesize',
|
||||
read_only: true
|
||||
},
|
||||
{
|
||||
name: 'remaining_subids',
|
||||
label: '@i18n:objects.subid.remaining_subids',
|
||||
read_only: true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
adder_dialog: {
|
||||
|
||||
@@ -464,7 +464,7 @@ return {
|
||||
},
|
||||
{
|
||||
$type: 'subid_generate',
|
||||
hide_cond: ['preserved-user'],
|
||||
hide_cond: ['preserved-user', 'self-service-other'],
|
||||
enable_cond: ['no-subid']
|
||||
}
|
||||
],
|
||||
@@ -556,8 +556,35 @@ return {
|
||||
{
|
||||
$type: 'association',
|
||||
name: 'memberof_subid',
|
||||
columns: [
|
||||
'ipauniqueid',
|
||||
'ipasubuidnumber',
|
||||
'ipasubgidnumber'
|
||||
],
|
||||
associator: IPA.serial_associator,
|
||||
read_only: true
|
||||
read_only: true,
|
||||
state: {
|
||||
evaluators: [
|
||||
IPA.user.self_service_other_user_evaluator,
|
||||
IPA.user.preserved_user_evaluator,
|
||||
IPA.user.has_subid_evaluator
|
||||
]
|
||||
},
|
||||
actions: [
|
||||
{
|
||||
$type: 'subid_generate',
|
||||
name: 'subid_generate',
|
||||
hide_cond: ['preserved-user', 'self-service-other'],
|
||||
enable_cond: ['no-subid']
|
||||
}
|
||||
],
|
||||
control_buttons: [
|
||||
{
|
||||
name: 'subid_generate',
|
||||
label: '@i18n:objects.user.auto_subid',
|
||||
icon: 'fa-plus'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
standard_association_facets: {
|
||||
@@ -1216,14 +1243,16 @@ IPA.user.subid_generate_action = function(spec) {
|
||||
var that = IPA.action(spec);
|
||||
|
||||
that.execute_action = function(facet) {
|
||||
|
||||
var subid_e = reg.entity.get('subid');
|
||||
var dialog = subid_e.get_dialog('add');
|
||||
dialog.open();
|
||||
if (!IPA.is_selfservice) {
|
||||
var owner = facet.get_pkey();
|
||||
dialog.get_field('ipaowner').set_value([owner]);
|
||||
}
|
||||
var owner = facet.get_pkey();
|
||||
var command = rpc.command({
|
||||
entity: 'subid',
|
||||
method: 'generate'
|
||||
});
|
||||
command.set_option('ipaowner', owner);
|
||||
command.on_success = function(data, text_status, xhr) {
|
||||
facet.refresh();
|
||||
};
|
||||
command.execute();
|
||||
};
|
||||
|
||||
return that;
|
||||
|
||||
Reference in new issue
Block a user