Skip to content

The open alternative to Salesforce, designed for AI.

Show Untitled, plain visibility and a page skeleton on core workflow pages (#26836)

Thomas Trompette0286cdde7809
diff --git a/packages/twenty-front/src/modules/object-core/components/CoreObjectIdentifierBar.tsx b/packages/twenty-front/src/modules/object-core/components/CoreObjectIdentifierBar.tsx
index b6e9beea82c..d98437e1fe3 100644
--- a/packages/twenty-front/src/modules/object-core/components/CoreObjectIdentifierBar.tsx
+++ b/packages/twenty-front/src/modules/object-core/components/CoreObjectIdentifierBar.tsx
@@ -1,4 +1,5 @@
import { styled } from '@linaria/react';
+import { isNonEmptyString } from '@sniptt/guards';
import { useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { themeCssVariables } from 'twenty-ui/theme';
@@ -79,6 +80,11 @@ export const CoreObjectIdentifierBar = ({
sizeVariant="sm"
value={editedName ?? name ?? ''}
placeholder={namePlaceholder}
+ textColor={
+ isNonEmptyString(editedName ?? name)
+ ? undefined
+ : themeCssVariables.font.color.tertiary
+ }
onChange={setEditedName}
onEnter={saveName}
onEscape={() => setEditedName(undefined)}
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
index 2ddbf3ea201..abaa6f8045b 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowEditor.tsx
@@ -1,6 +1,5 @@
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
-import { Loader } from 'twenty-ui/primitives/feedback';
import { WorkspaceRouteUnavailable } from '@/app/routing/components/WorkspaceRouteUnavailable';
import { useListenToCoreWorkflowEvents } from '@/object-core/workflows/hooks/useListenToCoreWorkflowEvents';
@@ -30,7 +29,7 @@ export const CoreWorkflowEditor = ({
});
if (loading && !isDefined(coreWorkflowVersion)) {
- return <Loader />;
+ return null;
}
if (isDefined(error)) {
return (
diff --git a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx
index f3d85ecba3b..79edcebac7b 100644
--- a/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx
+++ b/packages/twenty-front/src/modules/object-core/workflows/components/CoreWorkflowVisibilityCell.tsx
@@ -1,6 +1,6 @@
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
-import { Tag } from 'twenty-ui/primitives/data-display';
+import { OverflowingTextWithTooltip } from 'twenty-ui/primitives/typography';
import { type WorkflowVisibility } from '~/generated/graphql';
import { CORE_WORKFLOW_VISIBILITY_OPTIONS } from '@/object-core/workflows/constants/CoreWorkflowVisibilityOptions';
@@ -20,9 +20,5 @@ export const CoreWorkflowVisibilityCell = ({
return null;
}
- return (
- <Tag preventShrink color="gray" startIcon={<visibilityOption.Icon />}>
- {t(visibilityOption.label)}
- </Tag>
- );
+ return <OverflowingTextWithTooltip text={t(visibilityOption.label)} />;
};
diff --git a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
index 7c3f1c04add..43fb55bc4d3 100644
--- a/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
+++ b/packages/twenty-front/src/pages/object-core/WorkflowCoreShowPage.tsx
@@ -3,14 +3,15 @@ import { CoreObjectIdentifierBar } from '@/object-core/components/CoreObjectIden
import { CoreWorkflowToWorkspaceRedirect } from '@/object-core/workflows/components/CoreWorkflowToWorkspaceRedirect';
import { useRenameCoreWorkflow } from '@/object-core/workflows/hooks/useRenameCoreWorkflow';
import { styled } from '@linaria/react';
+import { isNonEmptyString } from '@sniptt/guards';
import { t } from '@lingui/core/macro';
import { useCallback } from 'react';
import { useParams, useSearchParams } from 'react-router-dom';
import { AppPath, CoreObjectNameSingular } from 'twenty-shared/types';
import { PermissionFlagType } from 'twenty-shared/constants';
import { getAppPath, isDefined } from 'twenty-shared/utils';
-import { Loader } from 'twenty-ui/primitives/feedback';
import { Button } from 'twenty-ui/primitives/input';
+import { themeCssVariables } from 'twenty-ui/theme';
import { WorkspaceRouteUnavailable } from '@/app/routing/components/WorkspaceRouteUnavailable';
import { RecordShowCommandMenu } from '@/command-menu-item/components/RecordShowCommandMenu';
@@ -32,6 +33,7 @@ import { PageCardLayout } from '@/ui/layout/page/components/PageCardLayout';
import { PageTitle } from '@/ui/utilities/page-title/components/PageTitle';
import { useIsWorkflowCoreEnabled } from '@/workflow/hooks/useIsWorkflowCoreEnabled';
import { getWorkflowCurrentVersion } from '@/workflow/utils/getWorkflowCurrentVersion';
+import { PageContentSkeletonLoader } from '~/loading/components/PageContentSkeletonLoader';
const StyledContainer = styled.div`
display: flex;
@@ -40,6 +42,10 @@ const StyledContainer = styled.div`
min-height: 0;
`;
+const StyledUntitled = styled.span`
+ color: ${themeCssVariables.font.color.tertiary};
+`;
+
const CoreWorkflowShowContent = ({
coreWorkflowId,
}: {
@@ -93,7 +99,7 @@ const CoreWorkflowShowContent = ({
return (
<>
{resource}
- <Loader />
+ <PageContentSkeletonLoader />
</>
);
}
@@ -139,7 +145,13 @@ const CoreWorkflowShowContent = ({
objectNamePlural: CoreObjectNamePlural.Workflow,
}),
},
- { children: record.name ?? '' },
+ {
+ children: isNonEmptyString(record.name) ? (
+ record.name
+ ) : (
+ <StyledUntitled>{t`Untitled`}</StyledUntitled>
+ ),
+ },
]}
actionButton={
<>
@@ -154,7 +166,7 @@ const CoreWorkflowShowContent = ({
<CoreObjectIdentifierBar
recordId={coreWorkflowId}
name={record.name}
- namePlaceholder={t`Workflow name`}
+ namePlaceholder={t`Untitled`}
onRename={renameWorkflow}
/>
{isDefined(selectedVersion) ? (