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 596ff76
Show file tree
Hide file tree
Showing 16 changed files with 658 additions and 202 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')]);
4 changes: 2 additions & 2 deletions app/resources/locales/en_US/field.po
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ msgid "ApiUsers.privileged.desc"
msgstr "A privileged API user has full access to the CO. Unprivileged API users may be granted specific permissions where supported."

msgid "ApiUsers.remote_ip.desc"
msgstr "If specified, a <a href="https://www.php.net/manual/en/reference.pcre.pattern.syntax.php">regular expression</a> describing the IP address(es) from which this API User may connect. Be sure to escape dots (eg: "/10\\.0\\.1\\.150/")."
msgstr "If specified, a <a href=\"https://www.php.net/manual/en/reference.pcre.pattern.syntax.php\">regular expression</a> describing the IP address(es) from which this API User may connect. Be sure to escape dots (eg: \"/10\\.0\\.1\\.150/\")."

msgid "ApiUsers.username.desc"
msgstr "The API User Name must be prefixed with the string \"co_#.\""
Expand Down Expand Up @@ -929,7 +929,7 @@ msgstr "If ticked, uniqueness checks for this Identifier Type will be case insen

msgid "Types.edupersonaffiliation.desc"
# XXX update link to PE wiki?
msgstr "Map the extended affiliation to this eduPersonAffiliation, see <a href="https://spaces.at.internet2.edu/display/COmanage/Extending+the+Registry+Data+Model#ExtendingtheRegistryDataModel-%7B%7BeduPersonAffiliation%7D%7DandExtendedAffiliations">eduPersonAffiliation and Extended Affiliations</a>"
msgstr "Map the extended affiliation to this eduPersonAffiliation, see <a href=\"https://spaces.at.internet2.edu/display/COmanage/Extending+the+Registry+Data+Model#ExtendingtheRegistryDataModel-%7B%7BeduPersonAffiliation%7D%7DandExtendedAffiliations\">eduPersonAffiliation and Extended Affiliations</a>"

msgid "Types.status.desc"
msgstr "Suspending a Type will prevent it from being assigned to new attributes, but will not remove it from existing attributes"
Expand Down
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 596ff76

Please sign in to comment.