Skip to content

Commit

Permalink
array index access to result in title resolver (SAP#2406)
Browse files Browse the repository at this point in the history
  • Loading branch information
hardl authored Dec 1, 2021
1 parent 6b395de commit e46e447
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions core/src/utilities/helpers/navigation-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LuigiAuth, LuigiConfig, LuigiFeatureToggles, LuigiI18N } from '../../co
import { AuthHelpers, GenericHelpers, RoutingHelpers } from './';
import { Navigation } from '../../navigation/services/navigation';
import { Routing } from '../../services/routing';
import { reject } from 'lodash';
import { reject, get } from 'lodash';

class NavigationHelpersClass {
constructor() {
Expand Down Expand Up @@ -369,14 +369,7 @@ class NavigationHelpersClass {
if (!propChain || !obj) {
return fallback;
}
const propArray = propChain.split('.');
let val = obj;
propArray.forEach(el => {
if (val) {
val = val[el];
}
});
return val || fallback;
return get(obj, propChain, fallback);
}

substituteVars(resolver, context) {
Expand Down

0 comments on commit e46e447

Please sign in to comment.