From cdf0240ccb24e9558c5a7a5503029f065d4a659a Mon Sep 17 00:00:00 2001 From: Thomas Trompette Date: Tue, 19 Nov 2024 11:55:25 +0100 Subject: [PATCH] Fix active navigation tab + quick workflows fixes (#8567) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Active navigation tab hovered in show page - remove timeline tab + rename workflow tab - remove {{variable}} placeholder - fix margin - Workflow Runs and Versions show page title Capture d’écran 2024-11-18 à 18 23 12 --- .../NavigationDrawerItemForObjectMetadataItem.tsx | 5 ++++- .../components/NavigationDrawerOpenedSection.tsx | 13 +++++++++---- ...avigationDrawerSectionForObjectMetadataItems.tsx | 1 - .../record-show/hooks/useRecordShowContainerTabs.ts | 5 ++++- .../hooks/useRecordShowPagePagination.ts | 2 +- .../components/WorkflowEditActionFormSendEmail.tsx | 6 +++--- .../WorkflowEditActionFormServerlessFunction.tsx | 2 +- 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsx b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsx index 2d35e2d4a..94581966a 100644 --- a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsx +++ b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerItemForObjectMetadataItem.tsx @@ -39,7 +39,10 @@ export const NavigationDrawerItemForObjectMetadataItem = ({ viewId ? `?view=${viewId}` : '' }`; - const isActive = currentPath === `/objects/${objectMetadataItem.namePlural}`; + const isActive = + currentPath === `/objects/${objectMetadataItem.namePlural}` || + currentPath.includes(`object/${objectMetadataItem.nameSingular}/`); + const shouldSubItemsBeDisplayed = isActive && objectMetadataViews.length > 1; const sortedObjectMetadataViews = [...objectMetadataViews].sort( diff --git a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx index b17ad4c31..915b882fe 100644 --- a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx +++ b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerOpenedSection.tsx @@ -14,17 +14,22 @@ export const NavigationDrawerOpenedSection = () => { const loading = useIsPrefetchLoading(); - const currentObjectNamePlural = useParams().objectNamePlural; - const { activeObjectMetadataItems: workspaceFavoritesObjectMetadataItems } = useFilteredObjectMetadataItemsForWorkspaceFavorites(); - if (!currentObjectNamePlural) { + const { + objectNamePlural: currentObjectNamePlural, + objectNameSingular: currentObjectNameSingular, + } = useParams(); + + if (!currentObjectNamePlural && !currentObjectNameSingular) { return; } const objectMetadataItem = filteredActiveObjectMetadataItems.find( - (item) => item.namePlural === currentObjectNamePlural, + (item) => + item.namePlural === currentObjectNamePlural || + item.nameSingular === currentObjectNameSingular, ); if (!objectMetadataItem) { diff --git a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerSectionForObjectMetadataItems.tsx b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerSectionForObjectMetadataItems.tsx index f90a160b5..97f2a7452 100644 --- a/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerSectionForObjectMetadataItems.tsx +++ b/packages/twenty-front/src/modules/object-metadata/components/NavigationDrawerSectionForObjectMetadataItems.tsx @@ -21,7 +21,6 @@ const StyledObjectsMetaDataItemsWrapper = styled.div` flex-direction: column; gap: ${({ theme }) => theme.betweenSiblingsGap}; width: 100%; - margin-bottom: ${({ theme }) => theme.spacing(3)}; flex: 1; overflow-y: auto; `; diff --git a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowContainerTabs.ts b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowContainerTabs.ts index 0e2cdf95e..3917de656 100644 --- a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowContainerTabs.ts +++ b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowContainerTabs.ts @@ -131,7 +131,7 @@ export const useRecordShowContainerTabs = ( }, [CoreObjectNameSingular.Workflow]: { workflow: { - title: 'Workflow', + title: 'Flow', position: 0, Icon: IconSettings, cards: [{ type: CardType.WorkflowCard }], @@ -144,6 +144,7 @@ export const useRecordShowContainerTabs = ( ifRelationsMissing: [], }, }, + timeline: null, }, [CoreObjectNameSingular.WorkflowVersion]: { workflowVersion: { @@ -160,6 +161,7 @@ export const useRecordShowContainerTabs = ( ifRelationsMissing: [], }, }, + timeline: null, }, [CoreObjectNameSingular.WorkflowRun]: { workflowRunOutput: { @@ -190,6 +192,7 @@ export const useRecordShowContainerTabs = ( ifRelationsMissing: [], }, }, + timeline: null, }, }; diff --git a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts index cea8c47db..0590a2616 100644 --- a/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts +++ b/packages/twenty-front/src/modules/object-record/record-show/hooks/useRecordShowPagePagination.ts @@ -141,7 +141,7 @@ export const useRecordShowPagePagination = ( const rankFoundInFiew = rankInView > -1; - const objectLabel = capitalize(objectMetadataItem.namePlural); + const objectLabel = capitalize(objectMetadataItem.labelPlural); const totalCount = Math.max(1, totalCountBefore, totalCountAfter); diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormSendEmail.tsx b/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormSendEmail.tsx index 9a1389c19..a59a22590 100644 --- a/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormSendEmail.tsx +++ b/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormSendEmail.tsx @@ -204,7 +204,7 @@ export const WorkflowEditActionFormSendEmail = ({ { field.onChange(email); @@ -220,7 +220,7 @@ export const WorkflowEditActionFormSendEmail = ({ { field.onChange(email); @@ -236,7 +236,7 @@ export const WorkflowEditActionFormSendEmail = ({ { field.onChange(email); diff --git a/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx b/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx index 9025788cd..56a8b9e74 100644 --- a/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx +++ b/packages/twenty-front/src/modules/workflow/components/WorkflowEditActionFormServerlessFunction.tsx @@ -187,7 +187,7 @@ export const WorkflowEditActionFormServerlessFunction = ({ key={pathKey} inputId={`input-${inputKey}`} label={inputKey} - placeholder="Enter value (use {{variable}} for dynamic content)" + placeholder="Enter value" value={`${inputValue || ''}`} onChange={(value) => handleInputChange(value, currentPath)} />