chore: create update view modal and sidebar global issues redirection

This commit is contained in:
Anmol Singh Bhatia 2023-09-22 15:21:20 +05:30
parent b297241d34
commit 8dbd77974b
5 changed files with 12 additions and 2 deletions

View File

@ -161,6 +161,7 @@ export const CommandPalette: React.FC = observer(() => {
/> />
<CreateUpdateViewModal <CreateUpdateViewModal
handleClose={() => setIsCreateViewModalOpen(false)} handleClose={() => setIsCreateViewModalOpen(false)}
viewType="project"
isOpen={isCreateViewModalOpen} isOpen={isCreateViewModalOpen}
user={user} user={user}
/> />

View File

@ -12,6 +12,7 @@ import stateService from "services/state.service";
// hooks // hooks
import useUser from "hooks/use-user"; import useUser from "hooks/use-user";
import { useProjectMyMembership } from "contexts/project-member.context"; import { useProjectMyMembership } from "contexts/project-member.context";
import useSpreadsheetIssuesView from "hooks/use-spreadsheet-issues-view";
// components // components
import { import {
AllLists, AllLists,
@ -86,6 +87,8 @@ export const AllViews: React.FC<Props> = ({
const { groupedIssues, isEmpty, displayFilters } = viewProps; const { groupedIssues, isEmpty, displayFilters } = viewProps;
const { spreadsheetIssues, mutateIssues } = useSpreadsheetIssuesView();
const { data: stateGroups } = useSWR( const { data: stateGroups } = useSWR(
workspaceSlug && projectId ? STATES_LIST(projectId as string) : null, workspaceSlug && projectId ? STATES_LIST(projectId as string) : null,
workspaceSlug workspaceSlug
@ -174,6 +177,8 @@ export const AllViews: React.FC<Props> = ({
) : displayFilters?.layout === "spreadsheet" ? ( ) : displayFilters?.layout === "spreadsheet" ? (
<SpreadsheetView <SpreadsheetView
handleIssueAction={handleIssueAction} handleIssueAction={handleIssueAction}
spreadsheetIssues={spreadsheetIssues}
mutateIssues={mutateIssues}
openIssuesListModal={cycleId || moduleId ? openIssuesListModal : null} openIssuesListModal={cycleId || moduleId ? openIssuesListModal : null}
disableUserActions={disableUserActions} disableUserActions={disableUserActions}
user={user} user={user}

View File

@ -481,6 +481,7 @@ export const IssuesView: React.FC<Props> = ({
<CreateUpdateViewModal <CreateUpdateViewModal
isOpen={createViewModal !== null} isOpen={createViewModal !== null}
handleClose={() => setCreateViewModal(null)} handleClose={() => setCreateViewModal(null)}
viewType="project"
preLoadedData={createViewModal} preLoadedData={createViewModal}
user={user} user={user}
/> />

View File

@ -34,8 +34,8 @@ const workspaceLinks = (workspaceSlug: string) => [
}, },
{ {
Icon: TaskAltOutlined, Icon: TaskAltOutlined,
name: "My Issues", name: "Issues",
href: `/${workspaceSlug}/me/my-issues`, href: `/${workspaceSlug}/workspace-views`,
}, },
]; ];

View File

@ -88,12 +88,14 @@ const ProjectViews: NextPage = () => {
> >
<CreateUpdateViewModal <CreateUpdateViewModal
isOpen={createUpdateViewModal} isOpen={createUpdateViewModal}
viewType="project"
handleClose={() => setCreateUpdateViewModal(false)} handleClose={() => setCreateUpdateViewModal(false)}
data={selectedViewToUpdate} data={selectedViewToUpdate}
user={user} user={user}
/> />
<DeleteViewModal <DeleteViewModal
isOpen={deleteViewModal} isOpen={deleteViewModal}
viewType="project"
data={selectedViewToDelete} data={selectedViewToDelete}
setIsOpen={setDeleteViewModal} setIsOpen={setDeleteViewModal}
user={user} user={user}
@ -107,6 +109,7 @@ const ProjectViews: NextPage = () => {
<SingleViewItem <SingleViewItem
key={view.id} key={view.id}
view={view} view={view}
viewType="project"
handleEditView={() => handleEditView(view)} handleEditView={() => handleEditView(view)}
handleDeleteView={() => handleDeleteView(view)} handleDeleteView={() => handleDeleteView(view)}
/> />