feat: add Opportunities Views dropdown (#1503)
* feat: add Opportunities Views dropdown Closes #1454 * feat: persist Opportunities view filters and sorts Closes #1456 * feat: create/edit/delete Opportunities views Closes #1455, Closes #1457 * fix: add missing Opportunities view mock --------- Co-authored-by: Charles Bochet <charlesBochet@users.noreply.github.com>
This commit is contained in:
@ -0,0 +1,40 @@
|
||||
import {
|
||||
EntityBoard,
|
||||
type EntityBoardProps,
|
||||
} from '@/ui/board/components/EntityBoard';
|
||||
import { EntityBoardActionBar } from '@/ui/board/components/EntityBoardActionBar';
|
||||
import { EntityBoardContextMenu } from '@/ui/board/components/EntityBoardContextMenu';
|
||||
import { useBoardViews } from '@/views/hooks/useBoardViews';
|
||||
|
||||
import { HooksCompanyBoard } from '../../components/HooksCompanyBoard';
|
||||
import { CompanyBoardRecoilScopeContext } from '../../states/recoil-scope-contexts/CompanyBoardRecoilScopeContext';
|
||||
|
||||
type OwnProps = Pick<
|
||||
EntityBoardProps,
|
||||
'boardOptions' | 'onColumnAdd' | 'onColumnDelete' | 'onEditColumnTitle'
|
||||
>;
|
||||
|
||||
export const CompanyBoard = ({ boardOptions, ...props }: OwnProps) => {
|
||||
const { handleViewsChange, handleViewSubmit } = useBoardViews({
|
||||
availableFilters: boardOptions.filters,
|
||||
availableSorts: boardOptions.sorts,
|
||||
objectId: 'company',
|
||||
scopeContext: CompanyBoardRecoilScopeContext,
|
||||
});
|
||||
|
||||
return (
|
||||
<>
|
||||
<HooksCompanyBoard />
|
||||
<EntityBoard
|
||||
boardOptions={boardOptions}
|
||||
defaultViewName="All opportunities"
|
||||
onViewsChange={handleViewsChange}
|
||||
onViewSubmit={handleViewSubmit}
|
||||
scopeContext={CompanyBoardRecoilScopeContext}
|
||||
{...props}
|
||||
/>
|
||||
<EntityBoardActionBar />
|
||||
<EntityBoardContextMenu />
|
||||
</>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user