Bug in distributed source code for controller widget

258
3
03-06-2024 04:29 PM
JoshGore
New Contributor III

Line 22 of dummy-layout.tsx within widgets/common/controller/src/runtime/builder/layout/dummy-layout.tsx imports LayoutItemToolbar:

import { LayoutItemToolbar } from 'jimu-layouts/lib/builder/layout-item-toolbar'
Causes the widget to fail to build as this is no longer included in the distributed jimu-layouts/lib

We're trying to wrap / extend this widget but this unfortunately breaks the functionality for adding widgets in
0 Kudos
3 Replies
Shen_Zhang
Esri Contributor

I assume that you made a copy of the Controller widget source code and tried to make a custom Controller widget.

However, the LayoutItemToolbar is an internal component which is not intended for custom widgets. The LayoutItemToolbar displays as a toolbar of the selected widget in the builder. It provides some widget tools, such as "Quick Style"(Button, Divider) and "Edit"(Text). You can remove the code related to LayoutItemToolbar in the custom Controller. This won't affect other parts of the Controller's logic.

Please let me know if you run into any furthur issues. Thanks!

Shen Zhang
0 Kudos
boro
by
New Contributor II

@Shen_Zhang wrote:

I assume that you made a copy of the Controller widget source code and tried to make a custom Controller widget.

However, the LayoutItemToolbar is an internal component which is not intended for custom widgets. The LayoutItemToolbar displays as a toolbar of the selected widget in the builder. It provides some widget tools, such as "Quick Style"(Button, Divider) and "Edit"(Text). You can remove the code related to LayoutItemToolbar in the custom Controller. This won't affect other parts of the Controller's logic.

Please let me know if you run into any furthur issues. Thanks!


Hijacking this thread because this is exactly what I'm trying to do. Removing the code related to LayoutItemToolbar breaks everything.. You can't be serious this component can't be used for custom widgets...That's a joke... Why make a "customizable" platform if you cant customise anything... Really disappointed.

0 Kudos
boro
by
New Contributor II

To anyone looking to do this, replace the LayoutItemToolbar import with the line below and replace all the mentions. It will give an error, but it will compile and run just fine.

import { Toolbar } from 'jimu-layouts/layout-builder'

 

0 Kudos