refactor: apply biome formatting to apps/web (#27692)
* refactor: apply biome formatting to apps/web (batch 1) Formats apps/web non-modules directories: - apps/web/app - apps/web/lib - apps/web/pages - apps/web/styles - apps/web/server - apps/web/test - Root-level .ts and .mjs files Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/modules (batch 2) Formats smaller apps/web/modules directories: - onboarding, data-table, users, apps, auth - integration-attribute-sync, shell, availability - feature-flags, team, webhooks, getting-started - feature-opt-in, troubleshooter, schedules, notifications - signup-view.tsx Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/modules (batch 3) Formats medium apps/web/modules directories: - bookings - event-types - insights - embed Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/modules/ee (batch 4) Formats apps/web/modules/ee directory. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web (batch 5) Formats remaining apps/web directories: - apps/web/modules/settings - apps/web/modules/booking-audit - apps/web/playwright Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to apps/web/components (batch 6) Formats remaining apps/web/components files. Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to new apps/web files from main Formats newly added/modified files from main merge: - WorkflowStepContainer.tsx (resolved merge conflicts) - Newly moved files (blocklist, form-builder, schedules, etc.) - Other files modified in main Co-Authored-By: Claude Opus 4.5 <[email protected]> * refactor: apply biome formatting to new apps/web files from main Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
271 files changed
+3729
-4857
No files matched your search
@@ -302,9 +302,9 @@ function AttributesList(props: { selectedUserId: number }) {
|
||||
const attribute = attributes?.find((attr) => attr.id === attributeId);
|
||||
return attribute
|
||||
? attribute.options.map((option) => ({
|
||||
value: option.id,
|
||||
label: option.value,
|
||||
}))
|
||||
value: option.id,
|
||||
label: option.value,
|
||||
}))
|
||||
: [];
|
||||
};
|
||||
|
||||
@@ -406,17 +406,17 @@ function AttributesList(props: { selectedUserId: number }) {
|
||||
const updatedOptions =
|
||||
attr.type === "MULTI_SELECT"
|
||||
? valueAsArray.map((v) => ({
|
||||
label: v.label,
|
||||
value: v.value,
|
||||
weight: v.weight || 100,
|
||||
}))
|
||||
label: v.label,
|
||||
value: v.value,
|
||||
weight: v.weight || 100,
|
||||
}))
|
||||
: [
|
||||
{
|
||||
label: valueAsArray[0].label,
|
||||
value: valueAsArray[0].value,
|
||||
weight: valueAsArray[0].weight || 100,
|
||||
},
|
||||
];
|
||||
{
|
||||
label: valueAsArray[0].label,
|
||||
value: valueAsArray[0].value,
|
||||
weight: valueAsArray[0].weight || 100,
|
||||
},
|
||||
];
|
||||
|
||||
field.onChange({
|
||||
id: attr.id,
|
||||
@@ -487,7 +487,7 @@ function getOptionsEnsuringNotOwnedByCalcomNotRemoved<
|
||||
TOptionAlreadySet extends {
|
||||
value?: string | number | undefined;
|
||||
createdByDSyncId?: string | null | undefined;
|
||||
}
|
||||
},
|
||||
>({
|
||||
earlierOptions,
|
||||
updatedOptions,
|
||||
|
||||
@@ -6,13 +6,7 @@ import { WEBAPP_URL } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import { Avatar } from "@calcom/ui/components/avatar";
|
||||
import {
|
||||
Sheet,
|
||||
SheetContent,
|
||||
SheetBody,
|
||||
SheetHeader,
|
||||
SheetFooter,
|
||||
} from "@calcom/ui/components/sheet";
|
||||
import { Sheet, SheetContent, SheetBody, SheetHeader, SheetFooter } from "@calcom/ui/components/sheet";
|
||||
import { Loader } from "@calcom/ui/components/skeleton";
|
||||
|
||||
import type { UserTableAction, UserTableState } from "../types";
|
||||
@@ -42,19 +36,15 @@ export function EditUserSheet({
|
||||
const { t } = useLocale();
|
||||
const { user: selectedUser } = state.editSheet;
|
||||
const orgBranding = useOrgBranding();
|
||||
const [editMode, setEditMode] = useEditMode(
|
||||
(state) => [state.editMode, state.setEditMode],
|
||||
shallow
|
||||
const [editMode, setEditMode] = useEditMode((state) => [state.editMode, state.setEditMode], shallow);
|
||||
const { data: loadedUser, isPending } = trpc.viewer.organizations.getUser.useQuery(
|
||||
{
|
||||
userId: selectedUser?.id,
|
||||
},
|
||||
{
|
||||
enabled: !!selectedUser?.id,
|
||||
}
|
||||
);
|
||||
const { data: loadedUser, isPending } =
|
||||
trpc.viewer.organizations.getUser.useQuery(
|
||||
{
|
||||
userId: selectedUser?.id,
|
||||
},
|
||||
{
|
||||
enabled: !!selectedUser?.id,
|
||||
}
|
||||
);
|
||||
|
||||
const { data: usersAttributes, isPending: usersAttributesPending } =
|
||||
trpc.viewer.attributes.getByUserId.useQuery(
|
||||
@@ -67,15 +57,11 @@ export function EditUserSheet({
|
||||
}
|
||||
);
|
||||
|
||||
const avatarURL = `${orgBranding?.fullDomain ?? WEBAPP_URL}/${
|
||||
loadedUser?.username
|
||||
}/avatar.png`;
|
||||
const avatarURL = `${orgBranding?.fullDomain ?? WEBAPP_URL}/${loadedUser?.username}/avatar.png`;
|
||||
|
||||
const schedulesNames =
|
||||
loadedUser?.schedules && loadedUser?.schedules.map((s) => s.name);
|
||||
const schedulesNames = loadedUser?.schedules && loadedUser?.schedules.map((s) => s.name);
|
||||
const teamNames =
|
||||
loadedUser?.teams &&
|
||||
loadedUser?.teams.map((t) => `${t.name} ${!t.accepted ? "(pending)" : ""}`);
|
||||
loadedUser?.teams && loadedUser?.teams.map((t) => `${t.name} ${!t.accepted ? "(pending)" : ""}`);
|
||||
|
||||
return (
|
||||
<Sheet
|
||||
@@ -83,8 +69,7 @@ export function EditUserSheet({
|
||||
onOpenChange={() => {
|
||||
setEditMode(false);
|
||||
dispatch({ type: "CLOSE_MODAL" });
|
||||
}}
|
||||
>
|
||||
}}>
|
||||
<SheetContent className="bg-default">
|
||||
{!isPending && loadedUser ? (
|
||||
<>
|
||||
@@ -94,12 +79,7 @@ export function EditUserSheet({
|
||||
<div className="border-subtle bg-default w-full rounded-xl border p-4">
|
||||
<OrganizationBanner />
|
||||
<div className="bg-default ml-3 w-fit translate-y-[-50%] rounded-full p-1 ring-1 ring-[#0000000F]">
|
||||
<Avatar
|
||||
asChild
|
||||
size="lg"
|
||||
alt={`${loadedUser?.name} avatar`}
|
||||
imageSrc={avatarURL}
|
||||
/>
|
||||
<Avatar asChild size="lg" alt={`${loadedUser?.name} avatar`} imageSrc={avatarURL} />
|
||||
</div>
|
||||
<h2 className="text-emphasis font-sans text-2xl font-semibold -mt-8">
|
||||
{loadedUser?.name || "Nameless User"}
|
||||
@@ -111,79 +91,49 @@ export function EditUserSheet({
|
||||
</SheetHeader>
|
||||
<SheetBody className="stack-y-4 flex flex-col p-4">
|
||||
<div className="stack-y-4 mb-4 flex flex-col">
|
||||
<h3 className="text-emphasis mb-1 text-base font-semibold">
|
||||
{t("profile")}
|
||||
</h3>
|
||||
<h3 className="text-emphasis mb-1 text-base font-semibold">{t("profile")}</h3>
|
||||
<DisplayInfo
|
||||
label="Cal"
|
||||
value={removeProtocol(
|
||||
`${orgBranding?.fullDomain ?? WEBAPP_URL}/${
|
||||
loadedUser?.username
|
||||
}`
|
||||
`${orgBranding?.fullDomain ?? WEBAPP_URL}/${loadedUser?.username}`
|
||||
)}
|
||||
icon="external-link"
|
||||
/>
|
||||
<DisplayInfo
|
||||
label={t("email")}
|
||||
value={loadedUser?.email ?? ""}
|
||||
icon="at-sign"
|
||||
/>
|
||||
<DisplayInfo
|
||||
label={t("role")}
|
||||
value={[loadedUser?.role ?? ""]}
|
||||
icon="fingerprint"
|
||||
/>
|
||||
<DisplayInfo
|
||||
label={t("timezone")}
|
||||
value={loadedUser?.timeZone ?? ""}
|
||||
icon="clock"
|
||||
/>
|
||||
<DisplayInfo label={t("email")} value={loadedUser?.email ?? ""} icon="at-sign" />
|
||||
<DisplayInfo label={t("role")} value={[loadedUser?.role ?? ""]} icon="fingerprint" />
|
||||
<DisplayInfo label={t("timezone")} value={loadedUser?.timeZone ?? ""} icon="clock" />
|
||||
<DisplayInfo
|
||||
label={t("teams")}
|
||||
value={
|
||||
!teamNames || teamNames.length === 0 ? "" : teamNames
|
||||
}
|
||||
value={!teamNames || teamNames.length === 0 ? "" : teamNames}
|
||||
icon="users"
|
||||
coloredBadges
|
||||
/>
|
||||
<DisplayInfo
|
||||
label={t("availability")}
|
||||
value={
|
||||
!schedulesNames || schedulesNames.length === 0
|
||||
? ""
|
||||
: schedulesNames
|
||||
}
|
||||
value={!schedulesNames || schedulesNames.length === 0 ? "" : schedulesNames}
|
||||
icon="calendar"
|
||||
/>
|
||||
</div>
|
||||
{canViewAttributes &&
|
||||
usersAttributes &&
|
||||
usersAttributes?.length > 0 && (
|
||||
<div className="mt-4 flex flex-col">
|
||||
<h3 className="text-emphasis mb-5 text-base font-semibold">
|
||||
{t("attributes")}
|
||||
</h3>
|
||||
<div className="stack-y-4 flex flex-col">
|
||||
{usersAttributes.map((attribute, index) => (
|
||||
<>
|
||||
<DisplayInfo
|
||||
key={index}
|
||||
label={attribute.name}
|
||||
value={
|
||||
["TEXT", "NUMBER", "SINGLE_SELECT"].includes(
|
||||
attribute.type
|
||||
)
|
||||
? attribute.options[0].value
|
||||
: attribute.options.map(
|
||||
(option) => option.value
|
||||
)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
{canViewAttributes && usersAttributes && usersAttributes?.length > 0 && (
|
||||
<div className="mt-4 flex flex-col">
|
||||
<h3 className="text-emphasis mb-5 text-base font-semibold">{t("attributes")}</h3>
|
||||
<div className="stack-y-4 flex flex-col">
|
||||
{usersAttributes.map((attribute, index) => (
|
||||
<>
|
||||
<DisplayInfo
|
||||
key={index}
|
||||
label={attribute.name}
|
||||
value={
|
||||
["TEXT", "NUMBER", "SINGLE_SELECT"].includes(attribute.type)
|
||||
? attribute.options[0].value
|
||||
: attribute.options.map((option) => option.value)
|
||||
}
|
||||
/>
|
||||
</>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</SheetBody>
|
||||
<SheetFooter>
|
||||
<SheetFooterControls
|
||||
|
||||
@@ -4,12 +4,14 @@ import { keepPreviousData } from "@tanstack/react-query";
|
||||
import { getCoreRowModel, getSortedRowModel, useReactTable, type ColumnDef } from "@tanstack/react-table";
|
||||
import { useMemo, useReducer, useState } from "react";
|
||||
|
||||
import { DataTableProvider, useColumnFilters, useDataTable } from "@calcom/features/data-table";
|
||||
import {
|
||||
DataTableProvider,
|
||||
useColumnFilters,
|
||||
useDataTable,
|
||||
} from "@calcom/features/data-table";
|
||||
import { DataTableWrapper, DataTableToolbar, DataTableFilters, DataTableSegment, DataTableSelectionBar } from "~/data-table/components";
|
||||
DataTableWrapper,
|
||||
DataTableToolbar,
|
||||
DataTableFilters,
|
||||
DataTableSegment,
|
||||
DataTableSelectionBar,
|
||||
} from "~/data-table/components";
|
||||
import { useSegments } from "~/data-table/hooks/useSegments";
|
||||
import { getUserAvatarUrl } from "@calcom/lib/getAvatarUrl";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
|
||||
export type UserTableUser =
|
||||
RouterOutputs["viewer"]["organizations"]["listMembers"]["rows"][number];
|
||||
export type UserTableUser = RouterOutputs["viewer"]["organizations"]["listMembers"]["rows"][number];
|
||||
|
||||
export type PlatformManagedUserTableUser = Omit<
|
||||
UserTableUser,
|
||||
|
||||
@@ -58,16 +58,19 @@ export const generateCsvRawForMembersTable = (
|
||||
const { email, role, teams, username, attributes } = row;
|
||||
|
||||
// Create a map of attributeId to array of values
|
||||
const attributeMap = (attributes ?? []).reduce((acc, attr) => {
|
||||
if (!acc[attr.attributeId]) {
|
||||
acc[attr.attributeId] = [];
|
||||
}
|
||||
acc[attr.attributeId].push({
|
||||
value: attr.value,
|
||||
weight: attr.weight ?? undefined,
|
||||
});
|
||||
return acc;
|
||||
}, {} as Record<string, { value: string; weight: number | undefined }[]>);
|
||||
const attributeMap = (attributes ?? []).reduce(
|
||||
(acc, attr) => {
|
||||
if (!acc[attr.attributeId]) {
|
||||
acc[attr.attributeId] = [];
|
||||
}
|
||||
acc[attr.attributeId].push({
|
||||
value: attr.value,
|
||||
weight: attr.weight ?? undefined,
|
||||
});
|
||||
return acc;
|
||||
},
|
||||
{} as Record<string, { value: string; weight: number | undefined }[]>
|
||||
);
|
||||
|
||||
const requiredColumns = [
|
||||
email, // Members column
|
||||
|
||||
@@ -80,7 +80,12 @@ export function UserPage(props: PageProps) {
|
||||
}}
|
||||
className={isOrg && user.profile.organization?.bannerUrl ? "-mt-14" : ""}
|
||||
/>
|
||||
<h1 className={classNames("font-cal text-emphasis mb-1 text-xl", isOrg && user.profile.organization?.bannerUrl ? "" : "mt-4")} data-testid="name-title">
|
||||
<h1
|
||||
className={classNames(
|
||||
"font-cal text-emphasis mb-1 text-xl",
|
||||
isOrg && user.profile.organization?.bannerUrl ? "" : "mt-4"
|
||||
)}
|
||||
data-testid="name-title">
|
||||
{profile.name}
|
||||
{!isOrg && user.verified && (
|
||||
<Icon
|
||||
|
||||
Reference in new issue
Block a user