2023-05-24 01:01:31 +00:00
|
|
|
import { PaperclipIcon, UserIcon, Users } from "lucide-react";
|
2022-11-10 20:23:56 +00:00
|
|
|
import { Trans } from "next-i18next";
|
2023-05-24 01:01:31 +00:00
|
|
|
import { useMemo, useState } from "react";
|
2023-06-11 09:36:59 +00:00
|
|
|
import type { FormEvent } from "react";
|
2022-11-10 20:23:56 +00:00
|
|
|
import { Controller, useForm } from "react-hook-form";
|
2022-09-12 22:04:33 +00:00
|
|
|
|
2023-06-06 23:34:14 +00:00
|
|
|
import { classNames } from "@calcom/lib";
|
|
|
|
import { IS_TEAM_BILLING_ENABLED, WEBAPP_URL } from "@calcom/lib/constants";
|
2022-09-12 22:04:33 +00:00
|
|
|
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
2023-05-24 01:01:31 +00:00
|
|
|
import { MembershipRole } from "@calcom/prisma/enums";
|
2023-06-06 23:34:14 +00:00
|
|
|
import { trpc } from "@calcom/trpc";
|
2022-11-23 02:55:25 +00:00
|
|
|
import {
|
|
|
|
Button,
|
2023-01-17 19:10:47 +00:00
|
|
|
Checkbox as CheckboxField,
|
2022-11-23 02:55:25 +00:00
|
|
|
Dialog,
|
|
|
|
DialogContent,
|
|
|
|
DialogFooter,
|
|
|
|
Form,
|
2022-11-25 12:59:25 +00:00
|
|
|
Label,
|
2023-06-06 23:34:14 +00:00
|
|
|
showToast,
|
|
|
|
TextField,
|
2022-11-25 12:59:25 +00:00
|
|
|
ToggleGroup,
|
2023-05-24 01:01:31 +00:00
|
|
|
Select,
|
|
|
|
TextAreaField,
|
2022-11-23 02:55:25 +00:00
|
|
|
} from "@calcom/ui";
|
2023-06-06 23:34:14 +00:00
|
|
|
import { Link } from "@calcom/ui/components/icon";
|
2022-09-12 22:04:33 +00:00
|
|
|
|
2023-04-05 18:14:46 +00:00
|
|
|
import type { PendingMember } from "../lib/types";
|
2023-05-24 01:01:31 +00:00
|
|
|
import { GoogleWorkspaceInviteButton } from "./GoogleWorkspaceInviteButton";
|
2022-11-10 20:23:56 +00:00
|
|
|
|
2022-09-12 22:04:33 +00:00
|
|
|
type MemberInvitationModalProps = {
|
|
|
|
isOpen: boolean;
|
|
|
|
onExit: () => void;
|
2023-06-16 12:45:20 +00:00
|
|
|
onSubmit: (values: NewMemberForm, resetFields: () => void) => void;
|
feat: Org settings - profile,appearance, child teams, create new child (#9231)
* Initial commit
* Adding feature flag
* Desktop first banner, mobile pending
* Removing dead code and img
* AppInstallButtonBase
* WIP
* Adds Email verification template+translations for organizations (#9202)
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Session logic to show org label
* Step 2 done, avatar not working
* List orgs and list teams specific if orgs exist
* Conditionally show org - fix settings layout - add labels for all pages
* Profile Page + update
* Org specific team creation
* appearance page
* Ensure members cant of org cant update settings in UI
* Fix update handler imports
* hide billing on sub teams
* Update profile slug page
* Letting duplicate slugs for teams to support orgs
* Add slug coliisions for org
* Covering null on unique clauses
* Covering null on unique clauses
* Extract to utils
* Update settings to use subdomain path in team url , team + org
* Supporting having the orgId in the session cookie
* Onboarding admins step
* Last step to create teams
* Update handler comments
* Upgrade ORG banner - disabled team banner for child teams
* Handle publishing ORGS
* Fix licenese issue
* Update packages/trpc/server/routers/viewer/teams/create.handler.ts
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* A11ly
* Feedback
* Making an org avatar (temp)
* Add slug colission detection for user and team name
* Fix Import
* Remove update password func
* Fix module import over relative
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Remove app install button sa its in 9337
* Remove i18n key not being used
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* feat: organization settings general and members page (#9266)
* feat: organization settings general page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* feat: add members page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore: remove
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use invalidate
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: delete mutation
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: remove organization id
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use zod schema
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Type fixes
* Reverting changes
* Update UsernameTextfield.tsx
* More reverts
* Update next-auth-options.ts
* Update common.json
* Type fixes
* Include invite token for orgs
* Update org schema
* Make token settings optional as it isnt used in orgs yet
* Fix missing prop
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
2023-06-15 17:27:39 +00:00
|
|
|
onSettingsOpen?: () => void;
|
2023-06-06 23:34:14 +00:00
|
|
|
teamId: number;
|
2022-11-10 20:23:56 +00:00
|
|
|
members: PendingMember[];
|
2023-06-06 23:34:14 +00:00
|
|
|
token?: string;
|
2022-09-12 22:04:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
type MembershipRoleOption = {
|
|
|
|
value: MembershipRole;
|
2022-11-10 20:23:56 +00:00
|
|
|
label: string;
|
2022-09-12 22:04:33 +00:00
|
|
|
};
|
|
|
|
|
2022-11-10 20:23:56 +00:00
|
|
|
export interface NewMemberForm {
|
2023-05-24 01:01:31 +00:00
|
|
|
emailOrUsername: string | string[];
|
2022-11-25 12:59:25 +00:00
|
|
|
role: MembershipRole;
|
2022-11-10 20:23:56 +00:00
|
|
|
sendInviteEmail: boolean;
|
|
|
|
}
|
2022-09-12 22:04:33 +00:00
|
|
|
|
2023-05-24 01:01:31 +00:00
|
|
|
type ModalMode = "INDIVIDUAL" | "BULK";
|
|
|
|
|
2023-06-11 09:36:59 +00:00
|
|
|
interface FileEvent<T = Element> extends FormEvent<T> {
|
|
|
|
target: EventTarget & T;
|
|
|
|
}
|
|
|
|
|
2022-09-12 22:04:33 +00:00
|
|
|
export default function MemberInvitationModal(props: MemberInvitationModalProps) {
|
2022-11-10 20:23:56 +00:00
|
|
|
const { t } = useLocale();
|
2023-06-06 23:34:14 +00:00
|
|
|
const trpcContext = trpc.useContext();
|
|
|
|
|
2023-05-24 01:01:31 +00:00
|
|
|
const [modalImportMode, setModalInputMode] = useState<ModalMode>("INDIVIDUAL");
|
2023-06-06 23:34:14 +00:00
|
|
|
|
|
|
|
const createInviteMutation = trpc.viewer.teams.createInvite.useMutation({
|
|
|
|
onSuccess(token) {
|
|
|
|
copyInviteLinkToClipboard(token);
|
|
|
|
trpcContext.viewer.teams.get.invalidate();
|
|
|
|
trpcContext.viewer.teams.list.invalidate();
|
|
|
|
},
|
|
|
|
onError: (error) => {
|
|
|
|
showToast(error.message, "error");
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const copyInviteLinkToClipboard = async (token: string) => {
|
|
|
|
const inviteLink = `${WEBAPP_URL}/teams?token=${token}`;
|
|
|
|
await navigator.clipboard.writeText(inviteLink);
|
|
|
|
showToast(t("invite_link_copied"), "success");
|
|
|
|
};
|
|
|
|
|
2022-11-10 20:23:56 +00:00
|
|
|
const options: MembershipRoleOption[] = useMemo(() => {
|
|
|
|
return [
|
2023-05-24 01:01:31 +00:00
|
|
|
{ value: MembershipRole.MEMBER, label: t("member") },
|
|
|
|
{ value: MembershipRole.ADMIN, label: t("admin") },
|
|
|
|
{ value: MembershipRole.OWNER, label: t("owner") },
|
2022-11-10 20:23:56 +00:00
|
|
|
];
|
2022-09-12 22:04:33 +00:00
|
|
|
}, [t]);
|
|
|
|
|
2022-11-10 20:23:56 +00:00
|
|
|
const newMemberFormMethods = useForm<NewMemberForm>();
|
2022-09-12 22:04:33 +00:00
|
|
|
|
2022-11-10 20:23:56 +00:00
|
|
|
const validateUniqueInvite = (value: string) => {
|
|
|
|
return !(
|
|
|
|
props.members.some((member) => member?.username === value) ||
|
|
|
|
props.members.some((member) => member?.email === value)
|
|
|
|
);
|
|
|
|
};
|
2022-09-12 22:04:33 +00:00
|
|
|
|
2023-06-11 09:36:59 +00:00
|
|
|
const handleFileUpload = (e: FileEvent<HTMLInputElement>) => {
|
|
|
|
if (!e.target.files?.length) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
const file = e.target.files[0];
|
|
|
|
|
|
|
|
if (file) {
|
|
|
|
const reader = new FileReader();
|
|
|
|
|
|
|
|
reader.onload = (e) => {
|
|
|
|
const contents = e?.target?.result as string;
|
|
|
|
const values = contents?.split(",").map((email) => email.trim().toLocaleLowerCase());
|
|
|
|
newMemberFormMethods.setValue("emailOrUsername", values);
|
|
|
|
};
|
|
|
|
|
|
|
|
reader.readAsText(file);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2023-06-16 12:45:20 +00:00
|
|
|
const resetFields = () => {
|
|
|
|
newMemberFormMethods.reset();
|
|
|
|
newMemberFormMethods.setValue("emailOrUsername", "");
|
|
|
|
setModalInputMode("INDIVIDUAL");
|
|
|
|
};
|
|
|
|
|
2022-09-12 22:04:33 +00:00
|
|
|
return (
|
2022-11-10 20:23:56 +00:00
|
|
|
<Dialog
|
2023-05-24 01:01:31 +00:00
|
|
|
name="inviteModal"
|
2022-11-10 20:23:56 +00:00
|
|
|
open={props.isOpen}
|
|
|
|
onOpenChange={() => {
|
|
|
|
props.onExit();
|
|
|
|
newMemberFormMethods.reset();
|
|
|
|
}}>
|
2022-09-15 09:47:59 +00:00
|
|
|
<DialogContent
|
|
|
|
type="creation"
|
2023-05-24 01:01:31 +00:00
|
|
|
title={t("invite_team_member")}
|
2022-09-15 09:47:59 +00:00
|
|
|
description={
|
2022-11-10 20:23:56 +00:00
|
|
|
IS_TEAM_BILLING_ENABLED ? (
|
2023-04-05 18:14:46 +00:00
|
|
|
<span className="text-subtle text-sm leading-tight">
|
2022-11-10 20:23:56 +00:00
|
|
|
<Trans i18nKey="invite_new_member_description">
|
2023-04-05 18:14:46 +00:00
|
|
|
Note: This will <span className="text-emphasis font-medium">cost an extra seat ($15/m)</span>{" "}
|
2022-11-10 20:23:56 +00:00
|
|
|
on your subscription.
|
|
|
|
</Trans>
|
|
|
|
</span>
|
2023-05-24 01:01:31 +00:00
|
|
|
) : null
|
2022-09-15 09:47:59 +00:00
|
|
|
}>
|
2023-05-24 01:01:31 +00:00
|
|
|
<div>
|
|
|
|
<Label className="sr-only" htmlFor="role">
|
|
|
|
{t("import_mode")}
|
|
|
|
</Label>
|
|
|
|
<ToggleGroup
|
|
|
|
isFullWidth={true}
|
|
|
|
onValueChange={(val) => setModalInputMode(val as ModalMode)}
|
|
|
|
defaultValue="INDIVIDUAL"
|
|
|
|
options={[
|
|
|
|
{
|
|
|
|
value: "INDIVIDUAL",
|
2023-06-23 08:48:20 +00:00
|
|
|
label: <span className="line-clamp-1">{t("invite_team_individual_segment")}</span>,
|
2023-05-24 01:01:31 +00:00
|
|
|
iconLeft: <UserIcon />,
|
|
|
|
},
|
2023-06-23 08:48:20 +00:00
|
|
|
{
|
|
|
|
value: "BULK",
|
|
|
|
label: <span className="line-clamp-1">{t("invite_team_bulk_segment")}</span>,
|
|
|
|
iconLeft: <Users />,
|
|
|
|
},
|
2023-05-24 01:01:31 +00:00
|
|
|
]}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2023-06-16 12:45:20 +00:00
|
|
|
<Form form={newMemberFormMethods} handleSubmit={(values) => props.onSubmit(values, resetFields)}>
|
2023-06-22 22:25:37 +00:00
|
|
|
<div className="mb-10 mt-6 space-y-6">
|
2023-05-24 01:01:31 +00:00
|
|
|
{/* Indivdual Invite */}
|
|
|
|
{modalImportMode === "INDIVIDUAL" && (
|
|
|
|
<Controller
|
|
|
|
name="emailOrUsername"
|
|
|
|
control={newMemberFormMethods.control}
|
|
|
|
rules={{
|
|
|
|
required: t("enter_email_or_username"),
|
|
|
|
validate: (value) => {
|
|
|
|
if (typeof value === "string")
|
|
|
|
return validateUniqueInvite(value) || t("member_already_invited");
|
|
|
|
},
|
|
|
|
}}
|
|
|
|
render={({ field: { onChange }, fieldState: { error } }) => (
|
|
|
|
<>
|
|
|
|
<TextField
|
|
|
|
label={t("email_or_username")}
|
|
|
|
id="inviteUser"
|
|
|
|
name="inviteUser"
|
|
|
|
placeholder="email@example.com"
|
|
|
|
required
|
|
|
|
onChange={(e) => onChange(e.target.value.trim().toLowerCase())}
|
|
|
|
/>
|
|
|
|
{error && <span className="text-sm text-red-800">{error.message}</span>}
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
{/* Bulk Invite */}
|
|
|
|
{modalImportMode === "BULK" && (
|
|
|
|
<div className="bg-muted flex flex-col rounded-md p-4">
|
|
|
|
<Controller
|
|
|
|
name="emailOrUsername"
|
|
|
|
control={newMemberFormMethods.control}
|
|
|
|
rules={{
|
|
|
|
required: t("enter_email_or_username"),
|
|
|
|
}}
|
|
|
|
render={({ field: { onChange, value }, fieldState: { error } }) => (
|
|
|
|
<>
|
|
|
|
{/* TODO: Make this a fancy email input that styles on a successful email. */}
|
|
|
|
<TextAreaField
|
|
|
|
name="emails"
|
|
|
|
label="Invite via email"
|
|
|
|
rows={4}
|
|
|
|
autoCorrect="off"
|
|
|
|
placeholder="john@doe.com, alex@smith.com"
|
|
|
|
required
|
|
|
|
value={value}
|
|
|
|
onChange={(e) => {
|
|
|
|
const emails = e.target.value
|
|
|
|
.split(",")
|
|
|
|
.map((email) => email.trim().toLocaleLowerCase());
|
|
|
|
|
|
|
|
return onChange(emails);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
{error && <span className="text-sm text-red-800">{error.message}</span>}
|
|
|
|
</>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<GoogleWorkspaceInviteButton
|
|
|
|
onSuccess={(data) => {
|
|
|
|
newMemberFormMethods.setValue("emailOrUsername", data);
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
<Button
|
|
|
|
type="button"
|
|
|
|
color="secondary"
|
|
|
|
StartIcon={PaperclipIcon}
|
|
|
|
className="mt-3 justify-center stroke-2">
|
2023-06-11 09:36:59 +00:00
|
|
|
<label htmlFor="bulkInvite">
|
|
|
|
Upload a .csv file
|
|
|
|
<input
|
|
|
|
id="bulkInvite"
|
|
|
|
type="file"
|
|
|
|
accept=".csv"
|
|
|
|
style={{ display: "none" }}
|
|
|
|
onChange={handleFileUpload}
|
|
|
|
/>
|
|
|
|
</label>
|
2023-05-24 01:01:31 +00:00
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
)}
|
2022-11-10 20:23:56 +00:00
|
|
|
<Controller
|
|
|
|
name="role"
|
|
|
|
control={newMemberFormMethods.control}
|
2022-11-25 12:59:25 +00:00
|
|
|
defaultValue={options[0].value}
|
2022-11-10 20:23:56 +00:00
|
|
|
render={({ field: { onChange } }) => (
|
|
|
|
<div>
|
2023-04-05 18:14:46 +00:00
|
|
|
<Label className="text-emphasis font-medium" htmlFor="role">
|
2023-05-24 01:01:31 +00:00
|
|
|
{t("invite_as")}
|
2022-11-25 12:59:25 +00:00
|
|
|
</Label>
|
2023-05-24 01:01:31 +00:00
|
|
|
<Select
|
2022-11-10 20:23:56 +00:00
|
|
|
id="role"
|
2023-05-24 01:01:31 +00:00
|
|
|
defaultValue={options[0]}
|
|
|
|
options={options}
|
|
|
|
onChange={(val) => {
|
|
|
|
if (val) onChange(val.value);
|
|
|
|
}}
|
2022-11-10 20:23:56 +00:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
<Controller
|
|
|
|
name="sendInviteEmail"
|
|
|
|
control={newMemberFormMethods.control}
|
2022-11-25 12:59:25 +00:00
|
|
|
defaultValue={true}
|
2022-11-10 20:23:56 +00:00
|
|
|
render={() => (
|
2022-11-25 12:59:25 +00:00
|
|
|
<CheckboxField
|
|
|
|
className="mr-0"
|
|
|
|
defaultChecked={true}
|
|
|
|
description={t("send_invite_email")}
|
|
|
|
onChange={(e) => newMemberFormMethods.setValue("sendInviteEmail", e.target.checked)}
|
|
|
|
/>
|
2022-11-10 20:23:56 +00:00
|
|
|
)}
|
2022-09-12 22:04:33 +00:00
|
|
|
/>
|
2023-06-07 19:55:47 +00:00
|
|
|
<div className="flex">
|
2023-06-06 23:34:14 +00:00
|
|
|
{props.token && (
|
|
|
|
<Button
|
|
|
|
type="button"
|
|
|
|
color="minimal"
|
2023-06-22 22:25:37 +00:00
|
|
|
className="me-2 ms-2"
|
2023-06-06 23:34:14 +00:00
|
|
|
onClick={() => {
|
feat: Org settings - profile,appearance, child teams, create new child (#9231)
* Initial commit
* Adding feature flag
* Desktop first banner, mobile pending
* Removing dead code and img
* AppInstallButtonBase
* WIP
* Adds Email verification template+translations for organizations (#9202)
* feat: Orgs Schema Changing `scopedMembers` to `orgUsers` (#9209)
* Change scopedMembers to orgMembers
* Change to orgUsers
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Session logic to show org label
* Step 2 done, avatar not working
* List orgs and list teams specific if orgs exist
* Conditionally show org - fix settings layout - add labels for all pages
* Profile Page + update
* Org specific team creation
* appearance page
* Ensure members cant of org cant update settings in UI
* Fix update handler imports
* hide billing on sub teams
* Update profile slug page
* Letting duplicate slugs for teams to support orgs
* Add slug coliisions for org
* Covering null on unique clauses
* Covering null on unique clauses
* Extract to utils
* Update settings to use subdomain path in team url , team + org
* Supporting having the orgId in the session cookie
* Onboarding admins step
* Last step to create teams
* Update handler comments
* Upgrade ORG banner - disabled team banner for child teams
* Handle publishing ORGS
* Fix licenese issue
* Update packages/trpc/server/routers/viewer/teams/create.handler.ts
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* A11ly
* Feedback
* Making an org avatar (temp)
* Add slug colission detection for user and team name
* Fix Import
* Remove update password func
* Fix module import over relative
* feat: organization event type filter (#9253)
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Missing changes to support orgs schema changes
* Remove app install button sa its in 9337
* Remove i18n key not being used
* feat: Onboarding process to create an organization (#9184)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* feedback
* Making sure we check requestedSlug now
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* feat: [CAL-1816] Organization subdomain support (#9345)
* Desktop first banner, mobile pending
* Removing dead code and img
* WIP
* Adds Email verification template+translations for organizations (#9202)
* First step done
* Merge branch 'feat/organizations-onboarding' of github.com:calcom/cal.com into feat/organizations-onboarding
* Step 2 done, avatar not working
* Covering null on unique clauses
* Onboarding admins step
* Last step to create teams
* Moving change password handler, improving verifying code flow
* Clearing error before submitting
* Reverting email testing api changes
* Reverting having the banner for now
* Consistent exported components
* Remove unneeded files from banner
* Removing uneeded code
* Fixing avatar selector
* Using meta component for head/descr
* Missing i18n strings
* Feedback
* Making an org avatar (temp)
* Check for subteams slug clashes with usernames
* Fixing create teams onsuccess
* Covering users and subteams, excluding non-org users
* Unpublished teams shows correctly
* Create subdomain in Vercel
* feedback
* Renaming Vercel env vars
* Vercel domain check before creation
* Supporting cal-staging.com
* Change to have vercel detect it
* vercel domain check data message error
* Remove check domain
* Making sure we check requestedSlug now
* Feedback and unneeded code
* Reverting unneeded changes
* Unneeded changes
---------
Co-authored-by: sean-brydon <55134778+sean-brydon@users.noreply.github.com>
* Vercel subdomain creation in PROD only
* feat: organization settings general and members page (#9266)
* feat: organization settings general page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* feat: add members page
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore: remove
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use invalidate
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: delete mutation
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: remove organization id
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* chore
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* fix: use zod schema
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
* Type fixes
* Reverting changes
* Update UsernameTextfield.tsx
* More reverts
* Update next-auth-options.ts
* Update common.json
* Type fixes
* Include invite token for orgs
* Update org schema
* Make token settings optional as it isnt used in orgs yet
* Fix missing prop
---------
Signed-off-by: Udit Takkar <udit.07814802719@cse.mait.ac.in>
Co-authored-by: Leo Giovanetti <hello@leog.me>
Co-authored-by: Joe Au-Yeung <65426560+joeauyeung@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
Co-authored-by: Hariom Balhara <hariombalhara@gmail.com>
2023-06-15 17:27:39 +00:00
|
|
|
props.onSettingsOpen && props.onSettingsOpen();
|
2023-06-06 23:34:14 +00:00
|
|
|
newMemberFormMethods.reset();
|
|
|
|
}}
|
|
|
|
data-testid="edit-invite-link-button">
|
|
|
|
{t("edit_invite_link")}
|
|
|
|
</Button>
|
|
|
|
)}
|
|
|
|
</div>
|
2023-06-07 19:55:47 +00:00
|
|
|
</div>
|
|
|
|
<DialogFooter showDivider>
|
2023-06-23 08:48:20 +00:00
|
|
|
<div className="flex w-full flex-col items-end gap-2 md:flex-row md:items-center md:justify-between">
|
|
|
|
<div>
|
|
|
|
<Button
|
|
|
|
type="button"
|
|
|
|
color="minimal"
|
|
|
|
variant="icon"
|
|
|
|
onClick={() =>
|
|
|
|
props.token
|
|
|
|
? copyInviteLinkToClipboard(props.token)
|
|
|
|
: createInviteMutation.mutate({ teamId: props.teamId })
|
|
|
|
}
|
|
|
|
className={classNames("gap-2", props.token && "opacity-50")}
|
|
|
|
data-testid="copy-invite-link-button">
|
|
|
|
<Link className="text-default h-4 w-4" aria-hidden="true" />
|
|
|
|
{t("copy_invite_link")}
|
|
|
|
</Button>
|
|
|
|
</div>
|
2023-06-22 22:25:37 +00:00
|
|
|
|
2023-06-23 08:48:20 +00:00
|
|
|
<div className="flex gap-2">
|
|
|
|
<Button
|
|
|
|
type="button"
|
|
|
|
color="minimal"
|
|
|
|
onClick={() => {
|
|
|
|
props.onExit();
|
|
|
|
resetFields();
|
|
|
|
}}>
|
|
|
|
{t("cancel")}
|
|
|
|
</Button>
|
|
|
|
<Button type="submit" color="primary" data-testid="invite-new-member-button">
|
|
|
|
{t("send_invite")}
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-12 22:04:33 +00:00
|
|
|
</DialogFooter>
|
2022-11-10 20:23:56 +00:00
|
|
|
</Form>
|
2022-09-12 22:04:33 +00:00
|
|
|
</DialogContent>
|
|
|
|
</Dialog>
|
|
|
|
);
|
|
|
|
}
|