mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-07-30 08:07:56 -05:00
webui: move host action panel actions to action dropdown
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
This commit is contained in:
@@ -550,7 +550,7 @@ IPA.cert.view_action = function(spec) {
|
||||
|
||||
spec = spec || {};
|
||||
spec.name = spec.name || 'view_cert';
|
||||
spec.label = spec.label || '@i18n:buttons.view';
|
||||
spec.label = spec.label || '@i18n:objects.cert.view_certificate_btn';
|
||||
spec.enable_cond = spec.enable_cond || ['has_certificate'];
|
||||
|
||||
var that = IPA.action(spec);
|
||||
@@ -583,7 +583,7 @@ IPA.cert.get_action = function(spec) {
|
||||
|
||||
spec = spec || {};
|
||||
spec.name = spec.name || 'get_cert';
|
||||
spec.label = spec.label || '@i18n:buttons.get';
|
||||
spec.label = spec.label || '@i18n:objects.cert.get_certificate';
|
||||
spec.enable_cond = spec.enable_cond || ['has_certificate'];
|
||||
|
||||
var that = IPA.action(spec);
|
||||
@@ -672,7 +672,7 @@ IPA.cert.revoke_action = function(spec) {
|
||||
|
||||
spec = spec || {};
|
||||
spec.name = spec.name || 'revoke_cert';
|
||||
spec.label = spec.label || '@i18n:buttons.revoke';
|
||||
spec.label = spec.label || '@i18n:objects.cert.revoke_certificate_simple';
|
||||
spec.enable_cond = spec.enable_cond || ['has_certificate'];
|
||||
spec.disable_cond = spec.disable_cond || ['certificate_revoked'];
|
||||
spec.hide_cond = spec.hide_cond || ['ra_disabled'];
|
||||
@@ -727,7 +727,7 @@ IPA.cert.restore_action = function(spec) {
|
||||
|
||||
spec = spec || {};
|
||||
spec.name = spec.name || 'restore_cert';
|
||||
spec.label = spec.label || '@i18n:buttons.restore';
|
||||
spec.label = spec.label || '@i18n:objects.cert.restore_certificate_simple';
|
||||
spec.enable_cond = spec.enable_cond || ['has_certificate', 'certificate_hold'];
|
||||
spec.hide_cond = spec.hide_cond || ['ra_disabled'];
|
||||
spec.confirm_msg = spec.confirm_msg || '@i18n:objects.cert.restore_confirmation';
|
||||
|
||||
@@ -117,11 +117,6 @@ return {
|
||||
},
|
||||
{
|
||||
name: 'enrollment',
|
||||
action_panel: {
|
||||
$factory: IPA.action_panel,
|
||||
name: 'enrollment_actions',
|
||||
actions: ['unprovision', 'set_otp', 'reset_otp']
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
$factory: IPA.host_keytab_widget,
|
||||
@@ -137,14 +132,6 @@ return {
|
||||
},
|
||||
{
|
||||
name: 'certificate',
|
||||
action_panel: {
|
||||
$factory: IPA.action_panel,
|
||||
name: 'cert_actions',
|
||||
actions: [
|
||||
'request_cert', 'view_cert', 'get_cert',
|
||||
'revoke_cert', 'restore_cert'
|
||||
]
|
||||
},
|
||||
fields: [
|
||||
{
|
||||
$type: 'certificate_status',
|
||||
@@ -194,7 +181,8 @@ return {
|
||||
'cert_revoke',
|
||||
'cert_restore'
|
||||
],
|
||||
header_actions: ['automember_rebuild'],
|
||||
header_actions: ['automember_rebuild', 'unprovision', 'set_otp', 'reset_otp',
|
||||
'request_cert', 'view_cert', 'get_cert', 'revoke_cert', 'restore_cert'],
|
||||
state: {
|
||||
evaluators: [
|
||||
IPA.host.has_password_evaluator,
|
||||
|
||||
@@ -209,6 +209,7 @@
|
||||
"find_validnotafter_to": "Valid not after to",
|
||||
"find_validnotbefore_from": "Valid not before from",
|
||||
"find_validnotbefore_to": "Valid not before to",
|
||||
"get_certificate": "Get Certificate",
|
||||
"issue_certificate": "Issue New Certificate for ${entity} ${primary_key}",
|
||||
"issued_by": "Issued By",
|
||||
"issued_on": "Issued On",
|
||||
@@ -242,7 +243,8 @@
|
||||
"unspecified": "Unspecified",
|
||||
"valid": "Valid Certificate Present",
|
||||
"validity": "Validity",
|
||||
"view_certificate": "Certificate for ${entity} ${primary_key}"
|
||||
"view_certificate": "Certificate for ${entity} ${primary_key}",
|
||||
"view_certificate_btn": "View Certificate"
|
||||
},
|
||||
"config": {
|
||||
"group": "Group Options",
|
||||
|
||||
@@ -343,6 +343,7 @@ class i18n_messages(Command):
|
||||
"find_validnotbefore_from": _("Valid not before from"),
|
||||
"find_validnotbefore_to": _("Valid not before to"),
|
||||
"fingerprints": _("Fingerprints"),
|
||||
"get_certificate": _("Get Certificate"),
|
||||
"issue_certificate": _("Issue New Certificate for ${entity} ${primary_key}"),
|
||||
"issued_by": _("Issued By"),
|
||||
"issued_on": _("Issued On"),
|
||||
@@ -377,6 +378,7 @@ class i18n_messages(Command):
|
||||
"valid": _("Valid Certificate Present"),
|
||||
"validity": _("Validity"),
|
||||
"view_certificate": _("Certificate for ${entity} ${primary_key}"),
|
||||
"view_certificate_btn": _("View Certificate"),
|
||||
},
|
||||
"config": {
|
||||
"group": _("Group Options"),
|
||||
|
||||
@@ -140,35 +140,35 @@ class test_host(host_tasks):
|
||||
self.assert_visible("div[name='certificate-missing']")
|
||||
|
||||
# cert request
|
||||
self.action_panel_action(panel, 'request_cert')
|
||||
self.action_list_action('request_cert', confirm=False)
|
||||
self.fill_text('textarea.certificate', csr)
|
||||
self.dialog_button_click('issue')
|
||||
self.wait_for_request(n=2, d=0.5)
|
||||
self.assert_visible("div[name='certificate-valid']")
|
||||
|
||||
# cert view
|
||||
self.action_panel_action(panel, 'view_cert')
|
||||
self.action_list_action('view_cert', confirm=False)
|
||||
self.wait()
|
||||
self.assert_text("tbody tr:nth-child(2) td:nth-child(2)", self.pkey)
|
||||
self.assert_text("tbody tr:nth-child(3) td:nth-child(2)", realm)
|
||||
self.dialog_button_click('close')
|
||||
|
||||
# cert get
|
||||
self.action_panel_action(panel, 'get_cert')
|
||||
self.action_list_action('get_cert', confirm=False)
|
||||
self.wait()
|
||||
# We don't know the cert text, so at least open and close the dialog
|
||||
self.dialog_button_click('close')
|
||||
|
||||
## cert revoke
|
||||
self.action_panel_action(panel, 'revoke_cert')
|
||||
# cert revoke
|
||||
self.action_list_action('revoke_cert', confirm=False)
|
||||
self.wait()
|
||||
self.select('select', '6')
|
||||
self.dialog_button_click('ok')
|
||||
self.wait_for_request(n=2)
|
||||
self.assert_visible("div[name='certificate-revoked']")
|
||||
|
||||
## cert restore
|
||||
self.action_panel_action(panel, 'restore_cert')
|
||||
# cert restore
|
||||
self.action_list_action('restore_cert', confirm=False)
|
||||
self.wait()
|
||||
self.dialog_button_click('ok')
|
||||
self.wait_for_request(n=2)
|
||||
@@ -191,13 +191,12 @@ class test_host(host_tasks):
|
||||
self.add_record(ENTITY, self.data)
|
||||
self.navigate_to_record(self.pkey)
|
||||
|
||||
panel = 'cert_actions'
|
||||
self.assert_action_panel_action(panel, 'request_cert', visible=False)
|
||||
self.assert_action_panel_action(panel, 'revoke_cert', visible=False)
|
||||
self.assert_action_panel_action(panel, 'restore_cert', visible=False)
|
||||
self.assert_action_list_action('request_cert', visible=False)
|
||||
self.assert_action_list_action('revoke_cert', visible=False)
|
||||
self.assert_action_list_action('restore_cert', visible=False)
|
||||
|
||||
self.assert_action_panel_action(panel, 'view_cert', enabled=False)
|
||||
self.assert_action_panel_action(panel, 'get_cert', enabled=False)
|
||||
self.assert_action_list_action('view_cert', enabled=False)
|
||||
self.assert_action_list_action('get_cert', enabled=False)
|
||||
|
||||
self.navigate_by_breadcrumb('Hosts')
|
||||
self.delete_record(self.pkey, self.data.get('del'))
|
||||
|
||||
Reference in New Issue
Block a user