MCPcopy Index your code
hub / github.com/sshwsfc/xadmin / addCell

Function addCell

xadmin-dashboard/src/editor/components/Menu.js:11–28  ·  view source on GitHub ↗
(type)

Source from the content-addressed store, hash-verified

9class Menu extends React.Component {
10
11 addCell(type) {
12 const Widget = app.load_dict('dashboard_widgets')[type]
13 const { params: { editLayer } } = this.props
14 const params = {
15 key: (Math.random() * 100).toString(),
16 params: {
17 layer: editLayer,
18 type,
19 title: '未命名标题'
20 },
21 layout: { x: 0, y: 0, w: 4, h: 4 }
22 }
23 this.props.addCell(params)
24
25 if(this.props.onAddCell) {
26 this.props.onAddCell(params.key)
27 }
28 }
29
30 changeLayer(editLayer) {
31 const { params, saveParams } = this.props

Callers

nothing calls this directly

Calls 1

load_dictMethod · 0.80

Tested by

no test coverage detected