Skip to content

Commit

Permalink
Person canvas add/edit modal forms (CFM-249) (#88)
Browse files Browse the repository at this point in the history
* Provide modal add/edit for person canvas vuejs components (CFM-249)

* Post-rebase cleanup to ensure Add menu works with vue components and modal (CFM-249)

* Set MVEAs to redirect to "self" (CFM-249)

* Set MVEAs to default to the "iframe" layout (CFM-249)

* Hide secondary subnavigation on Person Canvas (CFM-249)

* Trival cleanup of deprecated code and comments (CFM-249)

* Ensure Groups subnavigation doesn't complain of missing variables (CFM-249)

* Move MVEA canvas attributes into fields-nav.inc. Rename canvas from "person" to "mvea" for more generic treatment across views. (CFM-249)

* Move MVEA Canvas below standard edit form. Make the canvas available to External Identities. (CFM-249)

* Clean up External Id subnavigation (CFM-249)

* Add MVEA Canvas to Person Roles (CFM-249)

* Stylistic cleanup (CFM-249)

* First pass for cleanup and simplification of subnavigation and titles (CFM-249)

* Fix conflicting modal dialog ID (CFM-249)

* Turn off global person canvas Actions menu (CFM-249)

* Remove rowActions no longer needed for the Person pages (CFM-249)

* Enable ESC from within iframe to hide the MVEA modal window (CFM-249)

* Provide a default title for the MVEA modal window (CFM-249)
  • Loading branch information
arlen authored May 1, 2023
1 parent 16aec3e commit 56634ce
Show file tree
Hide file tree
Showing 33 changed files with 934 additions and 465 deletions.
6 changes: 6 additions & 0 deletions app/resources/locales/en_US/information.po
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ msgstr "Active, Cannot Be Disabled"
msgid "plugin.inactive"
msgstr "Inactive"

msgid "global.attribute.modal"
msgstr "Attribute Modal"

msgid "global.attributes"
msgstr "Attributes"

msgid "global.records.none"
msgstr "There are no records to display."

Expand Down
3 changes: 0 additions & 3 deletions app/resources/locales/en_US/menu.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

# Menu Messages

msgid "co.Attributes"
msgstr "Attributes"

msgid "co.configuration"
msgstr "Configuration"

Expand Down
5 changes: 5 additions & 0 deletions app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
}

$this->set('vv_template_path', $vv_template_path);

// Check to see if the model names a specific layout
if(method_exists($table, "getLayout")) {
$this->viewBuilder()->setLayout($table->getLayout());
}

return parent::beforeRender($event);
}
Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/AdHocAttributesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,26 @@ class AdHocAttributesTable extends Table {
use \App\Lib\Traits\ValidationTrait;
use \App\Lib\Traits\SearchFilterTrait;

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/AddressesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ class AddressesTable extends Table {
]
];

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/EmailAddressesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,26 @@ class EmailAddressesTable extends Table {
]
];

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
7 changes: 4 additions & 3 deletions app/src/Model/Table/ExternalIdentitiesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,15 @@ public function initialize(array $config): void {
// XXX does some of this stuff really belong in the controller?
$this->setEditContains([
'PrimaryName',
/* 'Addresses',
'Addresses',
'AdHocAttributes',
'EmailAddresses',
'Identifiers',
'Names',
'PersonRoles',
//'ExternalIdentityRoles',
'Pronouns',
'TelephoneNumbers',
'Urls'*/
'Urls'
]);
$this->setIndexContains(['PrimaryName']);

Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/IdentifiersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ class IdentifiersTable extends Table {
]
];

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/NamesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,26 @@ class NamesTable extends Table {
]
];

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
3 changes: 2 additions & 1 deletion app/src/Model/Table/PeopleTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ public function initialize(array $config): void {
'EmailAddresses',
'Identifiers',
'Names',
'PersonRoles',
//'PersonRoles',
'Pronouns',
'TelephoneNumbers',
'Urls'
]);
Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/PronounsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ class PronounsTable extends Table {
]
];

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/TelephoneNumbersTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ class TelephoneNumbersTable extends Table {
]
];

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
20 changes: 20 additions & 0 deletions app/src/Model/Table/UrlsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,26 @@ class UrlsTable extends Table {
]
];

/**
* Provide the default layout
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getLayout(): string {
return "iframe";
}

/**
* Provide the default redirect goal
*
* @since COmanage Registry v5.0.0
* @return string Type of redirect
*/
public function getRedirectGoal(): string {
return "self";
}

/**
* Perform Cake Model initialization.
*
Expand Down
3 changes: 3 additions & 0 deletions app/src/View/Helper/VueHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class VueHelper extends Helper {
'information' => [
'global.value.none',
'datepicker.hour'
],
'operation' => [
'close'
]
];

Expand Down
70 changes: 70 additions & 0 deletions app/templates/ExternalIdentities/fields-nav.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// List the MVEAs that may be shown on the mveaCanvas
// When this array exists, the mveaCanvas.php element will render
$mveas = [
'names',
'email_addresses',
'identifiers',
'ad_hoc_attributes',
'addresses',
'telephone_numbers',
'urls',
'pronouns'
];

// Name the MVEAs Entity Type
$mveasEntityType = "external_identity";

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [
[
Expand All @@ -42,6 +58,60 @@ $topLinks = [
]
];

// $addMenuLinks is also given slightly different treatment from the typical $topLinks found in most views:
// it is a page-global menu used for adding MVEAs and is given special treatment in element/mveaCanvas.php.
$addMenuLinks = [
[
'controller' => 'names',
'action' => 'add',
'icon' => 'account_box',
'iconClass' => 'material-icons-outlined'
],
[
'controller' => 'email_addresses',
'action' => 'add',
'icon' => 'email',
'iconClass' => 'material-icons-outlined'
],
[
'controller' => 'identifiers',
'action' => 'add',
'icon' => 'fingerprint'
],
[
'controller' => 'ad_hoc_attributes',
'action' => 'add',
'icon' => 'check_box',
'iconClass' => 'material-icons-outlined'
],
[
'controller' => 'addresses',
'action' => 'add',
'icon' => 'contact_mail',
'iconClass' => 'material-icons-outlined'
],
[
'controller' => 'history_records',
'action' => 'add',
'icon' => 'history'
],
[
'controller' => 'pronouns',
'action' => 'add',
'icon' => 'transgender'
],
[
'controller' => 'telephone_numbers',
'action' => 'add',
'icon' => 'phone'
],
[
'controller' => 'urls',
'action' => 'add',
'icon' => 'link'
]
];

$subnav = [
'name' => 'person',
'active' => 'external_identities',
Expand Down
Loading

0 comments on commit 56634ce

Please sign in to comment.