MCPcopy Create free account
hub / github.com/DTStack/molecule / initView

Method initView

src/controller/problems.tsx:71–106  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 };
70
71 public initView() {
72 const { builtInStatusProblems: statusProblems, builtInPanelProblems } =
73 this.builtinService.getModules();
74
75 if (statusProblems) {
76 statusProblems.render = (item) => (
77 <ProblemsStatusBarView {...item} />
78 );
79 statusProblems.onClick = this.onClick;
80
81 this.statusBarService.add(statusProblems, Float.left);
82 }
83
84 if (builtInPanelProblems) {
85 // keep ProblemsPaneView updated to problems' state
86 const ProblemsView = connect(
87 this.problemsService,
88 ProblemsPaneView
89 );
90 const problemsPanel = builtInPanelProblems;
91 problemsPanel.renderPane = () => (
92 <ProblemsView onSelect={this.onSelect} />
93 );
94
95 this.panelService.add(problemsPanel);
96 this.panelService.setActive(problemsPanel.id);
97 }
98
99 const { PROBLEM_MODEL_ID, PROBLEM_MODEL_NAME } =
100 this.builtinService.getConstants();
101
102 this.problemsService.setState({
103 id: PROBLEM_MODEL_ID,
104 name: PROBLEM_MODEL_NAME,
105 });
106 }
107
108 public onSelect = (node: IProblemsTreeNode) => {
109 this.emit(ProblemsEvent.onSelect, node);

Callers

nothing calls this directly

Calls 6

connectFunction · 0.90
setStateMethod · 0.80
getModulesMethod · 0.65
addMethod · 0.65
setActiveMethod · 0.65
getConstantsMethod · 0.65

Tested by

no test coverage detected