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,
|
onCurrentViewSubmit: handleCurrentViewSubmit,
|
||||||
onViewBarReset: handleViewBarReset,
|
onViewBarReset: handleViewBarReset,
|
||||||
onViewSelect: handleViewSelect,
|
onViewSelect: handleViewSelect,
|
||||||
onViewCreate: (view) => setSearchParams({ view: view.id }),
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ViewBar
|
<ViewBar
|
||||||
|
|||||||
@ -54,7 +54,6 @@ export const InlineCell = () => {
|
|||||||
persistField();
|
persistField();
|
||||||
closeInlineCell();
|
closeInlineCell();
|
||||||
};
|
};
|
||||||
console.log(JSON.stringify({ fieldDefinition }));
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<InlineCellContainer
|
<InlineCellContainer
|
||||||
|
|||||||
@ -40,7 +40,6 @@ export const TableHeader = () => {
|
|||||||
...viewBarContextProps,
|
...viewBarContextProps,
|
||||||
onCurrentViewSubmit,
|
onCurrentViewSubmit,
|
||||||
onViewSelect: handleViewSelect,
|
onViewSelect: handleViewSelect,
|
||||||
onViewCreate: (view) => setSearchParams({ view: view.id }),
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ViewBar
|
<ViewBar
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { RecoilScopeContext } from '@/types/RecoilScopeContext';
|
import { RecoilScopeContext } from '@/types/RecoilScopeContext';
|
||||||
import { useBoardColumns } from '@/ui/board/hooks/useBoardColumns';
|
import { useBoardColumns } from '@/ui/board/hooks/useBoardColumns';
|
||||||
import { boardCardFieldsScopedState } from '@/ui/board/states/boardCardFieldsScopedState';
|
import { boardCardFieldsScopedState } from '@/ui/board/states/boardCardFieldsScopedState';
|
||||||
@ -29,10 +31,13 @@ export const useBoardViews = ({
|
|||||||
const filters = useRecoilScopedValue(filtersScopedState, RecoilScopeContext);
|
const filters = useRecoilScopedValue(filtersScopedState, RecoilScopeContext);
|
||||||
const sorts = useRecoilScopedValue(sortsScopedState, RecoilScopeContext);
|
const sorts = useRecoilScopedValue(sortsScopedState, RecoilScopeContext);
|
||||||
|
|
||||||
|
const [_, setSearchParams] = useSearchParams();
|
||||||
|
|
||||||
const handleViewCreate = async (viewId: string) => {
|
const handleViewCreate = async (viewId: string) => {
|
||||||
await createViewFields(boardCardFields, viewId);
|
await createViewFields(boardCardFields, viewId);
|
||||||
await createViewFilters(filters, viewId);
|
await createViewFilters(filters, viewId);
|
||||||
await createViewSorts(sorts, viewId);
|
await createViewSorts(sorts, viewId);
|
||||||
|
setSearchParams({ view: viewId });
|
||||||
};
|
};
|
||||||
|
|
||||||
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
|
||||||
import { FieldMetadata } from '@/ui/field/types/FieldMetadata';
|
import { FieldMetadata } from '@/ui/field/types/FieldMetadata';
|
||||||
import { TableRecoilScopeContext } from '@/ui/table/states/recoil-scope-contexts/TableRecoilScopeContext';
|
import { TableRecoilScopeContext } from '@/ui/table/states/recoil-scope-contexts/TableRecoilScopeContext';
|
||||||
import { tableColumnsScopedState } from '@/ui/table/states/tableColumnsScopedState';
|
import { tableColumnsScopedState } from '@/ui/table/states/tableColumnsScopedState';
|
||||||
@ -29,10 +31,13 @@ export const useTableViews = ({
|
|||||||
);
|
);
|
||||||
const sorts = useRecoilScopedValue(sortsScopedState, TableRecoilScopeContext);
|
const sorts = useRecoilScopedValue(sortsScopedState, TableRecoilScopeContext);
|
||||||
|
|
||||||
|
const [_, setSearchParams] = useSearchParams();
|
||||||
|
|
||||||
const handleViewCreate = async (viewId: string) => {
|
const handleViewCreate = async (viewId: string) => {
|
||||||
await createViewFields(tableColumns, viewId);
|
await createViewFields(tableColumns, viewId);
|
||||||
await createViewFilters(filters, viewId);
|
await createViewFilters(filters, viewId);
|
||||||
await createViewSorts(sorts, viewId);
|
await createViewSorts(sorts, viewId);
|
||||||
|
setSearchParams({ view: viewId });
|
||||||
};
|
};
|
||||||
|
|
||||||
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
const { createView, deleteView, isFetchingViews, updateView } = useViews({
|
||||||
|
|||||||
Reference in New Issue
Block a user