Fix: Table / Board createView bug (#1782)
* fix createView for tables and board page * removed residual console.log from InlineCell component
This commit is contained in:
@ -109,7 +109,6 @@ export const BoardHeader = ({ className, onStageAdd }: BoardHeaderProps) => {
|
||||
onCurrentViewSubmit: handleCurrentViewSubmit,
|
||||
onViewBarReset: handleViewBarReset,
|
||||
onViewSelect: handleViewSelect,
|
||||
onViewCreate: (view) => setSearchParams({ view: view.id }),
|
||||
}}
|
||||
>
|
||||
<ViewBar
|
||||
|
||||
@ -54,7 +54,6 @@ export const InlineCell = () => {
|
||||
persistField();
|
||||
closeInlineCell();
|
||||
};
|
||||
console.log(JSON.stringify({ fieldDefinition }));
|
||||
|
||||
return (
|
||||
<InlineCellContainer
|
||||
|
||||
@ -40,7 +40,6 @@ export const TableHeader = () => {
|
||||
...viewBarContextProps,
|
||||
onCurrentViewSubmit,
|
||||
onViewSelect: handleViewSelect,
|
||||
onViewCreate: (view) => setSearchParams({ view: view.id }),
|
||||
}}
|
||||
>
|
||||
<ViewBar
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
|
||||
import { RecoilScopeContext } from '@/types/RecoilScopeContext';
|
||||
import { useBoardColumns } from '@/ui/board/hooks/useBoardColumns';
|
||||
import { boardCardFieldsScopedState } from '@/ui/board/states/boardCardFieldsScopedState';
|
||||
@ -29,10 +31,13 @@ export const useBoardViews = ({
|
||||
const filters = useRecoilScopedValue(filtersScopedState, RecoilScopeContext);
|
||||
const sorts = useRecoilScopedValue(sortsScopedState, RecoilScopeContext);
|
||||
|
||||
const [_, setSearchParams] = useSearchParams();
|
||||
|
||||
const handleViewCreate = async (viewId: string) => {
|
||||
await createViewFields(boardCardFields, viewId);
|
||||
await createViewFilters(filters, viewId);
|
||||
await createViewSorts(sorts, viewId);
|
||||
setSearchParams({ view: viewId });
|
||||
};
|
||||
|
||||
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
|
||||
import { FieldMetadata } from '@/ui/field/types/FieldMetadata';
|
||||
import { TableRecoilScopeContext } from '@/ui/table/states/recoil-scope-contexts/TableRecoilScopeContext';
|
||||
import { tableColumnsScopedState } from '@/ui/table/states/tableColumnsScopedState';
|
||||
@ -29,10 +31,13 @@ export const useTableViews = ({
|
||||
);
|
||||
const sorts = useRecoilScopedValue(sortsScopedState, TableRecoilScopeContext);
|
||||
|
||||
const [_, setSearchParams] = useSearchParams();
|
||||
|
||||
const handleViewCreate = async (viewId: string) => {
|
||||
await createViewFields(tableColumns, viewId);
|
||||
await createViewFilters(filters, viewId);
|
||||
await createViewSorts(sorts, viewId);
|
||||
setSearchParams({ view: viewId });
|
||||
};
|
||||
|
||||
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
||||
|
||||
Reference in New Issue
Block a user