Skip to content

Correct the placement of the Configuration breadcrumb link (CO-2582) #55

Merged
merged 1 commit into from
Jan 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions app/templates/element/breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' ||
Expand All @@ -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')) {

Expand Down