Commit Graph

62 Commits

Author SHA1 Message Date
Rijk van Zanten
9335372400 Foreign Key Constraints (#5615)
* Bump knex-schema-inspector

* Fix cli role name attr

* Update relation type

* Restructure relations

* Restructure relations table

* Update api type for relation record

* Fetch relations in new structure

* Update schema-inspector

* Use new relations schema structure in api

* Update relations GETters

* Add default value to one deselect

* Add create relationship on existing field

* Add updating existing relationship

* Add delete relations

* Add relations query resolver

* Add graphql mutations for relations

* Fix reading from wrong name

* Fix wrong method name

* No idea why this flip flops every install

* Update relation type

* Accept null in use-collection composable

* Use new relations structure in translations

* Use new relations structure in new-collection

* Start updating field detail store

* Renames for new relations structure

* Silently ignore passed collection/field in relation update

* Fix setting pk field in m2o relational setup

* Small tweaks in o2m setup

* Fix m2m setup

* Tweak m2o setup

* Fix m2a setup

* Allow null for related collection (m2a)

* Fix languages code name

* Fix migration default value

* Fix relational cleanup in collections/fields

* Fix transaction problem in field delete

* Fix inserting relational o2m items

* Don't execute updateByQuery on empty item set

Fixes #5710, fixes #5070

* Show referential action input on m2o

* Finish language for m2o

* Show triggers config on o2m

* Delete items on one_deselect_item delete

* Fix naming, show relational trigger config on m2m

* Tweak language, add setup to m2a

* Fix linter warnings

* Add trigger setup for translations

* fix Edit non-schema relationship issue

* Sync existing on_delete triggers in o2m setup

* Add migration to setup foreign key constraints

* Update illegal FK values before setting constraint

* Fix MySQL unsigned vs not-unsigned in FK creation

* Use pretty names for labels in relational triggers

* Prefix auto-junction when system table

Fixes #5493

* Add system foreign key triggers

Fixes #5749

* Update docs
2021-05-19 12:29:16 -04:00
Pierre
95fc9e3368 [TS] Add deprecated note (#5603)
https://github.com/directus/directus/discussions/5601
2021-05-11 09:42:50 -04:00
Rijk van Zanten
b6964fa1a1 Add XML export (#5526) 2021-05-07 12:55:03 -04:00
rijkvanzanten
801e868554 Fix remaining eslint errors
h/t @paescuj
2021-04-29 15:55:12 -04:00
Pascal Jufer
acd41eb0be Syntax fixes (#5367)
* Declare return types on functions

And a very few other type related minor fixes

* Minor syntax fixes

* Remove unnecessary escape chars in regexes
* Remove unnecessary awaits
* Replace deprecated req.connection with req.socket
* Replace deprecated upload with uploadOne
* Remove unnecessary eslint-disable-next-line comments
* Comment empty functions / catch or finally clauses
* Fix irregular whitespaces
* Add missing returns (null)
* Remove unreachable code
* A few logical fixes
* Remove / Handle non-null assertions which are certainly unnecessary (e.g. in
tests)
2021-04-29 12:11:43 -04:00
Rijk van Zanten
40b9fb0fe6 Allow disabling activity/revisions (#5112)
* Add accountability column

* Add field info for accountability

* Add accountability to collection type

* Fetch accountability info from collection meta

* Add field name translation for accountability field

* Hide revisions drawer detail if revisions aren't available

* Only save activity where accountability flag matches

* Disable revisions for directus_presets

Fixes #3767

* Tweak field option naming
2021-04-16 16:26:18 -04:00
Rijk van Zanten
1fb4db1fda Add _regex validation operator (#5089)
Closes #2917
2021-04-15 17:25:51 -04:00
Rijk van Zanten
dd551f3571 Add non-items system Resolvers (#4863)
* Add auth resolvers

* Add password request/reset

* Add up until file import

* Make revisions read only

* Add server resolvers

* Add utils

* Add schema resolvers for schema manipulation
2021-04-06 18:04:35 -04:00
Fatih Kaya
da4b66aca8 fix: exclude aliases from the payload. fixes #4810 (#4822)
* fix: exclude aliases from the payload

* Use alias from columns

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-04-05 16:20:18 -04:00
Rijk van Zanten
f90c31b798 GraphQL 2.0 (#4625)
* Start on GraphQL "2.0", add methodnotallowed exceptoin

* Fix relative file pointer in peer dep

* [WIP] Add pre-filtered schema to SchemaOverview

* Use root schema as is, add reduce-schema util

* Use reduceSchema in the wild

* Base schema on local reduced schema

* Remove todo

* Use graphql-compose to build out schema

* Start restructuring resolvers

* Add create mutation

* Return boolean true for empty create mutation selections

* Add update mutation

* Add delete mutation

* Add system/items scoping

* Fix merge conflicts for real now

* Use system services, rename ids->keys

* Start on docs on mutations

* Updates to match main

* Add fetch-by-id

* Add one/many resolvers for mutations

* Check system collection rows for singleton

* Fix resolver extraction for single read

* Share delete return type

* Add comments

* Use collection root name for readable type

* Add specs endpoint for GraphQL SDL

* Update docs

* Add note on SDL spec

* Fix delete single example

* Remove package-lock

* Fix collection read scoping in non-read
2021-03-30 17:06:35 -04:00
Rijk van Zanten
b562ceeb0c Add Tree-View Interface (#4602)
* Fix local type extraction

* Render basic tree in tree-view

* Render drawer-item in tree-view-group

* Retrieve nested draggable changes

* Default sort query to configured sortField

* Store nested group / sort to API

* Allow updating item values

* Figure out a dropzone approach on preview

* Finish editable tree view

* Set sort value based on sort field in relation

* Add create-new / add-existing

* Respect previously made nested edits

* Add description in setup

* Fix fetching level of o2m sort field

* Remove min height on empty root

* Remove unused types

* Add notice for invalid relationship type

* Allow recursive o2m in setup

* Styling tweak

* Revert changes in v-list

* Revert changes in groupable
2021-03-26 17:12:55 -04:00
rijkvanzanten
3eaa375952 Provide getSchema function in hook/endpoint registration function
Fixes #4621
2021-03-22 20:13:49 -04:00
Pyll Gomez
71c8c4cc2c Assets quality parameter #4557 (#4620)
* Rotate JPG image on upload #4206

* fixes #3949 width/height generated for gif and tif

* API hooks for event added for auth.login #4079

* updated doc for api hooks for new auth.login event

* Style tweaks

* Update docs

* Tweak docs some more

* Spelling error

* Allow non-required flags and pass to hook

* SDK - Persistent login refresh fixes #4113

* Fixed #4145 SDK, Token Expired error

* Spell check

* Docs Spell check

* Docs Spell check

* Docs Spell check

* update docs for sdk-js

* To delete all expired session from db on login

* corrected the condition for the delete

* changed the from Date.now to new date .

* Move it inline

* fixes issue 4557 for asset quality for thumbnail

* asset documentation is updated

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-22 20:08:44 -04:00
rijkvanzanten
f3683c9cf7 Parse filter structure on validation step
Fixes #4446
2021-03-11 18:25:14 -05:00
rijkvanzanten
ada85b20ce Fix build on rc 45
Fixes #4418
2021-03-08 11:18:14 -05:00
rijkvanzanten
1e89c25872 Remove "locked" field from directus_fields
Closes #3925
2021-03-04 18:41:59 -05:00
Nicola Krumschmidt
08293b8570 Update Knex to version 0.95.0 (#4374)
* Update Knex to version 0.95.0

* Fix formatting in schema dialects

* Fix Knex imports

* Update package-lock

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-03 19:37:44 -05:00
Rijk van Zanten
db30acbb8a Move sortField to relationship setup (#4304)
* Add migration

* Add sort field to relation types

* Remove sortfield options in favor of relationship

* Add sort field configuration to relational setup

* Save m2a sortfield on the correct row

* Add default sort field to system data
2021-02-25 19:13:36 -05:00
Rijk van Zanten
b7d87e581a System permissions for app access (#4004)
* Pass relations through schema, instead of individual reads

* Fetch field transforms upfront

* Fix length check

* List if user has app access or not in accountability

* Load permissions up front, merge app access minimal permissions

* Show app access required permissions in permissions overview

* Show system minimal permissions in permissions detail

* Fix app access check in authenticate for jwt use

* Fix minimal permissions for presets

* Remove /permissions/me in favor of root use w/ permissions

* Fix logical nested OR in an AND

* Use root permissions endpoint with filter instead of /me

* Allow filter query on /permissions

* Add system minimal app access permissions into result of /permissions

* Remove stray console log

* Remove stray console.dir

* Set current role as role for minimal permissions

* Fix no-permissions state for user detail

* Add filter items function that allows altering existing result set
2021-02-11 12:50:56 -05:00
rijkvanzanten
05f0bc967e Turn hash into type
Fixes #3542
2021-01-12 17:08:19 -05:00
rijkvanzanten
3654da7fa9 Work around breaking change in @types/express-sesssion
Fixes #927
2020-11-11 09:41:25 -05:00
rijkvanzanten
8cbdfb409b Use prefetched schema info 2020-11-09 17:13:48 -05:00
rijkvanzanten
0697f4b4be Add new overview method, attach it every request 2020-11-09 15:19:23 -05:00
rijkvanzanten
528112314d Remove outdated tests, fix imports 2020-11-09 12:29:01 -05:00
rijkvanzanten
d8339ae70d Merge branch 'main' into assets 2020-10-29 16:03:04 -04:00
rijkvanzanten
23fd029687 Move system collection rows out of DB 2020-10-28 16:26:46 -04:00
rijkvanzanten
3d08409290 Merge branch 'main' into assets 2020-10-26 19:44:50 +01:00
rijkvanzanten
dae2ca530f Fix type casting in authorization service
Fixes #776
2020-10-26 11:30:21 +01:00
Nicola Krumschmidt
3052b850ef Remove field.meta.required property 2020-10-22 18:52:45 +02:00
e01
d776bb826d Use withoutEnlargement for more consistency 2020-10-19 20:56:14 +03:00
e01
4ef8cac28e Assets improvements 2020-10-18 18:58:32 +03:00
Rijk van Zanten
60ed9be03e Update extensions.ts 2020-10-15 17:00:41 -04:00
rijkvanzanten
a3e5258387 Rename detail modals 2020-10-14 15:43:53 -04:00
rijkvanzanten
d33d877d02 Merge branch 'main' into many-to-any 2020-10-09 15:58:43 -04:00
rijkvanzanten
c140870e90 Use related PK 2020-10-09 15:53:46 -04:00
rijkvanzanten
5dba15082f Handle non-o2m cases 2020-10-09 13:13:49 -04:00
rijkvanzanten
25862429bd Augment types for m2a 2020-10-09 13:07:15 -04:00
rijkvanzanten
5b91bc3577 Rework nested ast typings to nodes 2020-10-09 13:07:15 -04:00
rijkvanzanten
bf76244ba7 Various system schema name changes
Fixes #482
2020-10-02 17:43:58 -04:00
rijkvanzanten
eeedc01c53 Add /utils/revert, use in app
Fixes #485
2020-10-02 16:20:06 -04:00
rijkvanzanten
537fe8f8dd Allow deep query 2020-10-02 10:34:48 -04:00
rijkvanzanten
f1159d08cd Fix date io in api 2020-09-28 18:16:27 -04:00
rijkvanzanten
2af75e3cfb Fix 500 on singleton retrieval
Fixes #418
2020-09-24 14:10:20 -04:00
rijkvanzanten
76d70df14b Remove unused type from accountability 2020-09-24 10:34:04 -04:00
rijkvanzanten
0d414bfb84 Fix type issue in response of readByQuery 2020-09-23 21:29:07 -04:00
rijkvanzanten
b8ec2934ca Add deep query support 2020-09-23 17:48:41 -04:00
rijkvanzanten
85ca7b5d17 Run prettier 2020-09-22 16:11:28 -04:00
rijkvanzanten
7caf429d1d Add custom endpoints support 2020-09-22 15:55:22 -04:00
rijkvanzanten
48fca55651 Restructure exports for services 2020-09-22 13:16:14 -04:00
rijkvanzanten
b8eff4c788 Use CSV for special, add on create / on update for fields 2020-09-15 17:31:37 -04:00