Merge branch 'main' into chore/ts-strapi

This commit is contained in:
Alexandre Bodin 2023-09-19 15:55:59 +02:00
commit c195099a2c
9 changed files with 76 additions and 69 deletions

View File

@ -7,9 +7,9 @@
</a>
</p>
<h3 align="center">API creation made simple, secure and fast.</h3>
<p align="center">The most advanced open-source headless CMS to build powerful APIs with no effort.</p>
<p align="center"><a href="https://strapi.io/cloud">Cloud</a> · <a href="https://strapi.io/demo">Try live demo</a></p>
<h3 align="center">Open-source headless CMS, self-hosted or Cloud youre in control.</h3>
<p align="center">The leading open-source headless CMS, 100% JavaScript/TypeScript, flexible and fully customizable.</p>
<p align="center"><a href="https://cloud.strapi.io/signups?source=github1">Cloud</a> · <a href="https://strapi.io/demo">Try live demo</a></p>
<br />
<p align="center">
@ -31,18 +31,22 @@
<p align="center">
<a href="https://strapi.io">
<img src="https://raw.githubusercontent.com/strapi/strapi/0bcebf77b37182fe021cb59cc19be8f5db4a18ac/public/assets/administration_panel.png" alt="Administration panel" />
<img src="https://raw.githubusercontent.com/strapi/strapi/main/public/assets/admin-demo.gif" alt="Administration panel" />
</a>
</p>
<br>
Strapi is a free and open-source headless CMS delivering your content anywhere you need.
Strapi Community Edition is a free and open-source headless CMS enabling you to manage any content, anywhere.
- **Keep control over your data**. With Strapi, you know where your data is stored, and you keep full control at all times.
- **Self-hosted**. You can host and scale Strapi projects the way you want. You can choose any hosting platform you want: AWS, Render, Netlify, Heroku, a VPS, or a dedicated server. You can scale as you grow, 100% independent.
- **Database agnostic**. Strapi works with SQL databases. You can choose the database you prefer: PostgreSQL, MySQL, MariaDB, and SQLite.
- **Customizable**. You can quickly build your logic by fully customizing APIs, routes, or plugins to fit your needs perfectly.
- **Self-hosted or Cloud**: You can host and scale Strapi projects the way you want. You can save time by deploying to [Strapi Cloud](https://cloud.strapi.io/signups?source=github1) or deploy to the hosting platform you want\*\*: AWS, Azure, Google Cloud, DigitalOcean.
- **Modern Admin Pane**: Elegant, entirely customizable and a fully extensible admin panel.
- **Multi-database support**: You can choose the database you prefer: PostgreSQL, MySQL, MariaDB, and SQLite.
- **Customizable**: You can quickly build your logic by fully customizing APIs, routes, or plugins to fit your needs perfectly.
- **Blazing Fast and Robust**: Built on top of Node.js and TypeScript, Strapi delivers reliable and solid performance.
- **Front-end Agnostic**: Use any front-end framework (React, Next.js, Vue, Angular, etc.), mobile apps or even IoT.
- **Secure by default**: Reusable policies, CORS, CSP, P3P, Xframe, XSS, and more.
- **Powerful CLI**: Scaffold projects and APIs on the fly.
## Getting Started
@ -107,13 +111,13 @@ Strapi only supports maintenance and LTS versions of Node.js. Please refer to th
## Features
- **Modern Admin Panel:** Elegant, entirely customizable and a fully extensible admin panel.
- **Secure by default:** Reusable policies, CORS, CSP, P3P, Xframe, XSS, and more.
- **Plugins Oriented:** Install the auth system, content management, custom plugins, and more, in seconds.
- **Blazing Fast:** Built on top of Node.js, Strapi delivers amazing performance.
- **Front-end Agnostic:** Use any front-end framework (React, Vue, Angular, etc.), mobile apps or even IoT.
- **Powerful CLI:** Scaffold projects and APIs on the fly.
- **SQL databases:** Works with PostgreSQL, MySQL, MariaDB, and SQLite.
- **Content Types Builder**: Build the most flexible publishing experience for your content managers, by giving them the freedom to create any page on the go with [fields](https://docs.strapi.io/user-docs/content-manager/writing-content#filling-up-fields), components and [Dynamic Zones](https://docs.strapi.io/user-docs/content-manager/writing-content#dynamic-zones).
- **Media Library**: Upload your images, videos, audio or documents to the media library. Easily find the right asset, edit and reuse it.
- **Internationalization**: The Internationalization (i18n) plugin allows Strapi users to create, manage and distribute localized content in different languages, called "locales
- **Role Based Access Control**: Create an unlimited number of custom roles and permissions for admin and end users.
- **GraphQL or REST**: Consume the API using REST or GraphQL
You can unlock additional features such as SSO, Audit Logs, Review Workflows in [Strapi Cloud](https://cloud.strapi.io/login?source=github1) or [Strapi Enterprise](https://strapi.io/enterprise?source=github1).
**[See more on our website](https://strapi.io/overview)**.

View File

@ -198,5 +198,12 @@ describe('DynamicComponent', () => {
});
});
it.todo('should handle errors in the fields');
it('should handle errors in the fields', async () => {
const { getByText } = render({
index: 0,
formErrors: { [`${defaultProps.name}.0`]: 'Error here' },
});
expect(getByText('The component contains error(s)')).toBeInTheDocument();
});
});

View File

@ -2,7 +2,7 @@ import React from 'react';
import { lightTheme, ThemeProvider } from '@strapi/design-system';
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
import { render as renderRTL } from '@testing-library/react';
import { act, render as renderRTL } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
@ -299,7 +299,9 @@ describe('DynamicZone', () => {
const [draggedItem] = getAllByRole('button', { name: 'Drag' });
draggedItem.focus();
act(() => {
draggedItem.focus();
});
await user.keyboard('[Space]');
@ -331,7 +333,9 @@ describe('DynamicZone', () => {
const [draggedItem] = getAllByRole('button', { name: 'Drag' });
draggedItem.focus();
act(() => {
draggedItem.focus();
});
await user.keyboard('[Space]');
await user.keyboard('[ArrowDown]');
@ -360,7 +364,9 @@ describe('DynamicZone', () => {
const [draggedItem] = getAllByRole('button', { name: 'Drag' });
draggedItem.focus();
act(() => {
draggedItem.focus();
});
await user.keyboard('[Space]');
await user.keyboard('[ArrowDown]');
@ -390,7 +396,9 @@ describe('DynamicZone', () => {
const [draggedItem] = getAllByRole('button', { name: 'Drag' });
draggedItem.focus();
act(() => {
draggedItem.focus();
});
await user.keyboard('[Space]');
await user.keyboard('[Escape]');

View File

@ -196,13 +196,13 @@ const RelationInput = ({
updatedRelationsWith.current === 'onChange' &&
relations.length !== previewRelationsLength
) {
listRef.current.scrollToItem(relations.length, 'end');
listRef.current?.scrollToItem(relations.length, 'end');
updatedRelationsWith.current = undefined;
} else if (
updatedRelationsWith.current === 'loadMore' &&
relations.length !== previewRelationsLength
) {
listRef.current.scrollToItem(0, 'start');
listRef.current?.scrollToItem(0, 'start');
updatedRelationsWith.current = undefined;
}
}, [previewRelationsLength, relations]);

View File

@ -112,7 +112,13 @@ const filterPluginsByAdminEntry = (plugin) => {
);
if (!isLocalPluginWithLegacyAdminFile) {
const isModuleWithFE = require.resolve(`${plugin.pathToPlugin}/strapi-admin`);
let pathToPlugin = plugin.pathToPlugin;
if (process.platform === 'win32') {
pathToPlugin = pathToPlugin.split(path.sep).join(path.posix.sep);
}
const isModuleWithFE = require.resolve(`${pathToPlugin}/strapi-admin`);
return isModuleWithFE;
}

View File

@ -17,7 +17,7 @@ const AttributeList = ({ attributes }) => (
const { paddingLeft, paddingRight } = getPadding(index);
return (
<GridItem key={attribute} col={6} style={{ height: '100%' }}>
<GridItem key={attribute} col={6}>
<Box
paddingLeft={paddingLeft}
paddingRight={paddingRight}

View File

@ -287,7 +287,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
>
<div
class="c15"
style="height: 100%;"
>
<div
class="c16"
@ -355,7 +354,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c25"
@ -423,7 +421,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c16"
@ -493,7 +490,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c25"
@ -557,7 +553,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c16"
@ -625,7 +620,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c25"
@ -695,7 +689,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c16"
@ -761,7 +754,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c25"
@ -831,7 +823,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c16"
@ -899,7 +890,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c25"
@ -969,7 +959,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c16"
@ -1035,7 +1024,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c25"
@ -1103,7 +1091,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
>
<div
class="c15"
style="height: 100%;"
>
<div
class="c16"
@ -1177,7 +1164,6 @@ exports[`<AttributeOptions /> renders and matches the snapshot 1`] = `
</div>
<div
class="c15"
style="height: 100%;"
>
<div
class="c25"

View File

@ -1,23 +1,15 @@
<p align="center">
<a href="https://strapi.io">
<picture>
<source
srcset="https://strapi.io/assets/strapi-logo-dark.svg"
media="(prefers-color-scheme: dark)"
width="318px"
/>
<img
src="https://strapi.io/assets/strapi-logo-light.svg"
alt="Strapi logo"
width="318px"
/>
</picture>
<a href="https://strapi.io/#gh-light-mode-only">
<img src="https://strapi.io/assets/strapi-logo-dark.svg" width="318px" alt="Strapi logo" />
</a>
<a href="https://strapi.io/#gh-dark-mode-only">
<img src="https://strapi.io/assets/strapi-logo-light.svg" width="318px" alt="Strapi logo" />
</a>
</p>
<h3 align="center">API creation made simple, secure and fast.</h3>
<p align="center">The most advanced open-source headless CMS to build powerful APIs with no effort.</p>
<p align="center"><a href="https://strapi.io/demo">Try live demo</a></p>
<h3 align="center">Open-source headless CMS, self-hosted or Cloud youre in control.</h3>
<p align="center">The leading open-source headless CMS, 100% JavaScript/TypeScript, flexible and fully customizable.</p>
<p align="center"><a href="https://cloud.strapi.io/signups?source=github1">Cloud</a> · <a href="https://strapi.io/demo">Try live demo</a></p>
<br />
<p align="center">
@ -39,18 +31,22 @@
<p align="center">
<a href="https://strapi.io">
<img src="https://raw.githubusercontent.com/strapi/strapi/0bcebf77b37182fe021cb59cc19be8f5db4a18ac/public/assets/administration_panel.png" alt="Administration panel" />
<img src="https://raw.githubusercontent.com/strapi/strapi/main/public/assets/admin-demo.gif" alt="Administration panel" />
</a>
</p>
<br>
Strapi is a free and open-source headless CMS delivering your content anywhere you need.
Strapi Community Edition is a free and open-source headless CMS enabling you to manage any content, anywhere.
- **Keep control over your data**. With Strapi, you know where your data is stored, and you keep full control at all times.
- **Self-hosted**. You can host and scale Strapi projects the way you want. You can choose any hosting platform you want: AWS, Render, Netlify, Heroku, a VPS, or a dedicated server. You can scale as you grow, 100% independent.
- **Database agnostic**. Strapi works with SQL databases. You can choose the database you prefer: PostgreSQL, MySQL, MariaDB, and SQLite.
- **Customizable**. You can quickly build your logic by fully customizing APIs, routes, or plugins to fit your needs perfectly.
- **Self-hosted or Cloud**: You can host and scale Strapi projects the way you want. You can save time by deploying to [Strapi Cloud](https://cloud.strapi.io/signups?source=github1) or deploy to the hosting platform you want\*\*: AWS, Azure, Google Cloud, DigitalOcean.
- **Modern Admin Pane**: Elegant, entirely customizable and a fully extensible admin panel.
- **Multi-database support**: You can choose the database you prefer: PostgreSQL, MySQL, MariaDB, and SQLite.
- **Customizable**: You can quickly build your logic by fully customizing APIs, routes, or plugins to fit your needs perfectly.
- **Blazing Fast and Robust**: Built on top of Node.js and TypeScript, Strapi delivers reliable and solid performance.
- **Front-end Agnostic**: Use any front-end framework (React, Next.js, Vue, Angular, etc.), mobile apps or even IoT.
- **Secure by default**: Reusable policies, CORS, CSP, P3P, Xframe, XSS, and more.
- **Powerful CLI**: Scaffold projects and APIs on the fly.
## Getting Started
@ -115,13 +111,13 @@ Strapi only supports maintenance and LTS versions of Node.js. Please refer to th
## Features
- **Modern Admin Panel:** Elegant, entirely customizable and a fully extensible admin panel.
- **Secure by default:** Reusable policies, CORS, CSP, P3P, Xframe, XSS, and more.
- **Plugins Oriented:** Install the auth system, content management, custom plugins, and more, in seconds.
- **Blazing Fast:** Built on top of Node.js, Strapi delivers amazing performance.
- **Front-end Agnostic:** Use any front-end framework (React, Vue, Angular, etc.), mobile apps or even IoT.
- **Powerful CLI:** Scaffold projects and APIs on the fly.
- **SQL databases:** Works with PostgreSQL, MySQL, MariaDB, and SQLite.
- **Content Types Builder**: Build the most flexible publishing experience for your content managers, by giving them the freedom to create any page on the go with [fields](https://docs.strapi.io/user-docs/content-manager/writing-content#filling-up-fields), components and [Dynamic Zones](https://docs.strapi.io/user-docs/content-manager/writing-content#dynamic-zones).
- **Media Library**: Upload your images, videos, audio or documents to the media library. Easily find the right asset, edit and reuse it.
- **Internationalization**: The Internationalization (i18n) plugin allows Strapi users to create, manage and distribute localized content in different languages, called "locales
- **Role Based Access Control**: Create an unlimited number of custom roles and permissions for admin and end users.
- **GraphQL or REST**: Consume the API using REST or GraphQL
You can unlock additional features such as SSO, Audit Logs, Review Workflows in [Strapi Cloud](https://cloud.strapi.io/login?source=github1) or [Strapi Enterprise](https://strapi.io/enterprise?source=github1).
**[See more on our website](https://strapi.io/overview)**.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 MiB