Skip to content

Commit d1d3194

Browse files
committed
fix: resolve type issues
1 parent 341e34b commit d1d3194

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

packages/pluggableWidgets/custom-chart-web/src/controllers/ChartPropsController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { EditorStoreState } from "@mendix/shared-charts/main";
2-
import { DerivedPropsGate, ReactiveController, ReactiveControllerHost } from "@mendix/widget-plugin-mobx-kit/main";
2+
import { DerivedPropsGate, SetupComponent, SetupComponentHost } from "@mendix/widget-plugin-mobx-kit/main";
33
import { executeAction } from "@mendix/widget-plugin-platform/framework/execute-action";
44
import { makeAutoObservable } from "mobx";
55
import { Config, Data, Layout } from "plotly.js-dist-min";
@@ -18,14 +18,14 @@ interface ChartPropsControllerSpec {
1818
editorStateGate: DerivedPropsGate<EditorStoreState>;
1919
}
2020

21-
export class ChartPropsController implements ReactiveController {
21+
export class ChartPropsController implements SetupComponent {
2222
private cleanup: undefined | (() => void) = undefined;
2323
private editorStateGate: DerivedPropsGate<EditorStoreState>;
2424
private propsGate: DerivedPropsGate<ControllerProps>;
2525
private sizeProvider: SizeProvider;
2626

27-
constructor(host: ReactiveControllerHost, spec: ChartPropsControllerSpec) {
28-
host.addController(this);
27+
constructor(host: SetupComponentHost, spec: ChartPropsControllerSpec) {
28+
host.add(this);
2929

3030
this.editorStateGate = spec.editorStateGate;
3131
this.propsGate = spec.propsGate;

packages/pluggableWidgets/custom-chart-web/src/controllers/CustomChartControllerHost.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import { EditorStoreState } from "@mendix/shared-charts/main";
2-
import { BaseControllerHost } from "@mendix/widget-plugin-mobx-kit/BaseControllerHost";
3-
import { DerivedPropsGate } from "@mendix/widget-plugin-mobx-kit/props-gate";
4-
import { ResizeController } from "./ResizeController";
2+
import { DerivedPropsGate, SetupHost } from "@mendix/widget-plugin-mobx-kit/main";
53
import { ChartPropsController } from "./ChartPropsController";
6-
import { ControllerProps } from "./typings";
74
import { PlotlyController } from "./PlotlyController";
5+
import { ResizeController } from "./ResizeController";
6+
import { ControllerProps } from "./typings";
87

98
interface CustomChartControllerHostSpec {
109
propsGate: DerivedPropsGate<ControllerProps>;
1110
editorStateGate: DerivedPropsGate<EditorStoreState>;
1211
}
1312

14-
export class CustomChartControllerHost extends BaseControllerHost {
13+
export class CustomChartControllerHost extends SetupHost {
1514
resizeCtrl: ResizeController;
1615
chartPropsController: ChartPropsController;
1716
plotlyController: PlotlyController;

packages/pluggableWidgets/custom-chart-web/src/controllers/PlotlyController.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { ChartProps, PlotlyChart } from "../components/PlotlyChart";
21
import { autorun } from "mobx";
2+
import { ChartProps, PlotlyChart } from "../components/PlotlyChart";
33

44
interface PropsProvider {
55
mergedProps: ChartProps;
@@ -23,8 +23,6 @@ export class PlotlyController {
2323
} else {
2424
const chart = new PlotlyChart(target, this.propsProvider.mergedProps);
2525

26-
// const [updatePlotlyDebounced, abort] = debounce((props: ChartProps) => chart.update(props), 100);
27-
2826
const dispose = autorun(
2927
() => {
3028
chart.update(this.propsProvider.mergedProps);

packages/pluggableWidgets/custom-chart-web/src/controllers/ResizeController.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { ReactiveController, ReactiveControllerHost } from "@mendix/widget-plugin-mobx-kit/main";
1+
import { SetupComponent, SetupComponentHost } from "@mendix/widget-plugin-mobx-kit/main";
22
import { debounce } from "@mendix/widget-plugin-platform/utils/debounce";
33
import { action, makeObservable, observable } from "mobx";
44

5-
export class ResizeController implements ReactiveController {
5+
export class ResizeController implements SetupComponent {
66
width = 0;
77
height = 0;
88
private cleanup: undefined | (() => void) = undefined;
99

10-
constructor(host: ReactiveControllerHost) {
11-
host.addController(this);
10+
constructor(host: SetupComponentHost) {
11+
host.add(this);
1212

1313
makeObservable(this, {
1414
width: observable,

0 commit comments

Comments
 (0)