Skip to content

Commit

Permalink
Breadcrumb improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Sep 16, 2025
1 parent 1d18bdb commit 45e0458
Show file tree
Hide file tree
Showing 15 changed files with 670 additions and 199 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,34 @@
namespace SqlConnector\Controller;

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

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

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

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

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

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

Expand Down Expand Up @@ -145,6 +146,23 @@ 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 @@ -77,7 +77,12 @@ public function add() {
$this->set('vv_obj', $obj);

// Default title is add new object
[$title, $supertitle, $subtitle] = StringUtilities::entityAndActionToTitle($obj, 'SshKeys', 'add');
[$title, $supertitle, $subtitle] = StringUtilities::entityAndActionToTitle(
$obj,
'SshKeys',
'add',
'ssh_key_authenticator'
);
$this->set('vv_title', $title);
$this->set('vv_supertitle', $supertitle);
$this->set('vv_subtitle', $subtitle);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,9 @@
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

declare(strict_types = 1);

$this->Field->disableFormEditMode();

// There are currently no configurable options for the SSH Key Authenticator
print $this->element('notify/banner', ['info' => __d('information', 'plugin.config.none')]);
2 changes: 1 addition & 1 deletion app/src/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function getCOID(): ?int {
* @since COmanage Registry v5.2.0
* @return \Cake\ORM\Table
*/
protected function getCurrentTable(): \Cake\ORM\Table
public function getCurrentTable(): \Cake\ORM\Table
{
/** @var string $modelsName */
$modelsName = $this->getName();
Expand Down
Loading

0 comments on commit 45e0458

Please sign in to comment.