Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add clickability to all data rows when a default action is obvious (C…
…O-1949)
arlen committed Oct 22, 2021
1 parent 62c8020 commit 346e7fe
Showing 13 changed files with 41 additions and 15 deletions.
3 changes: 2 additions & 1 deletion app/templates/ApiUsers/columns.inc
@@ -35,7 +35,8 @@ if(!empty($vv_cur_mg)) {

$indexColumns = [
'username' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
]
];

3 changes: 2 additions & 1 deletion app/templates/AttributeGroups/columns.inc
@@ -27,6 +27,7 @@

$indexColumns = [
'name' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
]
];
3 changes: 2 additions & 1 deletion app/templates/AttributeMappings/columns.inc
@@ -29,7 +29,8 @@
$indexColumns = [
'query' => [
'type' => 'link',
'sortable' => true
'sortable' => true,
'cssClass' => 'row-link'
],
'value' => [
'type' => 'echo',
3 changes: 2 additions & 1 deletion app/templates/AttributeMaps/columns.inc
@@ -27,7 +27,8 @@

$indexColumns = [
'name' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
]
];

3 changes: 2 additions & 1 deletion app/templates/Attributes/columns.inc
@@ -27,7 +27,8 @@

$indexColumns = [
'name' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
],
'attribute_group_id' => [
'type' => 'fk'
3 changes: 2 additions & 1 deletion app/templates/Matchgrids/columns.inc
@@ -27,7 +27,8 @@

$indexColumns = [
'table_name' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
],
'status' => [
'type' => 'enum',
3 changes: 2 additions & 1 deletion app/templates/Permissions/columns.inc
@@ -27,7 +27,8 @@

$indexColumns = [
'username' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
],
'matchgrid_id' => [ 'type' => 'fk' ],
'permission' => [
3 changes: 2 additions & 1 deletion app/templates/RuleAttributes/columns.inc
@@ -30,7 +30,8 @@ $indexColumns = [
'type' => 'link',
'model' => 'attribute',
'field' => 'name',
'sortable' => 'Attributes.name'
'sortable' => 'Attributes.name',
'cssClass' => 'row-link'
],
'crosscheck_attribute_id' => [
'type' => 'fk',
3 changes: 2 additions & 1 deletion app/templates/Rules/columns.inc
@@ -27,7 +27,8 @@

$indexColumns = [
'name' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
],
'confidence_mode' => [
'type' => 'enum',
2 changes: 1 addition & 1 deletion app/templates/Standard/index.php
@@ -171,7 +171,7 @@ function _column_key($modelsName, $c, $tz=null) {
?>
<tr>
<?php foreach($indexColumns as $col => $cfg): ?>
<td>
<td<?= !empty($cfg['cssClass']) ? ' class="' . $cfg['cssClass'] . '"' : ''; ?>>
<?php
switch($cfg['type']) {
case 'boolean':
3 changes: 2 additions & 1 deletion app/templates/SystemsOfRecord/columns.inc
@@ -27,7 +27,8 @@

$indexColumns = [
'label' => [
'type' => 'link'
'type' => 'link',
'cssClass' => 'row-link'
],
'resolution_mode' => [
'type' => 'enum',
22 changes: 19 additions & 3 deletions app/templates/element/javascript.php
@@ -175,11 +175,27 @@

// Enable Bootstrap Popovers. Unless needed elsewhere, constrain this to #content
$('#content [data-toggle="popover"]').popover();

// Generic row click handling for div-based rows
$('div.linked-row').click(function (e) {
location.href = $(this).find('a.row-link').attr('href');
});

// Generic row click handling
$('.linked-row').click(function (e) {
location.href = $(this).find('a.row-link').attr('href');
// Generic row click handling for table rows
$('td.row-link').each(function (e) {
url = $(this).find('a').attr('href');
if(url != undefined && url != '') {
$(this).closest('tr').addClass('linked-row').attr('data-target',url).click(function (e) {
location.href = $(this).attr('data-target');
}).find('a').on('click',function(e){
// don't propagate on other links to avoid redirecting dialog boxes
e.stopPropagation();
});
}
});

// Ensure that other links on table rows don't propigate


// Add loading animation when a form is submitted, when any item with a "spin" class is clicked,
// or on any button or anchor tag lacking the .nospin class.
2 changes: 1 addition & 1 deletion app/webroot/css/co-base.css
@@ -1161,7 +1161,7 @@ td.indented {
}
.linked-row:hover,
.linked-row:hover td {
background-color: var(--cmg-color-lightgray-002) !important;
background-color: var(--cmg-color-lightgray-004) !important;
}
.menuitembutton {
width: 250px;

0 comments on commit 346e7fe

Please sign in to comment.