diff --git a/.changeset/stupid-berries-run.md b/.changeset/stupid-berries-run.md new file mode 100644 index 0000000000..f506ce2475 --- /dev/null +++ b/.changeset/stupid-berries-run.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-home': patch +--- + +Make sure the widget name is never empty in the `AddWidgetDialog`. If the title was set to "", the entry would contain an empty string. Use the name as a fallback diff --git a/plugins/home/src/components/CustomHomepage/AddWidgetDialog.tsx b/plugins/home/src/components/CustomHomepage/AddWidgetDialog.tsx index c1c306233c..ee3ed98cbc 100644 --- a/plugins/home/src/components/CustomHomepage/AddWidgetDialog.tsx +++ b/plugins/home/src/components/CustomHomepage/AddWidgetDialog.tsx @@ -29,7 +29,7 @@ interface AddWidgetDialogProps { } const getTitle = (widget: Widget) => { - return widget.title ?? widget.name; + return widget.title || widget.name; }; export const AddWidgetDialog = (props: AddWidgetDialogProps) => {