Merge branch 'develop' of github.com:makeplane/plane into develop-deploy

This commit is contained in:
pablohashescobar 2023-11-20 19:43:23 +05:30
commit 417749c543
17 changed files with 141 additions and 135 deletions

View File

@ -372,8 +372,8 @@ module.exports = {
96: "21.6rem", 96: "21.6rem",
}, },
backgroundImage: { backgroundImage: {
"gradient-primary": "var( --gradient-onboarding-primary)", "onboarding-gradient-primary": "var( --gradient-onboarding-primary)",
"gradient-secondary": "var( --gradient-onboarding-secondary)", "onboarding-gradient-secondary": "var( --gradient-onboarding-secondary)",
}, },
}, },
fontFamily: { fontFamily: {

View File

@ -12,6 +12,7 @@ import { AuthService } from "services/auth.service";
import { Dialog, Transition } from "@headlessui/react"; import { Dialog, Transition } from "@headlessui/react";
// icons // icons
import { AlertTriangle } from "lucide-react"; import { AlertTriangle } from "lucide-react";
import { UserService } from "services/user.service";
type Props = { type Props = {
isOpen: boolean; isOpen: boolean;
@ -19,6 +20,7 @@ type Props = {
}; };
const authService = new AuthService(); const authService = new AuthService();
const userService = new UserService();
const DeleteAccountModal: React.FC<Props> = (props) => { const DeleteAccountModal: React.FC<Props> = (props) => {
const { isOpen, onClose } = props; const { isOpen, onClose } = props;
@ -41,6 +43,28 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
); );
}; };
const handleDeleteAccount = async () => {
setIsDeleteLoading(true);
await userService
.deleteAccount()
.then(() => {
setToastAlert({
type: "success",
title: "Success!",
message: "Account deleted successfully.",
});
router.push("/");
})
.catch((err) =>
setToastAlert({
type: "error",
title: "Error!",
message: err?.data?.error,
})
);
setIsDeleteLoading(false);
};
const handleClose = () => { const handleClose = () => {
onClose(); onClose();
}; };
@ -84,10 +108,10 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
</div> </div>
<div className="mt-6 px-4"> <div className="mt-6 px-4">
<p className="text-onboarding-text-300 font-normal text-base"> <ul className="text-onboarding-text-300 list-disc font-normal text-base">
<li>Delete this account if you have another and wont use this account.</li> <li>Delete this account if you have another and wont use this account.</li>
<li>Switch to another account if youd like to come back to this account another time.</li> <li>Switch to another account if youd like to come back to this account another time.</li>
</p> </ul>
</div> </div>
</div> </div>
</div> </div>
@ -95,7 +119,10 @@ const DeleteAccountModal: React.FC<Props> = (props) => {
<span className="text-sm font-medium hover:cursor-pointer" onClick={handleSignOut}> <span className="text-sm font-medium hover:cursor-pointer" onClick={handleSignOut}>
Switch account Switch account
</span> </span>
<button className="py-1.5 px-3 font-medium rounded-sm text-red-500 border border-red-500 text-sm "> <button
className="py-1.5 px-3 font-medium rounded-sm text-red-500 border border-red-500 text-sm "
onClick={handleDeleteAccount}
>
{isDeleteLoading ? "Deleting..." : "Delete account"} {isDeleteLoading ? "Deleting..." : "Delete account"}
</button> </button>
</div> </div>

View File

@ -84,7 +84,7 @@ const LabelPill = ({ labelId }: { labelId: string }) => {
return ( return (
<span <span
className="h-1.5 w-1.5 rounded-full" className="h-1.5 w-1.5 rounded-full flex-shrink-0"
style={{ style={{
backgroundColor: labels?.find((l) => l.id === labelId)?.color ?? "#000000", backgroundColor: labels?.find((l) => l.id === labelId)?.color ?? "#000000",
}} }}
@ -266,12 +266,12 @@ const activityDetails: {
if (activity.verb === "created") if (activity.verb === "created")
return ( return (
<> <>
added this issue to the cycle{" "} <span className="flex-shrink-0">added this issue to the cycle</span>
<a <a
href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.new_identifier}`} href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.new_identifier}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
> >
<span className="truncate">{activity.new_value}</span> <span className="truncate">{activity.new_value}</span>
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" /> <RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
@ -281,12 +281,12 @@ const activityDetails: {
else if (activity.verb === "updated") else if (activity.verb === "updated")
return ( return (
<> <>
set the cycle to{" "} <span className="flex-shrink-0">set the cycle to </span>
<a <a
href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.new_identifier}`} href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.new_identifier}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
> >
<span className="truncate">{activity.new_value}</span> <span className="truncate">{activity.new_value}</span>
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" /> <RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
@ -301,7 +301,7 @@ const activityDetails: {
href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.old_identifier}`} href={`/${workspaceSlug}/projects/${activity.project}/cycles/${activity.old_identifier}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
> >
<span className="truncate">{activity.old_value}</span> <span className="truncate">{activity.old_value}</span>
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" /> <RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
@ -370,15 +370,15 @@ const activityDetails: {
return ( return (
<> <>
added a new label{" "} added a new label{" "}
<span className="inline-flex items-center gap-2 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs"> <span className="flex truncate items-center gap-2 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs">
<LabelPill labelId={activity.new_identifier ?? ""} /> <LabelPill labelId={activity.new_identifier ?? ""} />
<span className="font-medium text-custom-text-100">{activity.new_value}</span> <span className="font-medium flex-shrink truncate text-custom-text-100">{activity.new_value}</span>
</span> </span>
{showIssue && ( {showIssue && (
<> <span>
{" "} {" "}
to <IssueLink activity={activity} /> to <IssueLink activity={activity} />
</> </span>
)} )}
</> </>
); );
@ -386,15 +386,15 @@ const activityDetails: {
return ( return (
<> <>
removed the label{" "} removed the label{" "}
<span className="inline-flex items-center gap-3 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs"> <span className="flex truncate items-center gap-2 rounded-full border border-custom-border-300 px-2 py-0.5 text-xs">
<LabelPill labelId={activity.old_identifier ?? ""} /> <LabelPill labelId={activity.old_identifier ?? ""} />
<span className="font-medium text-custom-text-100">{activity.old_value}</span> <span className="font-medium flex-shrink truncate text-custom-text-100">{activity.old_value}</span>
</span> </span>
{showIssue && ( {showIssue && (
<> <span>
{" "} {" "}
from <IssueLink activity={activity} /> from <IssueLink activity={activity} />
</> </span>
)} )}
</> </>
); );
@ -482,7 +482,7 @@ const activityDetails: {
href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`} href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
> >
<span className="truncate">{activity.new_value}</span> <span className="truncate">{activity.new_value}</span>
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" /> <RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
@ -497,7 +497,7 @@ const activityDetails: {
href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`} href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.new_identifier}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
> >
<span className="truncate">{activity.new_value}</span> <span className="truncate">{activity.new_value}</span>
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" /> <RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
@ -512,7 +512,7 @@ const activityDetails: {
href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.old_identifier}`} href={`/${workspaceSlug}/projects/${activity.project}/modules/${activity.old_identifier}`}
target="_blank" target="_blank"
rel="noopener noreferrer" rel="noopener noreferrer"
className="w-full font-medium text-custom-text-100 inline-flex items-center gap-1 hover:underline" className="font-medium text-custom-text-100 inline-flex items-center truncate gap-1 hover:underline"
> >
<span className="truncate">{activity.old_value}</span> <span className="truncate">{activity.old_value}</span>
<RocketIcon size={12} color="#6b7280" className="flex-shrink-0" /> <RocketIcon size={12} color="#6b7280" className="flex-shrink-0" />
@ -525,7 +525,7 @@ const activityDetails: {
name: { name: {
message: (activity, showIssue) => ( message: (activity, showIssue) => (
<> <>
set the name to {activity.new_value} <span className="truncate">set the name to {activity.new_value}</span>
{showIssue && ( {showIssue && (
<> <>
{" "} {" "}

View File

@ -186,6 +186,7 @@ export const CreateUpdateLabelInline = observer(
id="labelName" id="labelName"
name="name" name="name"
type="text" type="text"
autofocus
value={value} value={value}
onChange={onChange} onChange={onChange}
ref={ref} ref={ref}

View File

@ -18,6 +18,7 @@ import { ROLE } from "constants/workspace";
import { IWorkspaceMemberInvitation } from "types"; import { IWorkspaceMemberInvitation } from "types";
// icons // icons
import { CheckCircle2, Search } from "lucide-react"; import { CheckCircle2, Search } from "lucide-react";
import { trackEvent } from "helpers/event-tracker.helper";
type Props = { type Props = {
handleNextStep: () => void; handleNextStep: () => void;
@ -32,7 +33,7 @@ const Invitations: React.FC<Props> = (props) => {
const { const {
workspace: workspaceStore, workspace: workspaceStore,
user: { updateCurrentUser }, user: { currentUser, updateCurrentUser },
} = useMobxStore(); } = useMobxStore();
const { const {
@ -63,7 +64,8 @@ const Invitations: React.FC<Props> = (props) => {
await workspaceService await workspaceService
.joinWorkspaces({ invitations: invitationsRespond }) .joinWorkspaces({ invitations: invitationsRespond })
.then(async () => { .then(async (res) => {
trackEvent("WORKSPACE_USER_INVITE_ACCEPT", res);
await mutateInvitations(); await mutateInvitations();
await workspaceStore.fetchWorkspaces(); await workspaceStore.fetchWorkspaces();
await mutate(USER_WORKSPACES); await mutate(USER_WORKSPACES);
@ -145,15 +147,15 @@ const Invitations: React.FC<Props> = (props) => {
</div> </div>
</div> </div>
) : ( ) : (
<EmptyInvitation /> <EmptyInvitation email={currentUser!.email} />
); );
}; };
const EmptyInvitation = () => ( const EmptyInvitation = ({ email }: { email: string }) => (
<div className="items-center md:w-4/5 bg-onboarding-background-300/30 my-16 border-onboarding-border-200 py-5 px-10 rounded border justify-center "> <div className="items-center md:w-4/5 bg-onboarding-background-300/30 my-16 border-onboarding-border-200 py-5 px-10 rounded border justify-center ">
<p className="text-lg text-onboarding-text-300 text-center font-semibold">Is your Team already on Plane?</p> <p className="text-lg text-onboarding-text-300 text-center font-semibold">Is your team already on Plane?</p>
<p className="text-sm text-onboarding-text-300 mt-6 text-center"> <p className="text-sm text-onboarding-text-300 mt-6 text-center">
We couldnt find any existing workspaces for the email address bhavesh@caravel.ai We couldnt find any existing workspaces for the email address {email}
</p> </p>
<div <div
className="bg-onboarding-background-200 mt-6 py-3 text-center hover:cursor-pointer text-custom-text-200 rounded-md text-sm font-medium border border-custom-border-200" className="bg-onboarding-background-200 mt-6 py-3 text-center hover:cursor-pointer text-custom-text-200 rounded-md text-sm font-medium border border-custom-border-200"

View File

@ -231,7 +231,7 @@ export const InviteMembers: React.FC<Props> = (props) => {
return ( return (
<div className="flex py-14"> <div className="flex py-14">
<div <div
className={`hidden lg:block w-1/4 p-3 ml-auto rounded bg-gradient-secondary border border-onboarding-border-100 border-opacity-10`} className={`hidden lg:block w-1/4 p-3 ml-auto rounded bg-onboarding-gradient-secondary border border-onboarding-border-100 border-opacity-10`}
> >
<p className="text-base text-onboarding-text-400 font-semibold">Members</p> <p className="text-base text-onboarding-text-400 font-semibold">Members</p>

View File

@ -7,12 +7,9 @@ import DummySidebar from "components/account/sidebar";
import OnboardingStepIndicator from "components/account/step-indicator"; import OnboardingStepIndicator from "components/account/step-indicator";
import { Workspace } from "./workspace"; import { Workspace } from "./workspace";
// types // types
import { IWorkspaceMemberInvitation, TOnboardingSteps } from "types"; import { IWorkspace, TOnboardingSteps } from "types";
// fetch-keys // react-hook-form
import { USER_WORKSPACES, USER_WORKSPACE_INVITATIONS } from "constants/fetch-keys"; import { Controller, useForm } from "react-hook-form";
// constants
import { ROLE } from "constants/workspace";
import { trackEvent } from "helpers/event-tracker.helper";
type Props = { type Props = {
finishOnboarding: () => Promise<void>; finishOnboarding: () => Promise<void>;
@ -38,81 +35,30 @@ export const JoinWorkspaces: React.FC<Props> = ({ stepChange, setTryDiffAccount
const handleNextStep = async () => { const handleNextStep = async () => {
if (!user) return; if (!user) return;
await stepChange({ workspace_join: true, workspace_create: true });
await stepChange({ workspace_join: true });
if (user.onboarding_step.workspace_create && user.onboarding_step.workspace_invite) await finishOnboarding();
};
const submitInvitations = async () => {
if (invitationsRespond.length <= 0) return;
setIsJoiningWorkspaces(true);
await workspaceService
.joinWorkspaces({ invitations: invitationsRespond })
.then(async (res) => {
trackEvent(
'WORKSPACE_USER_INVITE_ACCEPT',
res
)
await mutateInvitations();
await mutate(USER_WORKSPACES);
await updateLastWorkspace();
await handleNextStep();
})
.finally(() => setIsJoiningWorkspaces(false));
}; };
return ( return (
<div className="w-full space-y-7 sm:space-y-10"> <div className="flex h-full w-full">
<h5 className="sm:text-lg">We see that someone has invited you to</h5> <div className="hidden lg:block w-3/12">
<h4 className="text-xl sm:text-2xl font-semibold">Join a workspace</h4> <Controller
<div className="max-h-[37vh] overflow-y-auto md:w-3/5 space-y-4"> control={control}
{invitations && name="name"
invitations.map((invitation) => { render={({ field: { value } }) => (
const isSelected = invitationsRespond.includes(invitation.id); <DummySidebar
watch={watch}
return ( setValue={setValue}
<div control={control}
key={invitation.id} showProject={false}
className={`flex cursor-pointer items-center gap-2 border py-5 px-3.5 rounded ${isSelected ? "border-custom-primary-100" : "border-custom-border-200 hover:bg-custom-background-80" workspaceName={value.length > 0 ? value : "New Workspace"}
}`} />
onClick={() => handleInvitation(invitation, isSelected ? "withdraw" : "accepted")} )}
> />
<div className="flex-shrink-0">
<div className="grid place-items-center h-9 w-9 rounded">
{invitation.workspace.logo && invitation.workspace.logo !== "" ? (
<img
src={invitation.workspace.logo}
height="100%"
width="100%"
className="rounded"
alt={invitation.workspace.name}
/>
) : (
<span className="grid place-items-center h-9 w-9 py-1.5 px-3 rounded bg-gray-700 uppercase text-white">
{invitation.workspace.name[0]}
</span>
)}
</div>
</div>
<div className="min-w-0 flex-1">
<div className="text-sm font-medium">{truncateText(invitation.workspace.name, 30)}</div>
<p className="text-xs text-custom-text-200">{ROLE[invitation.role]}</p>
</div>
<span className={`flex-shrink-0 ${isSelected ? "text-custom-primary-100" : "text-custom-text-200"}`}>
<CheckCircle className="h-5 w-5" />
</span>
</div>
);
})}
</div> </div>
<div className="w-full lg:w-1/2 md:w-4/5 md:px-0 px-7 my-16 mx-auto"> <div className="w-full lg:w-1/2 md:w-4/5 md:px-0 px-7 my-16 mx-auto">
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">
<p className="font-semibold text-onboarding-text-200 text-xl sm:text-2xl">What will your workspace </p> <p className="font-semibold text-onboarding-text-200 text-xl sm:text-2xl">What will your workspace be?</p>
<OnboardingStepIndicator step={1} /> <OnboardingStepIndicator step={1} />
</div> </div>
<Workspace <Workspace

View File

@ -23,6 +23,7 @@ import { Camera, User2 } from "lucide-react";
const defaultValues: Partial<IUser> = { const defaultValues: Partial<IUser> = {
first_name: "", first_name: "",
avatar: "", avatar: "",
use_case: undefined,
}; };
type Props = { type Props = {
@ -59,6 +60,7 @@ export const UserDetails: React.FC<Props> = observer((props) => {
...formData, ...formData,
first_name: formData.first_name.split(" ")[0], first_name: formData.first_name.split(" ")[0],
last_name: formData.first_name.split(" ")[1], last_name: formData.first_name.split(" ")[1],
use_case: formData.use_case,
onboarding_step: { onboarding_step: {
...user.onboarding_step, ...user.onboarding_step,
profile_complete: true, profile_complete: true,
@ -91,7 +93,6 @@ export const UserDetails: React.FC<Props> = observer((props) => {
handleDelete={() => {}} handleDelete={() => {}}
onSuccess={(url) => { onSuccess={(url) => {
setValue("avatar", url); setValue("avatar", url);
// handleSubmit(onSubmit)();
setIsImageUploadModalOpen(false); setIsImageUploadModalOpen(false);
}} }}
value={watch("avatar") !== "" ? watch("avatar") : undefined} value={watch("avatar") !== "" ? watch("avatar") : undefined}
@ -158,25 +159,31 @@ export const UserDetails: React.FC<Props> = observer((props) => {
name="first_name" name="first_name"
render={({ field: { value } }) => ( render={({ field: { value } }) => (
<p className="font-medium text-onboarding-text-200 text-xl sm:text-2xl p-0"> <p className="font-medium text-onboarding-text-200 text-xl sm:text-2xl p-0">
And how will you use Plane, {value} ? And how will you use Plane{value.length>0?", ":""}{value}?
</p> </p>
)} )}
/> />
<p className="font-medium text-onboarding-text-300 text-sm my-3">Choose just one</p> <p className="font-medium text-onboarding-text-300 text-sm my-3">Choose just one</p>
<div className="flex flex-wrap break-all overflow-auto"> <Controller
{useCases.map((useCase, index) => ( control={control}
<div name="use_case"
className={`border mb-3 hover:cursor-pointer hover:bg-onboarding-background-300/30 flex-shrink-0 ${ render={({ field: { value, onChange } }) => (
selectedUsecase === index ? "border-custom-primary-100" : "border-onboarding-border-100" <div className="flex flex-wrap break-all overflow-auto">
} mr-3 rounded-sm p-3 text-sm font-medium`} {useCases.map((useCase) => (
onClick={() => setSelectedUsecase(index)} <div
> className={`border mb-3 hover:cursor-pointer hover:bg-onboarding-background-300/30 flex-shrink-0 ${
{useCase} value === useCase ? "border-custom-primary-100" : "border-onboarding-border-100"
} mr-3 rounded-sm p-3 text-sm font-medium`}
onClick={() => onChange(useCase)}
>
{useCase}
</div>
))}
</div> </div>
))} )}
</div> />
</div> </div>
<Button variant="primary" type="submit" size="md" disabled={!isValid} loading={isSubmitting}> <Button variant="primary" type="submit" size="md" disabled={!isValid} loading={isSubmitting}>

View File

@ -184,7 +184,7 @@ export const SignInView = observer(() => {
<Spinner /> <Spinner />
</div> </div>
) : ( ) : (
<div className={`bg-gradient-primary h-full overflow-y-auto`}> <div className={`bg-onboarding-gradient-primary h-full overflow-y-auto`}>
<div className="sm:py-5 pl-8 pb-4 sm:pl-16 lg:pl-28 "> <div className="sm:py-5 pl-8 pb-4 sm:pl-16 lg:pl-28 ">
<div className="flex text-3xl items-center mt-16 font-semibold"> <div className="flex text-3xl items-center mt-16 font-semibold">
<div className="h-[30px] w-[30px] mr-2"> <div className="h-[30px] w-[30px] mr-2">
@ -196,7 +196,7 @@ export const SignInView = observer(() => {
<div className="md:w-2/3 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200"> <div className="md:w-2/3 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200">
<div className={`p-4`}> <div className={`p-4`}>
<div className={`px-7 sm:px-0 bg-gradient-secondary h-full pt-32 pb-20 rounded-md`}> <div className={`px-7 sm:px-0 bg-onboarding-gradient-secondary h-full pt-32 pb-20 rounded-md`}>
{!envConfig ? ( {!envConfig ? (
<div className="pt-10 mx-auto flex justify-center"> <div className="pt-10 mx-auto flex justify-center">
<div> <div>

View File

@ -49,7 +49,9 @@ export const RecentPagesList: React.FC<TPagesListProps> = observer((props) => {
return ( return (
<div key={key} className="h-full overflow-hidden pb-9"> <div key={key} className="h-full overflow-hidden pb-9">
<h2 className="text-xl font-semibold capitalize mb-2">{replaceUnderscoreIfSnakeCase(key)}</h2> <h2 className="text-xl font-semibold capitalize mb-2">
{replaceUnderscoreIfSnakeCase(key)}
</h2>
<PagesView pages={pages[key as keyof RecentPagesResponse]} viewType={viewType} /> <PagesView pages={pages[key as keyof RecentPagesResponse]} viewType={viewType} />
</div> </div>
); );

View File

@ -55,7 +55,7 @@ export interface ICreateProjectForm {
description: string; description: string;
emoji_and_icon: string; emoji_and_icon: string;
network: number; network: number;
project_lead_member: IWorkspaceMember; project_lead_member: string;
project_lead: string; project_lead: string;
cover_image: string; cover_image: string;
icon_prop: any; icon_prop: any;
@ -126,7 +126,7 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
if (typeof formData.emoji_and_icon === "object") payload.icon_prop = formData.emoji_and_icon; if (typeof formData.emoji_and_icon === "object") payload.icon_prop = formData.emoji_and_icon;
else payload.emoji = formData.emoji_and_icon; else payload.emoji = formData.emoji_and_icon;
payload.project_lead = formData.project_lead_member?.member.id; payload.project_lead = formData.project_lead_member;
return projectStore return projectStore
.createProject(workspaceSlug.toString(), payload) .createProject(workspaceSlug.toString(), payload)
@ -380,7 +380,7 @@ export const CreateProjectModal: FC<Props> = observer((props) => {
control={control} control={control}
render={({ field: { value, onChange } }) => ( render={({ field: { value, onChange } }) => (
<WorkspaceMemberSelect <WorkspaceMemberSelect
value={value} value={workspaceMembers?.filter((member: IWorkspaceMember) => member.member.id ===value)[0]}
onChange={onChange} onChange={onChange}
options={workspaceMembers || []} options={workspaceMembers || []}
placeholder="Select Lead" placeholder="Select Lead"

View File

@ -11,7 +11,7 @@ import { IWorkspaceMember } from "types";
export interface IWorkspaceMemberSelect { export interface IWorkspaceMemberSelect {
value: IWorkspaceMember | undefined; value: IWorkspaceMember | undefined;
onChange: (value: IWorkspaceMember) => void; onChange: (value: string) => void;
options: IWorkspaceMember[]; options: IWorkspaceMember[];
placeholder?: string; placeholder?: string;
disabled?: boolean; disabled?: boolean;
@ -48,7 +48,7 @@ export const WorkspaceMemberSelect: FC<IWorkspaceMemberSelect> = (props) => {
: options?.filter((option) => option.member.display_name.toLowerCase().includes(query.toLowerCase())); : options?.filter((option) => option.member.display_name.toLowerCase().includes(query.toLowerCase()));
const label = ( const label = (
<div className="flex items-center justify-between gap-2 w-full text-xs px-2.5 py-1.5 rounded border-[0.5px] border-custom-border-300"> <div className="flex items-center justify-between gap-2 w-full text-xs text-custom-text-300 px-2.5 py-1.5 rounded border-[0.5px] border-custom-border-300">
{value ? ( {value ? (
<> <>
<Avatar name={value?.member.display_name} src={value?.member.avatar} /> <Avatar name={value?.member.display_name} src={value?.member.avatar} />
@ -64,7 +64,13 @@ export const WorkspaceMemberSelect: FC<IWorkspaceMemberSelect> = (props) => {
); );
return ( return (
<Listbox as="div" className={`flex-shrink-0 text-left`} value={value} onChange={onChange} disabled={disabled}> <Listbox
as="div"
className={`flex-shrink-0 text-left`}
value={value?.member.id}
onChange={onChange}
disabled={disabled}
>
<Listbox.Button as={React.Fragment}> <Listbox.Button as={React.Fragment}>
<button <button
ref={setReferenceElement} ref={setReferenceElement}
@ -99,20 +105,20 @@ export const WorkspaceMemberSelect: FC<IWorkspaceMemberSelect> = (props) => {
{filteredOptions.map((workspaceMember: IWorkspaceMember) => ( {filteredOptions.map((workspaceMember: IWorkspaceMember) => (
<Listbox.Option <Listbox.Option
key={workspaceMember.id} key={workspaceMember.id}
value={workspaceMember} value={workspaceMember.member.id}
className={({ active, selected }) => className={({ active, selected }) =>
`flex items-center justify-between gap-2 cursor-pointer select-none truncate rounded px-1 py-1.5 ${ `flex items-center justify-between gap-2 cursor-pointer select-none truncate rounded px-1 py-1.5 ${
active && !selected ? "bg-custom-background-80" : "" active && !selected ? "bg-custom-background-80" : ""
} ${selected ? "text-custom-text-100" : "text-custom-text-200"}` } ${selected ? "text-custom-text-100" : "text-custom-text-200"}`
} }
> >
{({ selected }) => ( {() => (
<> <>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Avatar name={workspaceMember?.member.display_name} src={workspaceMember?.member.avatar} /> <Avatar name={workspaceMember?.member.display_name} src={workspaceMember?.member.avatar} />
{workspaceMember.member.display_name} {workspaceMember.member.display_name}
</div> </div>
{selected && <Check className="h-3.5 w-3.5" />} {value && value.member.id === workspaceMember.member.id && <Check className="h-3.5 w-3.5" />}
</> </>
)} )}
</Listbox.Option> </Listbox.Option>

View File

@ -154,7 +154,7 @@ const ProfileActivityPage: NextPageWithLayout = () => {
</div> </div>
</div> </div>
<div className="min-w-0 flex-1 py-4 border-b border-custom-border-100"> <div className="min-w-0 flex-1 py-4 border-b border-custom-border-100">
<div className="text-sm text-custom-text-200 break-words"> <div className="text-sm text-custom-text-200 break-words flex gap-1">
{activityItem.field === "archived_at" && activityItem.new_value !== "restore" ? ( {activityItem.field === "archived_at" && activityItem.new_value !== "restore" ? (
<span className="text-gray font-medium">Plane</span> <span className="text-gray font-medium">Plane</span>
) : activityItem.actor_detail.is_bot ? ( ) : activityItem.actor_detail.is_bot ? (
@ -166,7 +166,12 @@ const ProfileActivityPage: NextPageWithLayout = () => {
<a className="text-gray font-medium">{activityItem.actor_detail.display_name}</a> <a className="text-gray font-medium">{activityItem.actor_detail.display_name}</a>
</Link> </Link>
)}{" "} )}{" "}
{message} <span className="whitespace-nowrap">{timeAgo(activityItem.created_at)}</span> <div className="flex gap-1 truncate">
{message}{" "}
<span className="whitespace-nowrap flex-shrink-0">
{timeAgo(activityItem.created_at)}
</span>
</div>
</div> </div>
</div> </div>
</> </>

View File

@ -108,7 +108,7 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
}} }}
/> />
{user && step !== null ? ( {user && step !== null ? (
<div className={` bg-gradient-primary h-full overflow-y-auto`}> <div className={` bg-onboarding-gradient-primary h-full overflow-y-auto`}>
<div className="sm:py-14 py-10 px-4 sm:px-7 md:px-14 lg:pl-28 lg:pr-24 flex items-center"> <div className="sm:py-14 py-10 px-4 sm:px-7 md:px-14 lg:pl-28 lg:pr-24 flex items-center">
<div className="w-full flex items-center justify-between font-semibold "> <div className="w-full flex items-center justify-between font-semibold ">
<div className="text-3xl flex items-center gap-x-1"> <div className="text-3xl flex items-center gap-x-1">
@ -165,8 +165,8 @@ const OnboardingPage: NextPageWithLayout = observer(() => {
</div> </div>
</div> </div>
<div className="w-full lg:w-4/5 xl:w-3/4 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200"> <div className="w-full lg:w-4/5 xl:w-3/4 sm:w-4/5 rounded-md mx-auto shadow-sm border border-custom-border-200">
<div className={`bg-gradient-primary p-4`}> <div className={`bg-onboarding-gradient-primary p-4`}>
<div className={`bg-gradient-secondary h-full rounded-md`}> <div className={`bg-onboarding-gradient-secondary h-full rounded-md`}>
{step === 1 ? ( {step === 1 ? (
<JoinWorkspaces <JoinWorkspaces
setTryDiffAccount={() => { setTryDiffAccount={() => {

View File

@ -184,4 +184,13 @@ export class UserService extends APIService {
throw error?.response?.data; throw error?.response?.data;
}); });
} }
async deleteAccount(): Promise<void> {
return this.delete("/api/users/me/")
.then((response) => response?.data)
.catch((error) => {
throw error?.response;
});
}
} }

View File

@ -64,7 +64,7 @@ export class WorkspaceService extends APIService {
} }
async inviteWorkspace(workspaceSlug: string, data: IWorkspaceBulkInviteFormData): Promise<any> { async inviteWorkspace(workspaceSlug: string, data: IWorkspaceBulkInviteFormData): Promise<any> {
return this.post(`/api/workspaces/${workspaceSlug}/invite/`, data) return this.post(`/api/workspaces/${workspaceSlug}/invitations/`, data)
.then((response) => response?.data) .then((response) => response?.data)
.catch((error) => { .catch((error) => {
throw error?.response?.data; throw error?.response?.data;

View File

@ -27,6 +27,7 @@ export interface IUser {
user_timezone: string; user_timezone: string;
username: string; username: string;
theme: IUserTheme; theme: IUserTheme;
use_case? :string;
} }
export interface IInstanceAdminStatus { export interface IInstanceAdminStatus {