add input source prompting and plugin testing

This commit is contained in:
Jake McDermott
2019-02-26 15:17:53 -05:00
parent 0de8a89293
commit c436dcf875
19 changed files with 879 additions and 88 deletions

View File

@@ -102,8 +102,9 @@ function SmartSearchController (
const rootField = termParts[0].split('.')[0].replace(/^-/, '');
const listName = $scope.list.name;
const baseRelatedTypePath = `models.${listName}.base.${rootField}.type`;
const relatedTypePath = `models.${listName}.related`;
const isRelatedSearchTermField = (_.includes($scope.models[listName].related, rootField));
const isRelatedSearchTermField = (_.includes(_.get($scope, relatedTypePath), rootField));
const isBaseModelRelatedSearchTermField = (_.get($scope, baseRelatedTypePath) === 'field');
return (isRelatedSearchTermField || isBaseModelRelatedSearchTermField);