Skip to content
16 changes: 11 additions & 5 deletions frontend/src/images/Images.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,15 @@ export default {
this.runsArray = data;
this.config.runs = data;
});

// TODO: Migrate this line from San to Vue
// need debounce, can't use computed
//this.watch('config.groupNameReg', debounce(this.filterTagsList, 300));
},
mounted() {
autoAdjustHeight();
},
watch: {
'config.groupNameReg': function(val) {
this.throttledFilterTagsList()
}
},
methods:{
filterTagsList(groupNameReg) {
if (!groupNameReg) {
Expand All @@ -151,7 +152,12 @@ export default {
let tagsList = this.tagsList || [];
let regExp = new RegExp(groupNameReg);
this.filteredTagsList = tagsList.filter(item => regExp.test(item.tag));
}
},
throttledFilterTagsList: _.debounce(
function() {
this.filterTagsList(this.config.groupNameReg)
}, 300
),
}
};

Expand Down
15 changes: 11 additions & 4 deletions frontend/src/scalars/Scalars.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,15 @@ export default {
this.runsArray = data;
this.config.runs = data;
});

// TODO: Migrate this line from San to Vue
//this.watch('config.groupNameReg', debounce(this.filterTagsList, 300));
},
mounted() {
autoAdjustHeight();
},
watch: {
'config.groupNameReg': function(val) {
this.throttledFilterTagsList()
}
},
methods: {
filterTagsList(groupNameReg) {
if (!groupNameReg) {
Expand All @@ -158,7 +160,12 @@ export default {
let tagsList = this.tagsList || [];
let regExp = new RegExp(groupNameReg);
this.filteredTagsList = tagsList.filter(item => regExp.test(item.tag));
}
},
throttledFilterTagsList: _.debounce(
function() {
this.filterTagsList(this.config.groupNameReg)
}, 300
),
}
};

Expand Down