diff --git a/web/components/core/views/spreadsheet-view/issue-column/issue-column.tsx b/web/components/core/views/spreadsheet-view/issue-column/issue-column.tsx index d75df7343..c00f085b2 100644 --- a/web/components/core/views/spreadsheet-view/issue-column/issue-column.tsx +++ b/web/components/core/views/spreadsheet-view/issue-column/issue-column.tsx @@ -83,88 +83,89 @@ export const IssueColumn: React.FC = ({ return (
-
-
- {properties.key && ( - + {properties.key && ( +
+
+ {issue.project_detail?.identifier}-{issue.sequence_id} - )} - {!isNotAllowed && !disableUserActions && ( -
- setIsOpen(nextOpenState)} - content={ -
- - + - -
- } - placement="bottom-start" + + + +
+ } + placement="bottom-start" + > + + +
+ )} +
+ + {issue.sub_issues_count > 0 && ( +
+
)}
- - {issue.sub_issues_count > 0 && ( -
- -
- )} -
+ )}
- {renderColumn( - "State", - "state", - SpreadsheetStateColumn, - "state__name", - "-state__name" - )} - {renderColumn( - "Priority", - "priority", - SpreadsheetPriorityColumn, - "priority", - "-priority" - )} - {renderColumn( - "Assignees", - "assignee", - SpreadsheetAssigneeColumn, - "assignees__first_name", - "-assignees__first_name" - )} - {renderColumn( - "Label", - "labels", - SpreadsheetLabelColumn, - "labels__name", - "-labels__name" - )} - {renderColumn( - "Start Date", - "start_date", - SpreadsheetStartDateColumn, - "-start_date", - "start_date" - )} - {renderColumn( - "Due Date", - "due_date", - SpreadsheetDueDateColumn, - "-target_date", - "target_date" - )} - {renderColumn( - "Estimate", - "estimate", - SpreadsheetEstimateColumn, - "estimate_point", - "-estimate_point" - )} - {renderColumn( - "Created On", - "created_on", - SpreadsheetCreatedOnColumn, - "-created_at", - "created_at" - )} - {renderColumn( - "Updated On", - "updated_on", - SpreadsheetUpdatedOnColumn, - "-updated_at", - "updated_at" - )} + {currentViewProperties.state && + renderColumn( + "State", + "state", + SpreadsheetStateColumn, + "state__name", + "-state__name" + )} + + {currentViewProperties.priority && + renderColumn( + "Priority", + "priority", + SpreadsheetPriorityColumn, + "priority", + "-priority" + )} + {currentViewProperties.assignee && + renderColumn( + "Assignees", + "assignee", + SpreadsheetAssigneeColumn, + "assignees__first_name", + "-assignees__first_name" + )} + {currentViewProperties.labels && + renderColumn( + "Label", + "labels", + SpreadsheetLabelColumn, + "labels__name", + "-labels__name" + )} + {currentViewProperties.start_date && + renderColumn( + "Start Date", + "start_date", + SpreadsheetStartDateColumn, + "-start_date", + "start_date" + )} + {currentViewProperties.due_date && + renderColumn( + "Due Date", + "due_date", + SpreadsheetDueDateColumn, + "-target_date", + "target_date" + )} + {currentViewProperties.estimate && + renderColumn( + "Estimate", + "estimate", + SpreadsheetEstimateColumn, + "estimate_point", + "-estimate_point" + )} + {currentViewProperties.created_on && + renderColumn( + "Created On", + "created_on", + SpreadsheetCreatedOnColumn, + "-created_at", + "created_at" + )} + {currentViewProperties.updated_on && + renderColumn( + "Updated On", + "updated_on", + SpreadsheetUpdatedOnColumn, + "-updated_at", + "updated_at" + )} ) : (
diff --git a/web/components/issues/my-issues/my-issues-view-options.tsx b/web/components/issues/my-issues/my-issues-view-options.tsx index 1cbc467a8..69cfa1909 100644 --- a/web/components/issues/my-issues/my-issues-view-options.tsx +++ b/web/components/issues/my-issues/my-issues-view-options.tsx @@ -30,7 +30,7 @@ const issueViewOptions: { type: TIssueViewOptions; Icon: any }[] = [ export const MyIssuesViewOptions: React.FC = () => { const router = useRouter(); - const { workspaceSlug, workspaceViewId } = router.query; + const { workspaceSlug, globalViewId } = router.query; const { displayFilters, setDisplayFilters, filters, setFilters } = useMyIssuesFilters( workspaceSlug?.toString() @@ -42,7 +42,7 @@ export const MyIssuesViewOptions: React.FC = () => { router.pathname.includes(pathname) ); - const showFilters = isWorkspaceViewPath || workspaceViewId; + const showFilters = isWorkspaceViewPath || globalViewId; return (
diff --git a/web/components/issues/workspace-views/workpace-view-issues.tsx b/web/components/issues/workspace-views/workpace-view-issues.tsx index be9a4f838..78a12f807 100644 --- a/web/components/issues/workspace-views/workpace-view-issues.tsx +++ b/web/components/issues/workspace-views/workpace-view-issues.tsx @@ -13,6 +13,7 @@ import useProjects from "hooks/use-projects"; import useUser from "hooks/use-user"; import { useWorkspaceView } from "hooks/use-workspace-view"; import useWorkspaceMembers from "hooks/use-workspace-members"; +import useToast from "hooks/use-toast"; // components import { WorkspaceViewsNavigation } from "components/workspace/views/workpace-view-navigation"; import { EmptyState, PrimaryButton } from "components/ui"; @@ -31,7 +32,9 @@ import { IIssue, IWorkspaceIssueFilterOptions } from "types"; export const WorkspaceViewIssues = () => { const router = useRouter(); - const { workspaceSlug, viewId } = router.query; + const { workspaceSlug, globalViewId } = router.query; + + const { setToastAlert } = useToast(); const { memberRole } = useProjectMyMembership(); const { user } = useUser(); @@ -111,7 +114,9 @@ export const WorkspaceViewIssues = () => { const nullFilters = filters.filters && Object.keys(filters.filters).filter( - (key) => filters.filters[key as keyof IWorkspaceIssueFilterOptions] === null + (key) => + filters.filters[key as keyof IWorkspaceIssueFilterOptions] === null || + (filters.filters[key as keyof IWorkspaceIssueFilterOptions]?.length ?? 0) <= 0 ); const areFiltersApplied = @@ -189,16 +194,22 @@ export const WorkspaceViewIssues = () => { /> { - if (viewId) handleFilters("filters", filters.filters, true); - else + if (globalViewId) { + handleFilters("filters", filters.filters, true); + setToastAlert({ + title: "View updated", + message: "Your view has been updated", + type: "success", + }); + } else setCreateViewModal({ query: filters.filters, }); }} className="flex items-center gap-2 text-sm" > - {!viewId && } - {viewId ? "Update" : "Save"} view + {!globalViewId && } + {globalViewId ? "Update" : "Save"} view
{
} diff --git a/web/components/issues/workspace-views/workspace-all-issue.tsx b/web/components/issues/workspace-views/workspace-all-issue.tsx index f256e4a3e..4618c331d 100644 --- a/web/components/issues/workspace-views/workspace-all-issue.tsx +++ b/web/components/issues/workspace-views/workspace-all-issue.tsx @@ -31,7 +31,7 @@ import { IIssue, IWorkspaceIssueFilterOptions } from "types"; export const WorkspaceAllIssue = () => { const router = useRouter(); - const { workspaceSlug, viewId } = router.query; + const { workspaceSlug, globalViewId } = router.query; const [createViewModal, setCreateViewModal] = useState(null); @@ -128,7 +128,9 @@ export const WorkspaceAllIssue = () => { const nullFilters = filters.filters && Object.keys(filters.filters).filter( - (key) => filters.filters[key as keyof IWorkspaceIssueFilterOptions] === null + (key) => + filters.filters[key as keyof IWorkspaceIssueFilterOptions] === null || + (filters.filters[key as keyof IWorkspaceIssueFilterOptions]?.length ?? 0) <= 0 ); const areFiltersApplied = @@ -203,7 +205,7 @@ export const WorkspaceAllIssue = () => { /> { - if (viewId) handleFilters("filters", filters.filters, true); + if (globalViewId) handleFilters("filters", filters.filters, true); else setCreateViewModal({ query: filters.filters, @@ -211,8 +213,8 @@ export const WorkspaceAllIssue = () => { }} className="flex items-center gap-2 text-sm" > - {!viewId && } - {viewId ? "Update" : "Save"} view + {!globalViewId && } + {globalViewId ? "Update" : "Save"} view
{
} diff --git a/web/components/issues/workspace-views/workspace-assigned-issue.tsx b/web/components/issues/workspace-views/workspace-assigned-issue.tsx index ccee9ab84..4469804ac 100644 --- a/web/components/issues/workspace-views/workspace-assigned-issue.tsx +++ b/web/components/issues/workspace-views/workspace-assigned-issue.tsx @@ -50,13 +50,6 @@ export const WorkspaceAssignedIssue = () => { sub_issue: false, }; - // const { data: viewDetails, error } = useSWR( - // workspaceSlug && workspaceViewId ? WORKSPACE_VIEW_DETAILS(workspaceViewId.toString()) : null, - // workspaceSlug && workspaceViewId - // ? () => workspaceService.getViewDetails(workspaceSlug.toString(), workspaceViewId.toString()) - // : null - // ); - const { data: viewIssues, mutate: mutateIssues } = useSWR( workspaceSlug ? WORKSPACE_VIEW_ISSUES(workspaceSlug.toString(), params) : null, workspaceSlug ? () => workspaceService.getViewIssues(workspaceSlug.toString(), params) : null diff --git a/web/components/issues/workspace-views/workspace-issue-view-option.tsx b/web/components/issues/workspace-views/workspace-issue-view-option.tsx index b635ff870..25ddc338a 100644 --- a/web/components/issues/workspace-views/workspace-issue-view-option.tsx +++ b/web/components/issues/workspace-views/workspace-issue-view-option.tsx @@ -30,13 +30,13 @@ const issueViewOptions: { type: TIssueViewOptions; Icon: any }[] = [ export const WorkspaceIssuesViewOptions: React.FC = () => { const router = useRouter(); - const { workspaceSlug, workspaceViewId } = router.query; + const { workspaceSlug, globalViewId } = router.query; const { filters, handleFilters } = useWorkspaceView(); const isWorkspaceViewPath = router.pathname.includes("workspace-views/all-issues"); - const showFilters = isWorkspaceViewPath || workspaceViewId; + const showFilters = isWorkspaceViewPath || globalViewId; return (
diff --git a/web/components/views/single-view-item.tsx b/web/components/views/single-view-item.tsx index 4e5312229..6dba9c097 100644 --- a/web/components/views/single-view-item.tsx +++ b/web/components/views/single-view-item.tsx @@ -91,7 +91,7 @@ export const SingleViewItem: React.FC = ({ const viewRedirectionUrl = viewType === "project" ? `/${workspaceSlug}/projects/${projectId}/views/${view.id}` - : `/${workspaceSlug}/workspace-views/issues?viewId=${view.id}`; + : `/${workspaceSlug}/workspace-views/issues?globalViewId=${view.id}`; return (
diff --git a/web/components/workspace/views/workpace-view-navigation.tsx b/web/components/workspace/views/workpace-view-navigation.tsx index 4e6a762b6..867764a5d 100644 --- a/web/components/workspace/views/workpace-view-navigation.tsx +++ b/web/components/workspace/views/workpace-view-navigation.tsx @@ -17,7 +17,7 @@ type Props = { export const WorkspaceViewsNavigation: React.FC = ({ handleAddView }) => { const router = useRouter(); - const { workspaceSlug, viewId } = router.query; + const { workspaceSlug, globalViewId } = router.query; const { data: workspaceViews } = useSWR( workspaceSlug ? WORKSPACE_VIEWS_LIST(workspaceSlug.toString()) : null, @@ -28,7 +28,7 @@ export const WorkspaceViewsNavigation: React.FC = ({ handleAddView }) => React.useEffect(() => { const activeTabElement = document.getElementById("active-tab-global-view"); if (activeTabElement) activeTabElement.scrollIntoView({ behavior: "smooth", inline: "center" }); - }, [viewId, workspaceViews]); + }, [globalViewId, workspaceViews]); const tabsList = [ { @@ -80,13 +80,13 @@ export const WorkspaceViewsNavigation: React.FC = ({ handleAddView }) => workspaceViews?.map((view) => (