[WEB-4321]chore: workspace views refactor (#7214)
* chore: workspace views reafactor * chore: resolved coderabbit suggestions * chore: added project level workspace filter * chore: added enum for roles * chore: removed redundant type definition * chore: optimised the query --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
This commit is contained in:
parent
8988cf9a85
commit
64fd0b2830
24 changed files with 381 additions and 172 deletions
51
web/core/components/views/helper.tsx
Normal file
51
web/core/components/views/helper.tsx
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
import { EIssueLayoutTypes } from "@plane/constants";
|
||||
import { WorkspaceAdditionalLayouts } from "@/plane-web/components/views/helper";
|
||||
import { WorkspaceSpreadsheetRoot } from "../issues/issue-layouts/spreadsheet/roots/workspace-root";
|
||||
|
||||
export type TWorkspaceLayoutProps = {
|
||||
activeLayout: EIssueLayoutTypes | undefined;
|
||||
isDefaultView: boolean;
|
||||
isLoading?: boolean;
|
||||
toggleLoading: (value: boolean) => void;
|
||||
workspaceSlug: string;
|
||||
globalViewId: string;
|
||||
routeFilters: {
|
||||
[key: string]: string;
|
||||
};
|
||||
fetchNextPages: () => void;
|
||||
globalViewsLoading: boolean;
|
||||
issuesLoading: boolean;
|
||||
};
|
||||
|
||||
export const WorkspaceActiveLayout = (props: TWorkspaceLayoutProps) => {
|
||||
const {
|
||||
activeLayout = EIssueLayoutTypes.SPREADSHEET,
|
||||
isDefaultView,
|
||||
isLoading,
|
||||
toggleLoading,
|
||||
workspaceSlug,
|
||||
globalViewId,
|
||||
routeFilters,
|
||||
fetchNextPages,
|
||||
globalViewsLoading,
|
||||
issuesLoading,
|
||||
} = props;
|
||||
switch (activeLayout) {
|
||||
case EIssueLayoutTypes.SPREADSHEET:
|
||||
return (
|
||||
<WorkspaceSpreadsheetRoot
|
||||
isDefaultView={isDefaultView}
|
||||
isLoading={isLoading}
|
||||
toggleLoading={toggleLoading}
|
||||
workspaceSlug={workspaceSlug}
|
||||
globalViewId={globalViewId}
|
||||
routeFilters={routeFilters}
|
||||
fetchNextPages={fetchNextPages}
|
||||
globalViewsLoading={globalViewsLoading}
|
||||
issuesLoading={issuesLoading}
|
||||
/>
|
||||
);
|
||||
default:
|
||||
return <WorkspaceAdditionalLayouts {...props} />;
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue