Skip to content

Provide subnavigation and iframe layout for Enrollment Flow Plugin configs (CFM-428) #258

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
54b502e
Initial implementation of Enrollment Flow infrastructure and Attribut…
Feb 27, 2024
ddf9eb7
Add top-level subnavigation to Enrollment Flow and Enrollment Flow St…
arlen Mar 7, 2024
253d876
Add titles to Petition steps and buttons to the steps index (CFM-31) …
arlen Mar 13, 2024
d1f5e65
Simplify end-user Petition views (CFM-31) (#175)
arlen Mar 13, 2024
d8f009f
Post-rebase vs. develop corrections (CFM-31)
arlen Aug 14, 2024
7d15da5
Correct test for $rowActions post-rebase. (CFM-31)
arlen Sep 24, 2024
530887e
feature-cfm31-subnavigation (#217)
Ioannis Sep 26, 2024
65f3e68
Ensure a title exists on Petition start, dispatch, and resume (CFM-31…
arlen Sep 27, 2024
d626f21
Remove unnecessary top-link from Enrollment Flow properties (CFM-31) …
arlen Sep 27, 2024
5563c85
fix deep nested navigation tab id calculation
Ioannis Sep 28, 2024
8ea1bea
Set petition titles (Enrollment Flow name, Flow Step description) in …
arlen Sep 30, 2024
22e3bc3
Cleanup to subnavigation and titling (CFM-31) (#229)
arlen Oct 2, 2024
89f15c0
Initial implementation of BasicAttributeCollector (CFM-415) (#231)
benno Oct 3, 2024
dc8285c
Subnavigation fixes (#230)
Ioannis Oct 3, 2024
7c078aa
Fix tab rendering for EnrollmentFlow plugins (#235)
Ioannis Oct 14, 2024
e46e9e4
Fix use case:Plugin.Hierarchy deep nested when no hasMany association.
Ioannis Oct 15, 2024
8cac2d9
Check for hasMany associations before rendering a tab
Ioannis Oct 16, 2024
aa3b03b
Initial commit of Mostly Static Pages (CFM-62), InvitationAccepter (C…
Oct 31, 2024
d90ba02
First pass at cleaning up Petition view (CFM-31) (#246)
arlen Nov 8, 2024
cfe18b1
Add support for attribute collection fieldsets (#244)
Ioannis Nov 13, 2024
e856f0b
method parameters must not come before the required ones as of php 8.1
Ioannis Nov 15, 2024
5734a91
Add special "Start" button to Enrollment Flow views (CFM-428) (#251)
arlen Nov 21, 2024
bfaebab
Initial commit of Email Verifier Enroller Plugin (CFM-333)
Nov 28, 2024
0edf63a
Additional commit for CFM-333
Nov 28, 2024
ebd4c3c
Provide subnavigation and iframe layout for EmailVerifiers and Invita…
arlen Dec 4, 2024
ac3c156
Provide subnavigation and iframe layout for IdentifierCollectors (CFM…
arlen Dec 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
85 changes: 85 additions & 0 deletions app/config/schema/schema.json
Expand Up @@ -544,6 +544,91 @@
}
},

"enrollment_flows": {
"columns": {
"id": {},
"co_id": {},
"name": {},
"status": {},
"sor_label": {},
"authz_type": { "type": "string", "size": 2 },
"authz_cou_id": { "type": "integer", "foreignkey": { "table": "cous", "column": "id" }},
"authz_group_id": { "type": "integer", "foreignkey": { "table": "groups", "column": "id" }},
"collect_enrollee_email": { "type": "boolean" },
"redirect_on_finalize": { "type": "string", "size": 256 }
},
"indexes": {
"enrollment_flows_i1": { "columns": [ "co_id" ]},
"enrollment_flows_i2": { "needed": false, "columns": [ "authz_cou_id" ]},
"enrollment_flows_i3": { "needed": false, "columns": [ "authz_group_id" ]}
}
},

"enrollment_flow_steps": {
"columns": {
"id": {},
"enrollment_flow_id": { "type": "integer", "foreignkey": { "table": "enrollment_flows", "column": "id" }},
"description": {},
"status": {},
"plugin": {},
"ordr": {},
"actor_type": { "type": "string", "size": 2 }
},
"indexes": {
"enrollment_flow_steps_i1": { "columns": [ "enrollment_flow_id" ]}
}
},

"petitions": {
"columns": {
"id": {},
"enrollment_flow_id": { "type": "integer", "foreignkey": { "table": "enrollment_flows", "column": "id" }},
"status": {},
"cou_id": {},
"enrollee_email": { "type": "string", "size": 256 },
"enrollee_identifier": { "type": "string", "size": 256 },
"enrollee_person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" }},
"petitioner_identifier": { "type": "string", "size": 256 },
"petitioner_person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" }},
"token": { "type": "string", "size": 256 }
},
"indexes": {
"petitions_i1": { "columns": [ "enrollment_flow_id" ]},
"petitions_i2": { "columns": [ "cou_id" ]},
"petitions_i3": { "columns": [ "enrollee_person_id" ]},
"petitions_i4": { "columns": [ "petitioner_person_id" ]}
}
},

"petition_step_results": {
"columns": {
"id": {},
"petition_id": {},
"enrollment_flow_step_id": {},
"comment": {}
},
"indexes": {
"petition_step_results_i1": { "columns": [ "petition_id" ] },
"petition_step_results_i2": { "needed": false, "columns": [ "enrollment_flow_step_id" ] }
}
},

"petition_history_records": {
"columns": {
"id": {},
"petition_id": {},
"enrollment_flow_step_id": {},
"action": {},
"comment": {},
"actor_person_id": { "type": "integer", "foreignkey": { "table": "people", "column": "id" } }
},
"indexes": {
"petition_history_records_i1": { "columns": [ "petition_id" ] },
"petition_history_records_i2": { "columns": [ "actor_person_id" ] },
"petition_history_records_i3": { "needed": false, "columns": [ "enrollment_flow_step_id" ] }
}
},

"message_templates": {
"columns": {
"id": {},
Expand Down
Expand Up @@ -41,6 +41,27 @@ class EmailVerifiersController extends StandardEnrollerController {
'EmailVerifiers.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(\Cake\Event\EventInterface $event) {
$link = $this->getPrimaryLink(true);

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

return parent::beforeRender($event);
}

/**
* Dispatch an Enrollment Flow Step.
Expand Down
Expand Up @@ -38,6 +38,27 @@ class IdentifierCollectorsController extends StandardEnrollerController {
'IdentifierCollectors.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(\Cake\Event\EventInterface $event) {
$link = $this->getPrimaryLink(true);

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

return parent::beforeRender($event);
}

/**
* Dispatch an Enrollment Flow Step.
Expand Down
Expand Up @@ -39,6 +39,27 @@ class InvitationAcceptersController extends StandardEnrollerController {
'InvitationAccepters.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(\Cake\Event\EventInterface $event) {
$link = $this->getPrimaryLink(true);

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

return parent::beforeRender($event);
}

/**
* Dispatch an Enrollment Flow Step.
Expand Down
Expand Up @@ -81,7 +81,7 @@ public function initialize(array $config): void {
[
// Ordered list of Tabs
'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.AttributeCollectors', 'CoreEnroller.EnrollmentAttributes'],
// What actions will inlcude the subnavigation header
// 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
Expand Down
20 changes: 19 additions & 1 deletion app/plugins/CoreEnroller/src/Model/Table/EmailVerifiersTable.php
Expand Up @@ -46,10 +46,12 @@
class EmailVerifiersTable extends Table {
use \App\Lib\Traits\AutoViewVarsTrait;
use \App\Lib\Traits\CoLinkTrait;
use \App\Lib\Traits\LabeledLogTrait;
use \App\Lib\Traits\LabeledLogTrait;
use \App\Lib\Traits\LayoutTrait;
use \App\Lib\Traits\PermissionsTrait;
use \App\Lib\Traits\PrimaryLinkTrait;
use \App\Lib\Traits\TableMetaTrait;
use \App\Lib\Traits\TabTrait;
use \App\Lib\Traits\ValidationTrait;

/**
Expand Down Expand Up @@ -83,6 +85,22 @@ public function initialize(array $config): void {
$this->setPrimaryLink('enrollment_flow_step_id');
$this->setRequiresCO(true);
$this->setAllowLookupPrimaryLink(['dispatch', 'display']);

// All the tabs share the same configuration in the ModelTable file
$this->setTabsConfig(
[
// Ordered list of Tabs
'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.EmailVerifiers'],
// 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.EmailVerifiers' => ['edit']
]
]
);

$this->setAutoViewVars([
'modes' => [
Expand Down
Expand Up @@ -40,9 +40,11 @@
class IdentifierCollectorsTable 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\TableMetaTrait;
use \App\Lib\Traits\TabTrait;
use \App\Lib\Traits\ValidationTrait;

/**
Expand Down Expand Up @@ -75,7 +77,23 @@ public function initialize(array $config): void {
$this->setPrimaryLink('enrollment_flow_step_id');
$this->setRequiresCO(true);
$this->setAllowLookupPrimaryLink(['dispatch', 'display']);


// All the tabs share the same configuration in the ModelTable file
$this->setTabsConfig(
[
// Ordered list of Tabs
'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.IdentifierCollectors'],
// 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.IdentifierCollectors' => ['edit']
]
]
);

$this->setAutoViewVars([
'types' => [
'type' => 'type',
Expand Down
Expand Up @@ -41,9 +41,11 @@

class InvitationAcceptersTable extends Table {
use \App\Lib\Traits\CoLinkTrait;
use \App\Lib\Traits\LayoutTrait;
use \App\Lib\Traits\PermissionsTrait;
use \App\Lib\Traits\PrimaryLinkTrait;
use \App\Lib\Traits\TableMetaTrait;
use \App\Lib\Traits\TabTrait;
use \App\Lib\Traits\ValidationTrait;

/**
Expand Down Expand Up @@ -75,6 +77,22 @@ public function initialize(array $config): void {
$this->setPrimaryLink('enrollment_flow_step_id');
$this->setRequiresCO(true);
$this->setAllowLookupPrimaryLink(['dispatch', 'display']);

// All the tabs share the same configuration in the ModelTable file
$this->setTabsConfig(
[
// Ordered list of Tabs
'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.InvitationAccepters'],
// 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.InvitationAccepters' => ['edit']
]
]
);

$this->setPermissions([
// Actions that operate over an entity (ie: require an $id)
Expand Down
35 changes: 34 additions & 1 deletion app/src/Lib/Traits/TabTrait.php
@@ -1,6 +1,10 @@
<?php
/**
<<<<<<<< HEAD:app/src/Lib/Traits/TabTrait.php
* COmanage Registry Tab Trait
========
* COmanage Registry Tab Subnav Element
>>>>>>>> 9a427e22 (feature-cfm31-subnavigation (#217)):app/templates/element/subnavigation/inlineList.php
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
Expand All @@ -25,8 +29,10 @@
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/


declare(strict_types = 1);

<<<<<<<< HEAD:app/src/Lib/Traits/TabTrait.php
namespace App\Lib\Traits;

trait TabTrait
Expand Down Expand Up @@ -68,4 +74,31 @@ public function setTabsConfig(array $tabsConfig): void
$this->tabsConfig = $tabsConfig;
}

}
}
========
$curAction = $this->request->getParam('action');
$curController = $this->request->getParam('controller');
$isNested = true;

extract($vv_sub_nav_attributes, EXTR_PREFIX_ALL, 'vv_subnavigation');

$curId = $this->request->getQuery($vv_primary_link)
?? $vv_obj->id
?? end($vv_bc_title_links[0]['target']);
?>

<?php foreach($vv_subnavigation_nested['tabs'] as $tab): ?>
<li class="list-inline-item">
<?php
// Construct Element Title
$title = $this->element('subnavigation/tabTitle', compact('tab', 'curId', 'isNested'));
// Construct Target URL
$url = $this->Tab->constructLinkUrl($tab, $curId, $isNested);
// Calculate Tab Style Class(es)
$linkClass = $this->Tab->getLinkClass($tab, $isNested);
// Import <a> element in the DOM
print $this->Html->link($title, $url, ['class' => $linkClass, 'escape' => false]);
?>
</li>
<?php endforeach; ?>
>>>>>>>> 9a427e22 (feature-cfm31-subnavigation (#217)):app/templates/element/subnavigation/inlineList.php