Copilot commented on code in PR #503:
URL:
https://github.com/apache/skywalking-booster-ui/pull/503#discussion_r2418417269
##########
src/store/modules/dashboard.ts:
##########
@@ -270,11 +274,13 @@ export const dashboardStore = defineStore({
this.setCurrentTabItems((this.layout[index].children ||
[])[tabIndex].children);
return;
}
- this.layout[index] = {
- ...this.layout[index],
+ const layout = JSON.parse(JSON.stringify(this.layout));
+ layout[index] = {
+ ...layout[index],
...param,
};
- this.selectedGrid = this.layout[index];
+ this.setLayouts(layout);
+ this.selectedGrid = layout;
Review Comment:
Setting selectedGrid to the entire layout array instead of the specific grid
item (layout[index]) will cause incorrect behavior when accessing the selected
grid item.
```suggestion
this.selectedGrid = layout[index];
```
##########
src/views/dashboard/controls/Event.vue:
##########
@@ -54,6 +62,8 @@ limitations under the License. -->
});
const { t } = useI18n();
const dashboardStore = useDashboardStore();
+ const collapsedState = ref(false);
+ const originalState = ref({ h: props.data.h });
Review Comment:
The originalState is initialized with props.data.h but never updated when
the widget height changes. This could cause incorrect restoration of the
original height if the widget is resized before collapsing.
##########
src/views/dashboard/related/event/Content.vue:
##########
@@ -51,6 +51,7 @@ limitations under the License. -->
width: 0,
height: 0,
};
+ visTimeline();
Review Comment:
The visTimeline() function is called without being defined or imported. This
will result in a runtime error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]