Skip to content

Commit

Permalink
Add watch group name reg (#273)
Browse files Browse the repository at this point in the history
* Add vuetify framework
Update AppMenu.vue to include the basic menu item.

* use name as key.

* Add Watch on the groupNameReg
  • Loading branch information
jetfuel authored Feb 22, 2018
1 parent 6eeaf1e commit 7ecb82c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
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

0 comments on commit 7ecb82c

Please sign in to comment.