From cfea2a3952375534ac815cc843cdccd86bb60c0f Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Tue, 10 Jan 2023 10:18:00 -0500 Subject: [PATCH] Correct the placement of the Configuration breadcrumb link and ensure that the Configure links appears for 'AttributeMappings' (CO-2582) (#55) --- app/templates/element/breadcrumbs.php | 53 ++++++++++++++------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/app/templates/element/breadcrumbs.php b/app/templates/element/breadcrumbs.php index 7be2139ad..606b724e1 100644 --- a/app/templates/element/breadcrumbs.php +++ b/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')) {