Skip to content

Commit

Permalink
Fixes required after Filtering feature initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis Igoumenos committed May 1, 2022
1 parent 9b995a6 commit 08fa6ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions app/src/Lib/Traits/SearchFilterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

namespace App\Lib\Traits;

use Cake\Utility\Inflector;

trait SearchFilterTrait {
// Array (and configuration) of permitted search filters
private $searchFilters = array();
Expand All @@ -54,9 +56,9 @@ public function getLabel(string $attribute): string {
if($l != $attribute) {
return $l;
}
// If we make it here, just return $attribute
return $attribute;

// If we make it here, just return a pretty version of the $attribute name
return Inflector::humanize($attribute);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion app/src/View/Helper/MenuHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ public function getMenuIcon($action) {
'Delete' => 'delete'
);

return $icon[$action];
// For the actions with Default order we can pass directly the name of the icon
return $icon[$action] ?? $action;
}

}
2 changes: 1 addition & 1 deletion app/templates/Standard/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function _column_key($modelsName, $c, $tz=null) {
}

$action_args['vv_actions'][] = [
'order' => $this->Menu->getMenuOrder($t['icon']),
'order' => $this->Menu->getMenuOrder($t['order']),
'icon' => $this->Menu->getMenuIcon($t['icon']),
'url' => $this->Url->build($t['link']),
'label' => $t['label'],
Expand Down

0 comments on commit 08fa6ac

Please sign in to comment.