42 Commits

Author SHA1 Message Date
Pierre Noël
3c85f38fb4 Delete all entries in a locale when locale is deleted 2021-04-01 15:40:51 +02:00
Jean-Sébastien Herbaux
1e5b1c99f6
I18n/ permissions rework (#9535)
* Add a domain layer for the permission, rework the engine handling of the permissions

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Add permissions-fields-to-properties migration for the admin

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Removes useless console.log

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove debug logLevel from provider-login.test.e2e.js

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Adds the new layout for the GET permissions, allow to subscribe to actionRegistered events, adds i18n handlers

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix typo

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update permissions validators

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update unit tests

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update integrations test + fix some validation issues

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Change plugins & settings section format for the permissions layout

* only return locales property to localized subjects for the permission's layout

* Do not send the locales property to the permission's layout when there is no locales created

* Add the 'locales' property to publish & delete routes

* Fix unwanted mutation of the sections builder states on multiple builds

* Fix units tests with (new engine)

* Fix admin-role e2e test - Add locales property to the update payload

* fix e2e testsé

* Update e2e snapshots

* Fix unit test for i18n bootstrap

* Add mocks for i18n/bootstrap test

* Fix has-locale condition & updatePermission validator

* Avoid mutation in migration, always authorize super admin for has-locales condition

* Rework rbac domain objects, add a hook module and a provider factory

* Remove old providers

* Update the admin services & tests for the new rbac domain & providers

* Fix tests, bootstrap functions & services following rbac domain rework

* Update migration runner

* PR comments

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove useless console.log

* Fix sanitizeCondition bug

* Section builder rework

* Add test for the section-builder section & add jsdoc for the permission domain

* pr comments (without the migrations)

* fix fields-to-properties migration

* Add jsdoc for the sections-builder

* Moves createBoundAbstractDomain from permission domain to the engine service

* Remove debug logLevel for admin role test (e2e)

* Fix core-store

* Fix hooks & move business logic from i18n bootstrap to dedicated services

* add route get-non-localized-fields

* use write and read permission

* refacto

* add input validator

* add route doc

* handle ST

Co-authored-by: Pierre Noël <petersg83@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2021-03-25 14:59:44 +01:00
jonmol
7a6432da73
added a way to have a less expensive search (#9316)
* added a way to have a less expensive search

* renamed skipSearch to searchable

* forgot to remove one skipSearch

* skip non searchable fields on mongoose query

* cleaned up the if statement

* reverted change to strapi-plugin-upload/models

Co-authored-by: Luis del Rio <ldelriof@gmail.com>
Co-authored-by: Alexandre BODIN <alexandrebodin@users.noreply.github.com>
2021-02-16 17:37:30 +01:00
Jozef Cipa
808b2a464f
Handle duplicate entry error (#8367)
* Handle duplicate entry error message in bookshelf connector

Signed-off-by: jozefcipa <jozef.cipa@strv.com>

* Handle duplicate error message in mongoose connector

Signed-off-by: jozefcipa <jozef.cipa@strv.com>

* Apply changes from review

* Fix wrapping transactions in bookshelf adapter

* Add missing await to wrapErrors

* Call findOne without this
2021-01-25 14:03:48 +01:00
Pierre Noël
70ffd7c65b
Fix CM limited to show only 100 entries (#9118)
* fix mongo count

* harmonize code between mongoose and bookshelf

* refacto
2021-01-13 20:15:45 +01:00
Pierre Noël
4b25c36739 Add count 2020-12-08 17:27:02 +01:00
Alexandre Bodin
07e7cfc0bd Make lint stricter and fix the errors
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:42 +01:00
Alexandre Bodin
9f00438471 Fix count queries
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-01 17:18:58 +02:00
Pierre Noël
7221412d68 Draft publish/validators (#7853)
* add validators for dz, components and relations

Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-09-22 17:45:59 +02:00
Jean-Sébastien Herbaux
c4716d5668 [D&P] Return published content by default from get apis (#7657)
* Add _publicationState request param / Returns live by default for CT that have D&P activated

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-09-22 17:39:46 +02:00
Pierre Noël
38216554d5 Draft publish/remove some validators for drafts (#7537)
* remove required + minLength validator for drafts

Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-09-22 17:39:24 +02:00
Pierre Noël
e29c1b7de9 add published_at (#7374)
* add published_at

Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-09-22 17:39:18 +02:00
Pierre Noël
6d825fc3ca fix count with sort param
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-24 15:06:38 +02:00
Pierre Noël
3084b854d4 rename attributes -> values
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 11:09:53 +02:00
Pierre Noël
8598cee8d0 fourth refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 11:09:52 +02:00
Pierre Noël
6a1d65bc37 third refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-08 11:09:52 +02:00
Convly
651d42dbea fix PR comments, move pagination logic to the database layer, handle searches
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 10:50:44 +02:00
Convly
60b24dd3c3 Add GET /admin/users route and new pagination system
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 10:49:22 +02:00
Pierre Noël
10092f5a57 refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-07-01 11:59:33 +02:00
Pierre Noël
950a21469f add filtering to search route
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-06-30 15:50:52 +02:00
Pierre Noël
7c837cde6c refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-04-30 19:47:03 +02:00
Pierre Noël
015480b1b5 Change search logic
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-04-30 19:47:02 +02:00
Pierre Noël
17e8cba03e remove useless async
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-04-20 16:49:36 +02:00
Pierre Noël
555dbda454 fix count() result not a number
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-04-20 16:43:00 +02:00
Alexandre Bodin
cfdbf5423a Add file search and create simple sqlite search
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-03-25 17:34:39 +01:00
Alexandre Bodin
c8de166051 Add deleteRelations logic in connectors
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-03-20 11:04:23 +01:00
Alexandre Bodin
3187c08087 Fix uploadTopEntity and delete file relations on fie delete
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-03-20 11:04:22 +01:00
Pierre Noël
a1774db410 return null instead of promise
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-03-09 17:22:36 +01:00
Pierre Noël
b5f9795dbc small refacto of findOne + fix deleteMany of connector-mongoose
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>

Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-03-09 12:09:43 +01:00
Pierre Noël
b5ec9cb1c8 handle unexpected params from koa-router
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>

Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-03-06 19:16:51 +01:00
Pierre Noël
c0d9dd26d1 Fix findOne with PK as one of the params
Signed-off-by: Pierre Noël <pierre.noel@strapi.io>
2020-03-06 09:08:20 +01:00
Veit Bjarsch
31e6d08b66 fixed entry deletion if params contains associations 2020-01-06 02:29:47 +01:00
Alexandre Bodin
c5d57b32fe Merge branch 'develop' into features/dynamic-zones 2019-12-09 11:48:46 +01:00
Alexandre Bodin
fb5b770ce5 Merge branch 'master' into develop 2019-12-09 10:39:30 +01:00
Alexandre Bodin
49e270a7f6 Support uid for content types 2019-11-15 09:50:58 +01:00
Alexandre Bodin
a1d3c3abb5 Merge branch 'develop' into features/dynamic-zones 2019-11-13 19:25:16 +01:00
Alexandre Bodin
6339a92016 Delete dynamic zone components bookshelf 2019-11-13 18:49:03 +01:00
Alexandre Bodin
fbecade1c9 Update dynamic zones, bookshelf 2019-11-13 18:49:03 +01:00
Alexandre Bodin
79d1207c0c Create dynamiczone in queries 2019-11-13 18:49:02 +01:00
Alexandre Bodin
b9122edf0d Rename groups to components 2019-11-13 18:49:02 +01:00
Alexandre BODIN
5cda51043c
Use where instead of forge to make queries (#4488) 2019-11-13 18:42:59 +01:00
Alexandre Bodin
66b2d4f5c3 Init 2019-10-23 17:02:23 +02:00