diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index fb746ff47e..0bf8a68390 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -151,8 +151,10 @@ module.exports = { collapsable: false, title: '🚀 Getting Started', children: [ - '/3.0.0-beta.x/getting-started/introduction', - '/3.0.0-beta.x/getting-started/install-requirements', + ['/3.0.0-beta.x/getting-started/introduction', 'Introduction'], + ['/3.0.0-beta.x/getting-started/installation', 'Installation'], + ['/3.0.0-beta.x/getting-started/contributing', 'Contributing'], + ['/3.0.0-beta.x/getting-started/troubleshooting', 'Troubleshooting'], '/3.0.0-beta.x/getting-started/quick-start', '/3.0.0-beta.x/getting-started/quick-start-tutorial', ], @@ -215,10 +217,7 @@ module.exports = { { collapsable: true, title: '⚙️️ Admin Panel', - children: [ - '/3.0.0-beta.x/admin-panel/customization', - '/3.0.0-beta.x/admin-panel/deploy', - ], + children: ['/3.0.0-beta.x/admin-panel/customization', '/3.0.0-beta.x/admin-panel/deploy'], }, { collapsable: true, @@ -258,10 +257,7 @@ module.exports = { collapsable: false, title: '📚 Resources', children: [ - [ - 'https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md', - 'Contributing guide', - ], + ['https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md', 'Contributing guide'], '/3.0.0-beta.x/migration-guide/', ], }, @@ -340,10 +336,7 @@ module.exports = { collapsable: false, title: '📚 Resources', children: [ - [ - 'https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md', - 'Contributing guide', - ], + ['https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md', 'Contributing guide'], '/3.0.0-alpha.x/migration-guide/', '/3.0.0-alpha.x/articles/', ], diff --git a/docs/.vuepress/theme/global-components/InstallLink.vue b/docs/.vuepress/theme/global-components/InstallLink.vue new file mode 100644 index 0000000000..460f2ed343 --- /dev/null +++ b/docs/.vuepress/theme/global-components/InstallLink.vue @@ -0,0 +1,55 @@ + + + + + + + \ No newline at end of file diff --git a/docs/3.0.0-beta.x/cli/CLI.md b/docs/3.0.0-beta.x/cli/CLI.md index 06317fdf80..1c99305728 100644 --- a/docs/3.0.0-beta.x/cli/CLI.md +++ b/docs/3.0.0-beta.x/cli/CLI.md @@ -74,9 +74,9 @@ options: [--no-optimization] ``` - **strapi build**
- Builds the administration panel without minimizing the assets + Builds the administration panel and minimizing the assets - **strapi build --no-optimization**
- Builds the administration panel without minizing the assets. The build duration is faster. + Builds the administration panel without minimizing the assets. The build duration is faster. ::: tip You can specify a NODE_ENV to use the configurations in the `./config/environments/[development|staging|production]` folder. diff --git a/docs/3.0.0-beta.x/concepts/services.md b/docs/3.0.0-beta.x/concepts/services.md index 19f9925519..459f4e8fcb 100644 --- a/docs/3.0.0-beta.x/concepts/services.md +++ b/docs/3.0.0-beta.x/concepts/services.md @@ -97,7 +97,9 @@ module.exports = { if (files) { // automatically uploads the files based on the entry and the model - await this.uploadFiles(entry, files, { model: strapi.models.restaurant }); + await strapi.entityService.uploadFiles(entry, files, { + model: strapi.models.restaurant, + }); return this.findOne({ id: entry.id }); } @@ -125,7 +127,9 @@ module.exports = { if (files) { // automatically uploads the files based on the entry and the model - await this.uploadFiles(entry, files, { model: strapi.models.restaurant }); + await strapi.entityService.uploadFiles(entry, files, { + model: strapi.models.restaurant, + }); return this.findOne({ id: entry.id }); } @@ -258,12 +262,7 @@ module.exports = { const user = await User.create(ctx.params); // Send an email to validate his subscriptions. - strapi.services.email.send( - 'welcome@mysite.com', - user.email, - 'Welcome', - '...' - ); + strapi.services.email.send('welcome@mysite.com', user.email, 'Welcome', '...'); // Send response to the server. ctx.send({ diff --git a/docs/3.0.0-beta.x/getting-started/contributing.md b/docs/3.0.0-beta.x/getting-started/contributing.md new file mode 100644 index 0000000000..fc819853a8 --- /dev/null +++ b/docs/3.0.0-beta.x/getting-started/contributing.md @@ -0,0 +1,21 @@ +# 🦸 Contributing + +Strapi is a community oriented project and we really appreciate every contribution made by the community: feature requests, bug reports, and especially pull requests! If you have any questions please reach out the [Core team](https://strapi.io/company) on [Slack](https://slack.strapi.io). + +## Repositories + +### [strapi/strapi](https://github.com/strapi/strapi) + +This repository contains the core of Strapi. It means the admin panel, core plugins (Content Manager, Content Type Buidler, etc...), the documentation and the code that runs your Strapi app. You will also find some plugin providers. This is the main repo of the Strapi organization. + +### [strapi/buffet](https://github.com/strapi/buffet) + +[Buffet](https://buffetjs.io) is the componenent library that is used in the admin panel. This brings consistency throughout the different admin plugins. + +### [strapi/strapi-docker](https://github.com/strapi/strapi-docker) + +This is the code used to generate the official Docker images for Strapi. These images are available through our [Docker Hub](https://hub.docker.com/r/strapi/strapi). + +## Contributing guide + +To contribute to the project please follow instructions present in the [`CONTRIBUTING.md`](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md) file on GitHub. diff --git a/docs/3.0.0-beta.x/getting-started/install-requirements.md b/docs/3.0.0-beta.x/getting-started/install-requirements.md deleted file mode 100644 index fcbbece2b5..0000000000 --- a/docs/3.0.0-beta.x/getting-started/install-requirements.md +++ /dev/null @@ -1,28 +0,0 @@ -# Installation requirements - -## Node.js - -Strapi only requires [Node.js](https://nodejs.org). The current recommended version to run strapi is `Node v10` (current `LTS`). - -This is all that is needed before Strapi can run on your local environment. - -You can also use **yarn** if you want, [here](https://yarnpkg.com/en/docs/getting-started) are the instructions to get started with it. - -- **Node.js** >= 10.x -- **NPM** >= 6.x - -## Databases - -Strapi is supporting multiple databases. If you are using the `--quickstart` or if you manually choose the `SQLite` database, you will not need to install any database on you local computer. - -If you want to use a custom database, here are the versions you will have to respect: - -- **MongoDB** >= 3.6 -- **MySQL** >= 5.6 -- **MariaDB** >= 10.1 -- **PostgreSQL** >= 10 -- **SQLite** >= 3 - -::: tip NEXT STEPS -👏 Congrats, you are all set! Now that Node.js is installed you can continue with the [Quick start guide](quick-start.md). -::: diff --git a/docs/3.0.0-beta.x/getting-started/installation.md b/docs/3.0.0-beta.x/getting-started/installation.md new file mode 100644 index 0000000000..b0628a3087 --- /dev/null +++ b/docs/3.0.0-beta.x/getting-started/installation.md @@ -0,0 +1,39 @@ +# ⚙️ Installation + +### Installation guides + +
+ + + + + +
+ +
+ + + + + +
+ +
+ + + + + +
diff --git a/docs/3.0.0-beta.x/getting-started/introduction.md b/docs/3.0.0-beta.x/getting-started/introduction.md index d66f990c1e..87ba6bcc35 100644 --- a/docs/3.0.0-beta.x/getting-started/introduction.md +++ b/docs/3.0.0-beta.x/getting-started/introduction.md @@ -1,18 +1,80 @@ -# Introduction +# 🚀 Welcome to the Strapi documentation! -Welcome to the open source [headless CMS](https://strapi.io) developers love. +**Strapi is the open source [headless CMS](https://strapi.io) developers love.** -## Strapi Documentation +## What is Strapi? -### 👋 Welcome onboard! +Strapi, the most flexible open-source Headless CMS gives developers the freedom to use their favorite tools and frameworks while helping editors to easily manage their content and distribute anywhere. By making the admin panel and API easily customizable and extensible through a plugin system, Strapi enables the world’s largest companies to accelerate content delivery while building better digital experiences. -Users love Strapi because it is open source, MIT licensed, fully customizable and based on Node.js. Strapi lets you manage your content and distribute it anywhere. Strapi allows you to securely and privately serve your database from your hosting and server of choice. +::: tip Where the name come from? +**Strapi** come from Boot**strap** your **API** 🎉
+It's the origin purpose of the project. +::: -### Get Started +## Features -You are invited to get started using Strapi. You may explore Strapi by: +### Custom content structure -1. A [Quick Start Guide](quick-start.md) for more intermediate to advanced developers. -2. A [Tutorial](quick-start-tutorial.md) for those who prefer a step-by-step introduction. +With the admin panel of Strapi, You can generate the admin panel in just a few clicks, and get your whole CMS setup in a few minutes. -When you're done getting started, we invite you to join our [community](https://strapi.io/community). +### Manage content + +The Strapi's admin panel gives you an intuitive interface to create edit and delete your content. + +### Developer-friendly API + +Your content have to be displayed on your devices, an API is required. Strapi provide you an API that match your need. Fetch the data you want via a REST API or via the GraphQL endpoint. + +### Roles & permissions + +A User system is built in Strapi, that let you manage how can access to what. + +### Plugin system + +You want a new feature in you application, fetch a plugin in the market place and tada! You can install a GraphQL endpoint in one command. + +### Customization + +You can customize every single pice of your application. The architecture of Strapi let you customize your app to match your exact needs. + +Don't stay stuck by the techno you choose. + +## The Strapi Ecosystem + +### Code Source + +Strapi is an Open Source project, all the source code is under the MIT licence. The core project is in the [strapi/strapi](https://github.com/strapi/strapi) GitHub repository and you will find all other tools into the [Strapi](https://github.com/strapi) GitHub organization. + +### Marketplace + +In the marketplace section of the admin panel, you will only found official Strapi plugins. For now, the Strapi marketplace is not open to everyone but will be soon, stay tuned. + +But you already can develop yours and publish them on npm. + +### Roadmap + +Strapi is a community oriented project. We are trying to be the more transparent as possible to let you have a vision on the future of the project. +Your insights are really important too to help to develop the project in the right direction. +The [Roadmap](https://portal.productboard.com/strapi) is open, feel free to add your insights. + +### Tutorials and Guides + +To help you using Strapi, we and the community provide you a suite of resources to let you achieve your goals. +You will find [tutorials](https://strapi.io/tutorials/) on the website and guides into the documentation. + +### Demo + +You can discover Strapi in few minutes by watching the demo video or by requesting a live demo via the form present in the [Demo](https://strapi.io/demo) page. + +### Blog + +For long-form news and announcements the best place to keep up to date with everything happening is our [blog](https://strapi.io/blog). + +### Social media + +We maintain a handful of social media accounts to keep in touch with the community directly and give them updates about what's new with Strapi. Here are the easiest ways to keep track of Strapi and everything hapening around the web: + +- ⭐️ [GitHub](https://github.com/strapi/strapi) +- 🐧 [Twitter](https://twitter.com/strapijs) +- 👩🏻‍💻 [Facebook](https://www.facebook.com/strapijs/) +- 📸 [Instagram](https://www.instagram.com/strapijs/) diff --git a/docs/3.0.0-beta.x/getting-started/troubleshooting.md b/docs/3.0.0-beta.x/getting-started/troubleshooting.md new file mode 100644 index 0000000000..2b3bfd5494 --- /dev/null +++ b/docs/3.0.0-beta.x/getting-started/troubleshooting.md @@ -0,0 +1,78 @@ +# 💬 Troubleshooting + +Below are solutions to some common issues that you may experience when working with Strapi. You can also post questions to [StackOverflow](https://stackoverflow.com/questions/tagged/strapi) or reach out to the members of our [Slack](https://slack.strapi.io) community! + +[[toc]] + +## Technical Support + +Strapi is offered as free and open-source for users who wish to self-host the software. + +### Community Support + +[StackOverflow](https://stackoverflow.com/search?q=strapi) is great first place to reach out for help. Our community and Core developers often check this platform and answer posts tagged with `strapi`. + +Another option to get help is our [Community Slack](https://slack.strapi.io). Please keep all questions on the `#help` channel, be considerate, and remember that _you are getting free help for a free product_. + +### Enterprise support + +Looking for enterprise support? + +Fill out the form on the [Support page](https://strapi.io/support) of the Strapi website. + +## Frequently Asked Questions + +### Does Strapi handle deploying or migrating of content? + +Strapi does not currently provide any tools for migrating or deploying your data changes between different environments (_ie. from development to production_). + +### User can't login to the admin panel + +With the release of the Strapi beta version a fundamental change occurred in that the "end-users" (REST and GraphQL users) were split from the Administrators (admin panel users) in such a way that normal users can not be given access to the admin panel. If you would like to read more on why this change was done, you can read the Strapi [blog post](https://strapi.io/blog/why-we-split-the-management-of-the-admin-users-and-end-users) about it. + +In the future Strapi does plan to implement a solution where Administrators could use the REST and GraphQL routes like a standard 3rd party provider, but there is no intention of allowing for the reverse. Instead within Q1/Q2 2020 we plan to offer a plugin called [Administrators Roles & Permissions](https://portal.productboard.com/strapi/1-public-roadmap/c/8-administrators-roles-permissions) that will allow you to control access to Administrators within the admin panel. As of right now there is no work around to currently do this, anyone with access to the admin panel will have full access to all parts of it. + +When this new plugin release, there will be two versions: + +- Community Edition +- Enterprise Edition + +By default, the Community Edition will include 3 administrators and 3 pre-defined roles (Administrators, Editor, Author). Upgrading to the Enterprise Edition will unlock an unlimited number of administrators and roles. + +### Relations aren't maintaining their sort order + +With the components there is a hidden field called `order` that allows entries to maintain their sort, however with relations there is no such field. If you consider the typical count of of component entries vs relational based entries (in retrospect they function in the backend the same) there is generally a much higher number of relations. If relations were to have an `order` field applied to them as well it could cause significant performance degradation when trying to update the order, and likewise in the case where a relation could be attached to multiple entries it would be quite difficult to maintain the order. + +For the time being there is no recommended way to handle this automatically and instead it may be required for you to create custom controllers to handle this within your own project. + +### Why is my app's database and uploads resetting on Heroku + +If you used `--quickstart` to create your Strapi project, by default this uses the SQLite database. Heroku's file system is [ephemeral](https://devcenter.heroku.com/articles/dynos#ephemeral-filesystem) meaning that each time a dyno (container) is reset all filesystem changes are lost. And since both SQLite and local uploads are stored on the filesystem, any changes made to these since the last dyno reset will be deleted. Typically dynos are reset at least once a day, and in most cases multiple times per day or when new code is pushed to Heroku. + +It is recommended you use the Heroku PostgreSQL plugin or use something like MongoDB's Atlas for your database. For file uploads, you will need to use one of the 3rd party providers such as Cloudinary or AWS S3. + +### How do I customize a plugin + +Strapi uses a system called [extensions](../concepts/customization.md#plugin-extensions) as plugins are stored in the `node_modules` folder. Due to this extensions work by Strapi detecting newer versions of files and using that as a replacement for the ones stored within the `node_modules`. If you are familiar with React and "ejecting" a file, the concept is similar. + +You gain the ability to modify these files without forking the plugin package, however you lose the ability to easily update. After each version release you will need to compare your changes to those in the new version and modify your version of the files accordingly. + +### Can I add my own 3rd party auth provider + +Yes you can either follow the following [guide](../plugins/users-permissions.md#adding-a-new-provider-to-your-project) or you can take a look at the [users-permissions](https://github.com/strapi/strapi/tree/master/packages/strapi-plugin-users-permissions) and submit a pull request to include the provider for everyone. Eventually Strapi does plan to move from the current grant/purest provider to a split natured system similar to the upload providers. + +There is currently no ETA on this migration however. + +### How do I setup SSL with Strapi + +Strapi implements no SSL solution natively, this is due to the fact that it is extremely insecure to directly offer a Node.js application to the public web on a low port. + +On Linux based operating systems you need root permissions to bind to any port below 1024 and with typical SSL being port 443 you would need to run your application as root. + +Likewise since Strapi is Node.js based, in order for changes with the SSL certificate to take place (say when it expires) you would need to restart your application for that change to take effect. + +Due to these two issues, it is recommended you use a proxy application such as Nginx, Apache, Traefik, or many others to handle your edge routing to Strapi. There are settings in the environment [server.json](../concepts/configurations.md#server) to handle upstream proxies. The proxy block requires all settings to be filled out and will modify any backend plugins such as authentication providers and the upload plugin to replace your standard `localhost:1337` with the proxy URL. + +### Is X feature available yet + +You can see the [ProductBoard roadmap](https://portal.productboard.com/strapi) to see which feature requests are currently being worked on and which have not been started yet. diff --git a/docs/3.0.0-beta.x/guides/custom-data-response.md b/docs/3.0.0-beta.x/guides/custom-data-response.md index 92c780e365..d1049d5309 100644 --- a/docs/3.0.0-beta.x/guides/custom-data-response.md +++ b/docs/3.0.0-beta.x/guides/custom-data-response.md @@ -6,9 +6,9 @@ In this guide we will see how you can customize your API's response.. To be able to update the default data response you have first to understand how it works. -When you create a content type, it generates an API with the following list of [endpoints](../content-api/endpoint). +When you create a content type, it generates an API with the following list of [endpoints](../content-api/api-endpoints.md). -Each of these endpoint triggers a controller action. Here is the list of [controller actions](../concepts/controller.md) that exist by default when a content type is created. +Each of these endpoint triggers a controller action. Here is the list of [controller actions](../concepts/controllers.md) that exist by default when a content type is created. If you check the controller file of your generated API `./api/{content-type}/controller/{Content-Type}.js`, you will see an empty file. It is because all the default logic is managed by Strapi. But you can override these actions with your own code. @@ -68,9 +68,7 @@ module.exports = { entities = await strapi.services.restaurant.find(ctx.query); } - return entities.map(entity => - sanitizeEntity(entity, { model: strapi.models.restaurant }) - ); + return entities.map(entity => sanitizeEntity(entity, { model: strapi.models.restaurant })); }, }; ``` diff --git a/docs/3.0.0-beta.x/installation/cli.md b/docs/3.0.0-beta.x/installation/cli.md new file mode 100644 index 0000000000..586b5d0ef1 --- /dev/null +++ b/docs/3.0.0-beta.x/installation/cli.md @@ -0,0 +1,92 @@ +# Installing from CLI + +Fast-track local install for getting Strapi running on your computer. + +[[toc]] + +## Step 1: Make sure requirements are met + +#### Node.js + +Strapi only requires [Node.js](https://nodejs.org). The current recommended version to run strapi is Node v12 (current LTS). + +This is everything you need to run Strapi on your local environment. + +| Software | Minimum version | +| -------- | --------------- | +| Node.js | 12.x | +| npm | 6.x | + +#### Yarn (optional) + +You can also use **yarn** if you want [here](https://yarnpkg.com/en/docs/getting-started) are the instructions to get started with it. + +#### Databases + +Strapi currently support the following databases. + +| Database | Minimum version | +| ---------- | --------------- | +| SQLite | 3 | +| PostgreSQL | 10 | +| MySQL | 5.6 | +| MariaDB | 10.1 | +| MongoDB | 3.6 | + +## Step 2: Create a new project + +:::: tabs + +::: tab yarn + +```bash +yarn create strapi-app my-project --quickstart +``` + +::: + +::: tab npx + +```bash +npx create-strapi-app my-project --quickstart +``` + +::: + +:::: + +::: tip +If you want to use specific database, you don't have to use the `--quickstart` flag. The CLI will let you choose the database of your choice. +::: + +::: warning +If you use a custom database, this one has to be up and running before creating your Strapi project +::: + +## Step 3: Start the project + +To start your Strapi application you will have to run the following command in your application folder. + +:::: tabs + +::: tab yarn + +```bash +yarn develop +``` + +::: + +::: tab npm + +```bash +npm run develop +``` + +::: + +:::: + +::: tip +If you created your application using `--quickstart` flag, it will automatically run your application. +::: diff --git a/docs/3.0.0-beta.x/installation/docker.md b/docs/3.0.0-beta.x/installation/docker.md new file mode 100644 index 0000000000..dcae25eda3 --- /dev/null +++ b/docs/3.0.0-beta.x/installation/docker.md @@ -0,0 +1,111 @@ +# Installing using Docker + +If you're already familiar with Docker, you are probably looking for our official Docker images over [Docker Hub](https://hub.docker.com/r/strapi/strapi). + +[[toc]] + +## Step 1: Create a `docker-compose.yaml` file + +Create this `docker-compose.yaml` file in an empty folder.
+A fresh new Strapi application will be created where the `docker-compose.yaml` file is located. + +This docker-compose defines our database and Strapi service and links them. + +:::: tabs + +::: tab SQLite + +```yaml +version: '3' +services: + strapi: + image: strapi/strapi + volumes: + - ./:/srv/app + ports: + - '1337:1337' +``` + +::: + +::: tab Postgres + +```yaml +version: '3' +services: + strapi: + image: strapi/strapi + environment: + DATABASE_CLIENT: postgres + DATABASE_NAME: strapi + DATABASE_HOST: postgres + DATABASE_PORT: 5432 + DATABASE_USERNAME: strapi + DATABASE_PASSWORD: strapi + links: + - postgres:postgres + volumes: + - ./app:/srv/app + ports: + - '1337:1337' + + postgres: + image: postgres + environment: + POSTGRES_USER: strapi + POSTGRES_PASSWORD: strapi + volumes: + - ./data:/data/postgres + ports: + - '5432:5432' +``` + +::: + +::: tab MongoDB + +```yaml +version: '3' +services: + strapi: + image: strapi/strapi + environment: + DATABASE_CLIENT: mongo + DATABASE_NAME: strapi + DATABASE_HOST: mongo + DATABASE_PORT: 27017 + DATABASE_USERNAME: strapi + DATABASE_PASSWORD: strapi + links: + - mongo:mongo + volumes: + - ./app:/srv/app + ports: + - '1337:1337' + + mongo: + image: postgres + environment: + MONGO_INITDB_ROOT_USERNAME: strapi + MONGO_INITDB_ROOT_PASSWORD: strapi + volumes: + - ./data/db:/data/db + ports: + - '27017:27017' +``` + +::: + +:::: + +## Step 2: Pull the latest images + +``` +docker-compose pull +``` + +## Step 3: Run the stack + +``` +docker-compose up -d +``` diff --git a/docs/3.0.0-beta.x/installation/platformsh.md b/docs/3.0.0-beta.x/installation/platformsh.md new file mode 100644 index 0000000000..a2abe717b4 --- /dev/null +++ b/docs/3.0.0-beta.x/installation/platformsh.md @@ -0,0 +1,45 @@ +# Installing using Platform.sh + +[Plateform.sh](https://console.platform.sh/) gives you an easy way to get started and deploy your Strapi application. + +You can find the template [source code](https://github.com/platformsh-templates/strapi#customizations) on Platform.sh GitHub for more information. + +[[toc]] + +## Step 1: Create a Platform.sh account + +You must have a [Plateform.sh](https://platform.sh/) account before doing these steps. + +## Step 2: Create a project + +You can use the **One-Click** button or follow these steps. + + + Deploy on Platform.sh + + +- Click on `+ Add project` button +- Select `Use a template` option and click `Next` +- Fill your `Project name` and `Region` then click `Next` + +**Choose Strapi template.** + +Search for the Strapi template using the search bar. + +- Click on the search bar +- Fill `strapi` +- Select the Strapi template +- Click `Next` + +::: tip INFO +After few second a Strapi application will be setup with a Postgres database. +::: + +## Step 4: Visit your app + +Now to visit your application. + +- Click on `Settings` +- Then `Domains` in the left menu + +You will see the Platform.sh domain name that is used for your app. diff --git a/docs/3.0.0-beta.x/plugins/users-permissions.md b/docs/3.0.0-beta.x/plugins/users-permissions.md index d2cbae1d53..2249e69ec6 100644 --- a/docs/3.0.0-beta.x/plugins/users-permissions.md +++ b/docs/3.0.0-beta.x/plugins/users-permissions.md @@ -132,7 +132,7 @@ axios }); ``` -#### Providers +### Providers Thanks to [Grant](https://github.com/simov/grant) and [Purest](https://github.com/simov/purest), you can easily use OAuth and OAuth2 providers to enable authentication in your application. @@ -144,7 +144,7 @@ In the following examples, the client app will be the [react login examples app] ::: tab GitHub -### Setup the server +#### Setup the server Use `ngrok` to serve the frontend app. @@ -152,7 +152,7 @@ Use `ngrok` to serve the frontend app. ngrok http 3000 ``` -### Github configuration +#### Github configuration - Visit the OAuth Apps list page
[https://github.com/settings/developers](https://github.com/settings/developers) - Click on **New OAuth App** button @@ -164,7 +164,7 @@ Then fill the informations: - **Application description**: Strapi provider auth description - **Authorization callback URL**: `https://65e60559.ngrok.io/connect/github` -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **GitHub** provider @@ -180,7 +180,7 @@ Then fill the informations: ::: tab Facebook -### Setup the server +#### Setup the server Use `ngrok` to serve the server app. @@ -188,7 +188,7 @@ Use `ngrok` to serve the server app. ngrok http 1337 ``` -### Facebook configuration +#### Facebook configuration - Visit the Developer Apps list page
[https://developers.facebook.com/apps/](https://developers.facebook.com/apps/) - Click on **Add a New App** button @@ -205,7 +205,7 @@ To access the Application ID and secret: - Click on **Settings** in the left menu - Then on **Basic** link -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **Facebook** provider @@ -221,7 +221,7 @@ Then fill the informations: ::: tab Google -### Google configuration +#### Google configuration - Visit the Google Developer Console
[https://console.developers.google.com/](https://console.developers.google.com/) - Click on the **Select a project** dropdown in the top menu @@ -248,7 +248,7 @@ To access the Client ID and secret: - Click on **OAuth 2.0 Client IDs** name of the client you just created -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **Google** provider @@ -264,7 +264,7 @@ Then fill the informations: ::: tab Twitter -### Setup the server +#### Setup the server Use `ngrok` to serve the frontend app. @@ -272,7 +272,7 @@ Use `ngrok` to serve the frontend app. ngrok http 3000 ``` -### Twitter configuration +#### Twitter configuration - Visit the Apps list page
[https://developer.twitter.com/en/apps](https://developer.twitter.com/en/apps) - Click on **Create an app** button @@ -289,7 +289,7 @@ To access the Consumer API keys: - Click on **Keys and tokens** tab -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **Twitter** provider @@ -305,7 +305,7 @@ Then fill the informations: ::: tab Discord -### Discord configuration +#### Discord configuration - Visit the Apps list page on the developer portal
[https://discordapp.com/developers/applications/](https://discordapp.com/developers/applications/) - Click on **New application** button @@ -318,7 +318,7 @@ To access the Consumer API keys: - Click on **General information** in the left menu -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **Discord** provider @@ -334,7 +334,7 @@ Then fill the informations: ::: tab Twitch -### Twitch configuration +#### Twitch configuration - Visit the Apps list page on the developer console
[https://dev.twitch.tv/console/apps](https://dev.twitch.tv/console/apps) - Click on **Register Your Application** button @@ -350,7 +350,7 @@ To access the Consumer API keys: - Click on **Manage** button of your new app - Then generate a new **Client Secret** with the **New Secret** button -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **Twitch** provider @@ -366,7 +366,7 @@ Then fill the informations: ::: tab Instagram -### Setup the server +#### Setup the server Use `ngrok` to serve the server app. @@ -374,7 +374,7 @@ Use `ngrok` to serve the server app. ngrok http 1337 ``` -### Facebook configuration +#### Facebook configuration - Visit the Developer Apps list page
[https://developers.facebook.com/apps/](https://developers.facebook.com/apps/) - Click on **Add a New App** button @@ -393,7 +393,7 @@ On the **App Review for Instagram Basic Display** click on **Add to submition** Make sure your Application information are well completed. -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **Instagram** provider @@ -409,7 +409,7 @@ Then fill the informations: ::: tab VK -### VK configuration +#### VK configuration - Visit the Apps list page
[https://vk.com/apps?act=manage](https://vk.com/apps?act=manage) - Click on **Create app** button @@ -430,7 +430,7 @@ Then fill the informations: - **Authorized redirect UR**: `http://localhost:1337/connect/vk/callback` -### Strapi configuration +#### Strapi configuration - Visit the User Permissions provider settings page
[http://localhost:1337/admin/plugins/users-permissions/providers](http://localhost:1337/admin/plugins/users-permissions/providers) - Click on the **VK** provider @@ -573,17 +573,19 @@ create: async ctx => { }; ``` -## Adding a new provider (to the strapi project) +## Adding a new provider (to your project) To add a new provider on Strapi, you will need to perform changes onto the following files: ``` -packages/strapi-plugin-users-permissions/services/Providers.js -packages/strapi-plugin-users-permissions/config/functions/bootstrap.js -packages/strapi-plugin-users-permissions/admin/src/components/PopUpForm/index.js -packages/strapi-plugin-users-permissions/admin/src/translations/en.json +extensions/users-permissions/services/Providers.js +extensions/users-permissions/config/functions/bootstrap.js +extensions/users-permissions/admin/src/components/PopUpForm/index.js +extensions/users-permissions/admin/src/translations/en.json ``` +If these files don't exist you will need to copy from your `node_modules` or the Strapi mono-repo. You can see the [plugin extensions](../concepts/customization.md#plugin-extensions) for more information as to how this works + We will go step by step. ### Configure your Provider Request diff --git a/docs/package.json b/docs/package.json index f3aacd8b54..8c6c69a3a4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,6 +1,6 @@ { "name": "docs", - "version": "1.0.0", + "version": "2.0.0", "main": "index.js", "scripts": { "dev": "vuepress dev", diff --git a/examples/getstarted/api/homepage/models/homepage.settings.json b/examples/getstarted/api/homepage/models/homepage.settings.json index a83cbe8a08..9f2e0ab7c2 100644 --- a/examples/getstarted/api/homepage/models/homepage.settings.json +++ b/examples/getstarted/api/homepage/models/homepage.settings.json @@ -12,6 +12,10 @@ "attributes": { "title": { "type": "string" + }, + "slug": { + "type": "uid", + "targetField": "title" } } } diff --git a/examples/getstarted/package.json b/examples/getstarted/package.json index b8f0c74f83..a71e644aac 100644 --- a/examples/getstarted/package.json +++ b/examples/getstarted/package.json @@ -1,7 +1,7 @@ { "name": "getstarted", "private": true, - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "A Strapi application.", "scripts": { "develop": "strapi develop", @@ -15,23 +15,21 @@ "mysql": "^2.17.1", "pg": "^7.10.0", "sqlite3": "^4.0.6", - "strapi": "3.0.0-beta.18.7", - "strapi-admin": "3.0.0-beta.18.7", - "strapi-connector-bookshelf": "3.0.0-beta.18.7", - "strapi-connector-mongoose": "3.0.0-beta.18.7", - "strapi-middleware-views": "3.0.0-beta.18.7", - "strapi-plugin-content-manager": "3.0.0-beta.18.7", - "strapi-plugin-content-type-builder": "3.0.0-beta.18.7", - "strapi-plugin-documentation": "3.0.0-beta.18.7", - "strapi-plugin-email": "3.0.0-beta.18.7", - "strapi-plugin-graphql": "3.0.0-beta.18.7", - "strapi-plugin-upload": "3.0.0-beta.18.7", - "strapi-plugin-users-permissions": "3.0.0-beta.18.7", - "strapi-provider-email-mailgun": "3.0.0-beta.18.7", - "strapi-provider-upload-aws-s3": "3.0.0-beta.18.7", - "strapi-provider-upload-cloudinary": "3.0.0-beta.18.7", - "strapi-provider-upload-rackspace": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7" + "strapi": "3.0.0-beta.19", + "strapi-admin": "3.0.0-beta.19", + "strapi-connector-bookshelf": "3.0.0-beta.19", + "strapi-connector-mongoose": "3.0.0-beta.19", + "strapi-middleware-views": "3.0.0-beta.19", + "strapi-plugin-content-manager": "3.0.0-beta.19", + "strapi-plugin-content-type-builder": "3.0.0-beta.19", + "strapi-plugin-documentation": "3.0.0-beta.19", + "strapi-plugin-email": "3.0.0-beta.19", + "strapi-plugin-graphql": "3.0.0-beta.19", + "strapi-plugin-upload": "3.0.0-beta.19", + "strapi-plugin-users-permissions": "3.0.0-beta.19", + "strapi-provider-email-mailgun": "3.0.0-beta.19", + "strapi-provider-upload-aws-s3": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19" }, "strapi": { "uuid": "getstarted" diff --git a/lerna.json b/lerna.json index dc3ae8901d..dffe0d7516 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "packages": [ "packages/*", "examples/*" diff --git a/packages/create-strapi-app/package.json b/packages/create-strapi-app/package.json index e51184b99f..1bc9e00e68 100644 --- a/packages/create-strapi-app/package.json +++ b/packages/create-strapi-app/package.json @@ -1,6 +1,6 @@ { "name": "create-strapi-app", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate a new Strapi application.", "license": "MIT", "homepage": "http://strapi.io", @@ -21,7 +21,7 @@ ], "dependencies": { "commander": "^2.20.0", - "strapi-generate-new": "3.0.0-beta.18.7" + "strapi-generate-new": "3.0.0-beta.19" }, "scripts": { "test": "echo \"no tests yet\"" diff --git a/packages/strapi-admin/admin/src/containers/InstalledPluginsPage/CustomRow.js b/packages/strapi-admin/admin/src/containers/InstalledPluginsPage/CustomRow.js new file mode 100644 index 0000000000..b93ba312fb --- /dev/null +++ b/packages/strapi-admin/admin/src/containers/InstalledPluginsPage/CustomRow.js @@ -0,0 +1,19 @@ +import styled from 'styled-components'; +import { CustomRow as Base } from '@buffetjs/styles'; + +const CustomRow = styled(Base)` + &:before { + content: '-'; + display: inline-block; + line-height: 1.1em; + color: transparent; + background-color: transparent; + position: absolute; + left: 30px !important; + width: calc(100% - 60px) !important; + height: 1px; + margin-top: -1px; + } +`; + +export default CustomRow; diff --git a/packages/strapi-admin/admin/src/containers/InstalledPluginsPage/Row.js b/packages/strapi-admin/admin/src/containers/InstalledPluginsPage/Row.js index b16cb990de..078445f851 100644 --- a/packages/strapi-admin/admin/src/containers/InstalledPluginsPage/Row.js +++ b/packages/strapi-admin/admin/src/containers/InstalledPluginsPage/Row.js @@ -1,12 +1,12 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { IconLinks } from '@buffetjs/core'; -import { CustomRow } from '@buffetjs/styles'; import { useGlobalContext, PopUpWarning } from 'strapi-helper-plugin'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { useHistory } from 'react-router-dom'; import { faTrash, faCog } from '@fortawesome/free-solid-svg-icons'; import Text from '../../components/Text'; +import CustomRow from './CustomRow'; import LogoContainer from './Logo'; // TODO: remove the upload plugin when the media lib feature is merged. @@ -47,7 +47,7 @@ const Row = ({ logo, name, description, isRequired, id, icon, onConfirm }) => { return ( - + {logo && icon} {!logo && ( diff --git a/packages/strapi-admin/package.json b/packages/strapi-admin/package.json index 4c2ecc6a1c..ed5ad6e7bf 100644 --- a/packages/strapi-admin/package.json +++ b/packages/strapi-admin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-admin", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Strapi Admin", "repository": { "type": "git", @@ -85,8 +85,8 @@ "reselect": "^3.0.1", "sanitize.css": "^4.1.0", "shelljs": "^0.7.8", - "strapi-helper-plugin": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7", + "strapi-helper-plugin": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19", "style-loader": "^0.23.1", "styled-components": "^5.0.0", "terser-webpack-plugin": "^1.2.3", diff --git a/packages/strapi-connector-bookshelf/lib/buildDatabaseSchema.js b/packages/strapi-connector-bookshelf/lib/buildDatabaseSchema.js index b703d6db4a..2e6e2d56a8 100644 --- a/packages/strapi-connector-bookshelf/lib/buildDatabaseSchema.js +++ b/packages/strapi-connector-bookshelf/lib/buildDatabaseSchema.js @@ -64,7 +64,6 @@ module.exports = async ({ ORM, loadedModel, definition, connection, model }) => case 'json': return definition.client === 'pg' ? table.jsonb(name) : table.text(name, 'longtext'); case 'enumeration': - return table.enu(name, attribute.enum || []); case 'string': case 'password': case 'email': diff --git a/packages/strapi-connector-bookshelf/package.json b/packages/strapi-connector-bookshelf/package.json index 71e6d7424a..ca8051190d 100644 --- a/packages/strapi-connector-bookshelf/package.json +++ b/packages/strapi-connector-bookshelf/package.json @@ -1,6 +1,6 @@ { "name": "strapi-connector-bookshelf", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Bookshelf hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -22,7 +22,7 @@ "lodash": "^4.17.11", "pluralize": "^7.0.0", "rimraf": "3.0.0", - "strapi-utils": "3.0.0-beta.18.7" + "strapi-utils": "3.0.0-beta.19" }, "peerDependencies": { "knex": "^0.20.0" diff --git a/packages/strapi-connector-mongoose/package.json b/packages/strapi-connector-mongoose/package.json index 7ebd636328..0fd10b4ed9 100644 --- a/packages/strapi-connector-mongoose/package.json +++ b/packages/strapi-connector-mongoose/package.json @@ -1,6 +1,6 @@ { "name": "strapi-connector-mongoose", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Mongoose hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -20,7 +20,7 @@ "mongoose-float": "^1.0.4", "mongoose-long": "^0.2.1", "pluralize": "^7.0.0", - "strapi-utils": "3.0.0-beta.18.7" + "strapi-utils": "3.0.0-beta.19" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-database/package.json b/packages/strapi-database/package.json index 49bd58ed0c..0cf3574dcb 100644 --- a/packages/strapi-database/package.json +++ b/packages/strapi-database/package.json @@ -1,6 +1,6 @@ { "name": "strapi-database", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Strapi's database layer", "homepage": "http://strapi.io", "main": "./lib/index.js", diff --git a/packages/strapi-generate-api/package.json b/packages/strapi-generate-api/package.json index e1289b3724..d496792354 100644 --- a/packages/strapi-generate-api/package.json +++ b/packages/strapi-generate-api/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-api", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate an API for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-controller/package.json b/packages/strapi-generate-controller/package.json index 87f1f3b783..5db38f41e3 100644 --- a/packages/strapi-generate-controller/package.json +++ b/packages/strapi-generate-controller/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-controller", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate a controller for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-model/package.json b/packages/strapi-generate-model/package.json index fc4cfab23e..5857f00459 100644 --- a/packages/strapi-generate-model/package.json +++ b/packages/strapi-generate-model/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-model", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate a model for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-new/package.json b/packages/strapi-generate-new/package.json index 55ebd4c1a8..d1aee79a68 100644 --- a/packages/strapi-generate-new/package.json +++ b/packages/strapi-generate-new/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-new", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate a new Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-plugin/package.json b/packages/strapi-generate-plugin/package.json index 9be2296553..efb3613e36 100644 --- a/packages/strapi-generate-plugin/package.json +++ b/packages/strapi-generate-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-plugin", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate an plugin for a Strapi application.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-policy/package.json b/packages/strapi-generate-policy/package.json index 4bfdf61e79..7da0485834 100644 --- a/packages/strapi-generate-policy/package.json +++ b/packages/strapi-generate-policy/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-policy", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate a policy for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate-service/package.json b/packages/strapi-generate-service/package.json index f0813a205d..2e695b0bc0 100644 --- a/packages/strapi-generate-service/package.json +++ b/packages/strapi-generate-service/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate-service", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Generate a service for a Strapi API.", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-generate/package.json b/packages/strapi-generate/package.json index 3852bb1142..d262e3d40f 100644 --- a/packages/strapi-generate/package.json +++ b/packages/strapi-generate/package.json @@ -1,6 +1,6 @@ { "name": "strapi-generate", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Master of ceremonies for the Strapi generators.", "homepage": "http://strapi.io", "keywords": [ @@ -20,7 +20,7 @@ "fs-extra": "^8.0.1", "lodash": "^4.17.11", "reportback": "^2.0.2", - "strapi-utils": "3.0.0-beta.18.7" + "strapi-utils": "3.0.0-beta.19" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-helper-plugin/package.json b/packages/strapi-helper-plugin/package.json index bc6c49dcd6..3884fc67dc 100644 --- a/packages/strapi-helper-plugin/package.json +++ b/packages/strapi-helper-plugin/package.json @@ -1,6 +1,6 @@ { "name": "strapi-helper-plugin", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Helper for Strapi plugins development", "files": [ "dist" diff --git a/packages/strapi-hook-ejs/package.json b/packages/strapi-hook-ejs/package.json index 9deb8af65e..4fe9c70d6b 100644 --- a/packages/strapi-hook-ejs/package.json +++ b/packages/strapi-hook-ejs/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-ejs", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "EJS hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-hook-redis/package.json b/packages/strapi-hook-redis/package.json index c456f94a0d..766d2798f3 100644 --- a/packages/strapi-hook-redis/package.json +++ b/packages/strapi-hook-redis/package.json @@ -1,6 +1,6 @@ { "name": "strapi-hook-redis", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Redis hook for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ @@ -19,7 +19,7 @@ "lodash": "^4.17.11", "rimraf": "3.0.0", "stack-trace": "0.0.10", - "strapi-utils": "3.0.0-beta.18.7" + "strapi-utils": "3.0.0-beta.19" }, "author": { "email": "hi@strapi.io", diff --git a/packages/strapi-middleware-views/package.json b/packages/strapi-middleware-views/package.json index 94f5db37ce..b69468913c 100644 --- a/packages/strapi-middleware-views/package.json +++ b/packages/strapi-middleware-views/package.json @@ -1,6 +1,6 @@ { "name": "strapi-middleware-views", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Views middleware to enable server-side rendering for the Strapi framework", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js b/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js index c1557c929a..643b86f8b2 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/CustomTable/Row.js @@ -3,9 +3,8 @@ import { withRouter } from 'react-router'; import PropTypes from 'prop-types'; import { get, isEmpty, isNull, isObject, toLower, toString } from 'lodash'; import moment from 'moment'; -import { IcoContainer, useGlobalContext } from 'strapi-helper-plugin'; +import { IcoContainer, useGlobalContext, dateFormats } from 'strapi-helper-plugin'; import useListView from '../../hooks/useListView'; -import dateFormats from '../../utils/dateFormats'; import CustomInputCheckbox from '../CustomInputCheckbox'; import MediaPreviewList from '../MediaPreviewList'; import { ActionContainer, Truncate, Truncated } from './styledComponents'; @@ -20,9 +19,8 @@ const getDisplayedValue = (type, value, name) => { case 'text': case 'email': case 'enumeration': - return (value && !isEmpty(toString(value))) || name === 'id' - ? toString(value) - : '-'; + case 'uid': + return (value && !isEmpty(toString(value))) || name === 'id' ? toString(value) : '-'; case 'float': case 'integer': case 'biginteger': @@ -38,9 +36,7 @@ const getDisplayedValue = (type, value, name) => { } const date = - value && isObject(value) && value._isAMomentObject === true - ? JSON.stringify(value) - : value; + value && isObject(value) && value._isAMomentObject === true ? JSON.stringify(value) : value; return dateToUtcTime(date).format(dateFormats[type]); } @@ -71,12 +67,7 @@ const getDisplayedValue = (type, value, name) => { }; function Row({ goTo, isBulkable, row, headers }) { - const { - entriesToDelete, - onChangeBulk, - onClickDelete, - schema, - } = useListView(); + const { entriesToDelete, onChangeBulk, onClickDelete, schema } = useListView(); const memoizedDisplayedValue = useCallback( name => { @@ -96,10 +87,7 @@ function Row({ goTo, isBulkable, row, headers }) { toString(id) === toString(row.id)) - .length > 0 - } + value={entriesToDelete.filter(id => toString(id) === toString(row.id)).length > 0} /> )} diff --git a/packages/strapi-plugin-content-manager/admin/src/components/Inputs/index.js b/packages/strapi-plugin-content-manager/admin/src/components/Inputs/index.js index 73ef3c4e53..1bcbf899fa 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/Inputs/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/Inputs/index.js @@ -3,10 +3,11 @@ import PropTypes from 'prop-types'; import { get, isEmpty, omit, toLower } from 'lodash'; import { FormattedMessage } from 'react-intl'; import { Inputs as InputsIndex } from '@buffetjs/custom'; +import { useGlobalContext } from 'strapi-helper-plugin'; import useDataManager from '../../hooks/useDataManager'; import InputJSONWithErrors from '../InputJSONWithErrors'; -import InputFileWithErrors from '../InputFileWithErrors'; +// import InputFileWithErrors from '../InputFileWithErrors'; import SelectWrapper from '../SelectWrapper'; import WysiwygWithErrors from '../WysiwygWithErrors'; import InputUID from '../InputUID'; @@ -51,6 +52,10 @@ const getInputType = (type = '') => { }; function Inputs({ autoFocus, keys, layout, name, onBlur }) { + // FIXME: this is really temporary until the Field API is ready + // but this way development aren't dependent of the upcoming API + const { plugins } = useGlobalContext(); + const InputMedia = get(plugins, ['upload', 'fields', 'media'], () => {}); const { didCheckErrors, formErrors, modifiedData, onChange } = useDataManager(); const attribute = useMemo(() => get(layout, ['schema', 'attributes', name], {}), [layout, name]); const metadatas = useMemo(() => get(layout, ['metadatas', name, 'edit'], {}), [layout, name]); @@ -81,7 +86,7 @@ function Inputs({ autoFocus, keys, layout, name, onBlur }) { if (type === 'relation') { return ( -
+
{isDragging && } <> - - - +
+ +
- + {msg => { - return {displayedValue || msg}; + return
{displayedValue || msg}
; }}
- { @@ -65,10 +62,10 @@ const Banner = forwardRef( }} > - - +
+
- +
@@ -90,11 +87,7 @@ Banner.defaultProps = { }; Banner.propTypes = { - displayedValue: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - PropTypes.object, - ]), + displayedValue: PropTypes.oneOfType([PropTypes.string, PropTypes.number, PropTypes.object]), doesPreviousFieldContainErrorsAndIsOpen: PropTypes.bool, hasErrors: PropTypes.bool, hasMinError: PropTypes.bool, diff --git a/packages/strapi-plugin-content-manager/admin/src/components/RepeatableComponent/BannerWrapper.js b/packages/strapi-plugin-content-manager/admin/src/components/RepeatableComponent/BannerWrapper.js index 52e173fd52..6f7d26c60d 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/RepeatableComponent/BannerWrapper.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/RepeatableComponent/BannerWrapper.js @@ -46,7 +46,6 @@ const BannerWrapper = styled.button` }} border-bottom: 0; - line-height: 36px; font-size: 13px; font-weight: 500; cursor: pointer; @@ -93,14 +92,11 @@ const BannerWrapper = styled.button` &:focus { outline: 0;; } - span, div, button { - line-height: 16px; - } + .img-wrapper { width: 19px; height: 19px; - align-self: center; margin-right: 19px; border-radius: 50%; background-color: ${({ hasErrors, isOpen }) => { @@ -111,16 +107,14 @@ const BannerWrapper = styled.button` } else { return '#F3F4F4'; } - }} + }}; text-align: center; - line-height: 19px; - - ${({ isOpen }) => !isOpen && 'transform: rotate(180deg)'} - + ${({ isOpen }) => !isOpen && 'transform: rotate(180deg)'}; } .cta-wrapper { + display: flex; margin-left: auto; > button { padding: 0; @@ -130,7 +124,6 @@ const BannerWrapper = styled.button` svg { font-size: 10px; path { - // fill: #292b2c; fill: #4B515A; } } @@ -142,7 +135,6 @@ const BannerWrapper = styled.button` } ${({ hasErrors, isOpen }) => { - // let fill = '#B4B6BA'; let fill = '#ABB3C2'; let trashFill = '#4B515A'; @@ -173,6 +165,11 @@ const BannerWrapper = styled.button` }} webkit-font-smoothing: antialiased; + + > div { + align-self: center; + margin-top: -2px; + } `; export default BannerWrapper; diff --git a/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/ListItem.js b/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/ListItem.js index 17a49e0c39..93c6e1095d 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/ListItem.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/ListItem.js @@ -18,7 +18,7 @@ function ListItem({ onRemove, targetModel, }) { - const to = `/plugins/${pluginId}/${targetModel}/${data.id}?redirectUrl=${nextSearch}`; + const to = `/plugins/${pluginId}/collectionType/${targetModel}/${data.id}?redirectUrl=${nextSearch}`; const originalIndex = findRelation(data.id).index; const [{ isDragging }, drag, preview] = useDrag({ diff --git a/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/Relation.js b/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/Relation.js index 88e0aee724..7da3a889e5 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/Relation.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/SelectMany/Relation.js @@ -1,9 +1,8 @@ +/* eslint-disable jsx-a11y/click-events-have-key-events */ import React, { memo } from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router-dom'; - import { FormattedMessage } from 'react-intl'; - import pluginId from '../../pluginId'; import IconRemove from '../../assets/images/icon_remove.svg'; diff --git a/packages/strapi-plugin-content-manager/admin/src/components/SelectWrapper/index.js b/packages/strapi-plugin-content-manager/admin/src/components/SelectWrapper/index.js index cd6b235e85..3a5e7fe87c 100644 --- a/packages/strapi-plugin-content-manager/admin/src/components/SelectWrapper/index.js +++ b/packages/strapi-plugin-content-manager/admin/src/components/SelectWrapper/index.js @@ -148,11 +148,15 @@ function SelectWrapper({ relationType ); const nextSearch = `${pathname}${search}`; - const to = `/plugins/${pluginId}/${targetModel}/${ + const to = `/plugins/${pluginId}/collectionType/${targetModel}/${ value ? value.id : null }?redirectUrl=${nextSearch}`; const link = - value === null || value === undefined || ['role', 'permission'].includes(targetModel) ? null : ( + value === null || + value === undefined || + ['plugins::users-permissions.role', 'plugins::users-permissions.permission'].includes( + targetModel + ) ? null : ( diff --git a/packages/strapi-plugin-content-manager/package.json b/packages/strapi-plugin-content-manager/package.json index 8de01bbdf9..36bd718777 100644 --- a/packages/strapi-plugin-content-manager/package.json +++ b/packages/strapi-plugin-content-manager/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-manager", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "A powerful UI to easily manage your data.", "strapi": { "name": "Content Manager", @@ -30,8 +30,8 @@ "redux-immutable": "^4.0.0", "reselect": "^3.0.1", "showdown": "^1.9.0", - "strapi-helper-plugin": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7", + "strapi-helper-plugin": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19", "yup": "^0.27.0" }, "author": { diff --git a/packages/strapi-plugin-content-manager/services/utils/store.js b/packages/strapi-plugin-content-manager/services/utils/store.js index b4eef541fe..146e2029aa 100644 --- a/packages/strapi-plugin-content-manager/services/utils/store.js +++ b/packages/strapi-plugin-content-manager/services/utils/store.js @@ -29,24 +29,24 @@ const getModelConfiguration = async key => { }; const setModelConfiguration = async (key, value) => { - const config = (await getStore().get({ key: configurationKey(key) })) || {}; - + const storedConfig = (await getStore().get({ key: configurationKey(key) })) || {}; + const currentConfig = { ...storedConfig }; Object.keys(value).forEach(key => { if (value[key] !== null && value[key] !== undefined) { - _.set(config, key, value[key]); + _.set(currentConfig, key, value[key]); } }); - return getStore().set({ - key: configurationKey(key), - value: config, - }); + if (!_.isEqual(currentConfig, storedConfig)) { + return getStore().set({ + key: configurationKey(key), + value: currentConfig, + }); + } }; const deleteKey = key => { - return strapi - .query('core_store') - .delete({ key: `plugin_content_manager_configuration_${key}` }); + return strapi.query('core_store').delete({ key: `plugin_content_manager_configuration_${key}` }); }; function findByKeyQuery({ model }, key) { @@ -79,8 +79,7 @@ const moveKey = (oldKey, newKey) => { ); }; -const getAllConfigurations = () => - findByKey('plugin_content_manager_configuration'); +const getAllConfigurations = () => findByKey('plugin_content_manager_configuration'); module.exports = { getAllConfigurations, diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/List/index.js b/packages/strapi-plugin-content-type-builder/admin/src/components/List/index.js index f988cc38ac..34e2d7b230 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/List/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/List/index.js @@ -168,6 +168,7 @@ function List({ modifiedData.contentType ? modifiedData.contentType.schema.kind : editTarget }` : `${pluginId}.form.button.add.field.to.component`, + defaultMessage: 'Add another field', }) : null, onClick: onClickAddField, diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/ModalHeader/Icon.js b/packages/strapi-plugin-content-type-builder/admin/src/components/ModalHeader/Icon.js index 2014d5adb6..eb560d1590 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/ModalHeader/Icon.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/ModalHeader/Icon.js @@ -5,11 +5,15 @@ import PropTypes from 'prop-types'; const Icon = ({ type }) => { const icoName = type === 'collectionType' ? 'contentType' : type; - return ; + return ; +}; + +Icon.defaultProps = { + type: 'dynamiczone', }; Icon.propTypes = { - type: PropTypes.string.isRequired, + type: PropTypes.string, }; export default Icon; diff --git a/packages/strapi-plugin-content-type-builder/admin/src/components/RelationTargetPicker/index.js b/packages/strapi-plugin-content-type-builder/admin/src/components/RelationTargetPicker/index.js index 36a57351ed..ac1f492c89 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/components/RelationTargetPicker/index.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/components/RelationTargetPicker/index.js @@ -2,30 +2,20 @@ import React, { useState } from 'react'; import PropTypes from 'prop-types'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { get } from 'lodash'; -import { - Dropdown, - DropdownToggle, - DropdownMenu, - DropdownItem, -} from 'reactstrap'; +import { Dropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap'; import useDataManager from '../../hooks/useDataManager'; import Wrapper from './Wrapper'; -const RelationTargetPicker = ({ - onChange, - oneThatIsCreatingARelationWithAnother, - target, -}) => { +const RelationTargetPicker = ({ onChange, oneThatIsCreatingARelationWithAnother, target }) => { const [isOpen, setIsOpen] = useState(false); const { contentTypes, sortedContentTypesList } = useDataManager(); - - const targetFriendlyName = get( - contentTypes, - [target, 'schema', 'name'], - 'error' + const allowedContentTypesForRelation = sortedContentTypesList.filter( + obj => obj.kind === 'collectionType' ); + const targetFriendlyName = get(contentTypes, [target, 'schema', 'name'], 'error'); + return ( - {sortedContentTypesList.map(({ uid, title }) => { + {allowedContentTypesForRelation.map(({ uid, title }) => { return ( { const dynamicZoneTarget = query.get('dynamicZoneTarget'); const forTarget = query.get('forTarget'); const modalType = query.get('modalType'); - const kind = query.get('kind'); + const kind = query.get('kind') || get(allDataSchema, ['contentType', 'schema', 'kind'], null); const targetUid = query.get('targetUid'); const settingType = query.get('settingType'); const headerId = query.get('headerId'); diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/forms.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/forms.js index 868b2f9dac..bdb4339754 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/forms.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/forms.js @@ -452,6 +452,8 @@ const forms = { disabled: data.type !== 'date', }, ]); + } else if (type === 'richtext') { + items.splice(4, 1); } else if (type === 'uid') { const uidItems = [ [{ ...fields.default, disabled: Boolean(data.targetField), type: 'text' }], diff --git a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/getModalTitleSubHeader.js b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/getModalTitleSubHeader.js index b1e5b35fb7..00451fa26e 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/getModalTitleSubHeader.js +++ b/packages/strapi-plugin-content-type-builder/admin/src/containers/FormModal/utils/getModalTitleSubHeader.js @@ -5,17 +5,13 @@ const getModalTitleSubHeader = state => { case 'chooseAttribute': return getTrad( `modalForm.sub-header.chooseAttribute.${ - state.forTarget === 'contentType' ? 'contentType' : 'component' + state.forTarget.includes('component') ? 'component' : state.kind }` ); case 'attribute': { return getTrad( `modalForm.sub-header.attribute.${state.actionType}${ - state.step !== 'null' && - state.step !== null && - state.actionType !== 'edit' - ? '.step' - : '' + state.step !== 'null' && state.step !== null && state.actionType !== 'edit' ? '.step' : '' }` ); } diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/cs.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/cs.json index b3b47cc1ec..8adbaf97f8 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/cs.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/cs.json @@ -127,7 +127,7 @@ "modalForm.sub-header.attribute.create.step": "Přidat nový komponent ({step}/2)", "modalForm.sub-header.attribute.edit": "Upravit {name}", "modalForm.sub-header.chooseAttribute.component": "Vyberte typ pole pro komponent", - "modalForm.sub-header.chooseAttribute.contentType": "Vyberte typ pole pro Typ obsahu", + "modalForm.sub-header.chooseAttribute.collectionType": "Vyberte typ pole pro Typ obsahu", "modelPage.attribute.relationWith": "Propojení s", "modelPage.contentHeader.emptyDescription.description": "žádný popis", "notification.info.creating.notSaved": "Uložte změny před vytvořením nového Typu obsahu nebo komponentu", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json index 80a25aa318..a94f768022 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/en.json @@ -141,7 +141,8 @@ "modalForm.sub-header.attribute.create": "Add new {type} field", "modalForm.sub-header.attribute.edit": "Edit {name}", "modalForm.sub-header.chooseAttribute.component": "Select a field for your component", - "modalForm.sub-header.chooseAttribute.contentType": "Select a field for your collection type", + "modalForm.sub-header.chooseAttribute.collectionType": "Select a field for your collection type", + "modalForm.sub-header.chooseAttribute.singleType": "Select a field for your single type", "modelPage.attribute.relationWith": "Relation with", "modelPage.attribute.relation-polymorphic": "Relation (polymorphic)", "modelPage.contentHeader.emptyDescription.description": "There is no description", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json index d4d08ddd03..c1ff711589 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/fr.json @@ -57,6 +57,9 @@ "modalForm.attribute.target-field.none": "Aucun", "modalForm.attribute.form.base.name.placeholder": "ex : Slug, URL SEO, URL Canonique", "modalForm.singleType.header-create": "Créer un single type", + "modalForm.sub-header.chooseAttribute.component": "Selectionnez un champ pour votre composant", + "modalForm.sub-header.chooseAttribute.collectionType": "Selectionnez un champ pour votre collection", + "modalForm.sub-header.chooseAttribute.singleType": "Selectionnez un champ pour votre single type", "none": "Aucun", "button.single-types.create": "Créer un single type", "modelPage.attribute.relationWith": "Relation avec", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/pl.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/pl.json index cc798902c8..bd8d9feb2d 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/pl.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/pl.json @@ -140,7 +140,7 @@ "modalForm.sub-header.attribute.create.step": "Dodaj nowy komponent ({step}/2)", "modalForm.sub-header.attribute.edit": "Edytuj {name}", "modalForm.sub-header.chooseAttribute.component": "Wybierz pole dla komponentu", - "modalForm.sub-header.chooseAttribute.contentType": "Wybierz pole dla typu zawartości", + "modalForm.sub-header.chooseAttribute.collectionType": "Wybierz pole dla typu zawartości", "notification.info.creating.notSaved": "Zapisz swoją pracę przed utworzeniem nowego typu treści lub komponentu", "popUpWarning.bodyMessage.cancel-modifications": "Czy na pewno chcesz anulować swoje modyfikacje?", "popUpWarning.bodyMessage.cancel-modifications.with-components": "Czy na pewno chcesz anulować swoje modyfikacje? Niektóre komponenty zostały utworzone lub zmodyfikowane ...", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/ru.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/ru.json index 2c945f2bcd..35740c6d1a 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/ru.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/ru.json @@ -124,7 +124,7 @@ "modalForm.sub-header.attribute.create.step": "Добавить новый компонент ({step}/2)", "modalForm.sub-header.attribute.edit": "Изменение {name}", "modalForm.sub-header.chooseAttribute.component": "Выбрать имя поля компонента", - "modalForm.sub-header.chooseAttribute.contentType": "Выбрать имя поля типа контента", + "modalForm.sub-header.chooseAttribute.collectionType": "Выбрать имя поля типа контента", "modelPage.attribute.relationWith": "Связь с", "modelPage.contentHeader.emptyDescription.description": "Для этого типа контента нет описания", "notification.info.creating.notSaved": "Пожалуйста, сохраните изменения перед созданием нового компонента типа контента ", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/sk.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/sk.json index 2b6fe2c41a..6cfdd9a5b6 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/sk.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/sk.json @@ -126,7 +126,7 @@ "modalForm.sub-header.attribute.create.step": "Pridať nový komponent ({step}/2)", "modalForm.sub-header.attribute.edit": "Upraviť {name}", "modalForm.sub-header.chooseAttribute.component": "Vyberte typ políčka pre komponent", - "modalForm.sub-header.chooseAttribute.contentType": "Vyberte typ políčka pre Typ obsahu", + "modalForm.sub-header.chooseAttribute.collectionType": "Vyberte typ políčka pre Typ obsahu", "modelPage.attribute.relationWith": "Prepojenie s", "modelPage.contentHeader.emptyDescription.description": "Žiaden popis", "notification.info.creating.notSaved": "Uložte zmeny pred vytvorením nového Typu obsahu alebo komponentu", diff --git a/packages/strapi-plugin-content-type-builder/admin/src/translations/zh-Hans.json b/packages/strapi-plugin-content-type-builder/admin/src/translations/zh-Hans.json index 58bf7e8159..7aac20e3bb 100644 --- a/packages/strapi-plugin-content-type-builder/admin/src/translations/zh-Hans.json +++ b/packages/strapi-plugin-content-type-builder/admin/src/translations/zh-Hans.json @@ -128,7 +128,7 @@ "modalForm.sub-header.attribute.create.step": "添加新的组件 ({step}/2)", "modalForm.sub-header.attribute.edit": "编辑 {name}", "modalForm.sub-header.chooseAttribute.component": "为您的组件选择一个字段", - "modalForm.sub-header.chooseAttribute.contentType": "为您的 Content Type 选择一个字段", + "modalForm.sub-header.chooseAttribute.collectionType": "为您的 Content Type 选择一个字段", "modelPage.attribute.relationWith": "关联", "modelPage.contentHeader.emptyDescription.description": "该Collection Type没有任何描述", "notification.info.creating.notSaved": "在创建新的内容类型或组件之前,请保存您的工作", diff --git a/packages/strapi-plugin-content-type-builder/package.json b/packages/strapi-plugin-content-type-builder/package.json index 2e99b02939..dcf201386c 100644 --- a/packages/strapi-plugin-content-type-builder/package.json +++ b/packages/strapi-plugin-content-type-builder/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-content-type-builder", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Strapi plugin to create content type (API).", "strapi": { "name": "Content Type Builder", @@ -26,10 +26,10 @@ "redux": "^4.0.1", "redux-immutable": "^4.0.0", "reselect": "^3.0.1", - "strapi-generate": "3.0.0-beta.18.7", - "strapi-generate-api": "3.0.0-beta.18.7", - "strapi-helper-plugin": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7", + "strapi-generate": "3.0.0-beta.19", + "strapi-generate-api": "3.0.0-beta.19", + "strapi-helper-plugin": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19", "yup": "^0.27.0" }, "author": { diff --git a/packages/strapi-plugin-documentation/package.json b/packages/strapi-plugin-documentation/package.json index dbada84265..534fc9ab00 100755 --- a/packages/strapi-plugin-documentation/package.json +++ b/packages/strapi-plugin-documentation/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-documentation", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "This is the description of the plugin.", "strapi": { "name": "Documentation", @@ -32,7 +32,7 @@ "redux": "^4.0.1", "redux-immutable": "^4.0.0", "reselect": "^4.0.0", - "strapi-helper-plugin": "3.0.0-beta.18.7", + "strapi-helper-plugin": "3.0.0-beta.19", "swagger-ui-dist": "3.24.3" }, "author": { diff --git a/packages/strapi-plugin-email/package.json b/packages/strapi-plugin-email/package.json index c5f05187f3..c6df424ace 100644 --- a/packages/strapi-plugin-email/package.json +++ b/packages/strapi-plugin-email/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-email", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "This is the description of the plugin.", "strapi": { "name": "Email", @@ -13,13 +13,13 @@ }, "dependencies": { "lodash": "^4.17.11", - "strapi-provider-email-sendmail": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7" + "strapi-provider-email-sendmail": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19" }, "devDependencies": { "react-copy-to-clipboard": "5.0.1", "rimraf": "3.0.0", - "strapi-helper-plugin": "3.0.0-beta.18.7" + "strapi-helper-plugin": "3.0.0-beta.19" }, "author": { "name": "Strapi team", diff --git a/packages/strapi-plugin-graphql/package.json b/packages/strapi-plugin-graphql/package.json index 7ee4653b75..f28e1a7d75 100644 --- a/packages/strapi-plugin-graphql/package.json +++ b/packages/strapi-plugin-graphql/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-graphql", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "This is the description of the plugin.", "strapi": { "name": "graphql", @@ -24,7 +24,7 @@ "koa-compose": "^4.1.0", "lodash": "4.17.11", "pluralize": "^7.0.0", - "strapi-utils": "3.0.0-beta.18.7" + "strapi-utils": "3.0.0-beta.19" }, "devDependencies": { "cross-env": "^5.2.0", diff --git a/packages/strapi-plugin-upload/admin/src/components/InputFile/Input.js b/packages/strapi-plugin-upload/admin/src/components/InputFileModal/Input.js similarity index 100% rename from packages/strapi-plugin-upload/admin/src/components/InputFile/Input.js rename to packages/strapi-plugin-upload/admin/src/components/InputFileModal/Input.js diff --git a/packages/strapi-plugin-upload/admin/src/components/InputFile/Label.js b/packages/strapi-plugin-upload/admin/src/components/InputFileModal/Label.js similarity index 100% rename from packages/strapi-plugin-upload/admin/src/components/InputFile/Label.js rename to packages/strapi-plugin-upload/admin/src/components/InputFileModal/Label.js diff --git a/packages/strapi-plugin-upload/admin/src/components/InputFile/P.js b/packages/strapi-plugin-upload/admin/src/components/InputFileModal/P.js similarity index 100% rename from packages/strapi-plugin-upload/admin/src/components/InputFile/P.js rename to packages/strapi-plugin-upload/admin/src/components/InputFileModal/P.js diff --git a/packages/strapi-plugin-upload/admin/src/components/InputFile/index.js b/packages/strapi-plugin-upload/admin/src/components/InputFileModal/index.js similarity index 75% rename from packages/strapi-plugin-upload/admin/src/components/InputFile/index.js rename to packages/strapi-plugin-upload/admin/src/components/InputFileModal/index.js index 1c69d6a841..2122ef321d 100644 --- a/packages/strapi-plugin-upload/admin/src/components/InputFile/index.js +++ b/packages/strapi-plugin-upload/admin/src/components/InputFileModal/index.js @@ -8,7 +8,7 @@ import Label from './Label'; import Input from './Input'; import P from './P'; -const InputFile = ({ name, onChange }) => { +const InputFileModal = ({ name, onChange }) => { const [isDragging, setIsDragging] = useState(false); const { formatMessage } = useGlobalContext(); const ref = createRef(); @@ -48,40 +48,26 @@ const InputFile = ({ name, onChange }) => { >

- - {formatMessage({ id: getTrad('input.label-bold') })}  - + {formatMessage({ id: getTrad('input.label-bold') })}  {formatMessage({ id: getTrad('input.label-normal') })}

- - + {isDragging &&
} ); }; -InputFile.defaultProps = { +InputFileModal.defaultProps = { name: 'files', onChange: () => {}, }; -InputFile.propTypes = { +InputFileModal.propTypes = { name: PropTypes.string, onChange: PropTypes.func, }; -export default InputFile; +export default InputFileModal; diff --git a/packages/strapi-plugin-upload/admin/src/components/InputMedia/index.js b/packages/strapi-plugin-upload/admin/src/components/InputMedia/index.js new file mode 100644 index 0000000000..6ccf9dcbf7 --- /dev/null +++ b/packages/strapi-plugin-upload/admin/src/components/InputMedia/index.js @@ -0,0 +1,9 @@ +import React from 'react'; + +const InputMedia = props => { + console.log(props); + + return
COMING SOON
; +}; + +export default InputMedia; diff --git a/packages/strapi-plugin-upload/admin/src/components/UploadForm/index.js b/packages/strapi-plugin-upload/admin/src/components/UploadForm/index.js index 508f5a9cb1..95b83ff56f 100644 --- a/packages/strapi-plugin-upload/admin/src/components/UploadForm/index.js +++ b/packages/strapi-plugin-upload/admin/src/components/UploadForm/index.js @@ -1,6 +1,6 @@ import React, { useReducer } from 'react'; import PropTypes from 'prop-types'; -import InputFile from '../InputFile'; +import InputFileModal from '../InputFileModal'; import ModalNavWrapper from '../ModalNavWrapper'; import ModalSection from '../ModalSection'; import init from './init'; @@ -25,7 +25,7 @@ const UploadForm = ({ addFilesToUpload }) => { <> - {to === 'computer' && } + {to === 'computer' && } {to === 'url' &&
COMING SOON
}
diff --git a/packages/strapi-plugin-upload/admin/src/index.js b/packages/strapi-plugin-upload/admin/src/index.js index e92bd95de7..173a5b10bf 100644 --- a/packages/strapi-plugin-upload/admin/src/index.js +++ b/packages/strapi-plugin-upload/admin/src/index.js @@ -2,6 +2,7 @@ import pluginPkg from '../../package.json'; import pluginLogo from './assets/images/logo.svg'; import App from './containers/App'; import SettingsPage from './containers/SettingsPage'; +import InputMedia from './components/InputMedia'; import trads from './translations'; import pluginId from './pluginId'; @@ -13,6 +14,11 @@ export default strapi => { blockerComponent: null, blockerComponentProps: {}, description: pluginDescription, + // TODO: this is a really temporary API that will temporary allow + // this plugin to add a new type into the content manager, the final API will be different + fields: { + media: InputMedia, + }, icon: pluginPkg.strapi.icon, id: pluginId, initializer: null, diff --git a/packages/strapi-plugin-upload/package.json b/packages/strapi-plugin-upload/package.json index 8df8c87ce0..8b1b848b88 100644 --- a/packages/strapi-plugin-upload/package.json +++ b/packages/strapi-plugin-upload/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-upload", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "This is the description of the plugin.", "strapi": { "name": "Media Library", @@ -24,9 +24,9 @@ "react-router-dom": "^5.0.0", "react-transition-group": "^2.5.0", "reactstrap": "^5.0.0", - "strapi-helper-plugin": "3.0.0-beta.18.7", - "strapi-provider-upload-local": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7", + "strapi-helper-plugin": "3.0.0-beta.19", + "strapi-provider-upload-local": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19", "stream-to-array": "^2.3.0", "uuid": "^3.2.1" }, diff --git a/packages/strapi-plugin-users-permissions/admin/src/components/InputSearchLi/index.js b/packages/strapi-plugin-users-permissions/admin/src/components/InputSearchLi/index.js index 9e1bc3262c..cccf39d4aa 100644 --- a/packages/strapi-plugin-users-permissions/admin/src/components/InputSearchLi/index.js +++ b/packages/strapi-plugin-users-permissions/admin/src/components/InputSearchLi/index.js @@ -17,7 +17,7 @@ function InputSearchLi({ onClick, isAdding, item }) { const icon = isAdding ? 'fa-plus' : 'fa-minus-circle'; const liStyle = isAdding ? { cursor: 'pointer' } : {}; const handleClick = isAdding ? () => onClick(item) : () => {}; - const path = `/admin/plugins/content-manager/user/${id}?redirectUrl=/plugins/content-manager/user/?page=1&limit=20&sort=id&source=users-permissions`; + const path = `/admin/plugins/content-manager/collectionType/plugins::users-permissions.user/${id}?redirectUrl=/plugins/content-manager/collectionType/plugins::users-permissions.user`; return ( diff --git a/packages/strapi-plugin-users-permissions/package.json b/packages/strapi-plugin-users-permissions/package.json index 522a199a8a..404f588adc 100644 --- a/packages/strapi-plugin-users-permissions/package.json +++ b/packages/strapi-plugin-users-permissions/package.json @@ -1,6 +1,6 @@ { "name": "strapi-plugin-users-permissions", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Protect your API with a full-authentication process based on JWT", "strapi": { "name": "Roles & Permissions", @@ -32,8 +32,8 @@ "reactstrap": "^5.0.0", "redux-saga": "^0.16.0", "request": "^2.83.0", - "strapi-helper-plugin": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7", + "strapi-helper-plugin": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19", "uuid": "^3.1.0" }, "devDependencies": { diff --git a/packages/strapi-provider-email-amazon-ses/package.json b/packages/strapi-provider-email-amazon-ses/package.json index 9f459d1ed2..78c478aae7 100644 --- a/packages/strapi-provider-email-amazon-ses/package.json +++ b/packages/strapi-provider-email-amazon-ses/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-amazon-ses", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Amazon SES provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-mailgun/package.json b/packages/strapi-provider-email-mailgun/package.json index d758f5cbd3..ded77a9c55 100644 --- a/packages/strapi-provider-email-mailgun/package.json +++ b/packages/strapi-provider-email-mailgun/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-mailgun", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Mailgun provider for strapi email plugin", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-sendgrid/package.json b/packages/strapi-provider-email-sendgrid/package.json index b0e23eb0d5..a4c8580c82 100644 --- a/packages/strapi-provider-email-sendgrid/package.json +++ b/packages/strapi-provider-email-sendgrid/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-sendgrid", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Sendgrid provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-email-sendmail/package.json b/packages/strapi-provider-email-sendmail/package.json index c275fe2135..4ec9d962d3 100644 --- a/packages/strapi-provider-email-sendmail/package.json +++ b/packages/strapi-provider-email-sendmail/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-email-sendmail", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Sendmail provider for strapi email", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-aws-s3/package.json b/packages/strapi-provider-upload-aws-s3/package.json index 540d01a224..0f88fb1672 100644 --- a/packages/strapi-provider-upload-aws-s3/package.json +++ b/packages/strapi-provider-upload-aws-s3/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-aws-s3", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "AWS S3 provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-cloudinary/package.json b/packages/strapi-provider-upload-cloudinary/package.json index 8e306e5bde..552f16a5aa 100644 --- a/packages/strapi-provider-upload-cloudinary/package.json +++ b/packages/strapi-provider-upload-cloudinary/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-cloudinary", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Cloudinary provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-local/package.json b/packages/strapi-provider-upload-local/package.json index 337430c4aa..0af9e8703c 100644 --- a/packages/strapi-provider-upload-local/package.json +++ b/packages/strapi-provider-upload-local/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-local", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Local provider for strapi upload", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi-provider-upload-rackspace/package.json b/packages/strapi-provider-upload-rackspace/package.json index 60004ffc01..8684e88f0d 100644 --- a/packages/strapi-provider-upload-rackspace/package.json +++ b/packages/strapi-provider-upload-rackspace/package.json @@ -1,6 +1,6 @@ { "name": "strapi-provider-upload-rackspace", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Rackspace provider for strapi upload", "main": "./lib", "keywords": [], diff --git a/packages/strapi-utils/package.json b/packages/strapi-utils/package.json index 4e5ad16e0b..b37d60149c 100644 --- a/packages/strapi-utils/package.json +++ b/packages/strapi-utils/package.json @@ -1,6 +1,6 @@ { "name": "strapi-utils", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "Shared utilities for the Strapi packages", "homepage": "http://strapi.io", "keywords": [ diff --git a/packages/strapi/package.json b/packages/strapi/package.json index 89ba205997..f662ff7275 100644 --- a/packages/strapi/package.json +++ b/packages/strapi/package.json @@ -1,6 +1,6 @@ { "name": "strapi", - "version": "3.0.0-beta.18.7", + "version": "3.0.0-beta.19", "description": "An open source headless CMS solution to create and manage your own API. It provides a powerful dashboard and features to make your life easier. Databases supported: MongoDB, MySQL, MariaDB, PostgreSQL, SQLite", "homepage": "http://strapi.io", "directories": { @@ -50,16 +50,16 @@ "resolve-cwd": "^3.0.0", "rimraf": "^2.6.2", "shelljs": "^0.8.3", - "strapi-database": "3.0.0-beta.18.7", - "strapi-generate": "3.0.0-beta.18.7", - "strapi-generate-api": "3.0.0-beta.18.7", - "strapi-generate-controller": "3.0.0-beta.18.7", - "strapi-generate-model": "3.0.0-beta.18.7", - "strapi-generate-new": "3.0.0-beta.18.7", - "strapi-generate-plugin": "3.0.0-beta.18.7", - "strapi-generate-policy": "3.0.0-beta.18.7", - "strapi-generate-service": "3.0.0-beta.18.7", - "strapi-utils": "3.0.0-beta.18.7" + "strapi-database": "3.0.0-beta.19", + "strapi-generate": "3.0.0-beta.19", + "strapi-generate-api": "3.0.0-beta.19", + "strapi-generate-controller": "3.0.0-beta.19", + "strapi-generate-model": "3.0.0-beta.19", + "strapi-generate-new": "3.0.0-beta.19", + "strapi-generate-plugin": "3.0.0-beta.19", + "strapi-generate-policy": "3.0.0-beta.19", + "strapi-generate-service": "3.0.0-beta.19", + "strapi-utils": "3.0.0-beta.19" }, "scripts": { "postinstall": "node lib/utils/success.js"