feat: conferencing atoms (#17988)
* added api/v2 for zoom connect * Update conferencing.controller.ts * fix: added api for ConferencingAppsViewPlatformWrapper * type fixes * added getBulkEventTypes api for bulk-update default location * added bulk-update-to-default-location * fix:bulk-update-to-default-location * invalidated * fixed returnTo and onErrorReturnTo * make logos work for conferencing atoms * smalll improvements * fixup * share common types * type fix, and fixed a typo * fix: type-error * fix: json.parse(json.parse()) * fix: invalidate query * fix: removing app throws error in the main app * undo platform-libraries-1.2.3 * update platform-libraries version --------- Co-authored-by: Morgan <[email protected]>
This commit is contained in:
1 parent
44115ac7fa
commit
063400fcbc
54 files changed
+1898
-413
No files matched your search
@@ -3,8 +3,8 @@
|
||||
import { useReducer } from "react";
|
||||
|
||||
import getAppCategoryTitle from "@calcom/app-store/_utils/getAppCategoryTitle";
|
||||
import type { UpdateDefaultConferencingAppParams } from "@calcom/features/apps/components/AppList";
|
||||
import { AppList } from "@calcom/features/apps/components/AppList";
|
||||
import { AppList, type HandleDisconnect } from "@calcom/features/apps/components/AppList";
|
||||
import type { UpdateUsersDefaultConferencingAppParams } from "@calcom/features/apps/components/AppSetDefaultLinkDialog";
|
||||
import DisconnectIntegrationModal from "@calcom/features/apps/components/DisconnectIntegrationModal";
|
||||
import type { RemoveAppParams } from "@calcom/features/apps/components/DisconnectIntegrationModal";
|
||||
import type { BulkUpdatParams } from "@calcom/features/eventtypes/components/BulkEditDefaultForEventsModal";
|
||||
@@ -31,7 +31,7 @@ import InstalledAppsLayout from "@components/apps/layouts/InstalledAppsLayout";
|
||||
interface IntegrationsContainerProps {
|
||||
variant?: AppCategories;
|
||||
exclude?: AppCategories[];
|
||||
handleDisconnect: (credentialId: number) => void;
|
||||
handleDisconnect: HandleDisconnect;
|
||||
}
|
||||
|
||||
const IntegrationsContainer = ({
|
||||
@@ -54,17 +54,25 @@ const IntegrationsContainer = ({
|
||||
|
||||
const updateLocationsMutation = trpc.viewer.eventTypes.bulkUpdateToDefaultLocation.useMutation();
|
||||
|
||||
const handleUpdateDefaultConferencingApp = ({ appSlug, callback }: UpdateDefaultConferencingAppParams) => {
|
||||
const { data: eventTypesQueryData, isFetching: isEventTypesFetching } =
|
||||
trpc.viewer.eventTypes.bulkEventFetch.useQuery();
|
||||
|
||||
const handleUpdateUserDefaultConferencingApp = ({
|
||||
appSlug,
|
||||
onSuccessCallback,
|
||||
onErrorCallback,
|
||||
}: UpdateUsersDefaultConferencingAppParams) => {
|
||||
updateDefaultAppMutation.mutate(
|
||||
{ appSlug },
|
||||
{
|
||||
onSuccess: () => {
|
||||
showToast("Default app updated successfully", "success");
|
||||
utils.viewer.getUsersDefaultConferencingApp.invalidate();
|
||||
callback();
|
||||
onSuccessCallback();
|
||||
},
|
||||
onError: (error) => {
|
||||
showToast(`Error: ${error.message}`, "error");
|
||||
onErrorCallback();
|
||||
},
|
||||
}
|
||||
);
|
||||
@@ -84,6 +92,14 @@ const IntegrationsContainer = ({
|
||||
);
|
||||
};
|
||||
|
||||
const handleConnectDisconnectIntegrationMenuToggle = () => {
|
||||
utils.viewer.integrations.invalidate();
|
||||
};
|
||||
|
||||
const handleBulkEditDialogToggle = () => {
|
||||
utils.viewer.getUsersDefaultConferencingApp.invalidate();
|
||||
};
|
||||
|
||||
// TODO: Refactor and reuse getAppCategories?
|
||||
const emptyIcon: Record<AppCategories, React.ComponentProps<typeof Icon>["name"]> = {
|
||||
calendar: "calendar",
|
||||
@@ -146,9 +162,13 @@ const IntegrationsContainer = ({
|
||||
data={data}
|
||||
variant={variant}
|
||||
defaultConferencingApp={defaultConferencingApp}
|
||||
handleUpdateDefaultConferencingApp={handleUpdateDefaultConferencingApp}
|
||||
handleUpdateUserDefaultConferencingApp={handleUpdateUserDefaultConferencingApp}
|
||||
handleBulkUpdateDefaultLocation={handleBulkUpdateDefaultLocation}
|
||||
isBulkUpdateDefaultLocationPending={updateDefaultAppMutation.isPending}
|
||||
eventTypes={eventTypesQueryData?.eventTypes}
|
||||
isEventTypesFetching={isEventTypesFetching}
|
||||
handleConnectDisconnectIntegrationMenuToggle={handleConnectDisconnectIntegrationMenuToggle}
|
||||
handleBulkEditDialogToggle={handleBulkEditDialogToggle}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
@@ -187,7 +207,7 @@ export default function InstalledApps(props: PageProps) {
|
||||
updateData({ isOpen: false, credentialId: null });
|
||||
};
|
||||
|
||||
const handleDisconnect = (credentialId: number, teamId?: number) => {
|
||||
const handleDisconnect = (credentialId: number, app: string, teamId?: number) => {
|
||||
updateData({ isOpen: true, credentialId, teamId });
|
||||
};
|
||||
|
||||
|
||||
@@ -50,6 +50,9 @@ export const AvailabilitySettingsWebWrapper = ({
|
||||
const bulkUpdateDefaultAvailabilityMutation =
|
||||
trpc.viewer.availability.schedule.bulkUpdateToDefaultAvailability.useMutation();
|
||||
|
||||
const { data: eventTypesQueryData, isFetching: isEventTypesFetching } =
|
||||
trpc.viewer.eventTypes.bulkEventFetch.useQuery();
|
||||
|
||||
const bulkUpdateFunction = ({ eventTypeIds, callback }: BulkUpdatParams) => {
|
||||
bulkUpdateDefaultAvailabilityMutation.mutate(
|
||||
{
|
||||
@@ -65,6 +68,10 @@ export const AvailabilitySettingsWebWrapper = ({
|
||||
);
|
||||
};
|
||||
|
||||
const handleBulkEditDialogToggle = () => {
|
||||
utils.viewer.getUsersDefaultConferencingApp.invalidate();
|
||||
};
|
||||
|
||||
const isDefaultSchedule = me.data?.defaultScheduleId === scheduleId;
|
||||
|
||||
const updateMutation = trpc.viewer.availability.schedule.update.useMutation({
|
||||
@@ -142,6 +149,9 @@ export const AvailabilitySettingsWebWrapper = ({
|
||||
setIsOpen: setIsBulkUpdateModalOpen,
|
||||
save: bulkUpdateFunction,
|
||||
isSaving: bulkUpdateDefaultAvailabilityMutation.isPending,
|
||||
eventTypes: eventTypesQueryData?.eventTypes,
|
||||
isEventTypesFetching,
|
||||
handleBulkEditDialogToggle: handleBulkEditDialogToggle,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -83,6 +83,9 @@ export function AvailabilityList({ schedules }: RouterOutputs["viewer"]["availab
|
||||
const bulkUpdateDefaultAvailabilityMutation =
|
||||
trpc.viewer.availability.schedule.bulkUpdateToDefaultAvailability.useMutation();
|
||||
|
||||
const { data: eventTypesQueryData, isFetching: isEventTypesFetching } =
|
||||
trpc.viewer.eventTypes.bulkEventFetch.useQuery();
|
||||
|
||||
const bulkUpdateFunction = ({ eventTypeIds, callback }: BulkUpdatParams) => {
|
||||
bulkUpdateDefaultAvailabilityMutation.mutate(
|
||||
{
|
||||
@@ -98,6 +101,10 @@ export function AvailabilityList({ schedules }: RouterOutputs["viewer"]["availab
|
||||
);
|
||||
};
|
||||
|
||||
const handleBulkEditDialogToggle = () => {
|
||||
utils.viewer.getUsersDefaultConferencingApp.invalidate();
|
||||
};
|
||||
|
||||
const duplicateMutation = trpc.viewer.availability.schedule.duplicate.useMutation({
|
||||
onSuccess: async ({ schedule }) => {
|
||||
await router.push(`/availability/${schedule.id}`);
|
||||
@@ -161,6 +168,9 @@ export function AvailabilityList({ schedules }: RouterOutputs["viewer"]["availab
|
||||
setOpen={setBulkUpdateModal}
|
||||
bulkUpdateFunction={bulkUpdateFunction}
|
||||
description={t("default_schedules_bulk_description")}
|
||||
eventTypes={eventTypesQueryData?.eventTypes}
|
||||
isEventTypesFetching={isEventTypesFetching}
|
||||
handleBulkEditDialogToggle={handleBulkEditDialogToggle}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
|
||||
@@ -9,15 +9,7 @@ import ApiKeyListItem from "@calcom/features/ee/api-keys/components/ApiKeyListIt
|
||||
import { APP_NAME } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
DialogContent,
|
||||
EmptyScreen,
|
||||
Meta,
|
||||
SkeletonContainer,
|
||||
SkeletonText,
|
||||
} from "@calcom/ui";
|
||||
import { Button, Dialog, DialogContent, EmptyScreen, SkeletonContainer, SkeletonText } from "@calcom/ui";
|
||||
|
||||
const SkeletonLoader = ({ title, description }: { title: string; description: string }) => {
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user