Skip to content

Commit

Permalink
Index view improvements (CFM-189) (#44)
Browse files Browse the repository at this point in the history
* Index view improvements (CFM-189):
- Move index row actions into an "actions.inc" file;
- Move actions into a dropdown menu to the left of the index rows;
- Establish a convention for a row-link using the first link or relatedLink available in the indexColumns[];
- Add "bulk" action switch and checkboxes;
- Remove Edit, View, and Delete from the default set of index actions: edit and view are available from the row-link, delete is available from entity edit page (or bulk actions).

* Fix typo in comment (CFM-189)

* Represent read-only items in index with lock icon (CFM-189)

* Change read-only rows in index to use "edit_off" icon (CFM-189)
  • Loading branch information
arlen authored Aug 30, 2022
1 parent aa74603 commit b439757
Show file tree
Hide file tree
Showing 29 changed files with 893 additions and 537 deletions.
5 changes: 5 additions & 0 deletions app/templates/AdHocAttributes/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ $indexColumns = [
'type' => 'echo'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/Addresses/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ $indexColumns = [
'class' => 'LanguageEnum'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/ApiUsers/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,8 @@ if($vv_cur_co->id > 1) {
$indexColumns['valid_through'] = [
'type' => 'datetime'
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
39 changes: 39 additions & 0 deletions app/templates/Cos/actions.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* COmanage Registry COS Actions Menu Configuration
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// Index top-links appear as top links in the index view
$indexTopLinks = [];

// Actions appear as row-level menu items in the index view gear icon and as a tab menu or top-link menu on
// edit and view pages based on user permissions (TODO).
$actions = [
[
'action' => 'duplicate',
'class' => '',
'icon' => 'content_copy'
]
];
9 changes: 3 additions & 6 deletions app/templates/Cos/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ $indexColumns = [
]
];

$indexActions = [
[
'action' => 'duplicate',
'class' => '',
'icon' => 'content_copy'
]
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/Cous/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ $indexColumns = [
'type' => 'echo'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/EmailAddresses/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,8 @@ $indexColumns = [
'type' => 'fk'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/ExternalIdentities/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ $indexColumns = [
'sortable' => 'PrimaryName.family'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/ExternalIdentityRoles/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,8 @@ $indexColumns = [
'sortable' => true
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/GroupMembers/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ $indexColumns = [
'valid_through' => [
'type' => 'datetime'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/GroupNestings/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ $indexColumns = [
'model' => 'target_group',
'field' => 'name'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/GroupOwners/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ $indexColumns = [
// XXX not clear how to sort on submodel, but maybe just leave it for UX revisions?
// 'sortable' => 'PrimaryName.family'
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
73 changes: 73 additions & 0 deletions app/templates/Groups/actions.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php
/**
* COmanage Registry Groups Actions Menu Configuration
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// Index top-links appear as top links in the index view
$indexTopLinks = [];

// Actions appear as row-level menu items in the index view gear icon and as a tab menu or top-link menu on
// edit and view pages based on user permissions (TODO).

// TODO: Merge this with tabs (and top-links) available on the add-edit-view page (CFM-192 (and CO-647))
// TODO: Note that this is already marked up for 'tab' or 'topLink' for use in CFM-192.
$actions = [
[
'controller' => 'group_members',
'action' => 'index',
'icon' => 'people',
'type' => 'tab'
],
[
'controller' => 'group_owners',
'action' => 'index',
'icon' => 'settings',
'type' => 'tab'
],
[
'controller' => 'group_nestings',
'action' => 'index',
'icon' => 'group_add',
'type' => 'tab'
],
[
'controller' => 'history_records',
'action' => 'index',
'icon' => 'history',
'type' => 'tab'
],
[
'controller' => 'identifiers',
'action' => 'index',
'icon' => 'label',
'if' => 'notAutomatic',
'type' => 'tab'
],
[
'action' => 'reconcile',
'icon' => 'sync',
'type' => 'top-link'
]
];
37 changes: 3 additions & 34 deletions app/templates/Groups/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,38 +39,7 @@ $indexColumns = [
]
];

// XXX This should show on fields.inc and more generally perhaps we should merge
// this with the set of buttons available on the add-edit-view page (maybe just
// have that page use $indexActions?) (CO-647)
$indexActions = [
[
'controller' => 'group_members',
'action' => 'index',
'icon' => 'people',
],
[
'controller' => 'group_owners',
'action' => 'index',
'icon' => 'settings'
],
[
'controller' => 'group_nestings',
'action' => 'index',
'icon' => 'group_add'
],
[
'controller' => 'history_records',
'action' => 'index',
'icon' => 'history'
],
[
'controller' => 'identifiers',
'action' => 'index',
'icon' => 'label',
'if' => 'notAutomatic'
],
[
'action' => 'reconcile',
'icon' => 'sync'
]
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
2 changes: 1 addition & 1 deletion app/templates/HistoryRecords/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

$indexColumns = [
'id' => [
'type' => 'echo'
'type' => 'link'
],
'created' => [
'type' => 'datetime'
Expand Down
17 changes: 11 additions & 6 deletions app/templates/Identifiers/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,22 @@ $indexColumns = [
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$indexActions = [
[
'controller' => 'authentication_events',
'action' => 'index',
'icon' => 'person',
'if' => 'isLogin',
'query' => function ($e) {
return [
'authenticated_identifier' =>
\App\Lib\Util\StringUtilities::urlbase64encode($e->identifier)
];
}
'query' => function ($e) {
return [
'authenticated_identifier' =>
\App\Lib\Util\StringUtilities::urlbase64encode($e->identifier)
];
}
]
];
39 changes: 39 additions & 0 deletions app/templates/Names/actions.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php
/**
* COmanage Registry Names Actions Menu Configuration
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// Index top-links appear as top links in the index view
$indexTopLinks = [];

// Actions appear as row-level menu items in the index view gear icon and as a tab menu or top-link menu on
// edit and view pages based on user permissions.
$actions = [
[
'action' => 'primary',
'icon' => 'publish',
'if' => 'notPrimary'
]
];
9 changes: 3 additions & 6 deletions app/templates/Names/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ $indexColumns = [
]
];

$indexActions = [
[
'action' => 'primary',
'icon' => 'publish',
'if' => 'notPrimary'
]
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];
5 changes: 5 additions & 0 deletions app/templates/People/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ $indexColumns = [
'sortable' => true
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'expunge' => true
];
Loading

0 comments on commit b439757

Please sign in to comment.