Skip to content

Commit 26d92be

Browse files
authored
fix: on chart type change stream field list rendering issue in add panel (#2757)
- for edit panel, stream list not rendering
1 parent 9e1752a commit 26d92be

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

web/src/components/dashboards/addPanel/FieldList.vue

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,12 @@ export default defineComponent({
567567
true
568568
);
569569

570+
// below line required for pass by reference
571+
// if we don't set blank, then same object from cache is being set
572+
// and that doesn't call the watchers,
573+
// so it will not be updated when we switch to different chart types
574+
// which doesn't have field list and coming back to field list
575+
dashboardPanelData.meta.stream.selectedStreamFields = [];
570576
// assign the schema
571577
dashboardPanelData.meta.stream.selectedStreamFields =
572578
fieldWithSchema?.schema ?? [];
@@ -662,13 +668,12 @@ export default defineComponent({
662668
const getStreamList = async (stream_type: any) => {
663669
await getStreams(stream_type, false).then((res: any) => {
664670
data.schemaList = res.list;
665-
666671
// below line required for pass by reference
667672
// if we don't set blank, then same object from cache is being set
668673
// and that doesn't call the watchers,
669674
// so it will not be updated when we switch to different chart types
670675
// which doesn't have field list and coming back to field list
671-
dashboardPanelData.meta.stream.streamResults = []
676+
dashboardPanelData.meta.stream.streamResults = [];
672677

673678
dashboardPanelData.meta.stream.streamResults = res.list;
674679
});

0 commit comments

Comments
 (0)