171827f547
* 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 <peeroke@gmail.com> Co-authored-by: alannnc <alannnc@gmail.com> Co-authored-by: Hariom Balhara <hariombalhara@gmail.com> Co-authored-by: Omar López <zomars@me.com>
21 lines
623 B
TypeScript
21 lines
623 B
TypeScript
import z from "zod";
|
|
|
|
import { AppCategories } from "@calcom/prisma/enums";
|
|
|
|
const variantSchema = z.nativeEnum(AppCategories);
|
|
|
|
export default function getInstalledAppPath(
|
|
{ variant, slug }: { variant?: string; slug?: string },
|
|
locationSearch = ""
|
|
): string {
|
|
if (!variant) return `/apps/installed${locationSearch}`;
|
|
|
|
const parsedVariant = variantSchema.safeParse(variant);
|
|
|
|
if (!parsedVariant.success) return `/apps/installed${locationSearch}`;
|
|
|
|
if (!slug) return `/apps/installed/${variant}${locationSearch}`;
|
|
|
|
return `/apps/installed/${variant}?hl=${slug}${locationSearch && locationSearch.slice(1)}`;
|
|
}
|