fix: disable google-meet in user onboarding if google-calendar is not installed (#15702)
* fix: disable google-meet in user onboarding if google-calendar is not installed * add tooltip * fix: type check * fix: type check for tooltip - allowed `ReactNode` for tooltip content prop --------- Co-authored-by: Hariom Balhara <[email protected]>
This commit is contained in:
1 parent
ad61d48706
commit
fed3987028
5 files changed
+66
-7
No files matched your search
@@ -7,6 +7,11 @@ import { userMetadata } from "@calcom/prisma/zod-utils";
|
||||
import type { AppFrontendPayload as App } from "@calcom/types/App";
|
||||
import type { CredentialFrontendPayload as Credential } from "@calcom/types/Credential";
|
||||
|
||||
export type TDependencyData = {
|
||||
name?: string;
|
||||
installed?: boolean;
|
||||
}[];
|
||||
|
||||
/**
|
||||
* Get App metdata either using dirName or slug
|
||||
*/
|
||||
@@ -96,10 +101,7 @@ export async function getAppRegistryWithCredentials(userId: number, userAdminTea
|
||||
/* This is now handled from the DB */
|
||||
// if (!app.installed) return apps;
|
||||
app.createdAt = dbapp.createdAt.toISOString();
|
||||
let dependencyData: {
|
||||
name?: string;
|
||||
installed?: boolean;
|
||||
}[] = [];
|
||||
let dependencyData: TDependencyData = [];
|
||||
if (app.dependencies) {
|
||||
dependencyData = app.dependencies.map((dependency) => {
|
||||
const dependencyInstalled = dbApps.some(
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { Prisma } from "@prisma/client";
|
||||
|
||||
import appStore from "@calcom/app-store";
|
||||
import type { TDependencyData } from "@calcom/app-store/_appRegistry";
|
||||
import type { CredentialOwner } from "@calcom/app-store/types";
|
||||
import { getAppFromSlug } from "@calcom/app-store/utils";
|
||||
import getEnabledAppsFromCredentials from "@calcom/lib/apps/getEnabledAppsFromCredentials";
|
||||
import getInstallCountPerApp from "@calcom/lib/apps/getInstallCountPerApp";
|
||||
import { getUsersCredentials } from "@calcom/lib/server/getUsersCredentials";
|
||||
@@ -179,6 +181,18 @@ export const integrationsHandler = async ({ ctx, input }: IntegrationsOptions) =
|
||||
}
|
||||
}
|
||||
|
||||
let dependencyData: TDependencyData = [];
|
||||
if (app.dependencies?.length) {
|
||||
dependencyData = app.dependencies.map((dependency) => {
|
||||
const dependencyInstalled = enabledApps.some(
|
||||
(dbAppIterator) => dbAppIterator.credentials.length && dbAppIterator.slug === dependency
|
||||
);
|
||||
// If the app marked as dependency is simply deleted from the codebase, we can have the situation where App is marked installed in DB but we couldn't get the app.
|
||||
const dependencyName = getAppFromSlug(dependency)?.name;
|
||||
return { name: dependencyName, installed: dependencyInstalled };
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
...app,
|
||||
...(teams.length && {
|
||||
@@ -189,6 +203,7 @@ export const integrationsHandler = async ({ ctx, input }: IntegrationsOptions) =
|
||||
teams,
|
||||
isInstalled: !!userCredentialIds.length || !!teams.length || app.isGlobal,
|
||||
isSetupAlready,
|
||||
...(app.dependencies && { dependencyData }),
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
@@ -22,7 +22,7 @@ export type ButtonBaseProps = {
|
||||
EndIcon?: IconName;
|
||||
shallow?: boolean;
|
||||
/**Tool tip used when icon size is set to small */
|
||||
tooltip?: string;
|
||||
tooltip?: string | React.ReactNode;
|
||||
tooltipSide?: "top" | "right" | "bottom" | "left";
|
||||
tooltipOffset?: number;
|
||||
disabled?: boolean;
|
||||
@@ -240,7 +240,7 @@ const Wrapper = ({
|
||||
tooltipSide,
|
||||
tooltipOffset,
|
||||
}: {
|
||||
tooltip?: string;
|
||||
tooltip?: string | React.ReactNode;
|
||||
children: React.ReactNode;
|
||||
tooltipSide?: "top" | "right" | "bottom" | "left";
|
||||
tooltipOffset?: number;
|
||||
|
||||
Reference in new issue
Block a user