Skip to content

Commit

Permalink
Provide Person-centric Group management; includes subnavigation refac…
Browse files Browse the repository at this point in the history
…toring (CFM-291) (#367)

* Provide Person-centric Group management; includes subnavigation refactoring (CFM-291)

* Simplify $subnav declaration (CFM-291)

* Hide top filters in person-centric Groups view (CFM-291)
  • Loading branch information
arlen authored Mar 13, 2026
1 parent 1d35e2c commit 2a37581
Show file tree
Hide file tree
Showing 130 changed files with 959 additions and 1,051 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ class ApiSourceEndpointsController extends StandardPluginController {
*/

public function beforeRender(\Cake\Event\EventInterface $event) {
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->ApiSourceEndpoints->Apis->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->ApiSourceEndpoints->Apis->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->ApiSourceEndpoints->Apis->getPrimaryKey());
}

$vv_obj = $this->viewBuilder()->getVar('vv_obj');

if(!empty($vv_obj->external_identity_source->api_source->id)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

namespace ApiConnector\Controller;

use Cake\Event\EventInterface;
use Cake\Routing\Router;
use App\Controller\StandardPluginController;

Expand All @@ -38,4 +39,25 @@ class ApiSourcesController extends StandardPluginController {
'ApiSources.id' => 'asc'
]
];

/**
* Callback run prior to the request render.
*
* @param EventInterface $event Cake Event
*
* @return Response|void
* @since COmanage Registry v5.0.0
*/

public function beforeRender(EventInterface $event) {
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->ApiSources->ExternalIdentitySources->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->ApiSources->ExternalIdentitySources->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->ApiSources->ExternalIdentitySources->getPrimaryKey());
}

return parent::beforeRender($event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class ApiSourcesTable extends Table {
use \App\Lib\Traits\PrimaryLinkTrait;
use \App\Lib\Traits\TableMetaTrait;
use \App\Lib\Traits\ValidationTrait;
use \App\Lib\Traits\TabTrait;

/**
* Perform Cake Model initialization.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@ if(!empty($vv_push_endpoint)) {
$fields = [
'external_identity_source_id'
];

$subnav = [
'tabs' => ['Apis', 'ApiConnector.ApiSourceEndpoints'],
'action' => [
'Apis' => ['edit'],
'ApiConnector.ApiSourceEndpoints' => ['edit']
]
];
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,12 @@ $fields = [
'subtitle' => __d('api_connector', 'field.ApiSources.push_mode')
]
];

$subnav = [
'tabs' => ['ExternalIdentitySources', 'ApiConnector.ApiSources', 'ExternalIdentitySources@action.search'],
'action' => [
'ExternalIdentitySources' => ['edit', 'view', 'search'],
'ApiConnector.ApiSources' => ['edit'],
'ExternalIdentitySources@action.search' => [],
],
];
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,33 @@
namespace FileConnector\Controller;

use App\Controller\StandardPluginController;
use Cake\Event\EventInterface;

class FileProvisionersController extends StandardPluginController {
protected array $paginate = [
'order' => [
'FileProvisioners.id' => 'asc'
]
];

/**
* Callback run prior to the request render.
*
* @param EventInterface $event Cake Event
*
* @return Response|void
* @since COmanage Registry v5.0.0
*/

public function beforeRender(EventInterface $event) {
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->FileProvisioners->ProvisioningTargets->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->FileProvisioners->ProvisioningTargets->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->FileProvisioners->ProvisioningTargets->getPrimaryKey());
}

return parent::beforeRender($event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class FileSourcesTable extends Table {
use \App\Lib\Traits\PrimaryLinkTrait;
use \App\Lib\Traits\TableMetaTrait;
use \App\Lib\Traits\ValidationTrait;
use \App\Lib\Traits\TabTrait;

// Cache of the field configuration
protected $fieldCfg = null;
Expand Down Expand Up @@ -89,23 +88,6 @@ public function initialize(array $config): void {
]
]);

// All the tabs share the same configuration in the ModelTable file
$this->setTabsConfig(
[
// Ordered list of Tabs
'tabs' => ['ExternalIdentitySources', 'FileConnector.FileSources', 'ExternalIdentitySources@action.search'],
// What actions will include the subnavigation header
'action' => [
// If a model renders in a subnavigation mode in edit/view mode, it cannot
// render in index mode for the same use case/context
// XXX edit should go first.
'ExternalIdentitySources' => ['edit', 'view', 'search'],
'FileConnector.FileSources' => ['edit'],
'ExternalIdentitySources@action.search' => [],
],
]
);

$this->setPermissions([
// Actions that operate over an entity (ie: require an $id)
'entity' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@

$fields = [
'filename'
];
];

$subnav = [
'tabs' => ['ProvisioningTargets', 'FileConnector.FileProvisioners'],
'action' => [
'ProvisioningTargets' => ['edit'],
'FileConnector.FileProvisioners' => ['edit']
]
];
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,12 @@ $fields = [
'threshold_check',
'threshold_override',
];

$subnav = [
'tabs' => ['ExternalIdentitySources', 'FileConnector.FileSources', 'ExternalIdentitySources@action.search'],
'action' => [
'ExternalIdentitySources' => ['edit', 'view', 'search'],
'FileConnector.FileSources' => ['edit'],
'ExternalIdentitySources@action.search' => [],
],
];
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,33 @@
namespace KerberosConnector\Controller;

use App\Controller\StandardPluginController;
use Cake\Event\EventInterface;

class KerberosServersController extends StandardPluginController {
protected array $paginate = [
'order' => [
'KerberosServers.hostname' => 'asc'
]
];

/**
* Callback run prior to the request render.
*
* @param EventInterface $event Cake Event
*
* @return Response|void
* @since COmanage Registry v5.0.0
*/

public function beforeRender(EventInterface $event) {
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->KerberosServers->Servers->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->KerberosServers->Servers->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->KerberosServers->Servers->getPrimaryKey());
}

return parent::beforeRender($event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ $fields = [
'keytab_path'
];

$subnav = [
'tabs' => ['Servers', 'KerberosConnector.KerberosServers'],
'action' => [
'Servers' => ['edit'],
'KerberosConnector.KerberosServers' => ['edit']
]
];
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,33 @@
namespace PasswordAuthenticator\Controller;

use App\Controller\StandardPluginController;
use Cake\Event\EventInterface;

class PasswordAuthenticatorsController extends StandardPluginController {
protected array $paginate = [
'order' => [
'PasswordAuthenticators.id' => 'asc'
]
];

/**
* Callback run prior to the request render.
*
* @param EventInterface $event Cake Event
*
* @return Response|void
* @since COmanage Registry v5.0.0
*/

public function beforeRender(EventInterface $event) {
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->PasswordAuthenticators->Authenticators->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->PasswordAuthenticators->Authenticators->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->PasswordAuthenticators->Authenticators->getPrimaryKey());
}

return parent::beforeRender($event);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ $fields = [
'format_plaintext'
];

$subnav = [
'tabs' => ['Authenticators', 'PasswordAuthenticator.PasswordAuthenticators'],
'action' => [
'Authenticators' => ['edit'],
'PasswordAuthenticator.PasswordAuthenticators' => ['edit']
]
]

?>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
namespace SqlConnector\Controller;

use App\Controller\StandardPluginController;
use Cake\Event\EventInterface;

class SqlProvisionersController extends StandardPluginController {
protected array $paginate = [
Expand All @@ -38,6 +39,27 @@ class SqlProvisionersController extends StandardPluginController {
]
];

/**
* Callback run prior to the request render.
*
* @param EventInterface $event Cake Event
*
* @return Response|void
* @since COmanage Registry v5.0.0
*/

public function beforeRender(EventInterface $event) {
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->SqlProvisioners->ProvisioningTargets->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->SqlProvisioners->ProvisioningTargets->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->SqlProvisioners->ProvisioningTargets->getPrimaryKey());
}

return parent::beforeRender($event);
}

/**
* Reapply the target database schema.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class SqlSourcesTable extends Table {
use \App\Lib\Traits\PermissionsTrait;
use \App\Lib\Traits\PrimaryLinkTrait;
use \App\Lib\Traits\QueryModificationTrait;
use \App\Lib\Traits\TabTrait;
use \App\Lib\Traits\TableMetaTrait;
use \App\Lib\Traits\ValidationTrait;

Expand Down Expand Up @@ -157,23 +156,6 @@ public function initialize(array $config): void {
]
]);

// All the tabs share the same configuration in the ModelTable file
$this->setTabsConfig(
[
// Ordered list of Tabs
'tabs' => ['ExternalIdentitySources', 'SqlConnector.SqlSources', 'ExternalIdentitySources@action.search'],
// What actions will include the subnavigation header
'action' => [
// If a model renders in a subnavigation mode in edit/view mode, it cannot
// render in index mode for the same use case/context
// XXX edit should go first.
'ExternalIdentitySources' => ['edit', 'view', 'search'],
'SqlConnector.SqlSources' => ['edit'],
'ExternalIdentitySources@action.search' => [],
],
]
);

$this->setPermissions([
// Actions that operate over an entity (ie: require an $id)
'entity' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ $fields = [
]
];

$subnav = [
'tabs' => ['ProvisioningTargets', 'SqlConnector.SqlProvisioners'],
'action' => [
'ProvisioningTargets' => ['edit'],
'SqlConnector.SqlProvisioners' => ['edit']
]
];

// Top Links
$topLinks = [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ $fields = array_merge($fields, [
'threshold_override'
]);

$subnav = [
'tabs' => ['ExternalIdentitySources', 'SqlConnector.SqlSources', 'ExternalIdentitySources@action.search'],
'action' => [
'ExternalIdentitySources' => ['edit', 'view', 'search'],
'SqlConnector.SqlSources' => ['edit'],
'ExternalIdentitySources@action.search' => [],
],
];

?>

<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,15 @@ class MatchCallbacksController extends StandardPluginController {
*/

public function beforeRender(EventInterface $event) {
// Generate the callback URL
$link = $this->getPrimaryLink(true);

if(!empty($link->value)) {
$this->set('vv_bc_parent_obj', $this->MatchCallbacks->Apis->get($link->value));
$this->set('vv_bc_parent_displayfield', $this->MatchCallbacks->Apis->getDisplayField());
$this->set('vv_bc_parent_primarykey', $this->MatchCallbacks->Apis->getPrimaryKey());
}

// Generate the callback URL
$this->set('vv_api_endpoint', \Cake\Routing\Router::url('/', true) . 'api/match/' . $this->getCOID() . '/v1/resolution');

return parent::beforeRender($event);
Expand Down
Loading

0 comments on commit 2a37581

Please sign in to comment.