-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
In the current version of the code, the recommendation of relations between two classes is broken.
The problem is that getAvailableProperties(...) in
vsb/app/modules/workspace/modals/findRelationModalCtrl.js
Lines 21 to 31 in 148c51a
| subjects[0].getAvailableProperties(':relation', null) | |
| .then(filterPropertyCollection) | |
| .then(function (availableProperties) { | |
| $scope.subjects[0].$availableProperties = availableProperties; | |
| }); | |
| subjects[1].getAvailableProperties(':relation', null) | |
| .then(filterPropertyCollection) | |
| .then(function (availableProperties) { | |
| $scope.subjects[1].$availableProperties = availableProperties; | |
| }); |
vsb/app/modules/workspace/subject/SubjectModel.js
Lines 70 to 96 in 148c51a
| var customFilters = { | |
| pre: function (array, searchTerm) { | |
| if (!_.isArray(array) || !_.isString(searchTerm) || _.isEmpty(searchTerm)) { | |
| return {}; | |
| } | |
| var types = _(array).pluck('type').uniq() | |
| .map(function (type) { | |
| return type.toLowerCase().replace('_property', ''); | |
| }).value(); | |
| var searchRegex = new RegExp(':(' + _.map(types, _.escapeRegExp).join('|') + ')(?=\\s+|$)', 'ig'); | |
| if (!searchTerm.match(searchRegex)) { | |
| return {}; | |
| } | |
| var classToken = _.words(searchTerm, searchRegex)[0] | |
| .toUpperCase().replace(':', '') + '_PROPERTY'; | |
| return { | |
| array: _.where(array, {type: classToken}), | |
| filter: searchTerm.replace(searchRegex, '') | |
| }; | |
| } | |
| }; |
vsb/app/components/ui.select/select.js
Line 84 in 148c51a
| var temp = filterFunction(array, filter); |
A workaround (which half way works) is to replace all occurrences of ":relation" with null in this file https://github.com/leipert/vsb/blob/148c51ae1790673c3b14629145492e74845e2ef0/app/modules/workspace/modals/findRelationModalCtrl.js
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels