From a1de3f581fc4b804f41ca72d74de34b79102964a Mon Sep 17 00:00:00 2001 From: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com> Date: Fri, 5 May 2023 17:07:29 +0530 Subject: [PATCH] fix: layout height and overflow (#1004) * fix: kanban height issue * dev: Layout fixes * dev: layout changes * fix: layout overflow settings and fixed header * style: filters padding fixed * fix: hide filters if none are applied --------- Co-authored-by: gurusainath --- .../components/core/board-view/all-boards.tsx | 2 +- .../core/board-view/single-issue.tsx | 4 +- .../core/calendar-view/calendar.tsx | 2 +- apps/app/components/core/issues-view.tsx | 66 ++-- .../core/list-view/single-issue.tsx | 4 +- .../integration/github/select-repository.tsx | 2 +- .../components/issues/my-issues-list-item.tsx | 8 +- apps/app/components/project/index.ts | 1 + .../components/project/settings-header.tsx | 13 + apps/app/components/workspace/index.ts | 1 + .../components/workspace/settings-header.tsx | 13 + apps/app/layouts/app-layout/app-header.tsx | 4 +- apps/app/layouts/app-layout/app-sidebar.tsx | 28 +- .../project-authorization-wrapper.tsx | 43 +-- .../workspace-authorization-wrapper.tsx | 47 +-- apps/app/pages/[workspaceSlug]/index.tsx | 2 +- .../pages/[workspaceSlug]/me/my-issues.tsx | 84 ++--- .../[workspaceSlug]/me/profile/activity.tsx | 37 ++- .../[workspaceSlug]/me/profile/index.tsx | 271 ++++++++-------- .../projects/[projectId]/cycles/index.tsx | 2 +- .../projects/[projectId]/issues/[issueId].tsx | 1 - .../projects/[projectId]/modules/index.tsx | 4 +- .../projects/[projectId]/pages/[pageId].tsx | 2 +- .../projects/[projectId]/pages/index.tsx | 4 +- .../projects/[projectId]/settings/control.tsx | 4 +- .../[projectId]/settings/estimates.tsx | 122 +++---- .../[projectId]/settings/features.tsx | 96 +++--- .../projects/[projectId]/settings/index.tsx | 5 +- .../[projectId]/settings/integrations.tsx | 97 +++--- .../projects/[projectId]/settings/labels.tsx | 124 +++---- .../projects/[projectId]/settings/members.tsx | 230 ++++++------- .../projects/[projectId]/settings/states.tsx | 144 +++++---- .../projects/[projectId]/views/index.tsx | 2 +- .../pages/[workspaceSlug]/projects/index.tsx | 4 +- .../[workspaceSlug]/settings/billing.tsx | 52 +-- .../settings/import-export.tsx | 6 +- .../pages/[workspaceSlug]/settings/index.tsx | 303 +++++++++--------- .../[workspaceSlug]/settings/integrations.tsx | 52 +-- .../[workspaceSlug]/settings/members.tsx | 224 ++++++------- apps/app/styles/globals.css | 1 + apps/app/tailwind.config.js | 4 - 41 files changed, 1080 insertions(+), 1035 deletions(-) create mode 100644 apps/app/components/project/settings-header.tsx create mode 100644 apps/app/components/workspace/settings-header.tsx diff --git a/apps/app/components/core/board-view/all-boards.tsx b/apps/app/components/core/board-view/all-boards.tsx index 69346cd18..495cee0a5 100644 --- a/apps/app/components/core/board-view/all-boards.tsx +++ b/apps/app/components/core/board-view/all-boards.tsx @@ -44,7 +44,7 @@ export const AllBoards: React.FC = ({ return ( <> {groupedByIssues ? ( -
+
{Object.keys(groupedByIssues).map((singleGroup, index) => { const currentState = selectedGroup === "state" ? states?.find((s) => s.id === singleGroup) : null; diff --git a/apps/app/components/core/board-view/single-issue.tsx b/apps/app/components/core/board-view/single-issue.tsx index 8007f3216..e82b9897c 100644 --- a/apps/app/components/core/board-view/single-issue.tsx +++ b/apps/app/components/core/board-view/single-issue.tsx @@ -392,7 +392,7 @@ export const SingleBoardIssue: React.FC = ({
- + {issue.link_count}
@@ -402,7 +402,7 @@ export const SingleBoardIssue: React.FC = ({
- + {issue.attachment_count}
diff --git a/apps/app/components/core/calendar-view/calendar.tsx b/apps/app/components/core/calendar-view/calendar.tsx index dd814ed09..9dfdac64e 100644 --- a/apps/app/components/core/calendar-view/calendar.tsx +++ b/apps/app/components/core/calendar-view/calendar.tsx @@ -229,7 +229,7 @@ export const CalendarView: React.FC = ({ addIssueToDate }) => { return calendarIssues ? ( -
+
diff --git a/apps/app/components/core/issues-view.tsx b/apps/app/components/core/issues-view.tsx index 497d7fba4..9baa0318d 100644 --- a/apps/app/components/core/issues-view.tsx +++ b/apps/app/components/core/issues-view.tsx @@ -353,7 +353,7 @@ export const IssuesView: React.FC = ({ console.log(e); }); }, - [workspaceSlug, projectId, cycleId, params] + [workspaceSlug, projectId, cycleId, params, selectedGroup, setToastAlert] ); const removeIssueFromModule = useCallback( @@ -396,7 +396,7 @@ export const IssuesView: React.FC = ({ console.log(e); }); }, - [workspaceSlug, projectId, moduleId, params] + [workspaceSlug, projectId, moduleId, params, selectedGroup, setToastAlert] ); const handleTrashBox = useCallback( @@ -442,39 +442,35 @@ export const IssuesView: React.FC = ({ handleClose={() => setTransferIssuesModal(false)} isOpen={transferIssuesModal} /> - <> -
- - {areFiltersApplied && ( - { - if (viewId) { - setFilters({}, true); - setToastAlert({ - title: "View updated", - message: "Your view has been updated", - type: "success", - }); - } else - setCreateViewModal({ - query: filters, - }); - }} - className="flex items-center gap-2 text-sm" - > - {!viewId && } - {viewId ? "Update" : "Save"} view - - )} -
- {areFiltersApplied && ( -
- )} - + {areFiltersApplied && ( + <> +
+ + {areFiltersApplied && ( + { + if (viewId) { + setFilters({}, true); + setToastAlert({ + title: "View updated", + message: "Your view has been updated", + type: "success", + }); + } else + setCreateViewModal({ + query: filters, + }); + }} + className="flex items-center gap-2 text-sm" + > + {!viewId && } + {viewId ? "Update" : "Save"} view + + )} +
+ {
} + + )} diff --git a/apps/app/components/core/list-view/single-issue.tsx b/apps/app/components/core/list-view/single-issue.tsx index 3f794c20c..dbcb87451 100644 --- a/apps/app/components/core/list-view/single-issue.tsx +++ b/apps/app/components/core/list-view/single-issue.tsx @@ -314,7 +314,7 @@ export const SingleListIssue: React.FC = ({
- + {issue.link_count}
@@ -324,7 +324,7 @@ export const SingleListIssue: React.FC = ({
- + {issue.attachment_count}
diff --git a/apps/app/components/integration/github/select-repository.tsx b/apps/app/components/integration/github/select-repository.tsx index b1781b70e..69040c2d0 100644 --- a/apps/app/components/integration/github/select-repository.tsx +++ b/apps/app/components/integration/github/select-repository.tsx @@ -81,7 +81,7 @@ export const SelectRepository: React.FC = ({ {userRepositories && options.length < totalCount && (
); }; diff --git a/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx b/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx index 1ad2d6868..61da09887 100644 --- a/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx +++ b/apps/app/layouts/auth-layout/project-authorization-wrapper.tsx @@ -11,7 +11,6 @@ import useIssuesView from "hooks/use-issues-view"; import Container from "layouts/container"; import AppHeader from "layouts/app-layout/app-header"; import AppSidebar from "layouts/app-layout/app-sidebar"; -import SettingsNavbar from "layouts/settings-navbar"; // components import { NotAuthorizedView, JoinProject } from "components/auth-screens"; import { CommandPalette } from "components/command-palette"; @@ -30,7 +29,6 @@ type Meta = { type Props = { meta?: Meta; children: React.ReactNode; - noPadding?: boolean; noHeader?: boolean; bg?: "primary" | "secondary"; breadcrumbs?: JSX.Element; @@ -47,7 +45,6 @@ export const ProjectAuthorizationWrapper: React.FC = (props) => ( const ProjectAuthorizationWrapped: React.FC = ({ meta, children, - noPadding = false, noHeader = false, bg = "primary", breadcrumbs, @@ -68,8 +65,9 @@ const ProjectAuthorizationWrapped: React.FC = ({ return ( -
+
+ {loading ? (
@@ -107,7 +105,15 @@ const ProjectAuthorizationWrapped: React.FC = ({ type="project" /> ) : ( -
+
{!noHeader && ( = ({ setToggleSidebar={setToggleSidebar} /> )} -
- {settingsLayout && ( -
-
-

Project Settings

-

- This information will be displayed to every member of the project. -

-
- -
- )} - {children} +
+
+ {children} +
)} diff --git a/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx b/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx index 608760d6f..90dcbcf13 100644 --- a/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx +++ b/apps/app/layouts/auth-layout/workspace-authorization-wrapper.tsx @@ -32,25 +32,21 @@ type Meta = { type Props = { meta?: Meta; children: React.ReactNode; - noPadding?: boolean; noHeader?: boolean; bg?: "primary" | "secondary"; breadcrumbs?: JSX.Element; left?: JSX.Element; right?: JSX.Element; - profilePage?: boolean; }; export const WorkspaceAuthorizationLayout: React.FC = ({ meta, children, - noPadding = false, noHeader = false, bg = "primary", breadcrumbs, left, right, - profilePage = false, }) => { const [toggleSidebar, setToggleSidebar] = useState(false); @@ -101,7 +97,7 @@ export const WorkspaceAuthorizationLayout: React.FC = ({ -
+
{settingsLayout && (memberType?.isGuest || memberType?.isViewer) ? ( = ({ type="workspace" /> ) : ( -
+
{!noHeader && ( = ({ setToggleSidebar={setToggleSidebar} /> )} -
- {(settingsLayout || profilePage) && ( -
-
-

- {profilePage ? "Profile" : "Workspace"} Settings -

-

- {profilePage - ? "This information will be visible to only you." - : "This information will be displayed to every member of the workspace."} -

-
- -
- )} - {children} +
+
+ {children} +
)} diff --git a/apps/app/pages/[workspaceSlug]/index.tsx b/apps/app/pages/[workspaceSlug]/index.tsx index 5edef60eb..fd3ca88d3 100644 --- a/apps/app/pages/[workspaceSlug]/index.tsx +++ b/apps/app/pages/[workspaceSlug]/index.tsx @@ -45,7 +45,7 @@ const WorkspacePage: NextPage = () => { isOpen={isProductUpdatesModalOpen} setIsOpen={setIsProductUpdatesModalOpen} /> -
+
{ } - noPadding right={
{myIssues && myIssues.length > 0 && ( @@ -115,55 +114,42 @@ const MyIssuesPage: NextPage = () => { {myIssues ? ( <> {myIssues.length > 0 ? ( -
- - {({ open }) => ( -
-
- -
- - - -

My Issues

- - {myIssues.length} - -
-
-
- - - {myIssues.map((issue: IIssue) => ( - - ))} - - + + {({ open }) => ( +
+
+ +
+

My Issues

+ + {myIssues.length} + +
+
- )} - -
+ + + {myIssues.map((issue: IIssue) => ( + + ))} + + +
+ )} +
) : (
{ const { data: userActivity } = useSWR(USER_ACTIVITY, () => userService.getUserActivity()); @@ -25,20 +26,30 @@ const ProfileActivity = () => { } - profilePage > - {userActivity ? ( - userActivity.results.length > 0 ? ( - - ) : null - ) : ( - - - - - - - )} +
+
+
+

Profile Settings

+

+ This information will be visible to only you. +

+
+ +
+ {userActivity ? ( + userActivity.results.length > 0 ? ( + + ) : null + ) : ( + + + + + + + )} +
); }; diff --git a/apps/app/pages/[workspaceSlug]/me/profile/index.tsx b/apps/app/pages/[workspaceSlug]/me/profile/index.tsx index 6487fbbd8..5fbf3ef2a 100644 --- a/apps/app/pages/[workspaceSlug]/me/profile/index.tsx +++ b/apps/app/pages/[workspaceSlug]/me/profile/index.tsx @@ -24,6 +24,7 @@ import type { NextPage } from "next"; import type { IUser } from "types"; // constants import { USER_ROLES } from "constants/workspace"; +import SettingsNavbar from "layouts/settings-navbar"; const defaultValues: Partial = { avatar: "", @@ -130,7 +131,6 @@ const Profile: NextPage = () => { } - profilePage > { userImage /> {myProfile ? ( -
-
-
-

Profile Picture

-

- Max file size is 5MB. Supported file types are .jpg and .png. +

+
+
+

Profile Settings

+

+ This information will be visible to only you.

-
-
- -
- { - setIsImageUploadModalOpen(true); - }} - > - Upload - - {myProfile.avatar && myProfile.avatar !== "" && ( - handleDelete(myProfile.avatar, true)} - loading={isRemoving} + +
+
+
+
+

Profile Picture

+

+ Max file size is 5MB. Supported file types are .jpg and .png. +

+
+
+
+ +
+ { + setIsImageUploadModalOpen(true); + }} > - {isRemoving ? "Removing..." : "Remove"} - - )} + Upload + + {myProfile.avatar && myProfile.avatar !== "" && ( + handleDelete(myProfile.avatar, true)} + loading={isRemoving} + > + {isRemoving ? "Removing..." : "Remove"} + + )} +
-
-
-
-

Full Name

-

- This name will be reflected on all the projects you are working on. -

+
+
+

Full Name

+

+ This name will be reflected on all the projects you are working on. +

+
+
+ + +
-
- - +
+
+

Email

+

+ The email address that you are using. +

+
+
+ +
-
-
-
-

Email

-

The email address that you are using.

+
+
+

Role

+

Add your role.

+
+
+ ( + + {USER_ROLES.map((item) => ( + + {item.label} + + ))} + + )} + /> +
-
- +
+
+

Theme

+

+ Select or customize your interface color scheme. +

+
+
+ +
-
-
-
-

Role

-

Add your role.

+
+ + {isSubmitting ? "Updating..." : "Update profile"} +
-
- ( - - {USER_ROLES.map((item) => ( - - {item.label} - - ))} - - )} - /> -
-
-
-
-

Theme

-

- Select or customize your interface color scheme. -

-
-
- -
-
-
- - {isSubmitting ? "Updating..." : "Update profile"} -
) : ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx index 55351b42d..cf4b8b109 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/cycles/index.tsx @@ -124,7 +124,7 @@ const ProjectCycles: NextPage = () => { handleClose={() => setCreateUpdateCycleModal(false)} data={selectedCycle} /> -
+
{currentAndUpcomingCycles && currentAndUpcomingCycles.current_cycle.length > 0 && (

Current Cycle

diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx index 85ea7551c..1d73b2a75 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/issues/[issueId].tsx @@ -122,7 +122,6 @@ const IssueDetailsPage: NextPage = () => { return ( { document.dispatchEvent(e); }} > - + Add Module } @@ -89,7 +89,7 @@ const ProjectModules: NextPage = () => { /> {modules ? ( modules.length > 0 ? ( -
+

Modules

diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx index 9d2382d21..fb82b7364 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/pages/[pageId].tsx @@ -312,7 +312,7 @@ const SinglePage: NextPage = () => { } > {pageDetails ? ( -
+
-
- {!projectMembers || !projectInvitations ? ( - - - - - - - ) : ( -
- {members.length > 0 - ? members.map((member) => ( -
-
-
- {member.avatar && member.avatar !== "" ? ( - {member.first_name} - ) : member.first_name !== "" ? ( - member.first_name.charAt(0) - ) : ( - member.email.charAt(0) - )} -
-
-

- {member.first_name} {member.last_name} -

-

{member.email}

-
-
-
- {!member.member && ( -
- Pending -
- )} - { - if (!activeWorkspace || !projectDetails) return; - - projectService - .updateProjectMember( - activeWorkspace.slug, - projectDetails.id, - member.id, - { - role: value, - } - ) - .then((res) => { - setToastAlert({ - type: "success", - message: "Member role updated successfully.", - title: "Success", - }); - mutateMembers( - (prevData: any) => - prevData.map((m: any) => - m.id === member.id ? { ...m, ...res, role: value } : m - ), - false - ); - }) - .catch((err) => { - console.log(err); - }); - }} - position="right" - > - {Object.keys(ROLE).map((key) => ( - - <>{ROLE[parseInt(key) as keyof typeof ROLE]} - - ))} - - - { - if (member.member) setSelectedRemoveMember(member.id); - else setSelectedInviteRemoveMember(member.id); - }} - > - - - Remove member - - - -
-
- )) - : null} +
+ +
+
+

Members

+
- )} -
+ {!projectMembers || !projectInvitations ? ( + + + + + + + ) : ( +
+ {members.length > 0 + ? members.map((member) => ( +
+
+
+ {member.avatar && member.avatar !== "" ? ( + {member.first_name} + ) : member.first_name !== "" ? ( + member.first_name.charAt(0) + ) : ( + member.email.charAt(0) + )} +
+
+

+ {member.first_name} {member.last_name} +

+

{member.email}

+
+
+
+ {!member.member && ( +
+ Pending +
+ )} + { + if (!activeWorkspace || !projectDetails) return; + + projectService + .updateProjectMember( + activeWorkspace.slug, + projectDetails.id, + member.id, + { + role: value, + } + ) + .then((res) => { + setToastAlert({ + type: "success", + message: "Member role updated successfully.", + title: "Success", + }); + mutateMembers( + (prevData: any) => + prevData.map((m: any) => + m.id === member.id ? { ...m, ...res, role: value } : m + ), + false + ); + }) + .catch((err) => { + console.log(err); + }); + }} + position="right" + > + {Object.keys(ROLE).map((key) => ( + + <>{ROLE[parseInt(key) as keyof typeof ROLE]} + + ))} + + + { + if (member.member) setSelectedRemoveMember(member.id); + else setSelectedInviteRemoveMember(member.id); + }} + > + + + Remove member + + + +
+
+ )) + : null} +
+ )} + +
); diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx index b8040c473..39d83616d 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx @@ -28,6 +28,7 @@ import { getStatesList, orderStateGroups } from "helpers/state.helper"; import type { NextPage } from "next"; // fetch-keys import { STATES_LIST } from "constants/fetch-keys"; +import { SettingsHeader } from "components/project"; const StatesSettings: NextPage = () => { const [activeGroup, setActiveGroup] = useState(null); @@ -66,79 +67,82 @@ const StatesSettings: NextPage = () => { } > -
-
-

States

-

Manage the states of this project.

-
-
- {states && projectDetails ? ( - Object.keys(orderedStateGroups).map((key) => { - if (orderedStateGroups[key].length !== 0) - return ( -
-
-

{key}

- -
-
- {key === activeGroup && ( - { - setActiveGroup(null); - setSelectedState(null); - }} - data={null} - selectedGroup={key as keyof StateGroup} - /> - )} - {orderedStateGroups[key].map((state, index) => - state.id !== selectedState ? ( - setSelectedState(state.id)} - handleDeleteState={() => setSelectDeleteState(state.id)} +
+ +
+
+

States

+

Manage the states of this project.

+
+
+ {states && projectDetails ? ( + Object.keys(orderedStateGroups).map((key) => { + if (orderedStateGroups[key].length !== 0) + return ( +
+
+

{key}

+ +
+
+ {key === activeGroup && ( + { + setActiveGroup(null); + setSelectedState(null); + }} + data={null} + selectedGroup={key as keyof StateGroup} /> - ) : ( -
- { - setActiveGroup(null); - setSelectedState(null); - }} - data={ - statesList?.find((state) => state.id === selectedState) ?? null - } - selectedGroup={key as keyof StateGroup} + )} + {orderedStateGroups[key].map((state, index) => + state.id !== selectedState ? ( + setSelectedState(state.id)} + handleDeleteState={() => setSelectDeleteState(state.id)} /> -
- ) - )} + ) : ( +
+ { + setActiveGroup(null); + setSelectedState(null); + }} + data={ + statesList?.find((state) => state.id === selectedState) ?? null + } + selectedGroup={key as keyof StateGroup} + /> +
+ ) + )} +
-
- ); - }) - ) : ( - - - - - - - )} + ); + }) + ) : ( + + + + + + + )} +
diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx index 06599742b..79e72b85e 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/views/index.tsx @@ -97,7 +97,7 @@ const ProjectViews: NextPage = () => { /> {views ? ( views.length > 0 ? ( -
+

Views

{views.map((view) => ( diff --git a/apps/app/pages/[workspaceSlug]/projects/index.tsx b/apps/app/pages/[workspaceSlug]/projects/index.tsx index 9cb78563f..a38c037e5 100644 --- a/apps/app/pages/[workspaceSlug]/projects/index.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/index.tsx @@ -83,7 +83,7 @@ const ProjectsPage: NextPage = () => { data={projects?.find((item) => item.id === deleteProject) ?? null} /> {projects ? ( - <> +
{projects.length === 0 ? ( { ))}
)} - +
) : ( diff --git a/apps/app/pages/[workspaceSlug]/settings/billing.tsx b/apps/app/pages/[workspaceSlug]/settings/billing.tsx index 8b191316f..0e5cc69f4 100644 --- a/apps/app/pages/[workspaceSlug]/settings/billing.tsx +++ b/apps/app/pages/[workspaceSlug]/settings/billing.tsx @@ -8,6 +8,7 @@ import useSWR from "swr"; import workspaceService from "services/workspace.service"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { SettingsHeader } from "components/workspace"; // ui import { SecondaryButton } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; @@ -38,33 +39,36 @@ const BillingSettings: NextPage = () => { } > -
-
-

Billing & Plans

-

[Free launch preview] plan Pro

-
-
+
); }; diff --git a/apps/app/pages/[workspaceSlug]/settings/import-export.tsx b/apps/app/pages/[workspaceSlug]/settings/import-export.tsx index 3a8fa340f..821ceee7a 100644 --- a/apps/app/pages/[workspaceSlug]/settings/import-export.tsx +++ b/apps/app/pages/[workspaceSlug]/settings/import-export.tsx @@ -2,6 +2,7 @@ import { useRouter } from "next/router"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { SettingsHeader } from "components/workspace"; // components import IntegrationGuide from "components/integration/guide"; // ui @@ -22,7 +23,10 @@ const ImportExport: NextPage = () => { } > - +
+ + +
); }; diff --git a/apps/app/pages/[workspaceSlug]/settings/index.tsx b/apps/app/pages/[workspaceSlug]/settings/index.tsx index b0558b131..045e9a893 100644 --- a/apps/app/pages/[workspaceSlug]/settings/index.tsx +++ b/apps/app/pages/[workspaceSlug]/settings/index.tsx @@ -14,9 +14,10 @@ import fileService from "services/file.service"; import useToast from "hooks/use-toast"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import SettingsNavbar from "layouts/settings-navbar"; // components import { ImageUploadModal } from "components/core"; -import { DeleteWorkspaceModal } from "components/workspace"; +import { DeleteWorkspaceModal, SettingsHeader } from "components/workspace"; // ui import { Spinner, Input, CustomSelect, SecondaryButton, DangerButton } from "components/ui"; import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs"; @@ -172,163 +173,167 @@ const WorkspaceSettings: NextPage = () => { }} data={activeWorkspace ?? null} /> - {activeWorkspace ? ( -
-
-
-

Logo

-

- Max file size is 5MB. Supported file types are .jpg and .png. -

-
-
-
- -
- { - setIsImageUploadModalOpen(true); - }} - > - {isImageUploading ? "Uploading..." : "Upload"} - - {activeWorkspace.logo && activeWorkspace.logo !== "" && ( - handleDelete(activeWorkspace.logo)}> - {isImageRemoving ? "Removing..." : "Remove"} - - )} +
+ + {activeWorkspace ? ( +
+
+
+

Logo

+

+ Max file size is 5MB. Supported file types are .jpg and .png. +

+
+
+
+ +
+ { + setIsImageUploadModalOpen(true); + }} + > + {isImageUploading ? "Uploading..." : "Upload"} + + {activeWorkspace.logo && activeWorkspace.logo !== "" && ( + handleDelete(activeWorkspace.logo)}> + {isImageRemoving ? "Removing..." : "Remove"} + + )} +
-
-
-
-

URL

-

Your workspace URL.

+
+
+

URL

+

Your workspace URL.

+
+
+ + + copyTextToClipboard( + `${typeof window !== "undefined" && window.location.origin}/${ + activeWorkspace.slug + }` + ).then(() => { + setToastAlert({ + type: "success", + title: "Link Copied!", + message: "Workspace link copied to clipboard.", + }); + }) + } + outline + > + + +
-
- - - copyTextToClipboard( - `${typeof window !== "undefined" && window.location.origin}/${ - activeWorkspace.slug - }` - ).then(() => { - setToastAlert({ - type: "success", - title: "Link Copied!", - message: "Workspace link copied to clipboard.", - }); - }) - } - outline - > - +
+
+

Name

+

Give a name to your workspace.

+
+
+ +
+
+
+
+

Company Size

+

How big is your company?

+
+
+ ( + + {COMPANY_SIZE?.map((item) => ( + + {item.label} + + ))} + + )} + /> +
+
+
+ + {isSubmitting ? "Updating..." : "Update Workspace"}
-
-
-
-

Name

-

Give a name to your workspace.

-
-
- +
+
+

Danger Zone

+

+ The danger zone of the workspace delete page is a critical area that requires + careful consideration and attention. When deleting a workspace, all of the data + and resources within that workspace will be permanently removed and cannot be + recovered. +

+
+
+ setIsOpen(true)} outline> + Delete the workspace + +
-
-
-

Company Size

-

How big is your company?

-
-
- ( - - {COMPANY_SIZE?.map((item) => ( - - {item.label} - - ))} - - )} - /> -
+ ) : ( +
+
-
- - {isSubmitting ? "Updating..." : "Update Workspace"} - -
-
-
-

Danger Zone

-

- The danger zone of the workspace delete page is a critical area that requires - careful consideration and attention. When deleting a workspace, all of the data and - resources within that workspace will be permanently removed and cannot be recovered. -

-
-
- setIsOpen(true)} outline> - Delete the workspace - -
-
-
- ) : ( -
- -
- )} + )} +
); }; diff --git a/apps/app/pages/[workspaceSlug]/settings/integrations.tsx b/apps/app/pages/[workspaceSlug]/settings/integrations.tsx index 915a2af98..de3aa1533 100644 --- a/apps/app/pages/[workspaceSlug]/settings/integrations.tsx +++ b/apps/app/pages/[workspaceSlug]/settings/integrations.tsx @@ -9,6 +9,7 @@ import workspaceService from "services/workspace.service"; import IntegrationService from "services/integration"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { SettingsHeader } from "components/workspace"; // components import { SingleIntegrationCard } from "components/integration"; // ui @@ -46,31 +47,34 @@ const WorkspaceIntegrations: NextPage = () => { } > -
-
-

Integrations

-
- -

- Integrations and importers are only available on the cloud version. We plan to - open-source our SDKs in the near future so that the community can request or - contribute integrations as needed. -

+
+ +
+
+

Integrations

+
+ +

+ Integrations and importers are only available on the cloud version. We plan to + open-source our SDKs in the near future so that the community can request or + contribute integrations as needed. +

+
-
-
- {appIntegrations ? ( - appIntegrations.map((integration) => ( - - )) - ) : ( - - - - - )} -
-
+
+ {appIntegrations ? ( + appIntegrations.map((integration) => ( + + )) + ) : ( + + + + + )} +
+ +
); }; diff --git a/apps/app/pages/[workspaceSlug]/settings/members.tsx b/apps/app/pages/[workspaceSlug]/settings/members.tsx index 98d4eaaf2..05ae6249d 100644 --- a/apps/app/pages/[workspaceSlug]/settings/members.tsx +++ b/apps/app/pages/[workspaceSlug]/settings/members.tsx @@ -11,6 +11,7 @@ import useToast from "hooks/use-toast"; import workspaceService from "services/workspace.service"; // layouts import { WorkspaceAuthorizationLayout } from "layouts/auth-layout"; +import { SettingsHeader } from "components/workspace"; // components import ConfirmWorkspaceMemberRemove from "components/workspace/confirm-workspace-member-remove"; import SendWorkspaceInvitationModal from "components/workspace/send-workspace-invitation-modal"; @@ -137,117 +138,120 @@ const MembersSettings: NextPage = () => { } > -
-
-

Members

- -
- {!workspaceMembers || !workspaceInvitations ? ( - - - - - - - ) : ( -
- {members.length > 0 - ? members.map((member) => ( -
-
-
- {member.avatar && member.avatar !== "" ? ( - {member.first_name} - ) : member.first_name !== "" ? ( - member.first_name.charAt(0) - ) : ( - member.email.charAt(0) - )} -
-
-

- {member.first_name} {member.last_name} -

-

{member.email}

-
-
-
- {!member?.status && ( -
-

Pending

-
- )} - { - workspaceService - .updateWorkspaceMember(activeWorkspace?.slug as string, member.id, { - role: value, - }) - .then(() => { - mutateMembers( - (prevData) => - prevData?.map((m) => - m.id === member.id ? { ...m, role: value } : m - ), - false - ); - setToastAlert({ - title: "Success", - type: "success", - message: "Member role updated successfully.", - }); - }) - .catch(() => { - setToastAlert({ - title: "Error", - type: "error", - message: "An error occurred while updating member role.", - }); - }); - }} - position="right" - > - {Object.keys(ROLE).map((key) => ( - - <>{ROLE[parseInt(key) as keyof typeof ROLE]} - - ))} - - - { - if (member.member) { - setSelectedRemoveMember(member.id); - } else { - setSelectedInviteRemoveMember(member.id); - } - }} - > - Remove member - - -
-
- )) - : null} +
+ +
+
+

Members

+
- )} -
+ {!workspaceMembers || !workspaceInvitations ? ( + + + + + + + ) : ( +
+ {members.length > 0 + ? members.map((member) => ( +
+
+
+ {member.avatar && member.avatar !== "" ? ( + {member.first_name} + ) : member.first_name !== "" ? ( + member.first_name.charAt(0) + ) : ( + member.email.charAt(0) + )} +
+
+

+ {member.first_name} {member.last_name} +

+

{member.email}

+
+
+
+ {!member?.status && ( +
+

Pending

+
+ )} + { + workspaceService + .updateWorkspaceMember(activeWorkspace?.slug as string, member.id, { + role: value, + }) + .then(() => { + mutateMembers( + (prevData) => + prevData?.map((m) => + m.id === member.id ? { ...m, role: value } : m + ), + false + ); + setToastAlert({ + title: "Success", + type: "success", + message: "Member role updated successfully.", + }); + }) + .catch(() => { + setToastAlert({ + title: "Error", + type: "error", + message: "An error occurred while updating member role.", + }); + }); + }} + position="right" + > + {Object.keys(ROLE).map((key) => ( + + <>{ROLE[parseInt(key) as keyof typeof ROLE]} + + ))} + + + { + if (member.member) { + setSelectedRemoveMember(member.id); + } else { + setSelectedInviteRemoveMember(member.id); + } + }} + > + Remove member + + +
+
+ )) + : null} +
+ )} +
+
); diff --git a/apps/app/styles/globals.css b/apps/app/styles/globals.css index 8ca808544..4bdd47dbe 100644 --- a/apps/app/styles/globals.css +++ b/apps/app/styles/globals.css @@ -112,6 +112,7 @@ body { .horizontal-scroll-enable::-webkit-scrollbar { display: block; height: 7px; + width: 0; } .horizontal-scroll-enable::-webkit-scrollbar-track { diff --git a/apps/app/tailwind.config.js b/apps/app/tailwind.config.js index 9dde3bb74..3e2a2da4b 100644 --- a/apps/app/tailwind.config.js +++ b/apps/app/tailwind.config.js @@ -12,10 +12,6 @@ module.exports = { theme: { extend: { colors: { - theme: "#3f76ff", - "hover-gray": "#f5f5f5", - primary: "#f9fafb", // gray-50 - secondary: "white", brand: { accent: withOpacity("--color-accent"), base: withOpacity("--color-bg-base"),