Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Correct the placement of the Configuration breadcrumb link and ensure…
… that the Configure links appears for 'AttributeMappings' (CO-2582) (COmanage#55)
arlen committed Jan 10, 2023
1 parent 2c633da commit cfea2a3
Showing 1 changed file with 27 additions and 26 deletions.
53 changes: 27 additions & 26 deletions app/templates/element/breadcrumbs.php
@@ -57,38 +57,14 @@
);
}

if(!empty($vv_primary_link_obj)
&& !empty($vv_primary_link_model)
&& $vv_primary_link_model != 'Matchgrids') {
// If the primary link is not matchgrid, render a link to it (and the parent index).
// We'll need to calculate the controller name.

if(!empty($vv_cur_mg->id)) {
// We currently assume the parent of a primary link is matchgrid, which
// might or might not always be true in the future.
$this->Breadcrumbs->add(
__('match.ct.'.$vv_primary_link_model, [99]),
['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model),
'action' => 'index',
'?' => [ 'matchgrid_id' => $vv_cur_mg->id] ]
);
}

$this->Breadcrumbs->add(
$vv_primary_link_obj->name,
['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model),
'action' => 'edit',
$vv_primary_link_obj->id]
);
}

// Insert Matchgrid "Configure" breadcrumb for matchgrid configuration pages
if (!empty($vv_cur_mg) &&
($controller == 'MatchgridSettings' ||
$controller == 'Attributes' ||
$controller == 'ApiUsers' ||
$controller == 'AttributeGroups' ||
$controller == 'AttributeMaps' ||
$controller == 'AttributeMaps' ||
$controller == 'AttributeMappings' ||
$controller == 'Endpoints' ||
$controller == 'Rules' ||
$controller == 'RuleAttributes' ||
@@ -106,6 +82,31 @@
);
}

if(!empty($vv_primary_link_obj)
&& !empty($vv_primary_link_model)
&& $vv_primary_link_model != 'Matchgrids') {
// If the primary link is not matchgrid, render a link to it (and the parent index).
// We'll need to calculate the controller name.

if(!empty($vv_cur_mg->id)) {
// We currently assume the parent of a primary link is matchgrid, which
// might or might not always be true in the future.
$this->Breadcrumbs->add(
__('match.ct.'.$vv_primary_link_model, [99]),
['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model),
'action' => 'index',
'?' => [ 'matchgrid_id' => $vv_cur_mg->id] ]
);
}

$this->Breadcrumbs->add(
$vv_primary_link_obj->name,
['controller' => \Cake\Utility\Inflector::dasherize($vv_primary_link_model),
'action' => 'edit',
$vv_primary_link_obj->id]
);
}

if($action != 'index' && $action != 'manage' && $action != 'configure'
&& !($controller == 'Matchgrids' && $action == 'pending')) {

0 comments on commit cfea2a3

Please sign in to comment.