Skip to content

Commit

Permalink
feat: umami app added (#14783)
Browse files Browse the repository at this point in the history
Co-authored-by: Hariom <hariombalhara@gmail.com>
  • Loading branch information
vikaspatil0021 and hariombalhara committed Jun 14, 2024
1 parent 745f0b0 commit d666f29
Show file tree
Hide file tree
Showing 16 changed files with 123 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/app-store/apps.browser.generated.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const EventTypeAddonMap = {
import("./templates/event-type-app-card/components/EventTypeAppCardInterface")
),
twipla: dynamic(() => import("./twipla/components/EventTypeAppCardInterface")),
umami: dynamic(() => import("./umami/components/EventTypeAppCardInterface")),
"zoho-bigin": dynamic(() => import("./zoho-bigin/components/EventTypeAppCardInterface")),
zohocrm: dynamic(() => import("./zohocrm/components/EventTypeAppCardInterface")),
};
Expand Down
2 changes: 2 additions & 0 deletions packages/app-store/apps.keys-schemas.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { appKeysSchema as tandemvideo_zod_ts } from "./tandemvideo/zod";
import { appKeysSchema as booking_pages_tag_zod_ts } from "./templates/booking-pages-tag/zod";
import { appKeysSchema as event_type_app_card_zod_ts } from "./templates/event-type-app-card/zod";
import { appKeysSchema as twipla_zod_ts } from "./twipla/zod";
import { appKeysSchema as umami_zod_ts } from "./umami/zod";
import { appKeysSchema as vital_zod_ts } from "./vital/zod";
import { appKeysSchema as webex_zod_ts } from "./webex/zod";
import { appKeysSchema as wordpress_zod_ts } from "./wordpress/zod";
Expand Down Expand Up @@ -82,6 +83,7 @@ export const appKeysSchemas = {
"booking-pages-tag": booking_pages_tag_zod_ts,
"event-type-app-card": event_type_app_card_zod_ts,
twipla: twipla_zod_ts,
umami: umami_zod_ts,
vital: vital_zod_ts,
webex: webex_zod_ts,
wordpress: wordpress_zod_ts,
Expand Down
2 changes: 2 additions & 0 deletions packages/app-store/apps.metadata.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import general_app_settings_config_json from "./templates/general-app-settings/c
import link_as_an_app_config_json from "./templates/link-as-an-app/config.json";
import twipla_config_json from "./twipla/config.json";
import typeform_config_json from "./typeform/config.json";
import umami_config_json from "./umami/config.json";
import vimcal_config_json from "./vimcal/config.json";
import { metadata as vital__metadata_ts } from "./vital/_metadata";
import weather_in_your_calendar_config_json from "./weather_in_your_calendar/config.json";
Expand Down Expand Up @@ -167,6 +168,7 @@ export const appStoreMetadata = {
"link-as-an-app": link_as_an_app_config_json,
twipla: twipla_config_json,
typeform: typeform_config_json,
umami: umami_config_json,
vimcal: vimcal_config_json,
vital: vital__metadata_ts,
weather_in_your_calendar: weather_in_your_calendar_config_json,
Expand Down
2 changes: 2 additions & 0 deletions packages/app-store/apps.schemas.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import { appDataSchema as tandemvideo_zod_ts } from "./tandemvideo/zod";
import { appDataSchema as booking_pages_tag_zod_ts } from "./templates/booking-pages-tag/zod";
import { appDataSchema as event_type_app_card_zod_ts } from "./templates/event-type-app-card/zod";
import { appDataSchema as twipla_zod_ts } from "./twipla/zod";
import { appDataSchema as umami_zod_ts } from "./umami/zod";
import { appDataSchema as vital_zod_ts } from "./vital/zod";
import { appDataSchema as webex_zod_ts } from "./webex/zod";
import { appDataSchema as wordpress_zod_ts } from "./wordpress/zod";
Expand Down Expand Up @@ -82,6 +83,7 @@ export const appDataSchemas = {
"booking-pages-tag": booking_pages_tag_zod_ts,
"event-type-app-card": event_type_app_card_zod_ts,
twipla: twipla_zod_ts,
umami: umami_zod_ts,
vital: vital_zod_ts,
webex: webex_zod_ts,
wordpress: wordpress_zod_ts,
Expand Down
1 change: 1 addition & 0 deletions packages/app-store/apps.server.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export const apiHandlers = {
"link-as-an-app": import("./templates/link-as-an-app/api"),
twipla: import("./twipla/api"),
typeform: import("./typeform/api"),
umami: import("./umami/api"),
vimcal: import("./vimcal/api"),
vital: import("./vital/api"),
weather_in_your_calendar: import("./weather_in_your_calendar/api"),
Expand Down
2 changes: 2 additions & 0 deletions packages/app-store/bookerApps.metadata.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import telegram_config_json from "./telegram/config.json";
import booking_pages_tag_config_json from "./templates/booking-pages-tag/config.json";
import event_type_location_video_static_config_json from "./templates/event-type-location-video-static/config.json";
import twipla_config_json from "./twipla/config.json";
import umami_config_json from "./umami/config.json";
import webex_config_json from "./webex/config.json";
import whatsapp_config_json from "./whatsapp/config.json";
import whereby_config_json from "./whereby/config.json";
Expand Down Expand Up @@ -76,6 +77,7 @@ export const appStoreMetadata = {
"booking-pages-tag": booking_pages_tag_config_json,
"event-type-location-video-static": event_type_location_video_static_config_json,
twipla: twipla_config_json,
umami: umami_config_json,
webex: webex_config_json,
whatsapp: whatsapp_config_json,
whereby: whereby_config_json,
Expand Down
6 changes: 6 additions & 0 deletions packages/app-store/umami/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
items:
- 1.png
---

{DESCRIPTION}
16 changes: 16 additions & 0 deletions packages/app-store/umami/api/add.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { createDefaultInstallation } from "@calcom/app-store/_utils/installation";
import type { AppDeclarativeHandler } from "@calcom/types/AppHandler";

import appConfig from "../config.json";

const handler: AppDeclarativeHandler = {
appType: appConfig.type,
variant: appConfig.variant,
slug: appConfig.slug,
supportsMultipleInstalls: false,
handlerType: "add",
createCredential: ({ appType, user, slug, teamId }) =>
createDefaultInstallation({ appType, user: user, slug, key: {}, teamId }),
};

export default handler;
1 change: 1 addition & 0 deletions packages/app-store/umami/api/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as add } from "./add";
35 changes: 35 additions & 0 deletions packages/app-store/umami/components/EventTypeAppCardInterface.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { useAppContextWithSchema } from "@calcom/app-store/EventTypeAppContext";
import AppCard from "@calcom/app-store/_components/AppCard";
import useIsAppEnabled from "@calcom/app-store/_utils/useIsAppEnabled";
import type { EventTypeAppCardComponent } from "@calcom/app-store/types";
import { TextField } from "@calcom/ui";

import type { appDataSchema } from "../zod";

const EventTypeAppCard: EventTypeAppCardComponent = function EventTypeAppCard({ app, eventType }) {
const { getAppData, setAppData, disabled } = useAppContextWithSchema<typeof appDataSchema>();
const siteId = getAppData("SITE_ID");
const { enabled, updateEnabled } = useIsAppEnabled(app);

return (
<AppCard
app={app}
switchOnClick={(e) => {
updateEnabled(e);
}}
switchChecked={enabled}
teamId={eventType.team?.id || undefined}>
<TextField
disabled={disabled}
name="Site ID"
value={siteId}
placeholder="Enter your Site ID"
onChange={(e) => {
setAppData("SITE_ID", e.target.value);
}}
/>
</AppCard>
);
};

export default EventTypeAppCard;
28 changes: 28 additions & 0 deletions packages/app-store/umami/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "Umami",
"slug": "umami",
"type": "umami_analytics",
"logo": "icon.svg",
"url": "https://cal.com/",
"variant": "analytics",
"categories": ["analytics"],
"publisher": "Cal.com, Inc.",
"email": "help@cal.com",
"description": "Umami makes it easy to collect, analyze, and understand your web data — while maintaining visitor privacy and data ownership.",
"extendsFeature": "EventType",
"appData": {
"tag": {
"scripts": [
{
"src": "https://us.umami.is/script.js",
"attrs": {
"data-website-id": "{SITE_ID}"
}
}
]
}
},
"isTemplate": false,
"__createdUsingCli": true,
"__template": "booking-pages-tag"
}
1 change: 1 addition & 0 deletions packages/app-store/umami/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * as api from "./api";
14 changes: 14 additions & 0 deletions packages/app-store/umami/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://json.schemastore.org/package.json",
"private": true,
"name": "@calcom/umami",
"version": "0.0.0",
"main": "./index.ts",
"dependencies": {
"@calcom/lib": "*"
},
"devDependencies": {
"@calcom/types": "*"
},
"description": "Umami makes it easy to collect, analyze, and understand your web data — while maintaining visitor privacy and data ownership."
}
Binary file added packages/app-store/umami/static/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions packages/app-store/umami/static/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions packages/app-store/umami/zod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { z } from "zod";

import { eventTypeAppCardZod } from "@calcom/app-store/eventTypeAppCardZod";

export const appDataSchema = eventTypeAppCardZod.merge(
z.object({
SITE_ID: z.string().optional(),
})
);

export const appKeysSchema = z.object({});

0 comments on commit d666f29

Please sign in to comment.