chore: recategorize apps (#9306)

* Remove unused code in InstalledAppsLayout

* Add new app categories "crm", "conferencing" and "messaging"

* Sort getAppCategories entries alphabetically

* Fix 404s on new category pages (and remove hardcoded category lists)

* Fix admin apps list not showing "no available apps" for new categories

* Recategorise apps

* Sync seed-app-store categories with config files

* Replace unnecessary seed-app-store.config.json with appStoreMetadata

* Copy video.svg to conferencing.svg

* Add messaging.svg

* Remove web3 from getAppCategories (used by installed apps, admin apps)

* Fix app-store-cli categories

- Add conferencing
- Add CRM
- Remove video
- Remove web3

* Remove outdated web3 comment in seed-app-store

* Update apps/web/public/static/locales/en/common.json

* Add cron script to keep db apps in sync with app metadata

* Add redirect for app category "video" to "conferencing"

* Fix up "video" category overrides to apply to conferencing

* Fix conferencing apps not showing as a location for non-team users

* Restore "installed_app" string for conferencing apps

* Make linter happier

* Remove my "installed_app_conferencing_description" as this was fixed upstream

* Quick tidy up

* Add dry-run to syncAppMeta via  CRON_ENABLE_APP_SYNC env

* Replace console.log with logger in syncAppMeta

---------

Co-authored-by: Peer Richelsen <[email protected]>
Co-authored-by: alannnc <[email protected]>
Co-authored-by: Hariom Balhara <[email protected]>
Co-authored-by: Omar López <[email protected]>
This commit is contained in:
authored and GitHub committed 2023-06-28 18:22:51 +02:00
1 parent 8cfb9902ff
commit 171827f547
57 files changed
+304 -373

No files matched your search

@@ -0,0 +1,10 @@
-- AlterEnum
-- This migration adds more than one value to an enum.
-- With PostgreSQL versions 11 and earlier, this is not possible
-- in a single migration. This can be worked around by creating
-- multiple migrations, each migration adding only one value to
-- the enum.
ALTER TYPE "AppCategories" ADD VALUE 'conferencing';
ALTER TYPE "AppCategories" ADD VALUE 'crm';
+4 -2
View File
@@ -614,10 +614,12 @@ enum AppCategories {
messaging
other
payment
video
web3
video // deprecated, please use 'conferencing' instead
web3 // deprecated, we should no longer have any web3 apps
automation
analytics
conferencing
crm
}
model App {
-244
View File
@@ -1,244 +0,0 @@
[
{
"/*": "This file is deprecated now. No new entry should be added to it.",
"dirName": "routing-forms",
"categories": ["other"],
"slug": "routing-forms",
"type": "routing-forms_other"
},
{
"dirName": "whereby",
"categories": ["video"],
"slug": "whereby",
"type": "whereby_video"
},
{
"dirName": "around",
"categories": ["video"],
"slug": "around",
"type": "around_video"
},
{
"dirName": "riverside",
"categories": ["video"],
"slug": "riverside",
"type": "riverside_video"
},
{
"dirName": "typeform",
"categories": ["other"],
"slug": "typeform",
"type": "typeform_other"
},
{
"dirName": "ping",
"categories": ["video"],
"slug": "ping",
"type": "ping_video"
},
{
"dirName": "campfire",
"categories": ["video"],
"slug": "campfire",
"type": "campfire_video"
},
{
"dirName": "raycast",
"categories": ["other"],
"slug": "raycast",
"type": "raycast_other"
},
{
"dirName": "n8n",
"categories": ["automation"],
"slug": "n8n",
"type": "n8n_automation"
},
{
"dirName": "exchangecalendar",
"categories": ["calendar"],
"slug": "exchange",
"type": "exchange_calendar"
},
{
"dirName": "qr_code",
"categories": ["other"],
"slug": "qr_code",
"type": "qr_code_other"
},
{
"dirName": "weather_in_your_calendar",
"categories": ["other"],
"slug": "weather_in_your_calendar",
"type": "weather_in_your_calendar_other"
},
{
"dirName": "fathom",
"categories": ["analytics"],
"slug": "fathom",
"type": "fathom_analytics"
},
{
"dirName": "plausible",
"categories": ["analytics"],
"slug": "plausible",
"type": "plausible_analytics"
},
{
"dirName": "wordpress",
"categories": ["other"],
"slug": "wordpress",
"type": "wordpress_other"
},
{
"dirName": "ga4",
"categories": ["analytics"],
"slug": "ga4",
"type": "ga4_analytics"
},
{
"dirName": "pipedream",
"categories": ["automation"],
"slug": "pipedream",
"type": "pipedream_automation"
},
{
"dirName": "sirius_video",
"categories": ["video"],
"slug": "sirius_video",
"type": "sirius_video_video"
},
{
"dirName": "sendgrid",
"categories": ["other"],
"slug": "sendgrid",
"type": "sendgrid_other_calendar"
},
{
"dirName": "closecom",
"categories": ["other"],
"slug": "closecom",
"type": "closecom_other_calendar"
},
{
"dirName": "whatsapp",
"categories": ["video"],
"slug": "whatsapp",
"type": "whatsapp_video"
},
{
"dirName": "telegram",
"categories": ["video"],
"slug": "telegram",
"type": "telegram_video"
},
{
"dirName": "signal",
"categories": ["video"],
"slug": "signal",
"type": "signal_video"
},
{
"dirName": "vimcal",
"categories": ["calendar"],
"slug": "vimcal",
"type": "vimcal_other"
},
{
"dirName": "amie",
"categories": ["calendar"],
"slug": "amie",
"type": "amie_other"
},
{
"dirName": "booking-pages-tag",
"categories": ["analytics"],
"slug": "booking-pages-tag",
"type": "booking-pages-tag_other",
"isTemplate": true
},
{
"dirName": "event-type-app-card",
"categories": ["other"],
"slug": "event-type-app-card",
"type": "event-type-app-card_other",
"isTemplate": true
},
{
"dirName": "event-type-location-video-static",
"categories": ["video"],
"slug": "event-type-location-video-static",
"type": "event-type-location-video-static_other",
"isTemplate": true
},
{
"dirName": "general-app-settings",
"categories": ["other"],
"slug": "general-app-settings",
"type": "general-app-settings_other",
"isTemplate": true
},
{
"dirName": "link-as-an-app",
"categories": ["other"],
"slug": "link-as-an-app",
"type": "link-as-an-app_other",
"isTemplate": true
},
{
"dirName": "basic",
"categories": ["other"],
"slug": "basic",
"type": "basic_other",
"isTemplate": true
},
{
"dirName": "facetime",
"categories": ["video"],
"slug": "facetime",
"type": "facetime_video",
"isTemplate": false
},
{
"dirName": "zohocrm",
"categories": ["other"],
"slug": "zohocrm",
"type": "zohocrm_other_calendar",
"isTemplate": false
},
{
"dirName": "webex",
"categories": ["video"],
"slug": "webex",
"type": "webex_video",
"isTemplate": false
},
{
"dirName": "cron",
"categories": ["calendar"],
"slug": "cron",
"type": "cron_other",
"isTemplate": false
},
{
"dirName": "gtm",
"categories": ["analytics"],
"slug": "gtm",
"type": "gtm_analytics",
"isTemplate": false
},
{
"dirName": "discord",
"categories": ["video"],
"slug": "discord",
"type": "discord_video",
"isTemplate": false
},
{
"dirName": "sylapsvideo",
"categories": ["video"],
"slug": "sylapsvideo",
"type": "sylaps_video",
"isTemplate": false
}
]
+27 -26
View File
@@ -4,10 +4,11 @@
*/
import type { Prisma } from "@prisma/client";
import dotEnv from "dotenv";
import fs from "fs";
import path from "path";
import { appStoreMetadata } from "@calcom/app-store/appStoreMetaData";
import prisma from ".";
import { AppCategories } from "./enums";
dotEnv.config({ path: "../../.env.appStore" });
@@ -235,7 +236,7 @@ export default async function main() {
client_secret,
redirect_uris,
});
await createApp("google-meet", "googlevideo", ["video"], "google_video", {
await createApp("google-meet", "googlevideo", ["conferencing"], "google_video", {
client_id,
client_secret,
redirect_uris,
@@ -248,7 +249,7 @@ export default async function main() {
client_id: process.env.MS_GRAPH_CLIENT_ID,
client_secret: process.env.MS_GRAPH_CLIENT_SECRET,
});
await createApp("msteams", "office365video", ["video"], "office365_video", {
await createApp("msteams", "office365video", ["conferencing"], "office365_video", {
client_id: process.env.MS_GRAPH_CLIENT_ID,
client_secret: process.env.MS_GRAPH_CLIENT_SECRET,
});
@@ -266,45 +267,45 @@ export default async function main() {
}
// Video apps
if (process.env.DAILY_API_KEY) {
await createApp("daily-video", "dailyvideo", ["video"], "daily_video", {
await createApp("daily-video", "dailyvideo", ["conferencing"], "daily_video", {
api_key: process.env.DAILY_API_KEY,
scale_plan: process.env.DAILY_SCALE_PLAN,
});
}
if (process.env.TANDEM_CLIENT_ID && process.env.TANDEM_CLIENT_SECRET) {
await createApp("tandem", "tandemvideo", ["video"], "tandem_video", {
await createApp("tandem", "tandemvideo", ["conferencing"], "tandem_video", {
client_id: process.env.TANDEM_CLIENT_ID as string,
client_secret: process.env.TANDEM_CLIENT_SECRET as string,
base_url: (process.env.TANDEM_BASE_URL as string) || "https://tandem.chat",
});
}
if (process.env.ZOOM_CLIENT_ID && process.env.ZOOM_CLIENT_SECRET) {
await createApp("zoom", "zoomvideo", ["video"], "zoom_video", {
await createApp("zoom", "zoomvideo", ["conferencing"], "zoom_video", {
client_id: process.env.ZOOM_CLIENT_ID,
client_secret: process.env.ZOOM_CLIENT_SECRET,
});
}
await createApp("jitsi", "jitsivideo", ["video"], "jitsi_video");
await createApp("jitsi", "jitsivideo", ["conferencing"], "jitsi_video");
// Other apps
if (process.env.HUBSPOT_CLIENT_ID && process.env.HUBSPOT_CLIENT_SECRET) {
await createApp("hubspot", "hubspot", ["other"], "hubspot_other_calendar", {
await createApp("hubspot", "hubspot", ["crm"], "hubspot_other_calendar", {
client_id: process.env.HUBSPOT_CLIENT_ID,
client_secret: process.env.HUBSPOT_CLIENT_SECRET,
});
}
if (process.env.SALESFORCE_CONSUMER_KEY && process.env.SALESFORCE_CONSUMER_SECRET) {
await createApp("salesforce", "salesforce", ["other"], "salesforce_other_calendar", {
await createApp("salesforce", "salesforce", ["crm"], "salesforce_other_calendar", {
consumer_key: process.env.SALESFORCE_CONSUMER_KEY,
consumer_secret: process.env.SALESFORCE_CONSUMER_SECRET,
});
}
if (process.env.ZOHOCRM_CLIENT_ID && process.env.ZOHOCRM_CLIENT_SECRET) {
await createApp("zohocrm", "zohocrm", ["other"], "zohocrm_other_calendar", {
await createApp("zohocrm", "zohocrm", ["crm"], "zohocrm_other_calendar", {
client_id: process.env.ZOHOCRM_CLIENT_ID,
client_secret: process.env.ZOHOCRM_CLIENT_SECRET,
});
}
await createApp("wipe-my-cal", "wipemycalother", ["other"], "wipemycal_other");
await createApp("wipe-my-cal", "wipemycalother", ["automation"], "wipemycal_other");
if (process.env.GIPHY_API_KEY) {
await createApp("giphy", "giphy", ["other"], "giphy_other", {
api_key: process.env.GIPHY_API_KEY,
@@ -312,7 +313,7 @@ export default async function main() {
}
if (process.env.VITAL_API_KEY && process.env.VITAL_WEBHOOK_SECRET) {
await createApp("vital-automation", "vital", ["other"], "vital_other", {
await createApp("vital-automation", "vital", ["automation"], "vital_other", {
mode: process.env.VITAL_DEVELOPMENT_MODE || "sandbox",
region: process.env.VITAL_REGION || "us",
api_key: process.env.VITAL_API_KEY,
@@ -326,8 +327,7 @@ export default async function main() {
});
}
// Web3 apps
await createApp("huddle01", "huddle01video", ["web3", "video"], "huddle01_video");
await createApp("huddle01", "huddle01video", ["conferencing"], "huddle01_video");
// Payment apps
if (
@@ -348,21 +348,22 @@ export default async function main() {
});
}
const generatedApps = JSON.parse(
fs.readFileSync(path.join(__dirname, "seed-app-store.config.json"), "utf8")
);
for (let i = 0; i < generatedApps.length; i++) {
const generatedApp = generatedApps[i];
if (generatedApp.isTemplate && process.argv[2] !== "seed-templates") {
for (const [, app] of Object.entries(appStoreMetadata)) {
if (app.isTemplate && process.argv[2] !== "seed-templates") {
continue;
}
const validatedCategories = app.categories.filter(
(category): category is AppCategories => category in AppCategories
);
await createApp(
generatedApp.slug,
generatedApp.dirName,
generatedApp.categories,
generatedApp.type,
app.slug,
app.dirName ?? app.slug,
validatedCategories,
app.type,
undefined,
generatedApp.isTemplate
app.isTemplate
);
}