diff --git a/web/components/command-palette/command-pallette.tsx b/web/components/command-palette/command-pallette.tsx index b8ce9961c..3ec9234dc 100644 --- a/web/components/command-palette/command-pallette.tsx +++ b/web/components/command-palette/command-pallette.tsx @@ -1,7 +1,7 @@ import React, { useCallback, useEffect, useState } from "react"; - import { useRouter } from "next/router"; import useSWR from "swr"; +import { observer } from "mobx-react-lite"; // hooks import useToast from "hooks/use-toast"; import useUser from "hooks/use-user"; @@ -18,13 +18,10 @@ import { CreateUpdatePageModal } from "components/pages"; import { copyTextToClipboard } from "helpers/string.helper"; // services import issuesService from "services/issue.service"; -import inboxService from "services/inbox.service"; // fetch keys -import { INBOX_LIST, ISSUE_DETAILS } from "constants/fetch-keys"; +import { ISSUE_DETAILS } from "constants/fetch-keys"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; -import { observable } from "mobx"; -import { observer } from "mobx-react-lite"; export const CommandPalette: React.FC = observer(() => { const store: any = useMobxStore(); @@ -75,7 +72,7 @@ export const CommandPalette: React.FC = observer(() => { const handleKeyDown = useCallback( (e: KeyboardEvent) => { - const { key, ctrlKey, metaKey, altKey, shiftKey } = e; + const { key, ctrlKey, metaKey, altKey } = e; if (!key) return; const keyPressed = key.toLowerCase(); diff --git a/web/components/project/sidebar-list.tsx b/web/components/project/sidebar-list.tsx index 559de380a..e79a87b01 100644 --- a/web/components/project/sidebar-list.tsx +++ b/web/components/project/sidebar-list.tsx @@ -34,12 +34,12 @@ export const ProjectSidebarList: FC = observer(() => { // states const [isFavoriteProjectCreate, setIsFavoriteProjectCreate] = useState(false); const [isProjectModalOpen, setIsProjectModalOpen] = useState(false); - const [isScrolled, setIsScrolled] = useState(false); // scroll animation state - + // refs const containerRef = useRef(null); - + // user const { user } = useUserAuth(); + // toast const { setToastAlert } = useToast(); const joinedProjects = workspaceSlug && projectStore.joinedProjects; diff --git a/web/components/workspace/help-section.tsx b/web/components/workspace/help-section.tsx index 965a9e8a3..ae8cdd327 100644 --- a/web/components/workspace/help-section.tsx +++ b/web/components/workspace/help-section.tsx @@ -1,11 +1,7 @@ import React, { useRef, useState } from "react"; - import Link from "next/link"; - -// headless ui import { Transition } from "@headlessui/react"; // hooks -import useTheme from "hooks/use-theme"; import useOutsideClickDetector from "hooks/use-outside-click-detector"; // icons import { Bolt, HelpOutlineOutlined, WestOutlined } from "@mui/icons-material"; @@ -13,6 +9,7 @@ import { ChatBubbleOvalLeftEllipsisIcon } from "@heroicons/react/24/outline"; import { DocumentIcon, DiscordIcon, GithubIcon } from "components/icons"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; +import { observer } from "mobx-react-lite"; const helpOptions = [ { @@ -38,15 +35,14 @@ const helpOptions = [ }, ]; -export interface WorkspaceHelpSectionProps { - setSidebarActive: React.Dispatch>; -} - -export const WorkspaceHelpSection: React.FC = ({ setSidebarActive }) => { - const store: any = useMobxStore(); +export interface WorkspaceHelpSectionProps {} +export const WorkspaceHelpSection: React.FC = observer(() => { + // store + const { theme: themeStore } = useMobxStore(); + // states const [isNeedHelpOpen, setIsNeedHelpOpen] = useState(false); - + // refs const helpOptionsRef = useRef(null); useOutsideClickDetector(helpOptionsRef, () => setIsNeedHelpOpen(false)); @@ -55,23 +51,23 @@ export const WorkspaceHelpSection: React.FC = ({ setS <>
- {!store?.theme?.sidebarCollapsed && ( + {!themeStore?.sidebarCollapsed && (
Free Plan
)}
@@ -124,7 +120,7 @@ export const WorkspaceHelpSection: React.FC = ({ setS >
@@ -160,4 +156,4 @@ export const WorkspaceHelpSection: React.FC = ({ setS
); -}; +}); diff --git a/web/components/workspace/sidebar-menu.tsx b/web/components/workspace/sidebar-menu.tsx index 946f4b708..cf44ce551 100644 --- a/web/components/workspace/sidebar-menu.tsx +++ b/web/components/workspace/sidebar-menu.tsx @@ -7,14 +7,10 @@ import useTheme from "hooks/use-theme"; import { NotificationPopover } from "components/notifications"; import { Tooltip } from "components/ui"; // icons -import { - BarChartRounded, - GridViewOutlined, - TaskAltOutlined, - WorkOutlineOutlined, -} from "@mui/icons-material"; +import { BarChartRounded, GridViewOutlined, TaskAltOutlined, WorkOutlineOutlined } from "@mui/icons-material"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; +import { observer } from "mobx-react-lite"; const workspaceLinks = (workspaceSlug: string) => [ { @@ -39,21 +35,16 @@ const workspaceLinks = (workspaceSlug: string) => [ }, ]; -export const WorkspaceSidebarMenu = () => { - const store: any = useMobxStore(); - +export const WorkspaceSidebarMenu = observer(() => { + const { theme: themeStore } = useMobxStore(); + // router const router = useRouter(); const { workspaceSlug } = router.query; - const { collapsed: sidebarCollapse } = useTheme(); - return (
{workspaceLinks(workspaceSlug as string).map((link, index) => { - const isActive = - link.name === "Settings" - ? router.asPath.includes(link.href) - : router.asPath === link.href; + const isActive = link.name === "Settings" ? router.asPath.includes(link.href) : router.asPath === link.href; return ( @@ -62,17 +53,17 @@ export const WorkspaceSidebarMenu = () => { tooltipContent={link.name} position="right" className="ml-2" - disabled={!store?.theme?.sidebarCollapsed} + disabled={!themeStore?.sidebarCollapsed} >
{} - {!store?.theme?.sidebarCollapsed && link.name} + {!themeStore?.sidebarCollapsed && link.name}
@@ -83,4 +74,4 @@ export const WorkspaceSidebarMenu = () => {
); -}; +}); diff --git a/web/layouts/app-layout/app-header.tsx b/web/layouts/app-layout-legacy/app-header.tsx similarity index 100% rename from web/layouts/app-layout/app-header.tsx rename to web/layouts/app-layout-legacy/app-header.tsx diff --git a/web/layouts/app-layout/app-sidebar.tsx b/web/layouts/app-layout-legacy/app-sidebar.tsx similarity index 100% rename from web/layouts/app-layout/app-sidebar.tsx rename to web/layouts/app-layout-legacy/app-sidebar.tsx diff --git a/web/layouts/app-layout-legacy/layout.tsx b/web/layouts/app-layout-legacy/layout.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/web/layouts/app-layout/header.tsx b/web/layouts/app-layout/header.tsx new file mode 100644 index 000000000..e69de29bb diff --git a/web/layouts/app-layout/index.ts b/web/layouts/app-layout/index.ts new file mode 100644 index 000000000..8a235ad00 --- /dev/null +++ b/web/layouts/app-layout/index.ts @@ -0,0 +1,3 @@ +export * from "./layout"; +export * from "./sidebar"; +export * from "./header"; diff --git a/web/layouts/app-layout/layout.tsx b/web/layouts/app-layout/layout.tsx index e69de29bb..6e9f10264 100644 --- a/web/layouts/app-layout/layout.tsx +++ b/web/layouts/app-layout/layout.tsx @@ -0,0 +1,42 @@ +import { FC, ReactNode } from "react"; +// layouts +import { UserAuthWrapper, WorkspaceAuthWrapper } from "layouts/auth-layout"; +// components +import { CommandPalette } from "components/command-palette"; +import { AppSidebar } from "./sidebar"; + +export interface IAppLayout { + bg: string; + children: ReactNode; +} + +export const AppLayout: FC = (props) => { + const { bg = "primary", children } = props; + return ( +
+ + + +
+ +
+
+
+
{children}
+
+
+
+
+
+
+
+ ); +}; diff --git a/web/layouts/app-layout/sidebar.tsx b/web/layouts/app-layout/sidebar.tsx new file mode 100644 index 000000000..b5e804fdb --- /dev/null +++ b/web/layouts/app-layout/sidebar.tsx @@ -0,0 +1,36 @@ +import { FC } from "react"; +import { observer } from "mobx-react-lite"; +// components +import { + WorkspaceHelpSection, + WorkspaceSidebarDropdown, + WorkspaceSidebarMenu, + WorkspaceSidebarQuickAction, +} from "components/workspace"; +import { ProjectSidebarList } from "components/project"; +// mobx store +import { useMobxStore } from "lib/mobx/store-provider"; + +export interface IAppSidebar {} + +export const AppSidebar: FC = observer(() => { + // store + const { theme: themStore } = useMobxStore(); + + return ( +
+
+ + + + + +
+
+ ); +}); diff --git a/web/layouts/auth-layout-legacy/index.ts b/web/layouts/auth-layout-legacy/index.ts new file mode 100644 index 000000000..608e96606 --- /dev/null +++ b/web/layouts/auth-layout-legacy/index.ts @@ -0,0 +1,3 @@ +export * from "./project-authorization-wrapper"; +export * from "./workspace-authorization-wrapper"; +export * from "./user-authorization-wrapper"; diff --git a/web/layouts/auth-layout/project-authorization-wrapper.tsx b/web/layouts/auth-layout-legacy/project-authorization-wrapper.tsx similarity index 96% rename from web/layouts/auth-layout/project-authorization-wrapper.tsx rename to web/layouts/auth-layout-legacy/project-authorization-wrapper.tsx index 66f4693af..e8d57f955 100644 --- a/web/layouts/auth-layout/project-authorization-wrapper.tsx +++ b/web/layouts/auth-layout-legacy/project-authorization-wrapper.tsx @@ -6,8 +6,8 @@ import { useRouter } from "next/router"; // contexts import { useProjectMyMembership, ProjectMemberProvider } from "contexts/project-member.context"; // layouts -import AppHeader from "layouts/app-layout/app-header"; -import AppSidebar from "layouts/app-layout/app-sidebar"; +import AppHeader from "layouts/app-layout-legacy/app-header"; +import AppSidebar from "layouts/app-layout-legacy/app-sidebar"; // components import { NotAuthorizedView, JoinProject } from "components/auth-screens"; import { CommandPalette } from "components/command-palette"; diff --git a/web/layouts/auth-layout/user-authorization-wrapper.tsx b/web/layouts/auth-layout-legacy/user-authorization-wrapper.tsx similarity index 93% rename from web/layouts/auth-layout/user-authorization-wrapper.tsx rename to web/layouts/auth-layout-legacy/user-authorization-wrapper.tsx index f48403b0f..9e795aed7 100644 --- a/web/layouts/auth-layout/user-authorization-wrapper.tsx +++ b/web/layouts/auth-layout-legacy/user-authorization-wrapper.tsx @@ -22,7 +22,6 @@ export const UserAuthorizationLayout: React.FC = ({ children }) => { return (
-

Loading your profile...

diff --git a/web/layouts/auth-layout/workspace-authorization-wrapper.tsx b/web/layouts/auth-layout-legacy/workspace-authorization-wrapper.tsx similarity index 97% rename from web/layouts/auth-layout/workspace-authorization-wrapper.tsx rename to web/layouts/auth-layout-legacy/workspace-authorization-wrapper.tsx index 6dbb0cde9..c66945d42 100644 --- a/web/layouts/auth-layout/workspace-authorization-wrapper.tsx +++ b/web/layouts/auth-layout-legacy/workspace-authorization-wrapper.tsx @@ -10,8 +10,8 @@ import workspaceServices from "services/workspace.service"; // contexts import { WorkspaceMemberProvider } from "contexts/workspace-member.context"; // layouts -import AppSidebar from "layouts/app-layout/app-sidebar"; -import AppHeader from "layouts/app-layout/app-header"; +import AppSidebar from "layouts/app-layout-legacy/app-sidebar"; +import AppHeader from "layouts/app-layout-legacy/app-header"; import { UserAuthorizationLayout } from "./user-authorization-wrapper"; // components import { NotAuthorizedView, NotAWorkspaceMember } from "components/auth-screens"; diff --git a/web/layouts/auth-layout/index.ts b/web/layouts/auth-layout/index.ts index 6790a6b16..9f8f435fe 100644 --- a/web/layouts/auth-layout/index.ts +++ b/web/layouts/auth-layout/index.ts @@ -1,2 +1,2 @@ -export * from "./project-authorization-wrapper"; -export * from "./workspace-authorization-wrapper"; +export * from "./user-wrapper"; +export * from "./workspace-wrapper"; diff --git a/web/layouts/auth-layout/user-wrapper.tsx b/web/layouts/auth-layout/user-wrapper.tsx new file mode 100644 index 000000000..e37b4064e --- /dev/null +++ b/web/layouts/auth-layout/user-wrapper.tsx @@ -0,0 +1,39 @@ +import { FC, ReactNode } from "react"; +import { useRouter } from "next/router"; +import useSWR from "swr"; +// services +import userService from "services/user.service"; +// ui +import { Spinner } from "components/ui"; +// fetch-keys +import { CURRENT_USER } from "constants/fetch-keys"; + +export interface IUserAuthWrapper { + children: ReactNode; +} + +export const UserAuthWrapper: FC = (props) => { + const { children } = props; + // router + const router = useRouter(); + // fetching user information + const { data: currentUser, error } = useSWR(CURRENT_USER, () => userService.currentUser()); + + if (!currentUser && !error) { + return ( +
+
+ +
+
+ ); + } + + if (error) { + const redirectTo = router.asPath; + router.push(`/?next=${redirectTo}`); + return null; + } + + return <>{children}; +}; diff --git a/web/layouts/auth-layout/workspace-wrapper.tsx b/web/layouts/auth-layout/workspace-wrapper.tsx new file mode 100644 index 000000000..99233abc9 --- /dev/null +++ b/web/layouts/auth-layout/workspace-wrapper.tsx @@ -0,0 +1,73 @@ +import { FC, ReactNode } from "react"; +import { useRouter } from "next/router"; +import Link from "next/link"; +import useSWR from "swr"; +// services +import workspaceServices from "services/workspace.service"; +// icons +import { Spinner, PrimaryButton, SecondaryButton } from "components/ui"; +// fetch-keys +import { WORKSPACE_MEMBERS_ME } from "constants/fetch-keys"; + +export interface IWorkspaceAuthWrapper { + children: ReactNode; + noHeader?: boolean; + bg?: "primary" | "secondary"; + breadcrumbs?: JSX.Element; + left?: JSX.Element; + right?: JSX.Element; +} + +export const WorkspaceAuthWrapper: FC = (props) => { + const { children } = props; + // router + const router = useRouter(); + const { workspaceSlug } = router.query; + // fetching user workspace information + const { data: workspaceMemberMe, error } = useSWR( + workspaceSlug ? WORKSPACE_MEMBERS_ME(workspaceSlug as string) : null, + workspaceSlug ? () => workspaceServices.workspaceMemberMe(workspaceSlug.toString()) : null + ); + // while data is being loaded + if (!workspaceMemberMe && !error) { + return ( +
+
+ +
+
+ ); + } + // while user does not have access to view that workspace + if (error?.status === 401 || error?.status === 403) { + return ( +
+
+
+
+

Not Authorized!

+

+ You{"'"}re not a member of this workspace. Please contact the workspace admin to get an invitation or + check your pending invitations. +

+
+ +
+
+
+ ); + } + + return <>{children}; +}; diff --git a/web/layouts/profile-layout.tsx b/web/layouts/profile-layout.tsx index 46ac24d8e..b0be98495 100644 --- a/web/layouts/profile-layout.tsx +++ b/web/layouts/profile-layout.tsx @@ -1,7 +1,7 @@ // hooks import { useWorkspaceMyMembership } from "contexts/workspace-member.context"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { ProfileNavbar, ProfileSidebar } from "components/profile"; // ui diff --git a/web/pages/[workspaceSlug]/analytics.tsx b/web/pages/[workspaceSlug]/analytics.tsx index 2f6d1bc69..e088e4106 100644 --- a/web/pages/[workspaceSlug]/analytics.tsx +++ b/web/pages/[workspaceSlug]/analytics.tsx @@ -15,7 +15,7 @@ import { Tab } from "@headlessui/react"; import analyticsService from "services/analytics.service"; import trackEventServices from "services/track_event.service"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { CustomAnalytics, ScopeAndDemand } from "components/analytics"; // ui diff --git a/web/pages/[workspaceSlug]/index.tsx b/web/pages/[workspaceSlug]/index.tsx index df1a69865..607d771a7 100644 --- a/web/pages/[workspaceSlug]/index.tsx +++ b/web/pages/[workspaceSlug]/index.tsx @@ -9,19 +9,14 @@ import useSWR, { mutate } from "swr"; // next-themes import { useTheme } from "next-themes"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // services import userService from "services/user.service"; // hooks import useUser from "hooks/use-user"; import useProjects from "hooks/use-projects"; // components -import { - CompletedIssuesGraph, - IssuesList, - IssuesPieChart, - IssuesStats, -} from "components/workspace"; +import { CompletedIssuesGraph, IssuesList, IssuesPieChart, IssuesStats } from "components/workspace"; import { TourRoot } from "components/onboarding"; // ui import { PrimaryButton, ProductUpdatesModal } from "components/ui"; @@ -59,8 +54,7 @@ const WorkspacePage: NextPage = () => { ); const today = new Date(); - const greeting = - today.getHours() < 12 ? "morning" : today.getHours() < 18 ? "afternoon" : "evening"; + const greeting = today.getHours() < 12 ? "morning" : today.getHours() < 18 ? "afternoon" : "evening"; useEffect(() => { if (!workspaceSlug) return; @@ -100,10 +94,7 @@ const WorkspacePage: NextPage = () => { } > {isProductUpdatesModalOpen && ( - + )} {user && !user.is_tour_completed && (
@@ -156,9 +147,7 @@ const WorkspacePage: NextPage = () => {
Create a project
-

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

+

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

{ const e = new KeyboardEvent("keydown", { diff --git a/web/pages/[workspaceSlug]/me/my-issues.tsx b/web/pages/[workspaceSlug]/me/my-issues.tsx index 5b6ae3ecd..de12f5b32 100644 --- a/web/pages/[workspaceSlug]/me/my-issues.tsx +++ b/web/pages/[workspaceSlug]/me/my-issues.tsx @@ -5,7 +5,7 @@ import { useRouter } from "next/router"; // icons import { PlusIcon } from "@heroicons/react/24/outline"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // hooks import useMyIssuesFilters from "hooks/my-issues/use-my-issues-filter"; // components @@ -107,9 +107,7 @@ const MyIssuesPage: NextPage = () => { type="button" onClick={tab.onClick} className={`border-b-2 p-4 text-sm font-medium outline-none whitespace-nowrap ${ - tab.selected - ? "border-custom-primary-100 text-custom-primary-100" - : "border-transparent" + tab.selected ? "border-custom-primary-100 text-custom-primary-100" : "border-transparent" }`} > {tab.label} diff --git a/web/pages/[workspaceSlug]/me/profile/activity.tsx b/web/pages/[workspaceSlug]/me/profile/activity.tsx index ee527829b..09567ce26 100644 --- a/web/pages/[workspaceSlug]/me/profile/activity.tsx +++ b/web/pages/[workspaceSlug]/me/profile/activity.tsx @@ -6,7 +6,7 @@ import Link from "next/link"; // services import userService from "services/user.service"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { ActivityIcon, ActivityMessage } from "components/core"; import { TipTapEditor } from "components/tiptap"; @@ -60,8 +60,7 @@ const ProfileActivity = () => { activityItem.new_value === "restore" && ( ) - ) : activityItem.actor_detail.avatar && - activityItem.actor_detail.avatar !== "" ? ( + ) : activityItem.actor_detail.avatar && activityItem.actor_detail.avatar !== "" ? ( {activityItem.actor_detail.display_name} {
{ activityItem.field !== "estimate" ? ( created{" "} - + this issue. @@ -150,10 +143,7 @@ const ProfileActivity = () => {
{activityItem.field ? ( activityItem.new_value === "restore" ? ( - + ) : ( ) @@ -179,26 +169,19 @@ const ProfileActivity = () => {
- {activityItem.field === "archived_at" && - activityItem.new_value !== "restore" ? ( + {activityItem.field === "archived_at" && activityItem.new_value !== "restore" ? ( Plane ) : activityItem.actor_detail.is_bot ? ( {activityItem.actor_detail.first_name} Bot ) : ( - - - {activityItem.actor_detail.display_name} - + + {activityItem.actor_detail.display_name} )}{" "} {message}{" "} - - {timeAgo(activityItem.created_at)} - + {timeAgo(activityItem.created_at)}
diff --git a/web/pages/[workspaceSlug]/me/profile/index.tsx b/web/pages/[workspaceSlug]/me/profile/index.tsx index c536c384a..6381b06ac 100644 --- a/web/pages/[workspaceSlug]/me/profile/index.tsx +++ b/web/pages/[workspaceSlug]/me/profile/index.tsx @@ -11,7 +11,7 @@ import userService from "services/user.service"; import useUserAuth from "hooks/use-user-auth"; import useToast from "hooks/use-toast"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { ImagePickerPopover, ImageUploadModal } from "components/core"; import { SettingsSidebar } from "components/project"; @@ -174,10 +174,7 @@ const Profile: NextPage = () => {
{myProfile?.name @@ -214,10 +211,7 @@ const Profile: NextPage = () => { onChange={(imageUrl) => { setValue("cover_image", imageUrl); }} - value={ - watch("cover_image") ?? - "https://images.unsplash.com/photo-1506383796573-caf02b4a79ab" - } + value={watch("cover_image") ?? "https://images.unsplash.com/photo-1506383796573-caf02b4a79ab"} /> )} /> @@ -307,9 +301,7 @@ const Profile: NextPage = () => { )} /> - {errors.role && ( - Please select a role - )} + {errors.role && Please select a role}
@@ -328,8 +320,7 @@ const Profile: NextPage = () => { validate: (value) => { if (value.trim().length < 1) return "Display name can't be empty."; - if (value.split(" ").length > 1) - return "Display name can't have two consecutive spaces."; + if (value.split(" ").length > 1) return "Display name can't have two consecutive spaces."; if (value.replace(/\s/g, "").length < 1) return "Display name must be at least 1 characters long."; @@ -353,11 +344,7 @@ const Profile: NextPage = () => { render={({ field: { value, onChange } }) => ( t.value === value)?.label ?? value - : "Select a timezone" - } + label={value ? TIME_ZONES.find((t) => t.value === value)?.label ?? value : "Select a timezone"} options={timeZoneOptions} onChange={onChange} verticalPosition="top" @@ -366,9 +353,7 @@ const Profile: NextPage = () => { /> )} /> - {errors.role && ( - Please select a role - )} + {errors.role && Please select a role}
diff --git a/web/pages/[workspaceSlug]/me/profile/preferences.tsx b/web/pages/[workspaceSlug]/me/profile/preferences.tsx index b1b16a3d4..611756074 100644 --- a/web/pages/[workspaceSlug]/me/profile/preferences.tsx +++ b/web/pages/[workspaceSlug]/me/profile/preferences.tsx @@ -2,7 +2,7 @@ import { useEffect, useState } from "react"; // hooks import useUserAuth from "hooks/use-user-auth"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { CustomThemeSelector, ThemeSwitch } from "components/core"; // ui @@ -36,14 +36,10 @@ const ProfilePreferences = observer(() => { background: currentTheme.background !== "" ? currentTheme.background : "#0d101b", text: currentTheme.text !== "" ? currentTheme.text : "#c5c5c5", primary: currentTheme.primary !== "" ? currentTheme.primary : "#3f76ff", - sidebarBackground: - currentTheme.sidebarBackground !== "" ? currentTheme.sidebarBackground : "#0d101b", + sidebarBackground: currentTheme.sidebarBackground !== "" ? currentTheme.sidebarBackground : "#0d101b", sidebarText: currentTheme.sidebarText !== "" ? currentTheme.sidebarText : "#c5c5c5", darkPalette: false, - palette: - currentTheme.palette !== ",,,," - ? currentTheme.palette - : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5", + palette: currentTheme.palette !== ",,,," ? currentTheme.palette : "#0d101b,#c5c5c5,#3f76ff,#0d101b,#c5c5c5", theme: "custom", }); setCustomThemeSelectorOptions((prevData) => true); @@ -71,9 +67,7 @@ const ProfilePreferences = observer(() => {

Theme

-

- Select or customize your interface color scheme. -

+

Select or customize your interface color scheme.

{ const { data: projectDetails } = useSWR( workspaceSlug && projectId ? PROJECT_DETAILS(projectId as string) : null, - workspaceSlug && projectId - ? () => projectService.getProject(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => projectService.getProject(workspaceSlug as string, projectId as string) : null ); return ( @@ -39,9 +37,7 @@ const ProjectArchivedIssues: NextPage = () => { breadcrumbs={ - + } right={ diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx index 898a9bf80..9d5194ef7 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/[cycleId].tsx @@ -7,7 +7,7 @@ import useSWR from "swr"; import { ArrowLeftIcon } from "@heroicons/react/24/outline"; import { CyclesIcon } from "components/icons"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // contexts import { IssueViewContextProvider } from "contexts/issue-view.context"; // components diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx index 3876ffd08..2c80aa37b 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx @@ -6,7 +6,7 @@ import useSWR from "swr"; import useLocalStorage from "hooks/use-local-storage"; import useUserAuth from "hooks/use-user-auth"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import { CyclesView, ActiveCycleDetails, CreateUpdateCycleModal } from "components/cycles"; // ui diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/draft-issues/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/draft-issues/index.tsx index aaf854e11..d9c99cf9b 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/draft-issues/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/draft-issues/index.tsx @@ -5,7 +5,7 @@ import useSWR from "swr"; // services import projectService from "services/project.service"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // contexts import { IssueViewContextProvider } from "contexts/issue-view.context"; // helper @@ -28,9 +28,7 @@ const ProjectDraftIssues: NextPage = () => { const { data: projectDetails } = useSWR( workspaceSlug && projectId ? PROJECT_DETAILS(projectId as string) : null, - workspaceSlug && projectId - ? () => projectService.getProject(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => projectService.getProject(workspaceSlug as string, projectId as string) : null ); return ( @@ -39,9 +37,7 @@ const ProjectDraftIssues: NextPage = () => { breadcrumbs={ - + } right={ diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/inbox/[inboxId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/inbox/[inboxId].tsx index 7a82ac61f..2ede846c3 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/inbox/[inboxId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/inbox/[inboxId].tsx @@ -3,7 +3,7 @@ import { useRouter } from "next/router"; // hooks import useProjectDetails from "hooks/use-project-details"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // contexts import { InboxViewContextProvider } from "contexts/inbox-view-context"; // components @@ -30,9 +30,7 @@ const ProjectInbox: NextPage = () => { breadcrumbs={ - + } right={ diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx index b21859735..4f1c8c887 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx @@ -11,7 +11,7 @@ import issuesService from "services/issue.service"; // hooks import useUserAuth from "hooks/use-user-auth"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import { IssueDetailsSidebar, IssueMainContent } from "components/issues"; // ui diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/issues/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/issues/index.tsx index 73f4a18f7..70b003ac7 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/issues/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/issues/index.tsx @@ -10,7 +10,7 @@ import { useMobxStore } from "lib/mobx/store-provider"; import projectService from "services/project.service"; import inboxService from "services/inbox.service"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // helper import { truncateText } from "helpers/string.helper"; // components diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx index 573192626..29f0d0500 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/modules/[moduleId].tsx @@ -12,7 +12,7 @@ import modulesService from "services/modules.service"; import useToast from "hooks/use-toast"; import useUserAuth from "hooks/use-user-auth"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // contexts import { IssueViewContextProvider } from "contexts/issue-view.context"; // components @@ -45,32 +45,20 @@ const SingleModule: React.FC = () => { const { data: modules } = useSWR( workspaceSlug && projectId ? MODULE_LIST(projectId as string) : null, - workspaceSlug && projectId - ? () => modulesService.getModules(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => modulesService.getModules(workspaceSlug as string, projectId as string) : null ); const { data: moduleIssues } = useSWR( workspaceSlug && projectId && moduleId ? MODULE_ISSUES(moduleId as string) : null, workspaceSlug && projectId && moduleId - ? () => - modulesService.getModuleIssues( - workspaceSlug as string, - projectId as string, - moduleId as string - ) + ? () => modulesService.getModuleIssues(workspaceSlug as string, projectId as string, moduleId as string) : null ); const { data: moduleDetails, error } = useSWR( moduleId ? MODULE_DETAILS(moduleId as string) : null, workspaceSlug && projectId - ? () => - modulesService.getModuleDetails( - workspaceSlug as string, - projectId as string, - moduleId as string - ) + ? () => modulesService.getModuleDetails(workspaceSlug as string, projectId as string, moduleId as string) : null ); @@ -82,13 +70,7 @@ const SingleModule: React.FC = () => { }; await modulesService - .addIssuesToModule( - workspaceSlug as string, - projectId as string, - moduleId as string, - payload, - user - ) + .addIssuesToModule(workspaceSlug as string, projectId as string, moduleId as string, payload, user) .catch(() => setToastAlert({ type: "error", @@ -176,10 +158,7 @@ const SingleModule: React.FC = () => { /> ) : ( <> - setAnalyticsModal(false)} - /> + setAnalyticsModal(false)} />
{ const { data: activeProject } = useSWR( workspaceSlug && projectId ? PROJECT_DETAILS(projectId as string) : null, - workspaceSlug && projectId - ? () => projectService.getProject(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => projectService.getProject(workspaceSlug as string, projectId as string) : null ); const { data: modules, mutate: mutateModules } = useSWR( workspaceSlug && projectId ? MODULE_LIST(projectId as string) : null, - workspaceSlug && projectId - ? () => modulesService.getModules(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => modulesService.getModules(workspaceSlug as string, projectId as string) : null ); const handleEditModule = (module: IModule) => { @@ -95,24 +87,17 @@ const ProjectModules: NextPage = () => { {moduleViewOptions.map((option) => ( {replaceUnderscoreIfSnakeCase(option.type)} View - } + tooltipContent={{replaceUnderscoreIfSnakeCase(option.type)} View} position="bottom" > ))} diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 688eeaca8..f25091b43 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -21,7 +21,7 @@ import issuesService from "services/issue.service"; import useToast from "hooks/use-toast"; import useUser from "hooks/use-user"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import { CreateUpdateBlockInline, SinglePageBlock } from "components/pages"; import { CreateLabelModal } from "components/labels"; diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx index f6f8d3d86..3e5e07478 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/pages/index.tsx @@ -15,7 +15,7 @@ import useUserAuth from "hooks/use-user-auth"; // icons import { PlusIcon } from "components/icons"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import { RecentPagesList, CreateUpdatePageModal, TPagesListProps } from "components/pages"; // ui @@ -31,33 +31,21 @@ import { PROJECT_DETAILS } from "constants/fetch-keys"; // helper import { truncateText } from "helpers/string.helper"; -const AllPagesList = dynamic( - () => import("components/pages").then((a) => a.AllPagesList), - { - ssr: false, - } -); +const AllPagesList = dynamic(() => import("components/pages").then((a) => a.AllPagesList), { + ssr: false, +}); -const FavoritePagesList = dynamic( - () => import("components/pages").then((a) => a.FavoritePagesList), - { - ssr: false, - } -); +const FavoritePagesList = dynamic(() => import("components/pages").then((a) => a.FavoritePagesList), { + ssr: false, +}); -const MyPagesList = dynamic( - () => import("components/pages").then((a) => a.MyPagesList), - { - ssr: false, - } -); +const MyPagesList = dynamic(() => import("components/pages").then((a) => a.MyPagesList), { + ssr: false, +}); -const OtherPagesList = dynamic( - () => import("components/pages").then((a) => a.OtherPagesList), - { - ssr: false, - } -); +const OtherPagesList = dynamic(() => import("components/pages").then((a) => a.OtherPagesList), { + ssr: false, +}); const tabsList = ["Recent", "All", "Favorites", "Created by me", "Created by others"]; @@ -75,9 +63,7 @@ const ProjectPages: NextPage = () => { const { data: projectDetails } = useSWR( workspaceSlug && projectId ? PROJECT_DETAILS(projectId as string) : null, - workspaceSlug && projectId - ? () => projectService.getProject(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => projectService.getProject(workspaceSlug as string, projectId as string) : null ); const currentTabValue = (tab: string | null) => { @@ -109,9 +95,7 @@ const ProjectPages: NextPage = () => { breadcrumbs={ - + } right={ diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/automations.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/automations.tsx index 5dcea0838..f197cb654 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/automations.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/automations.tsx @@ -7,7 +7,7 @@ import { mutate } from "swr"; // services import projectService from "services/project.service"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // hooks import useUserAuth from "hooks/use-user-auth"; import useProjectDetails from "hooks/use-project-details"; @@ -45,8 +45,7 @@ const AutomationsSettings: NextPage = () => { mutate( PROJECTS_LIST(workspaceSlug as string, { is_favorite: "all" }), - (prevData) => - (prevData ?? []).map((p) => (p.id === projectDetails.id ? { ...p, ...formData } : p)), + (prevData) => (prevData ?? []).map((p) => (p.id === projectDetails.id ? { ...p, ...formData } : p)), false ); diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/estimates.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/estimates.tsx index b9a21f793..1f2f55952 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/estimates.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/estimates.tsx @@ -10,7 +10,7 @@ import projectService from "services/project.service"; // hooks import useProjectDetails from "hooks/use-project-details"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import { CreateUpdateEstimateModal, SingleEstimate } from "components/estimates"; import { SettingsSidebar } from "components/project"; diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx index 2dd4ab564..1a448cbdc 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx @@ -8,7 +8,7 @@ import useSWR, { mutate } from "swr"; import projectService from "services/project.service"; import trackEventServices, { MiscellaneousEventType } from "services/track_event.service"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // hooks import useToast from "hooks/use-toast"; import useUserAuth from "hooks/use-user-auth"; diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/index.tsx index 0ad153722..4d3858232 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/index.tsx @@ -3,7 +3,7 @@ import { useRouter } from "next/router"; import useSWR from "swr"; import { Disclosure, Transition } from "@headlessui/react"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // services import projectService from "services/project.service"; // components diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx index 9fc2fe7bf..d615c2751 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/integrations.tsx @@ -5,7 +5,7 @@ import { useRouter } from "next/router"; import useSWR from "swr"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // services import IntegrationService from "services/integration.service"; import projectService from "services/project.service"; diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/labels.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/labels.tsx index a6198acd2..4f6a236df 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/labels.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/labels.tsx @@ -10,7 +10,7 @@ import useUserAuth from "hooks/use-user-auth"; import projectService from "services/project.service"; import issuesService from "services/issue.service"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import { CreateUpdateLabelInline, diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx index 59e218ee4..893f1a497 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx @@ -15,7 +15,7 @@ import useProjectMembers from "hooks/use-project-members"; import useProjectDetails from "hooks/use-project-details"; import { Controller, useForm } from "react-hook-form"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import ConfirmProjectMemberRemove from "components/project/confirm-project-member-remove"; import SendProjectInvitationModal from "components/project/send-project-invitation-modal"; @@ -80,9 +80,8 @@ const MembersSettings: NextPage = () => { formState: { isSubmitting }, } = useForm({ defaultValues }); - const { data: activeWorkspace } = useSWR( - workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, - () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null) + const { data: activeWorkspace } = useSWR(workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, () => + workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null ); const { data: people } = useSWR( @@ -93,21 +92,16 @@ const MembersSettings: NextPage = () => { ); const { data: projectMembers, mutate: mutateMembers } = useSWR( - workspaceSlug && projectId - ? PROJECT_MEMBERS_WITH_EMAIL(workspaceSlug.toString(), projectId.toString()) - : null, + workspaceSlug && projectId ? PROJECT_MEMBERS_WITH_EMAIL(workspaceSlug.toString(), projectId.toString()) : null, workspaceSlug && projectId ? () => projectService.projectMembersWithEmail(workspaceSlug as string, projectId as string) : null ); const { data: projectInvitations, mutate: mutateInvitations } = useSWR( + workspaceSlug && projectId ? PROJECT_INVITATIONS_WITH_EMAIL(workspaceSlug.toString(), projectId.toString()) : null, workspaceSlug && projectId - ? PROJECT_INVITATIONS_WITH_EMAIL(workspaceSlug.toString(), projectId.toString()) - : null, - workspaceSlug && projectId - ? () => - projectService.projectInvitationsWithEmail(workspaceSlug as string, projectId as string) + ? () => projectService.projectInvitationsWithEmail(workspaceSlug as string, projectId as string) : null ); @@ -231,21 +225,12 @@ const MembersSettings: NextPage = () => { setSelectedRemoveMember(null); setSelectedInviteRemoveMember(null); }} - data={members.find( - (item) => item.id === selectedRemoveMember || item.id === selectedInviteRemoveMember - )} + data={members.find((item) => item.id === selectedRemoveMember || item.id === selectedInviteRemoveMember)} handleDelete={async () => { if (!activeWorkspace || !projectDetails) return; if (selectedRemoveMember) { - await projectService.deleteProjectMember( - activeWorkspace.slug, - projectDetails.id, - selectedRemoveMember - ); - mutateMembers( - (prevData: any) => prevData?.filter((item: any) => item.id !== selectedRemoveMember), - false - ); + await projectService.deleteProjectMember(activeWorkspace.slug, projectDetails.id, selectedRemoveMember); + mutateMembers((prevData: any) => prevData?.filter((item: any) => item.id !== selectedRemoveMember), false); } if (selectedInviteRemoveMember) { await projectService.deleteProjectInvitation( @@ -254,8 +239,7 @@ const MembersSettings: NextPage = () => { selectedInviteRemoveMember ); mutateInvitations( - (prevData: any) => - prevData?.filter((item: any) => item.id !== selectedInviteRemoveMember), + (prevData: any) => prevData?.filter((item: any) => item.id !== selectedInviteRemoveMember), false ); } @@ -348,10 +332,7 @@ const MembersSettings: NextPage = () => {
{members.length > 0 ? members.map((member) => ( -
+
{member.avatar && member.avatar !== "" ? (
@@ -377,19 +358,13 @@ const MembersSettings: NextPage = () => { {member.first_name} {member.last_name} - - ({member.display_name}) - + ({member.display_name}) ) : (

{member.display_name || member.email}

)} - {isOwner && ( -

- {member.email} -

- )} + {isOwner &&

{member.email}

}
@@ -419,27 +394,19 @@ const MembersSettings: NextPage = () => { mutateMembers( (prevData: any) => - prevData.map((m: any) => - m.id === member.id ? { ...m, role: value } : m - ), + prevData.map((m: any) => (m.id === member.id ? { ...m, role: value } : m)), false ); projectService - .updateProjectMember( - activeWorkspace.slug, - projectDetails.id, - member.id, - { - role: value, - } - ) + .updateProjectMember(activeWorkspace.slug, projectDetails.id, member.id, { + role: value, + }) .catch(() => { setToastAlert({ type: "error", title: "Error!", - message: - "An error occurred while updating member role. Please try again.", + message: "An error occurred while updating member role. Please try again.", }); }); }} @@ -447,18 +414,11 @@ const MembersSettings: NextPage = () => { disabled={ member.memberId === user?.id || !member.member || - (currentUser && - currentUser.role !== 20 && - currentUser.role < member.role) + (currentUser && currentUser.role !== 20 && currentUser.role < member.role) } > {Object.keys(ROLE).map((key) => { - if ( - currentUser && - currentUser.role !== 20 && - currentUser.role < parseInt(key) - ) - return null; + if (currentUser && currentUser.role !== 20 && currentUser.role < parseInt(key)) return null; return ( @@ -477,10 +437,7 @@ const MembersSettings: NextPage = () => { - - {" "} - {member.memberId !== user?.id ? "Remove member" : "Leave project"} - + {member.memberId !== user?.id ? "Remove member" : "Leave project"} diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx index 7037ec8ea..aaf3e86f1 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx @@ -10,7 +10,7 @@ import stateService from "services/project_state.service"; import useProjectDetails from "hooks/use-project-details"; import useUserAuth from "hooks/use-user-auth"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // components import { CreateUpdateStateInline, DeleteStateModal, SingleState, StateGroup } from "components/states"; import { SettingsSidebar } from "components/project"; diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx b/web/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx index 3597f113f..463a3c7c7 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/views/[viewId].tsx @@ -6,7 +6,7 @@ import useSWR from "swr"; import projectService from "services/project.service"; import viewsService from "services/views.service"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // contexts import { IssueViewContextProvider } from "contexts/issue-view.context"; // components @@ -30,27 +30,18 @@ const SingleView: React.FC = () => { const { data: activeProject } = useSWR( workspaceSlug && projectId ? PROJECT_DETAILS(projectId as string) : null, - workspaceSlug && projectId - ? () => projectService.getProject(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => projectService.getProject(workspaceSlug as string, projectId as string) : null ); const { data: views } = useSWR( workspaceSlug && projectId ? VIEWS_LIST(projectId as string) : null, - workspaceSlug && projectId - ? () => viewsService.getViews(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => viewsService.getViews(workspaceSlug as string, projectId as string) : null ); const { data: viewDetails, error } = useSWR( workspaceSlug && projectId && viewId ? VIEW_DETAILS(viewId as string) : null, workspaceSlug && projectId && viewId - ? () => - viewsService.getViewDetails( - workspaceSlug as string, - projectId as string, - viewId as string - ) + ? () => viewsService.getViewDetails(workspaceSlug as string, projectId as string, viewId as string) : null ); diff --git a/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx b/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx index 9a5511037..bbf34dff2 100644 --- a/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx +++ b/web/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx @@ -10,7 +10,7 @@ import useUserAuth from "hooks/use-user-auth"; import viewsService from "services/views.service"; import projectService from "services/project.service"; // layouts -import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; +import { ProjectAuthorizationWrapper } from "layouts/auth-layout-legacy"; // ui import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; //icons @@ -40,16 +40,12 @@ const ProjectViews: NextPage = () => { const { data: activeProject } = useSWR( workspaceSlug && projectId ? PROJECT_DETAILS(projectId as string) : null, - workspaceSlug && projectId - ? () => projectService.getProject(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => projectService.getProject(workspaceSlug as string, projectId as string) : null ); const { data: views } = useSWR( workspaceSlug && projectId ? VIEWS_LIST(projectId as string) : null, - workspaceSlug && projectId - ? () => viewsService.getViews(workspaceSlug as string, projectId as string) - : null + workspaceSlug && projectId ? () => viewsService.getViews(workspaceSlug as string, projectId as string) : null ); const handleEditView = (view: IView) => { diff --git a/web/pages/[workspaceSlug]/projects/index.tsx b/web/pages/[workspaceSlug]/projects/index.tsx index a6baebc53..1beeb0c55 100644 --- a/web/pages/[workspaceSlug]/projects/index.tsx +++ b/web/pages/[workspaceSlug]/projects/index.tsx @@ -9,7 +9,7 @@ import useProjects from "hooks/use-projects"; import useWorkspaces from "hooks/use-workspaces"; import useUserAuth from "hooks/use-user-auth"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // ui import { Icon, PrimaryButton } from "components/ui"; import { Breadcrumbs, BreadcrumbItem } from "components/breadcrumbs"; diff --git a/web/pages/[workspaceSlug]/settings/billing.tsx b/web/pages/[workspaceSlug]/settings/billing.tsx index 898b716bf..8624c585d 100644 --- a/web/pages/[workspaceSlug]/settings/billing.tsx +++ b/web/pages/[workspaceSlug]/settings/billing.tsx @@ -7,7 +7,7 @@ import useSWR from "swr"; // services import workspaceService from "services/workspace.service"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // component import { SettingsSidebar } from "components/project"; // ui @@ -25,9 +25,8 @@ const BillingSettings: NextPage = () => { query: { workspaceSlug }, } = useRouter(); - const { data: activeWorkspace } = useSWR( - workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, - () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null) + const { data: activeWorkspace } = useSWR(workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, () => + workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null ); return ( @@ -56,9 +55,7 @@ const BillingSettings: NextPage = () => {

Current plan

-

- You are currently using the free plan -

+

You are currently using the free plan

View Plans diff --git a/web/pages/[workspaceSlug]/settings/exports.tsx b/web/pages/[workspaceSlug]/settings/exports.tsx index f600f82f7..f90a5da46 100644 --- a/web/pages/[workspaceSlug]/settings/exports.tsx +++ b/web/pages/[workspaceSlug]/settings/exports.tsx @@ -5,7 +5,7 @@ import useSWR from "swr"; // services import workspaceService from "services/workspace.service"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import ExportGuide from "components/exporter/guide"; import { SettingsSidebar } from "components/project"; @@ -22,9 +22,8 @@ const ImportExport: NextPage = () => { const router = useRouter(); const { workspaceSlug } = router.query; - const { data: activeWorkspace } = useSWR( - workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, - () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null) + const { data: activeWorkspace } = useSWR(workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, () => + workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null ); return ( diff --git a/web/pages/[workspaceSlug]/settings/imports.tsx b/web/pages/[workspaceSlug]/settings/imports.tsx index a8a5c8dc0..95ee3f32f 100644 --- a/web/pages/[workspaceSlug]/settings/imports.tsx +++ b/web/pages/[workspaceSlug]/settings/imports.tsx @@ -5,7 +5,7 @@ import useSWR from "swr"; // services import workspaceService from "services/workspace.service"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import IntegrationGuide from "components/integration/guide"; import { SettingsSidebar } from "components/project"; @@ -22,9 +22,8 @@ const ImportExport: NextPage = () => { const router = useRouter(); const { workspaceSlug } = router.query; - const { data: activeWorkspace } = useSWR( - workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, - () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null) + const { data: activeWorkspace } = useSWR(workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, () => + workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null ); return ( diff --git a/web/pages/[workspaceSlug]/settings/index.tsx b/web/pages/[workspaceSlug]/settings/index.tsx index 4f576aa0a..670320cac 100644 --- a/web/pages/[workspaceSlug]/settings/index.tsx +++ b/web/pages/[workspaceSlug]/settings/index.tsx @@ -13,7 +13,7 @@ import fileService from "services/file.service"; import useToast from "hooks/use-toast"; import useUserAuth from "hooks/use-user-auth"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { ImageUploadModal } from "components/core"; import { DeleteWorkspaceModal } from "components/workspace"; @@ -59,9 +59,8 @@ const WorkspaceSettings: NextPage = () => { const { setToastAlert } = useToast(); - const { data: activeWorkspace } = useSWR( - workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, - () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null) + const { data: activeWorkspace } = useSWR(workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null, () => + workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null ); const { @@ -156,9 +155,7 @@ const WorkspaceSettings: NextPage = () => { - + } > @@ -191,11 +188,7 @@ const WorkspaceSettings: NextPage = () => {
-
- + {isSubmitting ? "Updating..." : "Update Workspace"}
@@ -337,17 +323,12 @@ const WorkspaceSettings: NextPage = () => {
- The danger zone of the project delete page is a critical area that - requires careful consideration and attention. When deleting a project, all - of the data and resources within that project will be permanently removed - and cannot be recovered. + The danger zone of the project delete page is a critical area that requires careful + consideration and attention. When deleting a project, all of the data and resources within + that project will be permanently removed and cannot be recovered.
- setIsOpen(true)} - className="!text-sm" - outline - > + setIsOpen(true)} className="!text-sm" outline> Delete my project
diff --git a/web/pages/[workspaceSlug]/settings/integrations.tsx b/web/pages/[workspaceSlug]/settings/integrations.tsx index 47fb33491..8b1f60354 100644 --- a/web/pages/[workspaceSlug]/settings/integrations.tsx +++ b/web/pages/[workspaceSlug]/settings/integrations.tsx @@ -8,7 +8,7 @@ import useSWR from "swr"; import workspaceService from "services/workspace.service"; import IntegrationService from "services/integration.service"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import { SingleIntegrationCard } from "components/integration"; import { SettingsSidebar } from "components/project"; diff --git a/web/pages/[workspaceSlug]/settings/members.tsx b/web/pages/[workspaceSlug]/settings/members.tsx index 0f0bc32ae..e5f65a40b 100644 --- a/web/pages/[workspaceSlug]/settings/members.tsx +++ b/web/pages/[workspaceSlug]/settings/members.tsx @@ -12,7 +12,7 @@ import useToast from "hooks/use-toast"; import useUser from "hooks/use-user"; import useWorkspaceMembers from "hooks/use-workspace-members"; // layouts -import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { WorkspaceAuthorizationLayout } from "layouts/auth-layout-legacy"; // components import ConfirmWorkspaceMemberRemove from "components/workspace/confirm-workspace-member-remove"; import SendWorkspaceInvitationModal from "components/workspace/send-workspace-invitation-modal"; @@ -25,11 +25,7 @@ import { XMarkIcon } from "components/icons"; // types import type { NextPage } from "next"; // fetch-keys -import { - WORKSPACE_DETAILS, - WORKSPACE_INVITATION_WITH_EMAIL, - WORKSPACE_MEMBERS_WITH_EMAIL, -} from "constants/fetch-keys"; +import { WORKSPACE_DETAILS, WORKSPACE_INVITATION_WITH_EMAIL, WORKSPACE_MEMBERS_WITH_EMAIL } from "constants/fetch-keys"; // constants import { ROLE } from "constants/workspace"; // helper @@ -49,23 +45,18 @@ const MembersSettings: NextPage = () => { const { isOwner } = useWorkspaceMembers(workspaceSlug?.toString(), Boolean(workspaceSlug)); - const { data: activeWorkspace } = useSWR( - workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug.toString()) : null, - () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug.toString()) : null) + const { data: activeWorkspace } = useSWR(workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug.toString()) : null, () => + workspaceSlug ? workspaceService.getWorkspace(workspaceSlug.toString()) : null ); const { data: workspaceMembers, mutate: mutateMembers } = useSWR( workspaceSlug ? WORKSPACE_MEMBERS_WITH_EMAIL(workspaceSlug.toString()) : null, - workspaceSlug - ? () => workspaceService.workspaceMembersWithEmail(workspaceSlug.toString()) - : null + workspaceSlug ? () => workspaceService.workspaceMembersWithEmail(workspaceSlug.toString()) : null ); const { data: workspaceInvitations, mutate: mutateInvitations } = useSWR( workspaceSlug ? WORKSPACE_INVITATION_WITH_EMAIL(workspaceSlug.toString()) : null, - workspaceSlug - ? () => workspaceService.workspaceInvitationsWithEmail(workspaceSlug.toString()) - : null + workspaceSlug ? () => workspaceService.workspaceInvitationsWithEmail(workspaceSlug.toString()) : null ); const members = [ @@ -143,15 +134,12 @@ const MembersSettings: NextPage = () => { }); }) .finally(() => { - mutateMembers((prevData: any) => - prevData?.filter((item: any) => item.id !== selectedRemoveMember) - ); + mutateMembers((prevData: any) => prevData?.filter((item: any) => item.id !== selectedRemoveMember)); }); } if (selectedInviteRemoveMember) { mutateInvitations( - (prevData: any) => - prevData?.filter((item: any) => item.id !== selectedInviteRemoveMember), + (prevData: any) => prevData?.filter((item: any) => item.id !== selectedInviteRemoveMember), false ); workspaceService @@ -206,10 +194,7 @@ const MembersSettings: NextPage = () => {
{members.length > 0 ? members.map((member) => ( -
+
{member.avatar && member.avatar !== "" ? ( @@ -239,21 +224,13 @@ const MembersSettings: NextPage = () => { {member.first_name} {member.last_name} - - ({member.display_name}) - + ({member.display_name}) ) : ( -

- {member.display_name || member.email} -

- )} - {isOwner && ( -

- {member.email} -

+

{member.display_name || member.email}

)} + {isOwner &&

{member.email}

}
@@ -288,9 +265,7 @@ const MembersSettings: NextPage = () => { mutateMembers( (prevData: any) => - prevData?.map((m: any) => - m.id === member.id ? { ...m, role: value } : m - ), + prevData?.map((m: any) => (m.id === member.id ? { ...m, role: value } : m)), false ); @@ -302,8 +277,7 @@ const MembersSettings: NextPage = () => { setToastAlert({ type: "error", title: "Error!", - message: - "An error occurred while updating member role. Please try again.", + message: "An error occurred while updating member role. Please try again.", }); }); }} @@ -311,18 +285,11 @@ const MembersSettings: NextPage = () => { disabled={ member.memberId === currentUser?.member.id || !member.status || - (currentUser && - currentUser.role !== 20 && - currentUser.role < member.role) + (currentUser && currentUser.role !== 20 && currentUser.role < member.role) } > {Object.keys(ROLE).map((key) => { - if ( - currentUser && - currentUser.role !== 20 && - currentUser.role < parseInt(key) - ) - return null; + if (currentUser && currentUser.role !== 20 && currentUser.role < parseInt(key)) return null; return ( @@ -344,10 +311,7 @@ const MembersSettings: NextPage = () => { - - {" "} - {user?.id === member.memberId ? "Leave" : "Remove member"} - + {user?.id === member.memberId ? "Leave" : "Remove member"} diff --git a/web/pages/calendar.tsx b/web/pages/calendar.tsx index bddca1f6f..40672dac4 100644 --- a/web/pages/calendar.tsx +++ b/web/pages/calendar.tsx @@ -2,7 +2,7 @@ import React from "react"; // layouts import DefaultLayout from "layouts/default-layout"; -import { UserAuthorizationLayout } from "layouts/auth-layout/user-authorization-wrapper"; +import { UserAuthorizationLayout } from "layouts/auth-layout-legacy/user-authorization-wrapper"; // components import { CalendarView } from "components/issues"; // types diff --git a/web/pages/create-workspace.tsx b/web/pages/create-workspace.tsx index b6aa41728..867f3f71f 100644 --- a/web/pages/create-workspace.tsx +++ b/web/pages/create-workspace.tsx @@ -13,7 +13,7 @@ import userService from "services/user.service"; import useUser from "hooks/use-user"; // layouts import DefaultLayout from "layouts/default-layout"; -import { UserAuthorizationLayout } from "layouts/auth-layout/user-authorization-wrapper"; +import { UserAuthorizationLayout } from "layouts/auth-layout-legacy/user-authorization-wrapper"; // components import { CreateWorkspaceForm } from "components/workspace"; // images @@ -59,9 +59,7 @@ const CreateWorkspace: NextPage = () => { false ); - await userService - .updateUser({ last_workspace_id: workspace.id }) - .then(() => router.push(`/${workspace.slug}`)); + await userService.updateUser({ last_workspace_id: workspace.id }).then(() => router.push(`/${workspace.slug}`)); }; return ( diff --git a/web/pages/invitations.tsx b/web/pages/invitations.tsx index 8e823b450..283e54abf 100644 --- a/web/pages/invitations.tsx +++ b/web/pages/invitations.tsx @@ -15,7 +15,7 @@ import useUser from "hooks/use-user"; import useToast from "hooks/use-toast"; // layouts import DefaultLayout from "layouts/default-layout"; -import { UserAuthorizationLayout } from "layouts/auth-layout/user-authorization-wrapper"; +import { UserAuthorizationLayout } from "layouts/auth-layout-legacy/user-authorization-wrapper"; // ui import { SecondaryButton, PrimaryButton, EmptyState } from "components/ui"; // icons @@ -51,16 +51,11 @@ const OnBoard: NextPage = () => { workspaceService.userWorkspaceInvitations() ); - const handleInvitation = ( - workspace_invitation: IWorkspaceMemberInvitation, - action: "accepted" | "withdraw" - ) => { + const handleInvitation = (workspace_invitation: IWorkspaceMemberInvitation, action: "accepted" | "withdraw") => { if (action === "accepted") { setInvitationsRespond((prevData) => [...prevData, workspace_invitation.id]); } else if (action === "withdraw") { - setInvitationsRespond((prevData) => - prevData.filter((item: string) => item !== workspace_invitation.id) - ); + setInvitationsRespond((prevData) => prevData.filter((item: string) => item !== workspace_invitation.id)); } }; @@ -144,9 +139,7 @@ const OnBoard: NextPage = () => { ? "border-custom-primary-100" : "border-custom-border-200 hover:bg-custom-background-80" }`} - onClick={() => - handleInvitation(invitation, isSelected ? "withdraw" : "accepted") - } + onClick={() => handleInvitation(invitation, isSelected ? "withdraw" : "accepted")} >
@@ -166,9 +159,7 @@ const OnBoard: NextPage = () => {
-
- {truncateText(invitation.workspace.name, 30)} -
+
{truncateText(invitation.workspace.name, 30)}

{ROLE[invitation.role]}