[DASHBOARDS] Update iFrame error message (#16777)
`Invalid URL` instead of `no data` for iFrame widgets. <img width="1142" height="638" alt="CleanShot 2025-12-23 at 14 13 17@2x" src="https://github.com/user-attachments/assets/22621e57-c4ba-4e1f-91d0-5c4ef435c649" />
This commit is contained in:
+12
-9
@@ -1,23 +1,26 @@
|
||||
import { useCurrentWidget } from '@/page-layout/widgets/hooks/useCurrentWidget';
|
||||
import { t } from '@lingui/core/macro';
|
||||
import { AppTooltip, Status } from 'twenty-ui/display';
|
||||
import { WidgetType } from '~/generated/graphql';
|
||||
|
||||
type PageLayoutWidgetNoDataDisplayProps = {
|
||||
widgetId: string;
|
||||
};
|
||||
export const PageLayoutWidgetNoDataDisplay = () => {
|
||||
const widget = useCurrentWidget();
|
||||
const tooltipId = `widget-incomplete-tooltip-${widget.id}`;
|
||||
|
||||
export const PageLayoutWidgetNoDataDisplay = ({
|
||||
widgetId,
|
||||
}: PageLayoutWidgetNoDataDisplayProps) => {
|
||||
const tooltipId = `widget-incomplete-tooltip-${widgetId}`;
|
||||
const text = widget.type === WidgetType.IFRAME ? t`Invalid URL` : t`No Data`;
|
||||
const tooltipContent =
|
||||
widget.type === WidgetType.IFRAME
|
||||
? t`Invalid URL. Click edit to configure this widget.`
|
||||
: t`No data available. Click edit to configure this widget.`;
|
||||
|
||||
return (
|
||||
<>
|
||||
<div id={tooltipId}>
|
||||
<Status color="red" text={t`No Data`} />
|
||||
<Status color="red" text={text} />
|
||||
</div>
|
||||
<AppTooltip
|
||||
anchorSelect={`#${tooltipId}`}
|
||||
content={t`No data available. Click edit to configure this widget.`}
|
||||
content={tooltipContent}
|
||||
place="top"
|
||||
/>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user