From 7c078aae8061d7c3a864eb54e9dd0620d84f07c8 Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Mon, 14 Oct 2024 18:26:15 +0300 Subject: [PATCH] Fix tab rendering for EnrollmentFlow plugins (#235) * Fix tab rendering for EnrollmentFlow plugins * Improve getLayout trait * fix enrollment attributes add/edit view title --- .../Model/Table/AttributeCollectorsTable.php | 27 +++++-------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php index 2c1699ddf..e7f74a3e0 100644 --- a/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php +++ b/app/plugins/CoreEnroller/src/Model/Table/AttributeCollectorsTable.php @@ -40,6 +40,7 @@ class AttributeCollectorsTable extends Table { use \App\Lib\Traits\AutoViewVarsTrait; use \App\Lib\Traits\CoLinkTrait; + use \App\Lib\Traits\LayoutTrait; use \App\Lib\Traits\PermissionsTrait; use \App\Lib\Traits\PrimaryLinkTrait; use \App\Lib\Traits\TabTrait; @@ -79,33 +80,17 @@ public function initialize(array $config): void { $this->setTabsConfig( [ // Ordered list of Tabs - 'tabs' => ['EnrollmentFlows', 'EnrollmentFlowSteps', 'Petitions'], + 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.AttributeCollectors', 'CoreEnroller.EnrollmentAttributes'], // What actions will inlcude 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. - 'EnrollmentFlows' => ['edit', 'view'], - 'EnrollmentFlowSteps' => ['index'], - 'Petitions' => ['index'], + 'EnrollmentFlowSteps' => ['edit', 'view'], + 'CoreEnroller.AttributeCollectors' => ['edit'], + 'CoreEnroller.EnrollmentAttributes' => ['index'], ], - // What model will have a counter-badge after the tab title - 'counter' => ['EnrollmentFlowSteps', 'Petitions'], - 'nested' => [ - // Ordered list of Tabs - 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.AttributeCollectors', 'CoreEnroller.EnrollmentAttributes'], - // 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. - 'EnrollmentFlowSteps' => ['edit', 'view'], - 'CoreEnroller.AttributeCollectors' => ['edit'], - 'CoreEnroller.EnrollmentAttributes' => ['index'] - ], - // What model will have a counter-badge after the tab title - 'counter' => ['CoreEnroller.EnrollmentAttributes'], - ] + 'skipTab' => ['CoreEnroller.AttributeCollectors'] ] );