From d3166cd70f3d03c8b09eea6ae2a5a06d17af111b Mon Sep 17 00:00:00 2001 From: francesco Date: Sat, 14 Dec 2024 02:16:50 +0100 Subject: [PATCH] It is not possible to override default entity actions --- CHANGELOG.md | 6 +++ examples/example_pro/src/FirestoreApp/App.tsx | 3 +- .../SampleCollectionActions.tsx | 8 +++- .../collections/showcase_collection.tsx | 27 ++++++++++- packages/cli/templates/template_pro/README.md | 13 ++++- .../datatalk/src/components/TableResults.tsx | 3 +- .../EntityCollectionView.tsx | 9 ++-- .../common/default_entity_actions.tsx | 31 ++---------- .../src/components/common/useColumnsIds.tsx | 2 +- .../firecms_core/src/core/EntityEditView.tsx | 3 +- .../firecms_core/src/types/collections.ts | 2 +- .../firecms_core/src/types/entity_actions.tsx | 10 ++++ .../firecms_core/src/util/entity_actions.ts | 28 +++++++++++ packages/firecms_core/src/util/index.ts | 1 + website/docs/CHANGELOG.md | 6 +++ website/docs/collections/entity_actions.md | 19 ++++---- website/docs/pro/licensing.md | 24 ++++++++++ website/docs/pro/nextjs.mdx | 19 ++++++++ .../pro/{index.mdx => pro_quickstart.mdx} | 12 +++-- website/docs/{pro => self}/custom_storage.mdx | 0 website/docs/{pro => self}/deployment.md | 15 ------ website/docs/{pro => self}/firestore_rules.md | 0 website/docs/{pro => self}/main_components.md | 0 .../docs/{pro => self}/main_controllers.md | 2 +- .../migrating_from_v2_to_pro.mdx | 14 ++---- .../{pro => self}/migrating_from_v3_beta.mdx | 2 +- website/docs/{pro => self}/mongodb.mdx | 0 .../docs/{pro => self}/styling_firecms.mdx | 1 + website/firebase.json | 35 ++++++++++++++ website/sidebars.js | 47 ++++++++++++++----- website/src/css/custom.css | 9 ++++ website/src/pages/index.tsx | 1 - website/src/partials/home/BuildAnything.tsx | 32 +++++++++++++ 33 files changed, 291 insertions(+), 93 deletions(-) create mode 100644 website/docs/pro/licensing.md rename website/docs/pro/{index.mdx => pro_quickstart.mdx} (69%) rename website/docs/{pro => self}/custom_storage.mdx (100%) rename website/docs/{pro => self}/deployment.md (79%) rename website/docs/{pro => self}/firestore_rules.md (100%) rename website/docs/{pro => self}/main_components.md (100%) rename website/docs/{pro => self}/main_controllers.md (99%) rename website/docs/{pro => self}/migrating_from_v2_to_pro.mdx (91%) rename website/docs/{pro => self}/migrating_from_v3_beta.mdx (99%) rename website/docs/{pro => self}/mongodb.mdx (100%) rename website/docs/{pro => self}/styling_firecms.mdx (97%) create mode 100644 website/src/partials/home/BuildAnything.tsx diff --git a/CHANGELOG.md b/CHANGELOG.md index da408a437..178772f5b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [3.0.0-beta.12] - 2024-12- + +- You can now override custom entity actions. Just provide an action with one of the keys `edit`, `copy` or `delete` in +the `entityActions` prop in the collection view. This will override the default actions for the entity. + + ## [3.0.0-beta.11] - 2024-12-13 - New Next.js template for FireCMS PRO. You can now create a new project with the PRO template using the CLI. diff --git a/examples/example_pro/src/FirestoreApp/App.tsx b/examples/example_pro/src/FirestoreApp/App.tsx index c4afd9cc3..a7eed6823 100644 --- a/examples/example_pro/src/FirestoreApp/App.tsx +++ b/examples/example_pro/src/FirestoreApp/App.tsx @@ -232,6 +232,7 @@ export function App() { if (process.env.NODE_ENV !== "production") { sourceCollections.push(testCollection); } + // return sourceCollections; return mergeCollections( sourceCollections, @@ -325,7 +326,7 @@ export function App() { const navigationController = useBuildNavigationController({ collections, - collectionPermissions: userManagement.collectionPermissions, + // collectionPermissions: userManagement.collectionPermissions, views, adminViews: userManagementAdminViews, authController, diff --git a/examples/example_pro/src/FirestoreApp/collection_actions/SampleCollectionActions.tsx b/examples/example_pro/src/FirestoreApp/collection_actions/SampleCollectionActions.tsx index ad273438f..5caea4253 100644 --- a/examples/example_pro/src/FirestoreApp/collection_actions/SampleCollectionActions.tsx +++ b/examples/example_pro/src/FirestoreApp/collection_actions/SampleCollectionActions.tsx @@ -1,9 +1,10 @@ import React from "react"; -import { CollectionActionsProps, useSnackbarController } from "@firecms/core"; +import { CollectionActionsProps, useSideEntityController, useSnackbarController } from "@firecms/core"; import { Button, CloseIcon, IconButton, Select, SelectItem } from "@firecms/ui"; export function SampleCollectionActions({ selectionController }: CollectionActionsProps) { + const sideEntityController = useSideEntityController(); const snackbarController = useSnackbarController(); const onClick = (event: React.MouseEvent) => { @@ -13,6 +14,11 @@ export function SampleCollectionActions({ selectionController }: CollectionActio type: "success", message: `User defined code here! ${count} products selected` }); + // sideEntityController.open({ + // path: "showcase", + // entityId: "delete_me", + // collection: showcaseCollection + // }); }; return ( diff --git a/examples/example_pro/src/FirestoreApp/collections/showcase_collection.tsx b/examples/example_pro/src/FirestoreApp/collections/showcase_collection.tsx index 523c6ce41..a61405a97 100644 --- a/examples/example_pro/src/FirestoreApp/collections/showcase_collection.tsx +++ b/examples/example_pro/src/FirestoreApp/collections/showcase_collection.tsx @@ -1,12 +1,37 @@ import { buildCollection, buildProperty } from "@firecms/core"; +import { AutoAwesomeIcon } from "@firecms/ui"; +import React from "react"; export const showcaseCollection = buildCollection({ - id: "showcase", + id: "id_showcase", path: "showcase", description: "Collection to showcase different field types", customId: false, icon: "bento", name: "Showcase", + entityActions: [ + { + name: "Edit", + key: "edit", + onClick: async ({ + entity, + collection + }) => { + console.log("Custom action", entity, collection); + } + } + ], + subcollections: [{ + id: "id_subcollection", + path: "subcollection", + name: "Subcollection", + properties: { + name: { + dataType: "string", + name: "Name" + } + } + }], properties: { name: buildProperty({ dataType: "string", diff --git a/packages/cli/templates/template_pro/README.md b/packages/cli/templates/template_pro/README.md index 756cd988f..c53328c16 100644 --- a/packages/cli/templates/template_pro/README.md +++ b/packages/cli/templates/template_pro/README.md @@ -18,6 +18,7 @@ yarn ``` And run the project locally: + ```bash yarn dev ``` @@ -61,10 +62,18 @@ function isFireCMSUser(){ ### Deploying the project -You can deploy the project to Firebase hosting by following [these instructions](https://firecms.co/docs/pro/deployment). -In order to deploy the project, you need to have a valid FireCMS PRO license. +You can develop your project locally without a license, but you will need to purchase one to deploy it. There is a grace +period after the first deployment to allow you to test it in production. + You can create one in the [FireCMS subscriptions](https://app.firecms.co/subscriptions). When you get your API key, you can set it in the `.env` file. +When creating your license, you need to specify the project IDs that will be using the license. You can find your +project ID in the Firebase console. + +You will receive an API key that you need to pass to your FireCMS component. If you are using the starter template, you +can set it in the .env file. + + diff --git a/packages/datatalk/src/components/TableResults.tsx b/packages/datatalk/src/components/TableResults.tsx index b46ecf1a7..954ffccdd 100644 --- a/packages/datatalk/src/components/TableResults.tsx +++ b/packages/datatalk/src/components/TableResults.tsx @@ -10,6 +10,7 @@ import { EntityCollection, EntityCollectionRowActions, EntityCollectionTable, + mergeEntityActions, OnCellValueChange, PropertiesOrBuilders, resolveCollection, @@ -136,7 +137,7 @@ export function TableResults({ actions.push(copyEntityAction); actions.push(deleteEntityAction); if (customEntityActions) - actions.push(...customEntityActions); + return mergeEntityActions(actions, customEntityActions); return actions; }; diff --git a/packages/firecms_core/src/components/EntityCollectionView/EntityCollectionView.tsx b/packages/firecms_core/src/components/EntityCollectionView/EntityCollectionView.tsx index 5a53f6577..13b1800a7 100644 --- a/packages/firecms_core/src/components/EntityCollectionView/EntityCollectionView.tsx +++ b/packages/firecms_core/src/components/EntityCollectionView/EntityCollectionView.tsx @@ -61,6 +61,7 @@ import { import { setIn } from "@firecms/formex"; import { getSubcollectionColumnId } from "../EntityCollectionTable/internal/common"; import { + COLLECTION_GROUP_PARENT_ID, OnCellValueChange, OnColumnResizeParams, UniqueFieldValidator, @@ -75,8 +76,7 @@ import { useAnalyticsController } from "../../hooks/useAnalyticsController"; import { useSelectionController } from "./useSelectionController"; import { EntityCollectionViewStartActions } from "./EntityCollectionViewStartActions"; import { addRecentId, getRecentIds } from "./utils"; - -const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent"; +import { mergeEntityActions } from "../../util/entity_actions"; /** * @group Components @@ -458,7 +458,7 @@ export const EntityCollectionView = React.memo( if (deleteEnabled) actions.push(deleteEntityAction); if (customEntityActions) - actions.push(...customEntityActions); + return mergeEntityActions(actions, customEntityActions); return actions; }; @@ -798,7 +798,8 @@ function EntityIdHeaderWidget({ }> -
+
{ e.preventDefault(); diff --git a/packages/firecms_core/src/components/common/default_entity_actions.tsx b/packages/firecms_core/src/components/common/default_entity_actions.tsx index 6cb2639ed..22d106512 100644 --- a/packages/firecms_core/src/components/common/default_entity_actions.tsx +++ b/packages/firecms_core/src/components/common/default_entity_actions.tsx @@ -5,6 +5,7 @@ import { addRecentId } from "../EntityCollectionView/utils"; export const editEntityAction: EntityAction = { icon: , + key: "edit", name: "Edit", collapsed: false, onClick({ @@ -38,6 +39,7 @@ export const editEntityAction: EntityAction = { export const copyEntityAction: EntityAction = { icon: , name: "Copy", + key: "copy", onClick({ entity, collection, @@ -62,38 +64,11 @@ export const copyEntityAction: EntityAction = { } } -export const archiveEntityAction: EntityAction = { - icon: , - name: "Archive", - onClick({ - entity, - collection, - context: { - dataSource, - } - }): Promise { - // Add your code here - return Promise.resolve(undefined); - } -} - -export const openWebsiteAction: EntityAction = { - icon: , - name: "See in website", - onClick({ - entity, - collection, - context, - }): Promise { - // open a new tab - window.open(`https://example.com/${entity.id}`, "_blank"); - return Promise.resolve(undefined); - } -} export const deleteEntityAction: EntityAction = { icon: , name: "Delete", + key: "delete", onClick({ entity, fullPath, diff --git a/packages/firecms_core/src/components/common/useColumnsIds.tsx b/packages/firecms_core/src/components/common/useColumnsIds.tsx index 6d4fc9717..11e9986af 100644 --- a/packages/firecms_core/src/components/common/useColumnsIds.tsx +++ b/packages/firecms_core/src/components/common/useColumnsIds.tsx @@ -3,7 +3,7 @@ import { EntityCollection, ResolvedEntityCollection, ResolvedProperty } from ".. import { getSubcollectionColumnId } from "../EntityCollectionTable/internal/common"; import { PropertyColumnConfig } from "../EntityCollectionTable/EntityCollectionTableProps"; -const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent"; +export const COLLECTION_GROUP_PARENT_ID = "collectionGroupParent"; export function useColumnIds>(collection: ResolvedEntityCollection, includeSubcollections: boolean): PropertyColumnConfig[] { return useMemo(() => { diff --git a/packages/firecms_core/src/core/EntityEditView.tsx b/packages/firecms_core/src/core/EntityEditView.tsx index ebde2d26f..bfd77bf6d 100644 --- a/packages/firecms_core/src/core/EntityEditView.tsx +++ b/packages/firecms_core/src/core/EntityEditView.tsx @@ -34,6 +34,7 @@ import { getValueInPath, isHidden, isReadOnly, + mergeEntityActions, removeInitialAndTrailingSlashes, resolveCollection, resolveDefaultSelectedView, @@ -702,7 +703,7 @@ export function EntityEditViewInner>({ if (deleteEnabled) actions.push(deleteEntityAction); if (customEntityActions) - actions.push(...customEntityActions); + return mergeEntityActions(actions, customEntityActions); return actions; }, [authController, inputCollection, path]); diff --git a/packages/firecms_core/src/types/collections.ts b/packages/firecms_core/src/types/collections.ts index 5ef2634f7..48e896658 100644 --- a/packages/firecms_core/src/types/collections.ts +++ b/packages/firecms_core/src/types/collections.ts @@ -119,7 +119,7 @@ export interface EntityCollection = any, USER exte * `hidden` in the property definition,will be ignored. * `propertiesOrder` has precedence over `hidden`. */ - propertiesOrder?: (Extract | `subcollection:${string}`)[]; + propertiesOrder?: (Extract | string | `subcollection:${string}` | "collectionGroupParent")[]; /** * If enabled, content is loaded in batches. If `false` all entities in the diff --git a/packages/firecms_core/src/types/entity_actions.tsx b/packages/firecms_core/src/types/entity_actions.tsx index 864f23950..fa8a10371 100644 --- a/packages/firecms_core/src/types/entity_actions.tsx +++ b/packages/firecms_core/src/types/entity_actions.tsx @@ -15,6 +15,16 @@ export type EntityAction = { */ name: string; + /** + * Key of the action. You only need to provide this if you want to + * override the default actions. + * The default actions are: + * - edit + * - delete + * - copy + */ + key?: string; + /** * Icon of the action */ diff --git a/packages/firecms_core/src/util/entity_actions.ts b/packages/firecms_core/src/util/entity_actions.ts index e69de29bb..d19e7b309 100644 --- a/packages/firecms_core/src/util/entity_actions.ts +++ b/packages/firecms_core/src/util/entity_actions.ts @@ -0,0 +1,28 @@ +import { EntityAction } from "../types"; + +const reservedKeys = ["edit", "copy", "delete"]; + +export function mergeEntityActions(currentActions: EntityAction[], newActions: EntityAction[]): EntityAction[] { + // given the current actions, replace the ones with the same key + // and append the new ones + const updatedActions: EntityAction[] = []; + currentActions.forEach(action => { + const newAction = newActions.find(a => a.key === action.key); + if (newAction) { + const mergedAction = { + ...action, + ...newAction + } + updatedActions.push(mergedAction); + } else { + updatedActions.push(action); + } + }); + newActions.forEach(action => { + if (!currentActions.find(a => a.key === action.key) && (!action.key || !reservedKeys.includes(action.key))) { + updatedActions.push(action); + } + }); + return updatedActions; + +} diff --git a/packages/firecms_core/src/util/index.ts b/packages/firecms_core/src/util/index.ts index e19a3cde7..48e5b1803 100644 --- a/packages/firecms_core/src/util/index.ts +++ b/packages/firecms_core/src/util/index.ts @@ -7,6 +7,7 @@ export * from "./objects"; export * from "./paths"; export * from "./regexp"; export * from "./navigation_utils"; +export * from "./entity_actions"; export * from "./useDebouncedCallback"; export * from "./property_utils"; export * from "./resolutions"; diff --git a/website/docs/CHANGELOG.md b/website/docs/CHANGELOG.md index de5dc0e1c..7ebb6866e 100644 --- a/website/docs/CHANGELOG.md +++ b/website/docs/CHANGELOG.md @@ -2,6 +2,12 @@ id: changelog title: Changelog --- +## [3.0.0-beta.12] - 2024-12- + +- You can now override custom entity actions. Just provide an action with one of the keys `edit`, `copy` or `delete` in +the `entityActions` prop in the collection view. This will override the default actions for the entity. + + ## [3.0.0-beta.11] - 2024-12-13 - New Next.js template for FireCMS PRO. You can now create a new project with the PRO template using the CLI. diff --git a/website/docs/collections/entity_actions.md b/website/docs/collections/entity_actions.md index 122cd0807..652852049 100644 --- a/website/docs/collections/entity_actions.md +++ b/website/docs/collections/entity_actions.md @@ -21,7 +21,6 @@ modifying data, accessing storage, opening dialogs, etc. In the `icon` prop, you can pass a React element to show an icon next to the action name. We recommend using any of the [FireCMS icons](/docs/icons), which are available in the `@firecms/ui` package. - ```tsx export const productsCollection = buildCollection({ @@ -53,18 +52,23 @@ export const productsCollection = buildCollection({ }); ``` - #### EntityAction * `name`: Name of the action +* `key`?: Key of the action. You only need to provide this if you want to + override the default actions. + The default actions are: + - edit + - delete + - copy * `icon`?: React.ReactElement Icon of the action -* `onClick`: (props: EntityActionClickProps) => Promise -Function to be called when the action is clicked -* `collapsed`?: boolean Show this action collapsed in the menu of the collection view. Defaults to true. If false, the action will be shown in the menu +* `onClick`: (props: EntityActionClickProps) => Promise + Function to be called when the action is clicked +* `collapsed`?: boolean Show this action collapsed in the menu of the collection view. Defaults to true. If false, the + action will be shown in the menu * `includeInForm`?: boolean Show this action in the form, defaults to true * `disabled`?: boolean Disable this action, defaults to false - #### EntityActionClickProps * `entity`: Entity being edited @@ -77,10 +81,9 @@ Function to be called when the action is clicked * `onCollectionChange`?: () => void * `sideEntityController`?: SideEntityController - ## Example -Let's build an example where we add an action to archive a product. +Let's build an example where we add an action to archive a product. When the action is clicked, we will call a Google Cloud Function to that will run some business logic, in the backend. diff --git a/website/docs/pro/licensing.md b/website/docs/pro/licensing.md new file mode 100644 index 000000000..53186ba90 --- /dev/null +++ b/website/docs/pro/licensing.md @@ -0,0 +1,24 @@ +--- +id: licensing +title: Licensing +--- + +:::tip +Do you have any questions, would like to request a trial, or need a custom license? +Please [contact us via email](mailto:hello@firecms.co), +or [schedule a call](https://calendar.google.com/calendar/u/0/appointments/schedules/AcZssZ0INW8ihjQ90S4gkdo8_rbL_Zx7gagZShLIpHyW43zDXkQDPole6a1coo1sT2O6Gl05X8lxFDlp?gv=true). +::: + +You can develop your project locally without a license, but you will need to +purchase one to deploy it. There is a grace period after the first deployment +to allow you to test it in production. + +You can purchase a license in the [FireCMS subscriptions site](https://app.firecms.co/subscriptions). + +When creating your license, you need to specify the project IDs that will be +using the license. You can find your project ID in the Firebase console. + +You will receive an API key that you need to pass to your `FireCMS` component. +If you are using the starter template, you can set it in the `.env` file. + + diff --git a/website/docs/pro/nextjs.mdx b/website/docs/pro/nextjs.mdx index 6ce31eea3..7187d65b1 100644 --- a/website/docs/pro/nextjs.mdx +++ b/website/docs/pro/nextjs.mdx @@ -4,6 +4,25 @@ title: Using FireCMS with Next.js sidebar_label: Using with Next.js --- +## Using the FireCMS PRO starter template + +The easiest way to use FireCMS with Next.js is to use the FireCMS PRO starter template. This template includes +a Next.js project with FireCMS already configured. + +You can create a new project using the FireCMS PRO template by running: + +```bash +npx create-firecms-app +``` + +and select the `FireCMS PRO with Next.js frontend` template. + +Then follow the instructions on the screen to create your project. + + +## Setting up FireCMS with Next.js manually + + You can use FireCMS with Next.js. FireCMS is a React library, so you can use it with any React framework. diff --git a/website/docs/pro/index.mdx b/website/docs/pro/pro_quickstart.mdx similarity index 69% rename from website/docs/pro/index.mdx rename to website/docs/pro/pro_quickstart.mdx index 11455ec0b..418e0d6df 100644 --- a/website/docs/pro/index.mdx +++ b/website/docs/pro/pro_quickstart.mdx @@ -4,16 +4,22 @@ title: PRO Quickstart sidebar_label: Quickstart --- -FireCMS PRO is the self-hosted version of FireCMS. It is designed for projects that require more control over the -infrastructure, data and user management. It is a great option for companies that need to comply with specific regulations, or that have specific requirements that are not covered by the cloud version. +FireCMS PRO is the self-hosted version of FireCMS that includes all the most advanced features such as the collection editor, +data import and export, user and roles management, or the openAI integration. + +It is designed for projects that require more control over the +infrastructure, data and user management. It is a great option for companies that need to +comply with specific regulations, or that have specific requirements that are not covered by the cloud or +community versions. FireCMS PRO is a fully open-source project, and it is built on top of Firebase, Firestore, and Firebase Authentication. +It can be also used with MongoDB Atlas, or any other backend by implementing the required interfaces. + It is designed to be deployed on your own infrastructure, and it is fully customizable. It allows you a high level of customization, and it is designed to be extended with your own components, authentication providers, custom views, dashboard, custom logic, you name it. -You can even replace Firebase with your own backend, as long as you implement the required interfaces. ### Create a new project using the CLI diff --git a/website/docs/pro/custom_storage.mdx b/website/docs/self/custom_storage.mdx similarity index 100% rename from website/docs/pro/custom_storage.mdx rename to website/docs/self/custom_storage.mdx diff --git a/website/docs/pro/deployment.md b/website/docs/self/deployment.md similarity index 79% rename from website/docs/pro/deployment.md rename to website/docs/self/deployment.md index ba3d319f6..fa0ad1e37 100644 --- a/website/docs/pro/deployment.md +++ b/website/docs/self/deployment.md @@ -12,21 +12,6 @@ We recommend deploying to Firebase Hosting, as it is in the same ecosystem, and pick up the Firebase config from the environment. -## Purchase a PRO license - -You can develop your project locally without a license, but you will need to -purchase one to deploy it. There is a grace period after the first deployment -to allow you to test it in production. - -You can purchase a license in the [FireCMS subscriptions site](https://app.firecms.co/subscriptions). - -When creating your license, you need to specify the project IDs that will be -using the license. You can find your project ID in the Firebase console. - -You will receive an API key that you need to pass to your `FireCMS` component. -If you are using the starter template, you can set it in the `.env` file. - - ## Deployment to Firebase Hosting If you would like to deploy your CMS to Firebase Hosting, you need to enable diff --git a/website/docs/pro/firestore_rules.md b/website/docs/self/firestore_rules.md similarity index 100% rename from website/docs/pro/firestore_rules.md rename to website/docs/self/firestore_rules.md diff --git a/website/docs/pro/main_components.md b/website/docs/self/main_components.md similarity index 100% rename from website/docs/pro/main_components.md rename to website/docs/self/main_components.md diff --git a/website/docs/pro/main_controllers.md b/website/docs/self/main_controllers.md similarity index 99% rename from website/docs/pro/main_controllers.md rename to website/docs/self/main_controllers.md index e664bceb9..c5eb00215 100644 --- a/website/docs/pro/main_controllers.md +++ b/website/docs/self/main_controllers.md @@ -1,5 +1,5 @@ --- -id: Controllers +id: controllers title: Controllers --- diff --git a/website/docs/pro/migrating_from_v2_to_pro.mdx b/website/docs/self/migrating_from_v2_to_pro.mdx similarity index 91% rename from website/docs/pro/migrating_from_v2_to_pro.mdx rename to website/docs/self/migrating_from_v2_to_pro.mdx index 42c1690a6..4e209fd3a 100644 --- a/website/docs/pro/migrating_from_v2_to_pro.mdx +++ b/website/docs/self/migrating_from_v2_to_pro.mdx @@ -1,19 +1,13 @@ --- -id: migrating_from_v2_to_pro -title: Migrating from FireCMS 2.0 to FireCMS PRO -sidebar_label: Migrating from FireCMS 2.0 to FireCMS PRO -description: Migrate to FireCMS PRO, the self-hosted version of FireCMS. +id: migrating_from_v2_to_v3 +title: Migrating from FireCMS 2.0 to FireCMS 3.0 +sidebar_label: Migrating from FireCMS 2.0 to FireCMS 3.0 +description: Migrate to FireCMS 3.0, from FireCMS 2.0 --- FireCMS 3.0 is a major release that introduces a lot of changes. This page describes the main changes and how to migrate from FireCMS 2.0. -:::important -FireCMS PRO is now feature complete and available for self-hosting. -You can still use the hosted version of FireCMS, now called FireCMS Cloud. -::: - - FireCMS PRO is the self-hosted version of FireCMS. It allows you to host your own backend and use FireCMS without any restrictions. It is the most similar version to FireCMS 2.0, but with a lot of improvements and new features. diff --git a/website/docs/pro/migrating_from_v3_beta.mdx b/website/docs/self/migrating_from_v3_beta.mdx similarity index 99% rename from website/docs/pro/migrating_from_v3_beta.mdx rename to website/docs/self/migrating_from_v3_beta.mdx index 99e5e1131..3939ae9be 100644 --- a/website/docs/pro/migrating_from_v3_beta.mdx +++ b/website/docs/self/migrating_from_v3_beta.mdx @@ -151,7 +151,7 @@ import { FireCMS } from "firecms"; You need to update it to use the new package name: ```javascript -import { FireCMS } from "packages/firecms_cloud/src/index"; +import { FireCMS } from "@firecms/cloud"; ``` ### Vite configuration diff --git a/website/docs/pro/mongodb.mdx b/website/docs/self/mongodb.mdx similarity index 100% rename from website/docs/pro/mongodb.mdx rename to website/docs/self/mongodb.mdx diff --git a/website/docs/pro/styling_firecms.mdx b/website/docs/self/styling_firecms.mdx similarity index 97% rename from website/docs/pro/styling_firecms.mdx rename to website/docs/self/styling_firecms.mdx index f410b9b08..f87beb3e3 100644 --- a/website/docs/pro/styling_firecms.mdx +++ b/website/docs/self/styling_firecms.mdx @@ -1,6 +1,7 @@ --- id: styling_firecms title: Styling FireCMS +description: FireCMS allows you to customize the look and feel of your admin panel. You can customize the theme, colors, and typography to match your brand. --- FireCMS allows you to customize the look and feel of your admin panel. You can diff --git a/website/firebase.json b/website/firebase.json index 896cd898d..4650d11b4 100644 --- a/website/firebase.json +++ b/website/firebase.json @@ -38,6 +38,41 @@ "source": "/blog/cms_comparison_2023", "destination": "/blog/cms_comparison_2024", "type": 301 + }, + { + "source": "/pro/custom_storage", + "destination": "/self/firestore_rules", + "type": 301 + }, + { + "source": "/pro/custom_storage", + "destination": "/self/firestore_rules", + "type": 301 + }, + { + "source": "/pro/main_components", + "destination": "/self/main_components", + "type": 301 + }, + { + "source": "/pro/styling_firecms", + "destination": "/self/styling_firecms", + "type": 301 + }, + { + "source": "/pro/migrating_from_v2_to_pro", + "destination": "/self/migrating_from_v2_to_v3", + "type": 301 + }, + { + "source": "/pro/migrating_from_v3_beta", + "destination": "/self/migrating_from_v3_beta", + "type": 301 + }, + { + "source": "/pro/deployment", + "destination": "/self/deployment", + "type": 301 } ], "rewrites": [ diff --git a/website/sidebars.js b/website/sidebars.js index eb9ebb4fd..1f9d1ae07 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -28,24 +28,45 @@ module.exports = { }, { "type": "category", - "label": "FireCMS PRO", + "label": "Self-hosted", "collapsed": false, - className: "pro-sidebar-category", "items": [ - "pro/pro_quickstart", - "pro/firestore_rules", - "pro/sample_pro", - "pro/main_components", - "pro/styling_firecms", - "pro/deployment", + "self/firestore_rules", + { + "type": "doc", + "label": "Quickstart PRO", + "id": "pro/pro_quickstart", + className: "pro-sidebar-item" + }, + { + "type": "doc", + "label": "Sample PRO", + "id": "pro/sample_pro", + className: "pro-sidebar-item" + }, + "self/controllers", + "self/main_components", + "self/styling_firecms", + "self/deployment", "pro/app_check", "firebase_setup", - "pro/mongodb", - "pro/user_management", - "pro/custom_storage", + "self/mongodb", + { + "type": "doc", + "label": "Licensing", + "id": "pro/licensing", + className: "pro-sidebar-item" + }, + { + "type": "doc", + "label": "User management", + "id": "pro/user_management", + className: "pro-sidebar-item" + }, + "self/custom_storage", "pro/nextjs", - "pro/migrating_from_v2_to_pro", - "pro/migrating_from_v3_beta" + "self/migrating_from_v2_to_v3", + "self/migrating_from_v3_beta" ] }, { diff --git a/website/src/css/custom.css b/website/src/css/custom.css index 37af0a307..fcd76e4fc 100644 --- a/website/src/css/custom.css +++ b/website/src/css/custom.css @@ -513,6 +513,15 @@ html[data-theme="dark"] { top: calc(var(--ifm-navbar-height) + 36px) !important; } +article { + --ifm-h1-font-size: 3rem; + --ifm-h2-font-size: 2.5rem; + --ifm-h3-font-size: 2rem; + --ifm-h4-font-size: 1.3rem; + --ifm-h5-font-size: 1.2rem; + --ifm-h6-font-size: 1.1rem; +} + .markdown h1:first-child { --ifm-h1-font-size: 3rem; } diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index 6ee30025e..9cabc33dc 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -55,7 +55,6 @@ function Home() { - diff --git a/website/src/partials/home/BuildAnything.tsx b/website/src/partials/home/BuildAnything.tsx new file mode 100644 index 000000000..a2d642bc3 --- /dev/null +++ b/website/src/partials/home/BuildAnything.tsx @@ -0,0 +1,32 @@ +// export function BuildAnything() { +// +// return
+//
+//
+//
+//

+// {title} +//

+//
+//
+//
+// {number} +//
+//
+// {description} +//
+//
+// {features.map((feat, idx) => ( +//
+// {feat.title} +//

{feat.title}

+//
+// ))} +//
+//
+//
+//
+//
+// }