Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add watch group name reg #273

Merged
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