cleanup
This commit is contained in:
@@ -19,6 +19,7 @@ import { PointerTrackingProvider, usePointerTracking } from './PointerTrackingCo
|
|||||||
import type { Identifier } from '../types/identifiers';
|
import type { Identifier } from '../types/identifiers';
|
||||||
import type { DocumentsListEntry, Document } from '../types/documents';
|
import type { DocumentsListEntry, Document } from '../types/documents';
|
||||||
import { usePreviewContext } from '../preview/PreviewContext';
|
import { usePreviewContext } from '../preview/PreviewContext';
|
||||||
|
import { useAppState } from '../app/appState';
|
||||||
|
|
||||||
type TagLike = { id?: Identifier | null; label?: string; color?: string | null } | null;
|
type TagLike = { id?: Identifier | null; label?: string; color?: string | null } | null;
|
||||||
type OverlaySource = { url: string; alt?: string | null; mimeType?: string | null; };
|
type OverlaySource = { url: string; alt?: string | null; mimeType?: string | null; };
|
||||||
@@ -51,7 +52,6 @@ export interface DesktopWorkspaceProps {
|
|||||||
onSelectionChange?: (selectedIds: Identifier[]) => void;
|
onSelectionChange?: (selectedIds: Identifier[]) => void;
|
||||||
onDocumentTagAttach?: (docId: Identifier, tagId: Identifier) => void;
|
onDocumentTagAttach?: (docId: Identifier, tagId: Identifier) => void;
|
||||||
onDocumentTagDetach?: (docId: Identifier, tagId: Identifier) => void;
|
onDocumentTagDetach?: (docId: Identifier, tagId: Identifier) => void;
|
||||||
tenantId?: Identifier | null;
|
|
||||||
viewId?: string | null;
|
viewId?: string | null;
|
||||||
defaultCardSize?: number;
|
defaultCardSize?: number;
|
||||||
}
|
}
|
||||||
@@ -87,11 +87,12 @@ const DesktopWorkspaceContent: React.FC<DesktopWorkspaceProps> = ({
|
|||||||
onSelectionChange,
|
onSelectionChange,
|
||||||
onDocumentTagAttach,
|
onDocumentTagAttach,
|
||||||
onDocumentTagDetach,
|
onDocumentTagDetach,
|
||||||
tenantId,
|
|
||||||
viewId,
|
viewId,
|
||||||
defaultCardSize = 200,
|
defaultCardSize = 200,
|
||||||
}) => {
|
}) => {
|
||||||
const { openPreview } = usePreviewContext();
|
const { openPreview } = usePreviewContext();
|
||||||
|
const { tenant } = useAppState();
|
||||||
|
const tenantId = tenant?.id as Identifier;
|
||||||
const { addPointer, removePointer } = usePointerTracking();
|
const { addPointer, removePointer } = usePointerTracking();
|
||||||
const containerRef = useRef<HTMLDivElement>(null);
|
const containerRef = useRef<HTMLDivElement>(null);
|
||||||
const [isLayoutReady, setIsLayoutReady] = useState(false);
|
const [isLayoutReady, setIsLayoutReady] = useState(false);
|
||||||
|
|||||||
@@ -64,7 +64,6 @@ export interface UseDocumentsPanelPropsArgs {
|
|||||||
folderOptions?: unknown[];
|
folderOptions?: unknown[];
|
||||||
moveDocumentsToFolder?: (...args: unknown[]) => void;
|
moveDocumentsToFolder?: (...args: unknown[]) => void;
|
||||||
selectionValue: WorkspaceSelectionValue;
|
selectionValue: WorkspaceSelectionValue;
|
||||||
currentTenantId?: Identifier | null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DocumentsPanelProps = ReturnType<typeof useDocumentsPanelProps>;
|
export type DocumentsPanelProps = ReturnType<typeof useDocumentsPanelProps>;
|
||||||
@@ -118,7 +117,6 @@ const useDocumentsPanelProps = (props: UseDocumentsPanelPropsArgs) => {
|
|||||||
folderOptions,
|
folderOptions,
|
||||||
moveDocumentsToFolder,
|
moveDocumentsToFolder,
|
||||||
selectionValue,
|
selectionValue,
|
||||||
currentTenantId,
|
|
||||||
} = props;
|
} = props;
|
||||||
|
|
||||||
return useMemo(
|
return useMemo(
|
||||||
@@ -173,7 +171,6 @@ const useDocumentsPanelProps = (props: UseDocumentsPanelPropsArgs) => {
|
|||||||
folderOptions,
|
folderOptions,
|
||||||
onMoveDocumentsToFolder: moveDocumentsToFolder,
|
onMoveDocumentsToFolder: moveDocumentsToFolder,
|
||||||
selectionValue,
|
selectionValue,
|
||||||
currentTenantId,
|
|
||||||
}),
|
}),
|
||||||
[
|
[
|
||||||
activeCorrespondentFilters,
|
activeCorrespondentFilters,
|
||||||
@@ -223,7 +220,6 @@ const useDocumentsPanelProps = (props: UseDocumentsPanelPropsArgs) => {
|
|||||||
getDocumentAsset,
|
getDocumentAsset,
|
||||||
folderOptions,
|
folderOptions,
|
||||||
selectionValue,
|
selectionValue,
|
||||||
currentTenantId,
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ export interface DocumentsViewProps {
|
|||||||
activeCorrespondentIdSet?: Set<Identifier> | null;
|
activeCorrespondentIdSet?: Set<Identifier> | null;
|
||||||
scrollRef?: RefObject<HTMLElement | null>;
|
scrollRef?: RefObject<HTMLElement | null>;
|
||||||
// Desk specific (optional for now or handled via intersection)
|
// Desk specific (optional for now or handled via intersection)
|
||||||
tenantId?: Identifier | null;
|
|
||||||
viewId?: string | null;
|
viewId?: string | null;
|
||||||
activeTagFilters?: Array<Identifier | null>;
|
activeTagFilters?: Array<Identifier | null>;
|
||||||
}
|
}
|
||||||
@@ -137,7 +136,6 @@ const DocumentsPanelInner: React.FC<DocumentsPanelInnerProps> = ({
|
|||||||
selectedFolder = null,
|
selectedFolder = null,
|
||||||
onDocumentTagAttach,
|
onDocumentTagAttach,
|
||||||
onDocumentTagDetach,
|
onDocumentTagDetach,
|
||||||
currentTenantId,
|
|
||||||
}): ReactNode => {
|
}): ReactNode => {
|
||||||
const {
|
const {
|
||||||
setFocusedEntryKey,
|
setFocusedEntryKey,
|
||||||
@@ -464,7 +462,6 @@ const DocumentsPanelInner: React.FC<DocumentsPanelInnerProps> = ({
|
|||||||
scrollRef,
|
scrollRef,
|
||||||
activeCorrespondentIdSet: activeCorrespondentIdSet,
|
activeCorrespondentIdSet: activeCorrespondentIdSet,
|
||||||
onCorrespondentClick: toggleCorrespondentFilter,
|
onCorrespondentClick: toggleCorrespondentFilter,
|
||||||
tenantId: currentTenantId,
|
|
||||||
viewId,
|
viewId,
|
||||||
onEntryPointer,
|
onEntryPointer,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1191,7 +1191,6 @@ const useDocumentsWorkspace = ({
|
|||||||
moveDocumentsToFolder,
|
moveDocumentsToFolder,
|
||||||
selectFolder,
|
selectFolder,
|
||||||
selectionValue: selection,
|
selectionValue: selection,
|
||||||
currentTenantId,
|
|
||||||
});
|
});
|
||||||
const documentsTableProps = useMemo(
|
const documentsTableProps = useMemo(
|
||||||
() => ({
|
() => ({
|
||||||
|
|||||||
Reference in New Issue
Block a user