fix: bug and auth fixes (#1224)
* fix: sign in and invitation page fixes * fix: project and workspace services track event fix * fix: user onboarding complete track event fix * fix: issue track event fix * fix: partial property , issue comment and mark as done issue track event fix * fix: bulk delete , move to cycle or module and issue label track event fix * fix: state , cycle and module track event fix * fix: pages and block track event fix * fix: integration , estimate , importer , analytics and gpt track event fix * fix: view track event fix * fix: build fix * fix: build fix
This commit is contained in:
parent
c127353281
commit
6f2a38ad66
117 changed files with 1319 additions and 494 deletions
|
|
@ -11,7 +11,7 @@ import useToast from "hooks/use-toast";
|
|||
// ui
|
||||
import { CustomSelect, Input, PrimaryButton } from "components/ui";
|
||||
// types
|
||||
import { IWorkspace } from "types";
|
||||
import { ICurrentUserResponse, IWorkspace } from "types";
|
||||
// fetch-keys
|
||||
import { USER_WORKSPACES } from "constants/fetch-keys";
|
||||
// constants
|
||||
|
|
@ -25,6 +25,7 @@ type Props = {
|
|||
company_size: number | null;
|
||||
};
|
||||
setDefaultValues: Dispatch<SetStateAction<any>>;
|
||||
user: ICurrentUserResponse | undefined;
|
||||
};
|
||||
|
||||
const restrictedUrls = [
|
||||
|
|
@ -44,6 +45,7 @@ export const CreateWorkspaceForm: React.FC<Props> = ({
|
|||
onSubmit,
|
||||
defaultValues,
|
||||
setDefaultValues,
|
||||
user,
|
||||
}) => {
|
||||
const [slugError, setSlugError] = useState(false);
|
||||
const [invalidSlug, setInvalidSlug] = useState(false);
|
||||
|
|
@ -66,7 +68,7 @@ export const CreateWorkspaceForm: React.FC<Props> = ({
|
|||
if (res.status === true && !restrictedUrls.includes(formData.slug)) {
|
||||
setSlugError(false);
|
||||
await workspaceService
|
||||
.createWorkspace(formData)
|
||||
.createWorkspace(formData, user)
|
||||
.then((res) => {
|
||||
setToastAlert({
|
||||
type: "success",
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import { ExclamationTriangleIcon } from "@heroicons/react/24/outline";
|
|||
// ui
|
||||
import { DangerButton, Input, SecondaryButton } from "components/ui";
|
||||
// types
|
||||
import type { IWorkspace } from "types";
|
||||
import type { ICurrentUserResponse, IWorkspace } from "types";
|
||||
// fetch-keys
|
||||
import { USER_WORKSPACES } from "constants/fetch-keys";
|
||||
|
||||
|
|
@ -23,9 +23,10 @@ type Props = {
|
|||
isOpen: boolean;
|
||||
data: IWorkspace | null;
|
||||
onClose: () => void;
|
||||
user: ICurrentUserResponse | undefined;
|
||||
};
|
||||
|
||||
export const DeleteWorkspaceModal: React.FC<Props> = ({ isOpen, data, onClose }) => {
|
||||
export const DeleteWorkspaceModal: React.FC<Props> = ({ isOpen, data, onClose, user }) => {
|
||||
const [isDeleteLoading, setIsDeleteLoading] = useState(false);
|
||||
|
||||
const [confirmWorkspaceName, setConfirmWorkspaceName] = useState("");
|
||||
|
|
@ -57,7 +58,7 @@ export const DeleteWorkspaceModal: React.FC<Props> = ({ isOpen, data, onClose })
|
|||
setIsDeleteLoading(true);
|
||||
if (!data || !canDelete) return;
|
||||
await workspaceService
|
||||
.deleteWorkspace(data.slug)
|
||||
.deleteWorkspace(data.slug, user)
|
||||
.then(() => {
|
||||
handleClose();
|
||||
router.push("/");
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import { CustomSelect, Input, PrimaryButton, SecondaryButton } from "components/
|
|||
// hooks
|
||||
import useToast from "hooks/use-toast";
|
||||
// types
|
||||
import { IWorkspaceMemberInvitation } from "types";
|
||||
import { ICurrentUserResponse, IWorkspaceMemberInvitation } from "types";
|
||||
// fetch keys
|
||||
import { WORKSPACE_INVITATIONS } from "constants/fetch-keys";
|
||||
// constants
|
||||
|
|
@ -21,6 +21,7 @@ type Props = {
|
|||
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
||||
workspace_slug: string;
|
||||
members: any[];
|
||||
user: ICurrentUserResponse | undefined;
|
||||
};
|
||||
|
||||
const defaultValues: Partial<IWorkspaceMemberInvitation> = {
|
||||
|
|
@ -33,6 +34,7 @@ const SendWorkspaceInvitationModal: React.FC<Props> = ({
|
|||
setIsOpen,
|
||||
workspace_slug,
|
||||
members,
|
||||
user,
|
||||
}) => {
|
||||
const { setToastAlert } = useToast();
|
||||
|
||||
|
|
@ -54,7 +56,7 @@ const SendWorkspaceInvitationModal: React.FC<Props> = ({
|
|||
|
||||
const onSubmit = async (formData: IWorkspaceMemberInvitation) => {
|
||||
await workspaceService
|
||||
.inviteWorkspace(workspace_slug, { emails: [formData] })
|
||||
.inviteWorkspace(workspace_slug, { emails: [formData] }, user)
|
||||
.then((res) => {
|
||||
setIsOpen(false);
|
||||
handleClose();
|
||||
|
|
@ -101,7 +103,10 @@ const SendWorkspaceInvitationModal: React.FC<Props> = ({
|
|||
<form onSubmit={handleSubmit(onSubmit)}>
|
||||
<div className="space-y-5">
|
||||
<div>
|
||||
<Dialog.Title as="h3" className="text-lg font-medium leading-6 text-brand-base">
|
||||
<Dialog.Title
|
||||
as="h3"
|
||||
className="text-lg font-medium leading-6 text-brand-base"
|
||||
>
|
||||
Members
|
||||
</Dialog.Title>
|
||||
<p className="text-sm text-brand-secondary">
|
||||
|
|
|
|||
|
|
@ -46,7 +46,10 @@ const SingleInvitation: React.FC<Props> = ({
|
|||
<div className="min-w-0 flex-1">
|
||||
<div className="text-sm font-medium">{truncateText(invitation.workspace.name, 30)}</div>
|
||||
<p className="text-sm text-brand-secondary">
|
||||
Invited by {invitation.workspace.owner.first_name}
|
||||
Invited by{" "}
|
||||
{invitation.created_by_detail
|
||||
? invitation.created_by_detail.first_name
|
||||
: invitation.workspace.owner.first_name}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex-shrink-0 self-center">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue