174 Commits

Author SHA1 Message Date
Alexandre Bodin
fd18d2a67a Merge branch 'master' into features/i18n 2021-04-02 17:33:24 +02:00
Pierre Noël
3c85f38fb4 Delete all entries in a locale when locale is deleted 2021-04-01 15:40:51 +02:00
Pierre Noël
740f22762e
fix error wording when join table name is too long (#9880) 2021-03-30 12:34:50 +02:00
Pierre Noël
2149493137 add migration when i18n is disabled on a CT 2021-03-29 16:28:01 +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
Pierre Noël
3e1a823f1b add migration when a CT becomes localized 2021-03-24 12:14:49 +01:00
Pierre Noël
ec0aca2de8 add migration for SQL DBs 2021-03-18 18:43:36 +01:00
Pierre Noël
9950bbe4c0 add previousDefinition in migration options 2021-03-18 18:28:19 +01:00
Alexandre Bodin
2467cad937 Merge branch 'i18n/localizations-sync' into features/i18n 2021-03-16 10:01:25 +01:00
Alexandre Bodin
c40c3ba8c3 pick assoc populate fields option 2021-03-12 17:56:38 +01:00
Alexandre Bodin
4583e3d086 Split logic cleanly between visible & writable attributes 2021-03-12 14:34:04 +01:00
Alexandre Bodin
c57b3be1eb Merge branch 'master' into features/i18n 2021-03-12 09:45:51 +01:00
germangonzo
a40e3b0014
Fix error with polymorphic relations when the attribute name is different to related (#9396) 2021-03-11 14:11:23 +01:00
Alexandre Bodin
996341f5d5 Move to many way & add populate option on assoc 2021-03-05 15:44:23 +01:00
Alexandre Bodin
469991f9f2 Merge branch 'master' into features/i18n 2021-02-18 14:36:32 +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
Alexandre Bodin
cefdde18f4 Init db lifecycles manager 2021-02-16 16:48:16 +01:00
Alexandre BODIN
6dd67d5c76
Fix pool config (#9417) 2021-02-16 10:16:49 +01:00
Alexandre Bodin
be1b8f20e8 Cleanup to be mergeable now 2021-02-15 11:32:37 +01:00
Alexandre Bodin
02782076d0 Update migrations to be more extensible 2021-02-15 08:45:20 +01:00
Alexandre Bodin
1592417ed3 Add migration manager in database 2021-02-12 12:52:29 +01:00
Pierre Noël
2ed1c05302
fix pool options (#9348) 2021-02-08 17:59:36 +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
Jozef Cipa
a48f9f3327
Fix lower() error when running on non-string column (#8419)
Signed-off-by: jozefcipa <jozef.cipa@strv.com>
2021-01-21 11:36:17 +01:00
Anthony Nguyen
b4f75fd7a6
Add min:0 to templates of Bookshelf DBs. Issue #8436 (#9155)
* Add min:0 to templates of Bookshelf DBs. Issue #8436

* Moving default property from db template to knex.js

* Move min to pool
2021-01-18 14:14:39 +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
08f9b05d21
Fix query when filtering and sorting on a relational field (#9045)
* fix query when filtering and sorting on a relational field

* add tests + refacto

* remove useless code
2021-01-11 17:21:01 +01:00
Convly
c3a2c7024d PR review adjustments 2021-01-08 10:09:10 +01:00
Convly
5bf9375381 First impl (wip)
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2021-01-08 09:52:21 +01:00
Alexandre Bodin
aa3d7eb2e0 Merge branch 'master' into feature/relational-fields 2020-12-17 12:58:34 +01:00
Pierre Noël
4a02c158b9
Fix migration when disabling dp on sqlite (#8768)
* fix migration disable dp on sqlite

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* fix mongo test

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* use context instead of migrationInfos

* refacto

* remove useless if
2020-12-17 12:33:00 +01:00
Alexandre BODIN
d6f5b0c572
Merge pull request #8829 from strapi/relational-fields/sort-by-relation
Relational fields/ Sort by relation
2020-12-10 14:05:56 +01:00
Pierre Noël
4b25c36739 Add count 2020-12-08 17:27:02 +01:00
Convly
92451db825 Add deep sort to mongoose, fix sort order on both connectors, cleanup
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-12-08 16:56:21 +01:00
Convly
95784438ce Add nested sort to bookshelf queries 2020-12-08 16:56:21 +01:00
soupette
61a3740c06 Fix conflicts
Signed-off-by: soupette <cyril.lpz@gmail.com>
2020-11-23 14:43:07 +01:00
Alexandre BODIN
6558161227
Fix ML (#8604)
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-09 19:21:08 +01:00
Pierre Noël
60bf24ce8b
Fix query when populating morph relations (#8548)
* change query when populating morph relations

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto

Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-11-06 14:35:36 +01:00
Pierre Noël
ff5307e8b6
fix altercolumns db migration (#8565)
* fix alter-column db migration

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto of data migration + fix sqlite dp migration

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto create-migration-runner

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* fix migration

Signed-off-by: Pierre Noël <petersg83@gmail.com>

* refacto

Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-11-06 14:27:57 +01:00
Alexandre Bodin
4a32691c07 fix lint
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-03 16:14:31 +01:00
Alexandre Bodin
08a603623b Cleanup tests
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:46 +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
81c684d7b4
Merge pull request #8314 from strapi/fix/dpMigration
fix d&p regressions
2020-10-20 14:08:49 +02:00
Convly
03f5342123 Fix deepFiltering with draft & publish
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-10-19 15:39:56 +02:00
Pierre Noël
d84284faf2 refacto
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-10-16 18:54:10 +02:00
Pierre Noël
e2341e9b06 run creation/update of the database even if the model hasnt changed
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-10-16 18:54:10 +02:00
Pierre Noël
025eed964c dont run d&p migration at CT creation + rebuild tables if there were deleted in DB
Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-10-16 18:54:09 +02:00
Alexandre BODIN
b91059a522
Fix undefined pk (#8260)
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-09 17:08:37 +02:00
Alexandre BODIN
e87af3f6c6
do not set id to undefined (#8232)
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-07 23:11:00 +02:00
Jean-Sébastien Herbaux
e7861232d0
Fix wrong query generation with bookshelf (#8228)
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-10-07 23:10:38 +02:00