Skip to content

Commit 7ecb82c

Browse files
authored
Add watch group name reg (#273)
* Add vuetify framework Update AppMenu.vue to include the basic menu item. * use name as key. * Add Watch on the groupNameReg
1 parent 6eeaf1e commit 7ecb82c

File tree

2 files changed

+22
-9
lines changed

2 files changed

+22
-9
lines changed

frontend/src/images/Images.vue

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,15 @@ export default {
134134
this.runsArray = data;
135135
this.config.runs = data;
136136
});
137-
138-
// TODO: Migrate this line from San to Vue
139-
// need debounce, can't use computed
140-
//this.watch('config.groupNameReg', debounce(this.filterTagsList, 300));
141137
},
142138
mounted() {
143139
autoAdjustHeight();
144140
},
141+
watch: {
142+
'config.groupNameReg': function(val) {
143+
this.throttledFilterTagsList()
144+
}
145+
},
145146
methods:{
146147
filterTagsList(groupNameReg) {
147148
if (!groupNameReg) {
@@ -151,7 +152,12 @@ export default {
151152
let tagsList = this.tagsList || [];
152153
let regExp = new RegExp(groupNameReg);
153154
this.filteredTagsList = tagsList.filter(item => regExp.test(item.tag));
154-
}
155+
},
156+
throttledFilterTagsList: _.debounce(
157+
function() {
158+
this.filterTagsList(this.config.groupNameReg)
159+
}, 300
160+
),
155161
}
156162
};
157163

frontend/src/scalars/Scalars.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,15 @@ export default {
142142
this.runsArray = data;
143143
this.config.runs = data;
144144
});
145-
146-
// TODO: Migrate this line from San to Vue
147-
//this.watch('config.groupNameReg', debounce(this.filterTagsList, 300));
148145
},
149146
mounted() {
150147
autoAdjustHeight();
151148
},
149+
watch: {
150+
'config.groupNameReg': function(val) {
151+
this.throttledFilterTagsList()
152+
}
153+
},
152154
methods: {
153155
filterTagsList(groupNameReg) {
154156
if (!groupNameReg) {
@@ -158,7 +160,12 @@ export default {
158160
let tagsList = this.tagsList || [];
159161
let regExp = new RegExp(groupNameReg);
160162
this.filteredTagsList = tagsList.filter(item => regExp.test(item.tag));
161-
}
163+
},
164+
throttledFilterTagsList: _.debounce(
165+
function() {
166+
this.filterTagsList(this.config.groupNameReg)
167+
}, 300
168+
),
162169
}
163170
};
164171

0 commit comments

Comments
 (0)