Skip to content

Commit

Permalink
Improve breadcrumbs for Reconciliation view (CO-1839) and generally
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen committed Jun 16, 2020
1 parent 5381fce commit 049ad5e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 7 deletions.
4 changes: 4 additions & 0 deletions app/src/Locale/en_US/default.po
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ msgstr "{0,plural,=1{System of Record} other{Systems of Record}}"
msgid "match.ct.Rules"
msgstr "{0,plural,=1{Rule} other{Rules}}"

### Actions
msgid "match.ac.PendingRequests"
msgstr "{0,plural,=1{Pending Request} other{Pending Requests}}"

### Enumerations
msgid "match.en.ConfidenceModeEnum.C"
msgstr "Canonical"
Expand Down
36 changes: 29 additions & 7 deletions app/src/Template/Element/breadcrumbs.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,18 @@ if($this->request->getRequestTarget(false) != '/') {
['controller' => 'matchgrids',
'action' => 'select']
);

if(!empty($vv_cur_mg)

if($modelsName != 'Matchgrids' && $modelsName != 'Permissions' && $modelsName != 'ApiUsers'
|| ($modelsName == 'Matchgrids' && ($action == 'reconcile' || $action == 'pending'))) {
// Link to matchgrids listing where appropriate
$this->Breadcrumbs->add(
__('match.ct.Matchgrids', [99]),
['controller' => 'matchgrids',
'action' => 'index' ]
);
}

if(!empty($vv_cur_mg)
&& ($modelsName != 'Matchgrids' || $action != 'manage')) {
// Link to matchgrid if set
$this->Breadcrumbs->add(
Expand All @@ -57,7 +67,7 @@ if($this->request->getRequestTarget(false) != '/') {
$vv_cur_mg->id ]
);
}

if(!empty($vv_primary_link_obj)
&& !empty($vv_primary_link_model)
&& $vv_primary_link_model != 'Matchgrids') {
Expand All @@ -84,9 +94,11 @@ if($this->request->getRequestTarget(false) != '/') {
}

if($action != 'index'
&& ($modelsName != 'Matchgrids' && $action != 'pending')) {
&& !($modelsName == 'Matchgrids' && $action == 'pending')) {

// Default parent is index, to which we might need to append the Primary Link ID

$crumbLinkText = 'match.ct.'.$modelsName;

$target = [
'controller' => Inflector::dasherize($modelsName),
'action' => 'index'
Expand All @@ -95,9 +107,19 @@ if($this->request->getRequestTarget(false) != '/') {
if(!empty($vv_primary_link) && !empty($vv_primary_link_obj->id)) {
$target[$vv_primary_link] = $vv_primary_link_obj->id;
}


// Non-index special cases
if ($modelsName == 'Matchgrids' && $action == 'reconcile') {
$crumbLinkText = 'match.ac.PendingRequests';
$target = [
'controller' => Inflector::dasherize($modelsName),
'action' => 'pending',
$vv_cur_mg->id // will always be set for reconcile
];
}

$this->Breadcrumbs->add(
__('match.ct.'.$modelsName, [99]),
__($crumbLinkText, [99]),
$target
);
}
Expand Down

0 comments on commit 049ad5e

Please sign in to comment.