diff --git a/apps/app/components/labels/create-update-label-inline.tsx b/apps/app/components/labels/create-update-label-inline.tsx index 70c87bc1c..6fe2d2495 100644 --- a/apps/app/components/labels/create-update-label-inline.tsx +++ b/apps/app/components/labels/create-update-label-inline.tsx @@ -108,28 +108,26 @@ export const CreateUpdateLabelInline = forwardRef(function CreateUpd return (
- + {({ open }) => ( <> - {watch("color") && watch("color") !== "" && ( - - )} + = ({ }; return ( - + {({ open }) => ( <>
@@ -74,7 +78,7 @@ export const SingleLabelGroup: React.FC = ({ -
{label.name}
+
{label.name}
@@ -122,7 +126,7 @@ export const SingleLabelGroup: React.FC = ({ key={child.id} className="group flex items-center justify-between rounded-md border border-brand-base p-2 text-sm" > -
+
= ({ editLabel, handleLabelDelete, }) => ( -
+
= ({ backgroundColor: label.color && label.color !== "" ? label.color : "#000", }} /> -
{label.name}
+
{label.name}
addLabelToGroup(label)}> diff --git a/apps/app/components/project/single-integration-card.tsx b/apps/app/components/project/single-integration-card.tsx index 4a329fa93..584c65fe8 100644 --- a/apps/app/components/project/single-integration-card.tsx +++ b/apps/app/components/project/single-integration-card.tsx @@ -18,7 +18,6 @@ import SlackLogo from "public/services/slack.png"; import { IWorkspaceIntegration } from "types"; // fetch-keys import { PROJECT_GITHUB_REPOSITORY } from "constants/fetch-keys"; -import { comboMatches } from "@blueprintjs/core"; type Props = { integration: IWorkspaceIntegration; @@ -27,14 +26,12 @@ type Props = { const integrationDetails: { [key: string]: any } = { github: { logo: GithubLogo, - installed: - "Activate GitHub integrations on individual projects to sync with specific repositories.", - notInstalled: "Connect with GitHub with your Plane workspace to sync project issues.", + description: "Select GitHub repository to enable sync.", }, slack: { logo: SlackLogo, - installed: "Activate Slack integrations on individual projects to sync with specific cahnnels.", - notInstalled: "Connect with Slack with your Plane workspace to sync project issues.", + description: + "Connect your slack channel to this project to get regular updates. Control which notification you want to receive.", }, }; @@ -67,19 +64,19 @@ export const SingleIntegration: React.FC = ({ integration }) => { } = repo; projectService - .syncGiuthubRepository(workspaceSlug as string, projectId as string, integration.id, { + .syncGithubRepository(workspaceSlug as string, projectId as string, integration.id, { name, owner: login, repository_id: id, url: html_url, }) - .then((res) => { + .then(() => { mutate(PROJECT_GITHUB_REPOSITORY(projectId as string)); setToastAlert({ type: "success", title: "Success!", - message: `${login}/${name} respository synced with the project successfully.`, + message: `${login}/${name} repository synced with the project successfully.`, }); }) .catch((err) => { @@ -88,7 +85,7 @@ export const SingleIntegration: React.FC = ({ integration }) => { setToastAlert({ type: "error", title: "Error!", - message: "Respository could not be synced with the project. Please try again.", + message: "Repository could not be synced with the project. Please try again.", }); }); }; @@ -96,24 +93,20 @@ export const SingleIntegration: React.FC = ({ integration }) => { return ( <> {integration && ( -
+
GithubLogo

{integration.integration_detail.title}

-

- {integration.integration_detail.provider === "github" - ? "Select GitHub repository to enable sync." - : integration.integration_detail.provider === "slack" - ? "Connect your slack channel to this project to get regular updates. Control which notification you want to receive" - : null} +

+ {integrationDetails[integration.integration_detail.provider].description}

diff --git a/apps/app/components/states/create-update-state-inline.tsx b/apps/app/components/states/create-update-state-inline.tsx index 36f780bd1..42ab52945 100644 --- a/apps/app/components/states/create-update-state-inline.tsx +++ b/apps/app/components/states/create-update-state-inline.tsx @@ -155,7 +155,7 @@ export const CreateUpdateStateInline: React.FC = ({ data, onClose, select return (
@@ -163,7 +163,7 @@ export const CreateUpdateStateInline: React.FC = ({ data, onClose, select <> {watch("color") && watch("color") !== "" && ( diff --git a/apps/app/components/states/single-state.tsx b/apps/app/components/states/single-state.tsx index a295d36ca..d9425c524 100644 --- a/apps/app/components/states/single-state.tsx +++ b/apps/app/components/states/single-state.tsx @@ -134,21 +134,19 @@ export const SingleState: React.FC = ({ }; return ( -
+
{getStateGroupIcon(state.group, "20", "20", state.color)}
-
{addSpaceIfCamelCase(state.name)}
-

{state.description}

+
{addSpaceIfCamelCase(state.name)}
+

{state.description}

{index !== 0 && ( )} {state.default ? ( - Default + Default ) : (
diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx index 4e48e2916..150d28b4a 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/features.tsx @@ -6,7 +6,7 @@ import useSWR, { mutate } from "swr"; // services import projectService from "services/project.service"; -import trackEventServices from "services/track-event.service"; +import trackEventServices, { MiscellaneousEventType } from "services/track-event.service"; // layouts import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; // hooks @@ -23,6 +23,52 @@ import type { NextPage } from "next"; // fetch-keys import { PROJECTS_LIST, PROJECT_DETAILS } from "constants/fetch-keys"; +const featuresList = [ + { + title: "Cycles", + description: + "Cycles are enabled for all the projects in this workspace. Access them from the sidebar.", + icon: , + property: "cycle_view", + }, + { + title: "Modules", + description: + "Modules are enabled for all the projects in this workspace. Access it from the sidebar.", + icon: , + property: "module_view", + }, + { + title: "Views", + description: + "Views are enabled for all the projects in this workspace. Access it from the sidebar.", + icon: , + property: "issue_views_view", + }, + { + title: "Pages", + description: + "Pages are enabled for all the projects in this workspace. Access it from the sidebar.", + icon: , + property: "page_view", + }, +]; + +const getEventType = (feature: string, toggle: boolean): MiscellaneousEventType => { + switch (feature) { + case "Cycles": + return toggle ? "TOGGLE_CYCLE_ON" : "TOGGLE_CYCLE_OFF"; + case "Modules": + return toggle ? "TOGGLE_MODULE_ON" : "TOGGLE_MODULE_OFF"; + case "Views": + return toggle ? "TOGGLE_VIEW_ON" : "TOGGLE_VIEW_OFF"; + case "Pages": + return toggle ? "TOGGLE_PAGES_ON" : "TOGGLE_PAGES_OFF"; + default: + return toggle ? "TOGGLE_PAGES_ON" : "TOGGLE_PAGES_OFF"; + } +}; + const FeaturesSettings: NextPage = () => { const router = useRouter(); const { workspaceSlug, projectId } = router.query; @@ -91,170 +137,57 @@ const FeaturesSettings: NextPage = () => {

Features

-
-
- -
-

Cycles

-

- Cycles are enabled for all the projects in this workspace. Access them from the - navigation bar. -

-
-
- -
-
-
- -
-

Modules

-

- Modules are enabled for all the projects in this workspace. Access it from the - navigation bar. -

+
+ {feature.icon} +
+

{feature.title}

+

{feature.description}

+
-
- -
-
-
- -
-

Views

-

- Views are enabled for all the projects in this workspace. Access it from the - navigation bar. -

-
+ role="switch" + aria-checked={projectDetails?.[feature.property as keyof IProject]} + onClick={() => { + trackEventServices.trackMiscellaneousEvent( + { + workspaceId: (projectDetails?.workspace as any)?.id, + workspaceSlug, + projectId, + projectIdentifier: projectDetails?.identifier, + projectName: projectDetails?.name, + }, + !projectDetails?.[feature.property as keyof IProject] + ? getEventType(feature.title, true) + : getEventType(feature.title, false) + ); + handleSubmit({ + [feature.property]: !projectDetails?.[feature.property as keyof IProject], + }); + }} + > + Use {feature.title} +
- -
-
-
- -
-

Pages

-

- Pages are enabled for all the projects in this workspace. Access them from the - navigation bar. -

-
-
- -
+ ))}
diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx index 06efddf27..d7fb1d824 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/members.tsx @@ -10,6 +10,7 @@ import projectService from "services/project.service"; import workspaceService from "services/workspace.service"; // hooks import useToast from "hooks/use-toast"; +import useProjectDetails from "hooks/use-project-details"; // layouts import { ProjectAuthorizationWrapper } from "layouts/auth-layout"; // components @@ -23,12 +24,7 @@ import { PlusIcon, XMarkIcon } from "@heroicons/react/24/outline"; // types import type { NextPage } from "next"; // fetch-keys -import { - PROJECT_DETAILS, - PROJECT_INVITATIONS, - PROJECT_MEMBERS, - WORKSPACE_DETAILS, -} from "constants/fetch-keys"; +import { PROJECT_INVITATIONS, PROJECT_MEMBERS, WORKSPACE_DETAILS } from "constants/fetch-keys"; // constants import { ROLE } from "constants/workspace"; @@ -48,24 +44,13 @@ const MembersSettings: NextPage = () => { () => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null) ); - const { data: projectDetails } = useSWR( - workspaceSlug && projectId ? PROJECT_DETAILS(projectId as string) : null, - workspaceSlug && projectId - ? () => projectService.getProject(workspaceSlug as string, projectId as string) - : null - ); + const { projectDetails } = useProjectDetails(); const { data: projectMembers, mutate: mutateMembers } = useSWR( workspaceSlug && projectId ? PROJECT_MEMBERS(projectId as string) : null, workspaceSlug && projectId ? () => projectService.projectMembers(workspaceSlug as string, projectId as string) - : null, - { - onErrorRetry(err, _, __, revalidate, revalidateOpts) { - if (err?.status === 403) return; - setTimeout(() => revalidate(revalidateOpts), 5000); - }, - } + : null ); const { data: projectInvitations, mutate: mutateInvitations } = useSWR( @@ -176,11 +161,11 @@ const MembersSettings: NextPage = () => { ) : ( -
+
{members.length > 0 ? members.map((member) => (
-
+
{member.avatar && member.avatar !== "" ? ( {

{member.email}

- {!member.member && ( - - Request Pending - - )}
+ {!member.member && ( +
+ Pending +
+ )} { console.log(err); }); }} + position="right" > {Object.keys(ROLE).map((key) => ( diff --git a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx index 8b513d640..b8040c473 100644 --- a/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx +++ b/apps/app/pages/[workspaceSlug]/projects/[projectId]/settings/states.tsx @@ -110,7 +110,10 @@ const StatesSettings: NextPage = () => { handleDeleteState={() => setSelectDeleteState(state.id)} /> ) : ( -
+
{ setActiveGroup(null); diff --git a/apps/app/pages/[workspaceSlug]/settings/members.tsx b/apps/app/pages/[workspaceSlug]/settings/members.tsx index f993c2ff9..98d4eaaf2 100644 --- a/apps/app/pages/[workspaceSlug]/settings/members.tsx +++ b/apps/app/pages/[workspaceSlug]/settings/members.tsx @@ -157,7 +157,7 @@ const MembersSettings: NextPage = () => { ) : ( -
+
{members.length > 0 ? members.map((member) => (
@@ -184,64 +184,63 @@ const MembersSettings: NextPage = () => {

{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.", - }); + { + 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); + } }} > - {Object.keys(ROLE).map((key) => ( - - <>{ROLE[parseInt(key) as keyof typeof ROLE]} - - ))} - - - { - if (member.member) { - setSelectedRemoveMember(member.id); - } else { - setSelectedInviteRemoveMember(member.id); - } - }} - > - Remove member - - -
+ Remove member + +
)) diff --git a/apps/app/services/project.service.ts b/apps/app/services/project.service.ts index f1740152b..f7daf5674 100644 --- a/apps/app/services/project.service.ts +++ b/apps/app/services/project.service.ts @@ -244,7 +244,7 @@ class ProjectServices extends APIService { }); } - async syncGiuthubRepository( + async syncGithubRepository( workspaceSlug: string, projectId: string, workspaceIntegrationId: string, diff --git a/apps/app/services/track-event.service.ts b/apps/app/services/track-event.service.ts index a8b77150c..5d7ed32f1 100644 --- a/apps/app/services/track-event.service.ts +++ b/apps/app/services/track-event.service.ts @@ -47,7 +47,7 @@ type ViewEventType = "VIEW_CREATE" | "VIEW_UPDATE" | "VIEW_DELETE"; type IssueCommentType = "ISSUE_COMMENT_CREATE" | "ISSUE_COMMENT_UPDATE" | "ISSUE_COMMENT_DELETE"; -type MiscellaneousEventType = +export type MiscellaneousEventType = | "TOGGLE_CYCLE_ON" | "TOGGLE_CYCLE_OFF" | "TOGGLE_MODULE_ON" diff --git a/apps/app/styles/globals.css b/apps/app/styles/globals.css index c16b39807..5f846e038 100644 --- a/apps/app/styles/globals.css +++ b/apps/app/styles/globals.css @@ -96,8 +96,11 @@ -webkit-font-smoothing: antialiased; } -/* scrollbar style */ +body { + color: rgba(var(--color-text-base)); +} +/* scrollbar style */ ::-webkit-scrollbar { display: none; } @@ -206,7 +209,7 @@ ); } -.progress-bar{ +.progress-bar { fill: currentColor; color: rgba(var(--color-bg-sidebar)); }