diff --git a/apps/app/components/analytics/custom-analytics/custom-analytics.tsx b/apps/app/components/analytics/custom-analytics/custom-analytics.tsx index 4d6a2bdbe..d04733b56 100644 --- a/apps/app/components/analytics/custom-analytics/custom-analytics.tsx +++ b/apps/app/components/analytics/custom-analytics/custom-analytics.tsx @@ -61,7 +61,7 @@ export const CustomAnalytics: React.FC = ({ = ({ }; const selectedProjects = - params.project && params.project.length > 0 ? params.project : projects.map((p) => p.id); + params.project && params.project.length > 0 ? params.project : projects?.map((p) => p.id); return (
= ({
)} -
+
{fullScreen ? ( <> {!isProjectLevel && selectedProjects && selectedProjects.length > 0 && ( @@ -215,61 +215,62 @@ export const AnalyticsSidebar: React.FC = ({

Selected Projects

{selectedProjects.map((projectId) => { - const project: IProject = projects.find((p) => p.id === projectId); + const project = projects?.find((p) => p.id === projectId); - return ( -
-
- {project.emoji ? ( - - {renderEmoji(project.emoji)} - - ) : project.icon_prop ? ( -
- - {project.icon_prop.name} + if (project) + return ( +
+
+ {project.emoji ? ( + + {renderEmoji(project.emoji)} -
- ) : ( - - {project?.name.charAt(0)} - - )} -
-

{project.name}

- - ({project.identifier}) - -
-
-
-
-
- -
Total members
-
- {project.total_members} + ) : project.icon_prop ? ( +
+ + {project.icon_prop.name} + +
+ ) : ( + + {project?.name.charAt(0)} + + )} +
+

{truncateText(project.name, 20)}

+ + ({project.identifier}) + +
-
-
- -
Total cycles
+
+
+
+ +
Total members
+
+ {project.total_members}
- {project.total_cycles} -
-
-
- -
Total modules
+
+
+ +
Total cycles
+
+ {project.total_cycles} +
+
+
+ +
Total modules
+
+ {project.total_modules}
- {project.total_modules}
-
- ); + ); })}
diff --git a/apps/app/components/core/issues-view.tsx b/apps/app/components/core/issues-view.tsx index 39135480f..b53553c9f 100644 --- a/apps/app/components/core/issues-view.tsx +++ b/apps/app/components/core/issues-view.tsx @@ -29,19 +29,13 @@ import { } from "components/core"; import { CreateUpdateIssueModal, DeleteIssueModal } from "components/issues"; import { CreateUpdateViewModal } from "components/views"; -import { CycleIssuesGanttChartView, TransferIssues, TransferIssuesModal } from "components/cycles"; -import { IssueGanttChartView } from "components/issues/gantt-chart"; +import { TransferIssues, TransferIssuesModal } from "components/cycles"; // ui -import { EmptySpace, EmptySpaceItem, EmptyState, PrimaryButton, Spinner } from "components/ui"; +import { EmptyState, PrimaryButton, Spinner } from "components/ui"; // icons -import { - ListBulletIcon, - PlusIcon, - RectangleStackIcon, - TrashIcon, -} from "@heroicons/react/24/outline"; +import { PlusIcon, TrashIcon } from "@heroicons/react/24/outline"; // images -import emptyIssue from "public/empty-state/empty-issue.svg"; +import emptyIssue from "public/empty-state/issue.svg"; // helpers import { getStatesList } from "helpers/state.helper"; import { orderArrayBy } from "helpers/array.helper"; @@ -56,7 +50,6 @@ import { PROJECT_ISSUES_LIST_WITH_PARAMS, STATES_LIST, } from "constants/fetch-keys"; -import { ModuleIssuesGanttChartView } from "components/modules"; type Props = { type?: "issue" | "cycle" | "module"; @@ -107,7 +100,7 @@ export const IssuesView: React.FC = ({ groupByProperty: selectedGroup, orderBy, filters, - isNotEmpty, + isEmpty, setFilters, params, } = useIssuesView(); @@ -517,7 +510,7 @@ export const IssuesView: React.FC = ({ )} {groupedByIssues ? ( - isNotEmpty ? ( + !isEmpty || issueView === "kanban" || issueView === "calendar" ? ( <> {isCompleted && setTransferIssuesModal(true)} />} {issueView === "list" ? ( @@ -584,46 +577,20 @@ export const IssuesView: React.FC = ({ issueView === "gantt_chart" && )} - ) : type === "issue" ? ( - ) : ( -
- - - Use
C
{" "} - shortcut to create a new issue - - } - Icon={PlusIcon} - action={() => { - const e = new KeyboardEvent("keydown", { - key: "c", - }); - document.dispatchEvent(e); - }} - /> - {openIssuesListModal && ( - - )} -
-
+ } + onClick={() => { + const e = new KeyboardEvent("keydown", { + key: "c", + }); + document.dispatchEvent(e); + }} + /> ) ) : (
diff --git a/apps/app/components/cycles/cycles-view.tsx b/apps/app/components/cycles/cycles-view.tsx index 0220018ab..bcf3281ce 100644 --- a/apps/app/components/cycles/cycles-view.tsx +++ b/apps/app/components/cycles/cycles-view.tsx @@ -19,8 +19,10 @@ import { } from "components/cycles"; // ui import { EmptyState, Loader } from "components/ui"; +// icons +import { PlusIcon } from "@heroicons/react/24/outline"; // images -import emptyCycle from "public/empty-state/empty-cycle.svg"; +import emptyCycle from "public/empty-state/cycle.svg"; // helpers import { getDateRangeStatus } from "helpers/date-time.helper"; // types @@ -205,10 +207,17 @@ export const CyclesView: React.FC = ({ cycles, viewType }) => { ) ) : ( } + onClick={() => { + const e = new KeyboardEvent("keydown", { + key: "q", + }); + document.dispatchEvent(e); + }} /> ) ) : viewType === "list" ? ( diff --git a/apps/app/components/integration/jira/give-details.tsx b/apps/app/components/integration/jira/give-details.tsx index 3bfe159b5..3fc5d9641 100644 --- a/apps/app/components/integration/jira/give-details.tsx +++ b/apps/app/components/integration/jira/give-details.tsx @@ -137,7 +137,7 @@ export const JiraGetImportDetail: React.FC = () => { label={ {value && value !== "" ? ( - projects.find((p) => p.id === value)?.name + projects?.find((p) => p.id === value)?.name ) : ( Select a project )} @@ -145,7 +145,7 @@ export const JiraGetImportDetail: React.FC = () => { } verticalPosition="top" > - {projects.length > 0 ? ( + {projects && projects.length > 0 ? ( projects.map((project) => ( {project.name} diff --git a/apps/app/components/pages/pages-list/recent-pages-list.tsx b/apps/app/components/pages/pages-list/recent-pages-list.tsx index ce66a6ce1..2a4942564 100644 --- a/apps/app/components/pages/pages-list/recent-pages-list.tsx +++ b/apps/app/components/pages/pages-list/recent-pages-list.tsx @@ -10,8 +10,10 @@ import pagesService from "services/pages.service"; import { PagesView } from "components/pages"; // ui import { EmptyState, Loader } from "components/ui"; +// icons +import { PlusIcon } from "@heroicons/react/24/outline"; // images -import emptyPage from "public/empty-state/empty-page.svg"; +import emptyPage from "public/empty-state/page.svg"; // helpers import { replaceUnderscoreIfSnakeCase } from "helpers/string.helper"; // types @@ -51,10 +53,17 @@ export const RecentPagesList: React.FC = ({ viewType }) => { }) ) : ( } + onClick={() => { + const e = new KeyboardEvent("keydown", { + key: "d", + }); + document.dispatchEvent(e); + }} /> ) ) : ( diff --git a/apps/app/components/pages/pages-view.tsx b/apps/app/components/pages/pages-view.tsx index bc4f0f438..b1c8419f6 100644 --- a/apps/app/components/pages/pages-view.tsx +++ b/apps/app/components/pages/pages-view.tsx @@ -18,8 +18,10 @@ import { } from "components/pages"; // ui import { EmptyState, Loader } from "components/ui"; +// icons +import { PlusIcon } from "@heroicons/react/24/outline"; // images -import emptyPage from "public/empty-state/empty-page.svg"; +import emptyPage from "public/empty-state/page.svg"; // types import { IPage, TPageViewProps } from "types"; import { @@ -255,10 +257,17 @@ export const PagesView: React.FC = ({ pages, viewType }) => { ) ) : ( } + onClick={() => { + const e = new KeyboardEvent("keydown", { + key: "d", + }); + document.dispatchEvent(e); + }} /> )}
diff --git a/apps/app/components/pages/single-page-detailed-item.tsx b/apps/app/components/pages/single-page-detailed-item.tsx index c6e27f83f..fcd6ca54f 100644 --- a/apps/app/components/pages/single-page-detailed-item.tsx +++ b/apps/app/components/pages/single-page-detailed-item.tsx @@ -20,7 +20,11 @@ import { import { ExclamationIcon } from "components/icons"; // helpers import { copyTextToClipboard, truncateText } from "helpers/string.helper"; -import { renderShortTime, renderShortDate, renderLongDateFormat } from "helpers/date-time.helper"; +import { + render24HourFormatTime, + renderShortDate, + renderLongDateFormat, +} from "helpers/date-time.helper"; // types import { IPage, IProjectMember } from "types"; @@ -97,11 +101,13 @@ export const SinglePageDetailedItem: React.FC = ({
-

{renderShortTime(page.updated_at)}

+

+ {render24HourFormatTime(page.updated_at)} +

{page.is_favorite ? ( - - Star us on GitHub - + {projects ? ( + projects.length > 0 ? ( +
+
+
+

+ Plane is open source, support us by starring us on GitHub. +

+
+ + + Star us on GitHub + +
+
+ +
+ + + + +
- -
- - - - + ) : ( +
+

+ Good {greeting}, {user?.first_name} {user?.last_name} +

+
+ {DAYS[today.getDay()]}, {renderShortDate(today)} {render12HourFormatTime(today)} +
+
+
+
Create a project
+

+ Manage your projects by creating issues, cycles, modules, views and pages. +

+ { + const e = new KeyboardEvent("keydown", { + key: "p", + }); + document.dispatchEvent(e); + }} + > + Create Project + +
+
+ Empty Dashboard +
+
-
-
+ ) + ) : null} ); }; diff --git a/apps/app/pages/[workspaceSlug]/me/my-issues.tsx b/apps/app/pages/[workspaceSlug]/me/my-issues.tsx index 77c58873e..e4826bf64 100644 --- a/apps/app/pages/[workspaceSlug]/me/my-issues.tsx +++ b/apps/app/pages/[workspaceSlug]/me/my-issues.tsx @@ -5,13 +5,15 @@ import { useRouter } from "next/router"; // headless ui import { Disclosure, Popover, Transition } from "@headlessui/react"; // icons -import { ChevronDownIcon, PlusIcon, RectangleStackIcon } from "@heroicons/react/24/outline"; +import { ChevronDownIcon, PlusIcon } from "@heroicons/react/24/outline"; +// images +import emptyMyIssues from "public/empty-state/my-issues.svg"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; // hooks import useIssues from "hooks/use-issues"; // ui -import { Spinner, EmptySpace, EmptySpaceItem, PrimaryButton } from "components/ui"; +import { Spinner, PrimaryButton, EmptyState } from "components/ui"; import { Breadcrumbs, BreadcrumbItem } from "components/breadcrumbs"; // hooks import useMyIssuesProperties from "hooks/use-my-issues-filter"; @@ -23,13 +25,14 @@ import { MyIssuesListItem } from "components/issues"; import { replaceUnderscoreIfSnakeCase } from "helpers/string.helper"; // types import type { NextPage } from "next"; +import useProjects from "hooks/use-projects"; const MyIssuesPage: NextPage = () => { const router = useRouter(); const { workspaceSlug } = router.query; - // fetching user issues const { myIssues } = useIssues(workspaceSlug as string); + const { projects } = useProjects(); const [properties, setProperties] = useMyIssuesProperties(workspaceSlug as string); @@ -148,30 +151,39 @@ const MyIssuesPage: NextPage = () => { )} ) : ( -
- - - Use
C
shortcut - to create a new issue - - } - Icon={PlusIcon} - action={() => { - const e = new KeyboardEvent("keydown", { - key: "c", - }); - document.dispatchEvent(e); - }} - /> -
-
+ 0 + ? "You don't have any issue assigned to you yet" + : "Issues assigned to you will appear here" + : "" + } + description={ + projects + ? projects.length > 0 + ? "Keep track of your work in a single place." + : "Let's create your first project and add issues that you want to accomplish." + : "" + } + image={emptyMyIssues} + buttonText={projects ? (projects.length > 0 ? "New Issue" : "New Project") : ""} + buttonIcon={} + onClick={() => { + let e: KeyboardEvent; + + if (projects && projects.length > 0) + e = new KeyboardEvent("keydown", { + key: "c", + }); + else + e = new KeyboardEvent("keydown", { + key: "p", + }); + + document.dispatchEvent(e); + }} + /> )} ) : ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx index b86e6eee5..4997ddf6e 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx @@ -10,7 +10,6 @@ import { Tab } from "@headlessui/react"; import useLocalStorage from "hooks/use-local-storage"; import useUserAuth from "hooks/use-user-auth"; // services -import cycleService from "services/cycles.service"; import projectService from "services/project.service"; // layouts import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx index e3df4a53a..ba952be7a 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/modules/index.tsx @@ -21,9 +21,9 @@ import { import { EmptyState, Loader, PrimaryButton } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; // icons -import { ChartBarIcon, PlusIcon, Squares2X2Icon } from "@heroicons/react/24/outline"; +import { PlusIcon, Squares2X2Icon } from "@heroicons/react/24/outline"; // images -import emptyModule from "public/empty-state/empty-module.svg"; +import emptyModule from "public/empty-state/module.svg"; // types import { IModule, SelectModuleType } from "types/modules"; import type { NextPage } from "next"; @@ -141,10 +141,17 @@ const ProjectModules: NextPage = () => {
) : ( } + onClick={() => { + const e = new KeyboardEvent("keydown", { + key: "m", + }); + document.dispatchEvent(e); + }} /> ) ) : ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 519853858..f34689237 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -41,7 +41,7 @@ import { } from "@heroicons/react/24/outline"; import { ColorPalletteIcon, ClipboardIcon } from "components/icons"; // helpers -import { renderShortTime, renderShortDate } from "helpers/date-time.helper"; +import { render24HourFormatTime, renderShortDate } from "helpers/date-time.helper"; import { copyTextToClipboard } from "helpers/string.helper"; import { orderArrayBy } from "helpers/array.helper"; // types @@ -397,11 +397,11 @@ const SinglePage: NextPage = () => {
-

{renderShortTime(pageDetails.updated_at)}

+

{render24HourFormatTime(pageDetails.updated_at)}