diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.json index b998bf38c8..f194e9659d 100644 --- a/apps/web/public/static/locales/en/common.json +++ b/apps/web/public/static/locales/en/common.json @@ -670,9 +670,14 @@ "team_updated_successfully": "Team updated successfully", "your_team_updated_successfully": "Your team has been updated successfully.", "your_org_updated_successfully": "Your Org has been updated successfully.", + "error_copying_to_clipboard": "Error copying to clipboard", "about": "About", "team_description": "A few sentences about your team. This will appear on your team's url page.", + "organization_id": "Organization ID", + "organization_id_copied": "Organization ID copied.", "org_description": "A few sentences about your organization. This will appear on your organization's url page.", + "team_id": "Team ID", + "team_id_copied": "Team ID copied.", "members": "Members", "organization_members": "Organization members", "member": "Member", diff --git a/packages/features/ee/organizations/pages/settings/profile.tsx b/packages/features/ee/organizations/pages/settings/profile.tsx index a8201bc06a..acf241e301 100644 --- a/packages/features/ee/organizations/pages/settings/profile.tsx +++ b/packages/features/ee/organizations/pages/settings/profile.tsx @@ -36,6 +36,7 @@ import { SkeletonAvatar, } from "@calcom/ui/components/skeleton"; import { showToast } from "@calcom/ui/components/toast"; +import { Tooltip } from "@calcom/ui/components/tooltip"; import { useOrgBranding } from "../../../organizations/context/provider"; @@ -48,6 +49,7 @@ const orgProfileFormSchema = z.object({ }); type FormValues = { + id: number; name: string; logoUrl: string | null; banner: string | null; @@ -111,6 +113,7 @@ const OrgProfileView = () => { !currentOrganisation.bio.replace("


", "").length; const defaultValues: FormValues = { + id: currentOrganisation?.id, name: currentOrganisation?.name || "", logoUrl: currentOrganisation?.logoUrl, banner: currentOrganisation?.bannerUrl || "", @@ -204,6 +207,14 @@ const OrgProfileForm = ({ defaultValues }: { defaultValues: FormValues }) => { const isDisabled = isSubmitting || !isDirty; + const handleCopy = async (value: string) => { + try { + await navigator.clipboard.writeText(value); + showToast(t("organization_id_copied"), "success"); + } catch (error) { + showToast(t("error_copying_to_clipboard"), "error"); + } + }; return (
{ )} /> + ( +
+ + + + } + /> +
+ )} + />
{ return ( <> {isAdmin ? ( - + ) : (
@@ -248,9 +251,12 @@ const ProfileView = () => { ); }; -export type TeamProfileFormProps = { team: RouterOutputs["viewer"]["teams"]["get"] }; +export type TeamProfileFormProps = { + team: RouterOutputs["viewer"]["teams"]["get"]; + teamId: number; +}; -const TeamProfileForm = ({ team }: TeamProfileFormProps) => { +const TeamProfileForm = ({ team, teamId }: TeamProfileFormProps) => { const utils = trpc.useUtils(); const { t } = useLocale(); const router = useRouter(); @@ -275,6 +281,7 @@ const TeamProfileForm = ({ team }: TeamProfileFormProps) => { }); const defaultValues: FormValues = { + id: team?.id, name: team?.name || "", logo: team?.logo || "", bio: team?.bio || "", @@ -306,6 +313,14 @@ const TeamProfileForm = ({ team }: TeamProfileFormProps) => { }, }); + const handleCopy = async (value: string) => { + try { + await navigator.clipboard.writeText(value); + showToast(t("team_id_copied"), "success"); + } catch (error) { + showToast(t("error_copying_to_clipboard"), "error"); + } + }; return ( {
)} /> + +
+ + + + } + /> +