Fix/opportunities board (#2610)

* WIP

* wip

* update pipelineStepId

* rename pipeline stage to pipeline step

* rename pipelineProgress to Opportunity

* fix UUID type not queried

* fix boardColumnTotal

* fix micros

* fixing filters, sorts and fields

* wip

* wip

* Fix opportunity board re-render

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
Co-authored-by: bosiraphael <raphael.bosi@gmail.com>
This commit is contained in:
Charles Bochet
2023-11-21 01:24:25 +01:00
committed by GitHub
parent a33d4c8b8d
commit 09533e286b
36 changed files with 364 additions and 277 deletions

View File

@ -19,7 +19,7 @@ export const PipelineAddButton = () => {
const handleCompanySelected = (
selectedCompany: EntityForSelect | null,
selectedPipelineStageId: string | null,
selectedPipelineStepId: string | null,
) => {
if (!selectedCompany?.id) {
enqueueSnackBar(
@ -33,7 +33,7 @@ export const PipelineAddButton = () => {
return;
}
if (!selectedPipelineStageId) {
if (!selectedPipelineStepId) {
enqueueSnackBar(
'There was a problem with the pipeline stage selection, please retry.',
{
@ -45,7 +45,7 @@ export const PipelineAddButton = () => {
return;
}
closeDropdown();
//createCompanyProgress(selectedCompany.id, selectedPipelineStageId);
//createCompanyProgress(selectedCompany.id, selectedPipelineStepId);
};
return (

View File

@ -7,7 +7,7 @@ import { BoardColumnDefinition } from '@/ui/layout/board/types/BoardColumnDefini
import { currentPipelineState } from '../states/currentPipelineState';
export const usePipelineStages = () => {
export const usePipelineSteps = () => {
const currentPipeline = useRecoilValue(currentPipelineState);
const { createOneObject: createOnePipelineStep } =
@ -20,7 +20,7 @@ export const usePipelineStages = () => {
objectNameSingular: 'pipelineStep',
});
const handlePipelineStageAdd = async (boardColumn: BoardColumnDefinition) => {
const handlePipelineStepAdd = async (boardColumn: BoardColumnDefinition) => {
if (!currentPipeline?.id) return;
return createOnePipelineStep?.({
@ -37,11 +37,11 @@ export const usePipelineStages = () => {
});
};
const handlePipelineStageDelete = async (boardColumnId: string) => {
const handlePipelineStepDelete = async (boardColumnId: string) => {
if (!currentPipeline?.id) return;
return deleteOnePipelineStep?.(boardColumnId);
};
return { handlePipelineStageAdd, handlePipelineStageDelete };
return { handlePipelineStepAdd, handlePipelineStepDelete };
};

View File

@ -2,6 +2,7 @@ import { Person } from '@/people/types/Person';
import { PipelineStep } from '@/pipeline/types/PipelineStep';
export type Opportunity = {
[key: string]: any;
id: string;
amount: {
amountMicros: number;
@ -13,5 +14,4 @@ export type Opportunity = {
pipelineStep: PipelineStep;
pointOfContactId: string;
pointOfContact: Pick<Person, 'id' | 'name' | 'avatarUrl'>;
[key: string]: any;
};