Logical flows: tag filter may not be initialised correctly on source-target-panel
@@ -220,9 +220,17 @@ function controller($element,
vm.$onInit = () => {
serviceBroker.loadViewData(CORE_API.DataTypeStore.findAll)
.then(r => vm.dataTypes = _.keyBy(r.data, dt => dt.id));
+ };
+
+ vm.$onChanges = (changes) => {
+
+ if (changes.logicalFlows || changes.decorators) {
+ vm.resetNodeAndTypeFilter();
+ }
- // initialise selected tags (change to userPref)
if (!_.isEmpty(vm.tags)) {
+ vm.tags = maybeAddUntaggedFlowsTag(vm.tags);
+
getSelectedTagsFromPreferences(
vm.tags,
appLogicalFlowFilterExcludedTagIdsKey,
@@ -231,16 +239,6 @@ function controller($element,
vm.filterOptions.selectedTags = selectedTags;
filterChanged();
});
- } else {
- vm.filterOptions.selectedTags = [];
- filterChanged();
- }
- };
-
- vm.$onChanges = (changes) => {
-
- if (changes.logicalFlows || changes.decorators) {
- vm.resetNodeAndTypeFilter();
}
const keyedLogicalFlows = calculateSourceAndTargetFlowsByEntity(
@@ -249,11 +247,6 @@ function controller($element,
const logicalFlowsById = _.keyBy(vm.logicalFlows, "id");
- // add untaggedFlowsTag
- if (!_.isEmpty(vm.tags)) {
- vm.tags = maybeAddUntaggedFlowsTag(vm.tags);
- }
-
function select(entity, type, logicalFlowId, evt) {
const typeInfoByFlowId = mkTypeInfo(vm.decorators, vm.dataTypes);
const types = typeInfoByFlowId[logicalFlowId] || [];
