Select to view content in your preferred language

Bug in distributed source code for controller widget

481
4
03-06-2024 04:29 PM
JoshGore
Occasional Contributor

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
4 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
Occasional Contributor

@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.

boro
by
Occasional Contributor

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'

 

Dvirus
by
Regular Contributor

@Shen_Zhang , Please add LayoutItemToolbar,
It's not make sense that developers need to find that post to discover that component is not part of custom widgets.
If so, esri sould document that. 

Please help the developer experience so that they can really have a development experience.

After all it's all about the experience 😉

 

0 Kudos