Improve provisionning new accounts (#757)
* Improve provisionning new accounts * Fix lint
This commit is contained in:
@ -75,7 +75,7 @@ export function App() {
|
||||
<Routes>
|
||||
<Route
|
||||
path=""
|
||||
element={<Navigate to={AppPath.PeoplePage} replace />}
|
||||
element={<Navigate to={AppPath.CompaniesPage} replace />}
|
||||
/>
|
||||
<Route path={AppPath.PeoplePage} element={<People />} />
|
||||
<Route
|
||||
|
||||
@ -47,18 +47,18 @@ export function AppNavbar() {
|
||||
icon={<IconSettings size={theme.icon.size.md} />}
|
||||
/>
|
||||
<NavTitle label="Workspace" />
|
||||
<NavItem
|
||||
label="People"
|
||||
to="/people"
|
||||
icon={<IconUser size={theme.icon.size.md} />}
|
||||
active={currentPath === '/people'}
|
||||
/>
|
||||
<NavItem
|
||||
label="Companies"
|
||||
to="/companies"
|
||||
icon={<IconBuildingSkyscraper size={theme.icon.size.md} />}
|
||||
active={currentPath === '/companies'}
|
||||
/>
|
||||
<NavItem
|
||||
label="People"
|
||||
to="/people"
|
||||
icon={<IconUser size={theme.icon.size.md} />}
|
||||
active={currentPath === '/people'}
|
||||
/>
|
||||
<NavItem
|
||||
label="Opportunities"
|
||||
to="/opportunities"
|
||||
|
||||
@ -16,7 +16,10 @@ import { filtersScopedState } from '@/ui/filter-n-sort/states/filtersScopedState
|
||||
import { FilterDefinition } from '@/ui/filter-n-sort/types/FilterDefinition';
|
||||
import { turnFilterIntoWhereClause } from '@/ui/filter-n-sort/utils/turnFilterIntoWhereClause';
|
||||
import { useRecoilScopedValue } from '@/ui/recoil-scope/hooks/useRecoilScopedValue';
|
||||
import { PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By } from '~/generated/graphql';
|
||||
import {
|
||||
PipelineProgressableType,
|
||||
PipelineProgressOrderByWithRelationInput as PipelineProgresses_Order_By,
|
||||
} from '~/generated/graphql';
|
||||
import {
|
||||
Pipeline,
|
||||
useGetCompaniesQuery,
|
||||
@ -39,11 +42,16 @@ export function HooksCompanyBoard({
|
||||
const [currentPipeline, setCurrentPipeline] =
|
||||
useRecoilState(currentPipelineState);
|
||||
|
||||
const [, setBoard] = useRecoilState(boardState);
|
||||
const [board, setBoard] = useRecoilState(boardState);
|
||||
|
||||
const [, setIsBoardLoaded] = useRecoilState(isBoardLoadedState);
|
||||
|
||||
useGetPipelinesQuery({
|
||||
variables: {
|
||||
where: {
|
||||
pipelineProgressableType: { equals: PipelineProgressableType.Company },
|
||||
},
|
||||
},
|
||||
onCompleted: async (data) => {
|
||||
const pipeline = data?.findManyPipeline[0] as Pipeline;
|
||||
setCurrentPipeline(pipeline);
|
||||
@ -55,12 +63,12 @@ export function HooksCompanyBoard({
|
||||
})
|
||||
: [];
|
||||
const initialBoard: BoardPipelineStageColumn[] =
|
||||
orderedPipelineStages?.map((pipelineStage) => ({
|
||||
orderedPipelineStages?.map((pipelineStage, i) => ({
|
||||
pipelineStageId: pipelineStage.id,
|
||||
title: pipelineStage.name,
|
||||
colorCode: pipelineStage.color,
|
||||
index: pipelineStage.index || 0,
|
||||
pipelineProgressIds: [],
|
||||
pipelineProgressIds: board?.[i].pipelineProgressIds || [],
|
||||
})) || [];
|
||||
setBoard(initialBoard);
|
||||
},
|
||||
|
||||
@ -14,6 +14,8 @@ import {
|
||||
} from '~/generated/graphql';
|
||||
import { logError } from '~/utils/logError';
|
||||
|
||||
import { SEARCH_COMPANY_QUERY } from '../../search/queries/search';
|
||||
|
||||
type OwnProps = {
|
||||
people: Pick<Person, 'id'>;
|
||||
};
|
||||
@ -51,7 +53,10 @@ export function PeopleCompanyCreateCell({ people }: OwnProps) {
|
||||
address: '',
|
||||
createdAt: new Date().toISOString(),
|
||||
},
|
||||
refetchQueries: [getOperationName(GET_COMPANIES) || ''],
|
||||
refetchQueries: [
|
||||
getOperationName(GET_COMPANIES) ?? '',
|
||||
getOperationName(SEARCH_COMPANY_QUERY) ?? '',
|
||||
],
|
||||
});
|
||||
|
||||
await updatePeople({
|
||||
|
||||
@ -17,6 +17,8 @@ import {
|
||||
useInsertCompanyMutation,
|
||||
} from '~/generated/graphql';
|
||||
|
||||
import { SEARCH_COMPANY_QUERY } from '../../modules/search/queries/search';
|
||||
|
||||
const StyledTableContainer = styled.div`
|
||||
display: flex;
|
||||
width: 100%;
|
||||
@ -37,7 +39,10 @@ export function Companies() {
|
||||
|
||||
await insertCompany({
|
||||
variables: newCompany,
|
||||
refetchQueries: [getOperationName(GET_COMPANIES) ?? ''],
|
||||
refetchQueries: [
|
||||
getOperationName(GET_COMPANIES) ?? '',
|
||||
getOperationName(SEARCH_COMPANY_QUERY) ?? '',
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user