Skip to content

Commit

Permalink
Added beta 9 blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
fgatti675 committed Sep 18, 2024
1 parent caf4952 commit 52e2d26
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 20 deletions.
4 changes: 1 addition & 3 deletions examples/example_pro/src/FirestoreApp/TestEditorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,14 @@ const defaultEditorContent = `![](https://firebasestorage.googleapis.com/v0/b/fi
# Introducing the FireCMS editor
> The [FireCMS editor](https://firecms.co/) is a Notion-style WYSIWYG editor built with [Tiptap](https://tiptap.dev/).
>
> It is currently under development, but stable enough to try out
## Features
1. Slash menu (try hitting '/' in a new line)
2. Bubble menu (try selecting some code)
3. Image uploads (drag & drop / copy & paste)
4. Bullet and numbered lists
5. AI autocompletion (WIP)
5. AI autocompletion
6. JSON, HTML or Markdown output
\`\`\`
Expand Down
29 changes: 14 additions & 15 deletions examples/example_pro/src/gen/genInserts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'fs';
import fs from "fs";

interface Product {
id: string;
Expand All @@ -22,28 +22,28 @@ interface Product {
}

function extractProductIds(array: string[]): string[] {
if(!array) return [];
return array.map(item => item.split('/').pop());
if (!array) return [];
return array.map(item => item.split("/").pop() as string);
}

function escapeString(value: string): string {
return value.replace(/'/g, "''");
}

function formatArray(array: string[]): string {
return array.length > 0 ? `ARRAY[${array.map(item => `'${escapeString(item)}'`).join(', ')}]` : 'ARRAY[]::TEXT[]';
return array.length > 0 ? `ARRAY[${array.map(item => `'${escapeString(item)}'`).join(", ")}]` : "ARRAY[]::TEXT[]";
}

function formatValue(value: any): string {
if (value === null || value === undefined) {
return 'NULL';
} else if (typeof value === 'boolean') {
return value ? 'TRUE' : 'FALSE';
} else if (typeof value === 'number') {
return "NULL";
} else if (typeof value === "boolean") {
return value ? "TRUE" : "FALSE";
} else if (typeof value === "number") {
return value.toString();
} else if (Array.isArray(value)) {
return formatArray(value);
} else if (typeof value === 'string') {
} else if (typeof value === "string") {
return `'${escapeString(value)}'`;
} else {
return `'${escapeString(value.toString())}'`;
Expand Down Expand Up @@ -75,21 +75,20 @@ function generateInsertStatements(products: Product[]): string {
extractProductIds(product.related_products) // Extract only the IDs for related_products
];

const formattedValues = values.map(formatValue).join(', ');
const formattedValues = values.map(formatValue).join(", ");
const insertStatement = `INSERT INTO products (id, public, category, available, min_known_price, name, added_on, main_image, uppercase_name, feed_excluded, price, brand, available_locales, amazon_link, liked_by_count, currency, description) VALUES (${formattedValues});`;

insertStatements.push(insertStatement);
});

return insertStatements.join('\n');
return insertStatements.join("\n");
}

// Replace 'your_products.json' with the actual path to your JSON file
const productsData = JSON.parse(fs.readFileSync('./src/gen/Products.json', 'utf8'));
const productsData = JSON.parse(fs.readFileSync("./src/gen/Products.json", "utf8"));
const insertStatements = generateInsertStatements(productsData);
const res = "DELETE * FROM products;\n" + insertStatements;
const res = "DELETE * FROM products;\n" + insertStatements;
console.log(res);


// save output to a file
fs.writeFileSync('./src/gen/inserts.sql', res);
fs.writeFileSync("./src/gen/inserts.sql", res);
4 changes: 2 additions & 2 deletions website/blog/2024-09-10-hello_mongodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ While this announcement focuses on MongoDB, it's crucial to remember that FireCM
We recommend you take a look ath the documentation regarding [FireCMS Controller](https://firecms.co/docs/pro/Controllers). We also dropped an example in our Github: [FireCMS MongoDB Example](https://github.com/firecmsco/firecms/blob/main/examples/example_pro/src/MongoDBApp/MongoDBApp.tsx).

But here are the steps if you want to jump on it:
- Install the package `npm install @firecms/mongodb`
- Install the package `yarn add @firecms/mongodb` or `npm install @firecms/mongodb`
- Add the atlas config, example:
```typescript
const atlasConfig: = {
const atlasConfig = {
"appId": "your_app_id",
"appUrl": "your_app_url",
"baseUrl": "your_base_url",
Expand Down
86 changes: 86 additions & 0 deletions website/blog/2024-09-18-beta_9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
---
slug: beta_9
title: FireCMS Beta.9 is out
author: Francesco Gatti
image: /img/avatars/francesco_avatar.jpg
author_url: https://www.linkedin.com/in/fgatti675
author_image_url: https://avatars.githubusercontent.com/u/5120271?v=4
---


# FireCMS Beta.9 is out

**Check what's new in your favourite CMS**

We are excited to announce the release of FireCMS Beta.9. This release includes a lot of new features and improvements,
including a new Markdown editor, multi select, and MongoDB support.

FireCMS continues its journey to become the most flexible and powerful CMS. We aim to become a true headless CMS, with
and by headless we mean compatible with any database and backend, as well as also detached from any frontend technology.

## New Markdown editor

![Editor](../static/img/new_editor.png)

Completely revamped Markdown editor inspired by Notion, with an amazing UX and **autocomplete features**.
The previous editor was not very user-friendly, and we have decided to replace it with a new one that is more powerful
and easier to use.
It is also now possible to **upload images** inline.
The editor can be used as a Markdown field in your collections, as well as a standalone component in your components.


## Multi select
![Multi select](../static/img/multi_select.png)

We have improved the multi select component, now supporting search and better performance. The previous
version would clip items based on the position of the dropdown, which was not ideal.

## MongoDB support

FireCMS continues to expand its database support. We have added a new package `@firecms/mongodb`
that allows you to connect to MongoDB databases.

You can now run FireCMS PRO with MongoDB as your backend, with no connection to any Firebase services.
Use the Auth and Database services of MongoDB Atlas to authenticate and store your data.

This is part of our efforts to bring all the power of FireCMS with the [PRO](https://firecms.co/pro) version
to any database you want.

## UI updates

Our FireCMS UI package is available as a separate package, `@firecms/ui`. This allows you to use the same UI components
we use in FireCMS in your own projects.

![Toleroo](../static/img/toleroo.png)

We have improved it's customization capabilities. For example, Toleroo needs to apply it's brand guidelines to its
CMS implementation. Until now we could only change colors, but now we can change fonts, sizes, and more. For
each text variant you can define a set of tailwind classes.

If you are updating from a previous version, you will need to add an import in your css:

```css
@import "@firecms/ui/index.css";
```

and then you are free to customize each style as you see fit.

```css
.typography-h1 {
@apply text-6xl font-headers font-light;
}

.typography-h2 {
@apply text-5xl font-headers font-light;
}

.typography-h3 {
@apply text-4xl font-headers font-normal;
}
/* ... */
```

## And more

There are many more improvements and bug fixes. Check the [changelog](https://firecms.co/docs/changelog) for more details.

Binary file added website/static/img/multi_select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/new_editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added website/static/img/toleroo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 52e2d26

Please sign in to comment.