Make sure the title in AddWidget is never empty

Signed-off-by: ivgo <ivgo@spreadgroup.com>
This commit is contained in:
ivgo
2023-07-18 08:57:40 +02:00
parent bf67dce731
commit 6743d3917a
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -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
@@ -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) => {