In the current version of the code, the recommendation of relations between two classes is broken.
The problem is that getAvailableProperties(...) in
|
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; |
|
}); |
always returns an empty array since it is looking for properties which have a type of ':relation' by applying this
|
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, '') |
|
}; |
|
} |
|
}; |
filter function here
|
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
In the current version of the code, the recommendation of relations between two classes is broken.
The problem is that
getAvailableProperties(...)invsb/app/modules/workspace/modals/findRelationModalCtrl.js
Lines 21 to 31 in 148c51a
vsb/app/modules/workspace/subject/SubjectModel.js
Lines 70 to 96 in 148c51a
vsb/app/components/ui.select/select.js
Line 84 in 148c51a
A workaround (which half way works) is to replace all occurrences of
":relation"withnullin this file https://github.com/leipert/vsb/blob/148c51ae1790673c3b14629145492e74845e2ef0/app/modules/workspace/modals/findRelationModalCtrl.js