feat: replace admin API settings page with link to API docs (#28046)
* feat: replace admin API settings page with link to API docs Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com> * chore: remove unused AdminAPIView component Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com> * feat: rename admin API tab to API Docs Co-Authored-By: joe@cal.com <j.auyeung419@gmail.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
4 files changed
+12
-95
No files matched your search
+8
-7
@@ -154,9 +154,10 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
trackingMetadata: { section: "developer", page: "api_keys" },
|
||||
},
|
||||
{
|
||||
name: "admin_api",
|
||||
href: "/settings/organizations/admin-api",
|
||||
trackingMetadata: { section: "developer", page: "admin_api" },
|
||||
name: "api_docs",
|
||||
href: "https://cal.com/docs/api-reference/v2/introduction",
|
||||
isExternalLink: true,
|
||||
trackingMetadata: { section: "developer", page: "api_docs" },
|
||||
},
|
||||
// TODO: Add profile level for embeds
|
||||
// { name: "embeds", href: "/v2/settings/developer/embeds" },
|
||||
@@ -206,10 +207,10 @@ const getTabs = (orgBranding: OrganizationBranding | null) => {
|
||||
trackingMetadata: { section: "organization", page: "directory_sync" },
|
||||
},
|
||||
{
|
||||
name: "admin_api",
|
||||
href: "https://cal.com/docs/enterprise-features/api/api-reference/bookings#admin-access",
|
||||
name: "api_docs",
|
||||
href: "https://cal.com/docs/api-reference/v2/introduction",
|
||||
isExternalLink: true,
|
||||
trackingMetadata: { section: "organization", page: "admin_api" },
|
||||
trackingMetadata: { section: "organization", page: "api_docs" },
|
||||
},
|
||||
...(HAS_ORG_OPT_IN_FEATURES
|
||||
? [
|
||||
@@ -450,7 +451,7 @@ const useTabs = ({
|
||||
return { ...tab, children: filtered };
|
||||
} else if (tab.href === "/settings/developer") {
|
||||
const filtered = tab?.children?.filter(
|
||||
(childTab) => permissions?.canUpdateOrganization || childTab.name !== "admin_api"
|
||||
(childTab) => permissions?.canUpdateOrganization || childTab.name !== "api_docs"
|
||||
);
|
||||
return { ...tab, children: filtered };
|
||||
}
|
||||
|
||||
+3
-29
@@ -1,33 +1,7 @@
|
||||
import { getTranslate, _generateMetadata } from "app/_utils";
|
||||
import { redirect } from "next/navigation";
|
||||
|
||||
import SettingsHeader from "@calcom/features/settings/appDir/SettingsHeader";
|
||||
|
||||
import { AdminAPIView } from "~/ee/organizations/admin-api";
|
||||
|
||||
import { validateUserHasOrg } from "../actions/validateUserHasOrg";
|
||||
|
||||
export const generateMetadata = async () =>
|
||||
await _generateMetadata(
|
||||
(t) => `${t("admin")} ${t("api_reference")}`,
|
||||
(t) => t("leverage_our_api"),
|
||||
undefined,
|
||||
undefined,
|
||||
"/settings/organizations/admin-api"
|
||||
);
|
||||
|
||||
const Page = async () => {
|
||||
const t = await getTranslate();
|
||||
|
||||
await validateUserHasOrg();
|
||||
|
||||
return (
|
||||
<SettingsHeader
|
||||
title={`${t("admin")} ${t("api_reference")}`}
|
||||
description={t("leverage_our_api")}
|
||||
borderInShellHeader={false}>
|
||||
<AdminAPIView />
|
||||
</SettingsHeader>
|
||||
);
|
||||
const Page = () => {
|
||||
redirect("https://cal.com/docs/api-reference/v2/introduction");
|
||||
};
|
||||
|
||||
export default Page;
|
||||
@@ -1,59 +0,0 @@
|
||||
"use client";
|
||||
|
||||
import LicenseRequired from "~/ee/common/components/LicenseRequired";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { ButtonGroup } from "@calcom/ui/components/buttonGroup";
|
||||
import { FolderIcon, SparklesIcon, TerminalIcon } from "@coss/ui/icons";
|
||||
|
||||
import { UpgradeTip } from "~/shell/UpgradeTip";
|
||||
|
||||
export const AdminAPIView = () => {
|
||||
const { t } = useLocale();
|
||||
|
||||
const features = [
|
||||
{
|
||||
icon: <TerminalIcon className="h-5 w-5 text-pink-500" />,
|
||||
title: t("admin_api"),
|
||||
description: t("leverage_our_api"),
|
||||
},
|
||||
{
|
||||
icon: <FolderIcon className="h-5 w-5 text-red-500" />,
|
||||
title: `SCIM & ${t("directory_sync")}`,
|
||||
description: t("directory_sync_description"),
|
||||
},
|
||||
{
|
||||
icon: <SparklesIcon className="h-5 w-5 text-blue-500" />,
|
||||
title: "Cal.ai",
|
||||
description: t("use_cal_ai_to_make_call_description"),
|
||||
},
|
||||
];
|
||||
return (
|
||||
<LicenseRequired>
|
||||
<div className="mt-8">
|
||||
<UpgradeTip
|
||||
plan="enterprise"
|
||||
title={t("enterprise_license")}
|
||||
description={t("create_your_enterprise_description")}
|
||||
features={features}
|
||||
background="/tips/enterprise"
|
||||
buttons={
|
||||
<div className="stack-y-2 rtl:space-x-reverse sm:space-x-2">
|
||||
<ButtonGroup>
|
||||
<Button color="primary" href="https://cal.com/sales" target="_blank">
|
||||
{t("contact_sales")}
|
||||
</Button>
|
||||
<Button color="minimal" href="https://cal.com/enterprise" target="_blank">
|
||||
{t("learn_more")}
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
}>
|
||||
<>Create Org</>
|
||||
</UpgradeTip>
|
||||
</div>
|
||||
</LicenseRequired>
|
||||
);
|
||||
};
|
||||
|
||||
export default AdminAPIView;
|
||||
@@ -816,6 +816,7 @@
|
||||
"owner": "Owner",
|
||||
"admin": "Admin",
|
||||
"admin_api": "Admin API",
|
||||
"api_docs": "API Docs",
|
||||
"administrator_user": "Administrator user",
|
||||
"lets_create_first_administrator_user": "Let's create the first administrator user.",
|
||||
"admin_user_created": "Administrator user setup",
|
||||
|
||||
Reference in new issue
Block a user