Skip to content

The open alternative to Salesforce, designed for AI.

Fix pipeline bug on scroll (#666)

Charles Bochet2bbcf6980ac1
diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx
index 2649095c0a7..16bc6d7d9dd 100644
--- a/front/src/generated/graphql.tsx
+++ b/front/src/generated/graphql.tsx
@@ -5001,7 +5001,7 @@ export type GetPipelinesLazyQueryHookResult = ReturnType<typeof useGetPipelinesL
export type GetPipelinesQueryResult = Apollo.QueryResult<GetPipelinesQuery, GetPipelinesQueryVariables>;
export const GetPipelineProgressDocument = gql`
query GetPipelineProgress($where: PipelineProgressWhereInput) {
- findManyPipelineProgress(where: $where) {
+ findManyPipelineProgress(where: $where, orderBy: {createdAt: asc}) {
id
progressableType
progressableId
diff --git a/front/src/modules/companies/components/NewCompanyProgressButton.tsx b/front/src/modules/companies/components/NewCompanyProgressButton.tsx
index 2d3481f6f90..bebbe62335a 100644
--- a/front/src/modules/companies/components/NewCompanyProgressButton.tsx
+++ b/front/src/modules/companies/components/NewCompanyProgressButton.tsx
@@ -1,4 +1,4 @@
-import { useCallback, useRef, useState } from 'react';
+import { useCallback, useState } from 'react';
import { getOperationName } from '@apollo/client/utilities';
import { useRecoilState } from 'recoil';
import { v4 as uuidv4 } from 'uuid';
@@ -26,7 +26,6 @@ import {
import { currentPipelineState } from '~/pages/opportunities/currentPipelineState';
export function NewCompanyProgressButton() {
- const containerRef = useRef<HTMLDivElement>(null);
const [isCreatingCard, setIsCreatingCard] = useState(false);
const [board, setBoard] = useRecoilState(boardState);
const [pipeline] = useRecoilState(currentPipelineState);
@@ -112,24 +111,22 @@ export function NewCompanyProgressButton() {
return (
<>
- {isCreatingCard && (
+ {isCreatingCard ? (
<RecoilScope>
- <div ref={containerRef}>
- <div ref={containerRef}>
- <SingleEntitySelect
- onEntitySelected={(value) => handleEntitySelect(value)}
- onCancel={handleCancel}
- entities={{
- entitiesToSelect: companies.entitiesToSelect,
- selectedEntity: companies.selectedEntities[0],
- loading: companies.loading,
- }}
- />
- </div>
- </div>
+ <SingleEntitySelect
+ onEntitySelected={(value) => handleEntitySelect(value)}
+ onCancel={handleCancel}
+ entities={{
+ entitiesToSelect: companies.entitiesToSelect,
+ selectedEntity: companies.selectedEntities[0],
+ loading: companies.loading,
+ }}
+ disableBackgroundBlur={true}
+ />
</RecoilScope>
+ ) : (
+ <NewButton onClick={handleNewClick} />
)}
- <NewButton onClick={handleNewClick} />
</>
);
}
diff --git a/front/src/modules/pipeline-progress/components/EntityBoardColumn.tsx b/front/src/modules/pipeline-progress/components/EntityBoardColumn.tsx
index 1f61f3d4328..eb8a9a2e3e4 100644
--- a/front/src/modules/pipeline-progress/components/EntityBoardColumn.tsx
+++ b/front/src/modules/pipeline-progress/components/EntityBoardColumn.tsx
@@ -18,6 +18,10 @@ const StyledPlaceholder = styled.div`
min-height: 1px;
`;
+const StyledNewCardButtonContainer = styled.div`
+ padding-bottom: ${({ theme }) => theme.spacing(40)};
+`;
+
const BoardColumnCardsContainer = ({
children,
droppableProvided,
@@ -72,7 +76,9 @@ export function EntityBoardColumn({
</RecoilScope>
))}
</BoardColumnCardsContainer>
- <RecoilScope>{boardOptions.newCardComponent}</RecoilScope>
+ <StyledNewCardButtonContainer>
+ <RecoilScope>{boardOptions.newCardComponent}</RecoilScope>
+ </StyledNewCardButtonContainer>
</BoardColumn>
)}
</Droppable>
diff --git a/front/src/modules/pipeline-progress/queries/index.ts b/front/src/modules/pipeline-progress/queries/index.ts
index bc9a98009c8..4dea0a03b67 100644
--- a/front/src/modules/pipeline-progress/queries/index.ts
+++ b/front/src/modules/pipeline-progress/queries/index.ts
@@ -21,7 +21,7 @@ export const GET_PIPELINES = gql`
export const GET_PIPELINE_PROGRESS = gql`
query GetPipelineProgress($where: PipelineProgressWhereInput) {
- findManyPipelineProgress(where: $where) {
+ findManyPipelineProgress(where: $where, orderBy: { createdAt: asc }) {
id
progressableType
progressableId
diff --git a/front/src/modules/relation-picker/components/SingleEntitySelect.tsx b/front/src/modules/relation-picker/components/SingleEntitySelect.tsx
index 2476a4da7ff..4fac5cfc5fe 100644
--- a/front/src/modules/relation-picker/components/SingleEntitySelect.tsx
+++ b/front/src/modules/relation-picker/components/SingleEntitySelect.tsx
@@ -30,11 +30,13 @@ export function SingleEntitySelect<
onEntitySelected,
onCreate,
onCancel,
+ disableBackgroundBlur = false,
}: {
onCancel?: () => void;
onCreate?: () => void;
entities: EntitiesForSingleEntitySelect<CustomEntityForSelect>;
onEntitySelected: (entity: CustomEntityForSelect) => void;
+ disableBackgroundBlur?: boolean;
}) {
const containerRef = useRef<HTMLDivElement>(null);
@@ -49,7 +51,7 @@ export function SingleEntitySelect<
});
return (
- <DropdownMenu ref={containerRef}>
+ <DropdownMenu disableBlur={disableBackgroundBlur} ref={containerRef}>
<DropdownMenuSearch
value={searchFilter}
onChange={handleSearchFilterChange}
diff --git a/front/src/modules/ui/board/components/Board.tsx b/front/src/modules/ui/board/components/Board.tsx
index 6ce57d75241..0894bd9a0f5 100644
--- a/front/src/modules/ui/board/components/Board.tsx
+++ b/front/src/modules/ui/board/components/Board.tsx
@@ -5,7 +5,6 @@ export const StyledBoard = styled.div`
border-radius: ${({ theme }) => theme.spacing(2)};
display: flex;
flex-direction: row;
- height: calc(100%);
overflow-x: auto;
width: 100%;
`;
diff --git a/front/src/modules/ui/board/components/NewButton.tsx b/front/src/modules/ui/board/components/NewButton.tsx
index 21abc911fea..16540a5c23a 100644
--- a/front/src/modules/ui/board/components/NewButton.tsx
+++ b/front/src/modules/ui/board/components/NewButton.tsx
@@ -13,7 +13,6 @@ const StyledButton = styled.button`
cursor: pointer;
display: flex;
gap: ${({ theme }) => theme.spacing(1)};
- justify-content: center;
padding: ${({ theme }) => theme.spacing(1)};
&:hover {
diff --git a/front/src/modules/ui/components/menu/DropdownMenu.tsx b/front/src/modules/ui/components/menu/DropdownMenu.tsx
index b76405196ea..7e80cdda45a 100644
--- a/front/src/modules/ui/components/menu/DropdownMenu.tsx
+++ b/front/src/modules/ui/components/menu/DropdownMenu.tsx
@@ -1,8 +1,9 @@
import styled from '@emotion/styled';
-export const DropdownMenu = styled.div`
+export const DropdownMenu = styled.div<{ disableBlur?: boolean }>`
align-items: center;
- backdrop-filter: blur(20px);
+ backdrop-filter: ${({ disableBlur }) =>
+ disableBlur ? 'none' : 'blur(20px)'};
background: ${({ theme }) => theme.background.transparent.secondary};
border: 1px solid ${({ theme }) => theme.border.color.light};
@@ -14,7 +15,5 @@ export const DropdownMenu = styled.div`
flex-direction: column;
- height: fit-content;
-
width: 200px;
`;