-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18586 from strapi/feature/content-releases
feat(content-releases): add content releases
- Loading branch information
Showing
99 changed files
with
6,250 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
title: Introduction | ||
tags: | ||
- content-releases | ||
--- | ||
|
||
# Content Releases | ||
|
||
A release contains various content entries, each capable of being assigned a specific action such as publish or unpublish. Within a release, entries may be in different locales or come from different content types. With a simple click of a button, a release can execute the designated action for each entry. Content Releases is an enterprise edition feature. | ||
|
||
### Architecture | ||
|
||
As opposed to other EE features built in the [EE folder](docs/docs/01-core/admin/01-ee/00-intro.md), Releases is built as a plugin. The plugin can be found in: | ||
|
||
``` | ||
packages/core/content-releases | ||
``` | ||
|
||
```mdx-code-block | ||
import DocCardList from '@theme/DocCardList'; | ||
import { useCurrentSidebarCategory } from '@docusaurus/theme-common'; | ||
<DocCardList items={useCurrentSidebarCategory().items} /> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
--- | ||
title: Backend Design | ||
description: Content Releases backend | ||
tags: | ||
- content-releases | ||
- tech design | ||
--- | ||
|
||
All backend code can be found in: | ||
|
||
``` | ||
packages/core/content-releases/server | ||
``` | ||
|
||
## Content-types | ||
|
||
The content-releases plugin creates two hidden content-types. | ||
|
||
### Release | ||
|
||
The `Release` content type stores all the information about a release and its associated Release Actions. It is saved in the database as `strapi_releases`. The schema can be found in: | ||
|
||
``` | ||
packages/core/content-releases/server/src/content-types/release/schema.ts | ||
``` | ||
|
||
### Release Action | ||
|
||
Th `Release Action` content type is associated with any entry from any content-type that has draft and publish enabled. It is responsible for storing the action to perform for an associated entry. It is saved in the database as `strapi_release_actions`. The schema can be found in: | ||
|
||
``` | ||
packages/core/content-releases/server/src/content-types/release-action/schema.ts | ||
``` | ||
|
||
## Routes | ||
|
||
Release and Release Action routes are only accessible on the Admin API. | ||
|
||
### Release | ||
|
||
Release routes can be found in: | ||
|
||
``` | ||
packages/core/content-releases/server/src/routes/release.ts | ||
``` | ||
|
||
**Get all releases**: | ||
|
||
- method: `GET` | ||
- endpoint: `/content-releases/` | ||
- params: | ||
```ts | ||
{ | ||
page: number; | ||
pageSize: number; | ||
} | ||
``` | ||
|
||
**Get a single release** | ||
|
||
- method: `GET` | ||
- endpoint: `/content-releases/:id` | ||
|
||
**Create a release**: | ||
|
||
- method: `POST` | ||
- endpoint: `/content-releases/` | ||
- body: | ||
```ts | ||
{ | ||
name: string; | ||
} | ||
``` | ||
|
||
**Update a release**: | ||
|
||
- method: `PUT` | ||
- endpoint: `/content-releases/:id` | ||
- body: | ||
```ts | ||
{ | ||
name: string; | ||
} | ||
``` | ||
|
||
**Publish a release**: | ||
|
||
- method: `POST` | ||
- endpoint: `/content-releases/:id/publish` | ||
|
||
### Release Action | ||
|
||
**Create a release action** | ||
|
||
- method: `POST` | ||
- endpoint: `/content-releases/:releaseId/actions` | ||
- body: | ||
|
||
```ts | ||
{ | ||
entry: { | ||
id: number, | ||
contentType: string | ||
} | ||
type: 'publish' | 'unpublish' | ||
} | ||
``` | ||
|
||
**Update a release action** | ||
|
||
- method: `PUT` | ||
- endpoint: `/content-releases/:releaseId/actions/:actionId` | ||
- body: | ||
```ts | ||
{ | ||
type: 'publish' | 'unpublish'; | ||
} | ||
``` | ||
|
||
**Delete a release action** | ||
|
||
- method: `DELETE` | ||
- endpoint: `/content-releases/:releaseId/actions/:actionId` | ||
|
||
## Controllers | ||
|
||
### Release | ||
|
||
Handles requests to interact with the Release content type | ||
|
||
``` | ||
packages/core/content-releases/server/src/controllers/release.ts | ||
``` | ||
|
||
### Release Action | ||
|
||
Handles requests to interact with the Release Action content type | ||
|
||
## Services | ||
|
||
### Release | ||
|
||
Interacts with the database for Release and Release Action CRUD operations | ||
|
||
``` | ||
packages/core/content-releases/server/src/services/release.ts | ||
``` | ||
|
||
### Release Validation | ||
|
||
Exposes validation functions to run before performing operations on a Release | ||
|
||
``` | ||
packages/core/content-releases/server/src/services/validation.ts | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"label": "Content Releases", | ||
"collapsible": true, | ||
"collapsed": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Future Flags | ||
--- | ||
|
||
In Strapi, we have incoming features that are not yet ready to be shipped to all users, but we aim to keep them updated with our codebase. Additionally, we want to offer community users the opportunity to provide early feedback on these new features or changes. | ||
|
||
To achieve this, we utilize future flags, which provide a way to enable unstable features **at your own risk**. Please considered that these flags may be subject to change, removal and it's possible that they contain breaking changes. | ||
|
||
Future flags can be used for unstable features that have not yet been shipped. So, if you decide to enable an unstable feature (prefixed with `unstable`), please be aware that this feature is likely to be modified or even removed. It's also highly probable that this unstable feature is not fully ready for use; some parts may still be under development or using mock data at the moment. | ||
|
||
Additionally, future flags can be utilized for enabling coming breaking changes in upcoming versions (when prefixed by `vX`, with 'X' being the target version). In this scenario, if you decide to enable a future flag for a breaking change, please consider that you will need to migrate your application to adapt to this breaking change. | ||
|
||
## How to enable a future flag. | ||
|
||
To enable a future flag, you should add it to your config/features.(js|ts) file in your Strapi application. If you don't have this file, create one. | ||
|
||
```ts | ||
// config/features.ts | ||
|
||
export default { | ||
future: { | ||
unstableFeatureName: true, | ||
v5breakingChange: env('STRAPI_FEATURES_FUTURE_V5BREAKINGCHANGE', false), | ||
}, | ||
}; | ||
``` | ||
|
||
## How to add and start using a future flag. | ||
|
||
Developers are responsible for adding new future flags if they intend to introduce a new unstable feature into the Strapi codebase. Features config is part of the config object and can be easily accessed with `strapi.config.get('features')`. | ||
|
||
We also provide an API in the strapi object that allows you to check if a future flag is enabled. You can do this using the following method: `strapi.future.isEnabled('featureName')`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = ({ env }) => ({}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export * from './components/DefaultDocument'; | ||
export * from './render'; | ||
|
||
export type { SanitizedAdminUser } from '../../shared/contracts/shared'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[{package.json,*.yml}] | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
Oops, something went wrong.