Commit Graph

2092 Commits

Author SHA1 Message Date
Josh Soref
0b01923b0d Spelling (#13072) 2022-05-02 13:16:03 -04:00
Rob Lee
b62456fca8 first attempt at nested sorting (#12084)
* first attempt at nested sorting

* pull out addJoin so it can be reused

* Move get-relation-info to file, add tests

* Extract get-column-path, add tests

* Little cleanup

* Prevent the regex from blowing up with malicious input

* Allow sorting on m2o fields in the tabular layout

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-27 15:02:10 -04:00
rijkvanzanten
5d19120cf4 Force share generated perm set to read 2022-04-26 14:34:06 -04:00
Rijk van Zanten
d7d47b4e14 Allow configuring the HSTS header (#13004) 2022-04-25 16:46:55 -04:00
Rijk van Zanten
aae90979fb Allow disabling GraphQL introspection (#13003) 2022-04-25 16:20:32 -04:00
Rijk van Zanten
70c70af4ee Support BOM in CSV import (#12993)
Fixes #12970
2022-04-25 10:39:19 -04:00
gkielwasser
625b1dbc7e Store original error code in extensions (#8034)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-22 17:32:39 -04:00
rijkvanzanten
18407ad7c3 Add missing " 2022-04-22 17:10:07 -04:00
rijkvanzanten
ed780aceba v9.9.1 2022-04-22 12:21:24 -04:00
Azri Kahar
3965a5e6dd prevent fields without permissions from appearing (#12949) 2022-04-22 11:56:21 -04:00
Azri Kahar
90b5883f49 fix api for non existent fields & collections (#12952) 2022-04-22 10:49:03 -04:00
Azri Kahar
4438909186 Fix readSingleItems response from array to object (#12922) 2022-04-21 08:21:35 -04:00
Rijk van Zanten
78a3895f75 Give config file higher priority than existing env (#12900)
Fixes #12884
2022-04-20 16:33:26 -04:00
Rijk van Zanten
d652a12008 Ignore non-alias fields that only exist in directus_fields (#12860)
* Ignore non-alias fields that only exist in directus_fields

Fixes #12857

* Organize imports
2022-04-19 14:44:32 -04:00
Azri Kahar
08e57c2901 only set default value when exists for singleton (#12852) 2022-04-19 11:18:09 -04:00
Azri Kahar
098dc4cc70 fix directus_user mutation with role (#12849) 2022-04-19 10:32:08 -04:00
Azri Kahar
460f0ba003 Fix alias (#12826)
* fix alias

* minor clean up

* fix graphql nested junction aliases
2022-04-19 10:19:49 -04:00
Rijk van Zanten
986bd51759 Don't save directus_revisions row for empty delta (#12839)
Fixes #12838
2022-04-18 22:54:19 +00:00
Rijk van Zanten
7dd8e8a6a9 Support jsonb in count() (#12835)
* Support jsonb in count()

Fixes #12779

* Flip check

The expected path is json rather than jsonb, so it feels like the safer default
2022-04-18 15:16:57 -04:00
Rijk van Zanten
982a7836f2 Scope not null in subquery (#12833)
Fixes #12803
2022-04-18 13:21:29 -04:00
Rijk van Zanten
74fbba5c3b Fix casting of duplication fields (#12824)
Fixes #12555
2022-04-18 10:39:41 -04:00
Rijk van Zanten
d8b81f07c7 Throw 400 on file upload with missing filename (#12785)
Fixes #8101
2022-04-15 17:36:42 -04:00
rijkvanzanten
fb252ca4ce v9.9.0 2022-04-15 14:26:54 -04:00
Azri Kahar
953eb99eb3 Fix schema apply for changes in field meta options & display_options (#12712)
* Fix schema apply for changes in field meta options

* take display_options into account

* check changes in meta in general
2022-04-15 13:27:47 -04:00
Nitwel
3e1fce8968 Relational Interfaces Rework 🐰🕳️ (#12082)
* add basic util function for later use

* sketch up useRelationMultiple implementation

* update relation util and start reworking relational interfaces

* support filter in m2o

* start working on useRelationMultiple

* continue working on relational foundation

* finish basic use-relation-multiple composable

* get o2m pretty close to being finished

* finish up list-o2m

* replace old interfaces

* copy existing interface

* rewrite vue file

* highlight deleted items

* use Search instead of Get

* support selection on m2m

* finish up m2m

* replace old files

* update files interface

* fix permission checks

* fix styling

* add sketches to explain relations

* rewrite m2a interface

* add usage hint to use-relation-multiple

* update file interface to use new composable

* update file-image interface

* fix image not being shown

* revert names

* fix selection of existing items

* fix loading selected items

* in between commit

* update translations interface

* try using composable recursive

* try linear approach on value modeling

* finish rewriting list-o2m-tree-view interface

* revert api changes

* fix sorting for list-o2m-tree-view

* fix selected items in created array

* Add direct download option to files interface

* Fix linter warnings

* Weird that it's being difficult, but ok

* Cast existingItemCount to number at all times

* fix page gets set below 1

* align pagination to the right

* highlight deselecting row

* show min 1 skeleton loader

* only filter selected when item exists

* fix working on new items

* Fix linter warning

* fix deselecting selected items

* show different icon depending if icon is local

* add changes from #12611

* Add _some vs _none support to o2m

* finish filtering out selected items

* Use get instead of search request

* fix save and stay

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>

* fix adding items to m2o

* Fix linter warning

* Handle no-type better

* Clean up axios usage

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-04-14 22:57:17 +02:00
keesvanbemmel
d11c59462f Adds x-directus-cache response header with HIT value (#12732)
* Adds x-directus-cache response header with HIT value

* Added ENV var for cache header and MISS, UNCACHEABLE

* Rename CACHE_HEADER_KEY -> CACHE_STATUS_HEADER

Tad opinionated, but I feel like it describes the functionality slightly better

* Return miss consistently

Uncacheable doesn't quite describe what's happening. The user actively requests the cache to be skipped, which should result in an expected miss. The value isn't un-cacheable, the cache is skipped on purpose

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-14 13:42:10 -04:00
Aiden Foxx
fd668647c1 Added default role support to LDAP and allow optional role syncing (#12767)
* Added default role support to LDAP and allow optional role syncing

* Add minimal docs

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-14 11:27:17 -04:00
Nick Olszanski
360d5b64f5 add Last-Modified header to /assets/* responses (#12231)
* add `Last-Modified` header to `/assets/*` responses

only affects assets with a valid `modified_on` DB field

* update docs about `Last-Modified`

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-13 16:46:34 -04:00
Azri Kahar
513cb7b824 Fix schema apply of UUIDs from SQLite onto other databases (#12723)
* Fix schema apply for UUIDs from SQLite

* simplify the merge a little bit
2022-04-13 15:32:02 -04:00
ian
d8cf2bb234 Split filter key to get m2a nested collection name (#12739)
* Split filter key to get m2a nested collection name

* Add the collection field to the required permissions

* Adding required permissions to relational table

* Tidy up code
2022-04-13 14:37:17 -04:00
Azri Kahar
3fb81db1c9 Fix schema apply for CURRENT_TIMESTAMP default value (#12716)
* Fix schema apply for CURRENT_TIMESTAMP default val

* add typeof string check
2022-04-13 11:18:58 -04:00
Aiden Foxx
4654aefa66 Added "json" to acceptedEnvTypes (#12727) 2022-04-13 09:22:42 -04:00
Rijk van Zanten
f92fb0762f Return BigIntegers as Strings in GraphQL (#12688)
Fixes #12051
2022-04-11 16:57:21 -04:00
Rijk van Zanten
49f97dfdd4 Only add update_me permissions for logged in users (#12685)
Fixes #12256
2022-04-11 15:39:21 -04:00
rijkvanzanten
56963faca9 Default users last_access to readonly
Ref #12655
2022-04-11 15:19:18 -04:00
Rijk van Zanten
a117e5b65f Add count fn support to gql (#12684) 2022-04-11 14:58:32 -04:00
Azri Kahar
095e7665d4 add citext as a supported local type (#12670) 2022-04-11 12:24:03 -04:00
Rijk van Zanten
e3f3d7e3b2 Throw payload error when using file upload without providing a file (#12682)
* Throw error on file upload if the number of uploaded files is 0

Fixes #12678

* Add unit test

* Mock env

* Fix mocks
2022-04-11 12:04:45 -04:00
ian
18d872a003 Merge permission's validation only when not empty (#12615) 2022-04-07 09:11:32 -04:00
ian
68066eccb7 Remove UTC conversion from date, time and datetime fields (#10956)
* Remove UTC conversion from date, time and datetime fields

* Fix mysql / maria timestamps when not in UTC timezone

* Add sequential tests with node timezone change

* Increase connection attempt check

* Add error catching in tests flow setup

* Check for server connectivity

* Fix promises

* Fix timestamp inconsistencies

* Revert to previously used parseISO

* Ensure database and directus connection

* Add another timezone to test positive and negative GMT

* Set local server hostname to localhost

* Add tests for SQLite

* Use notNullable primary key

* Revert connection testing sleep duration

* Fix nested transactions on SQLite

* Increase MSSQL request timeout

* Add type override flag for SQLite

* Remove commented code

* Add type override flags for Oracle

* Updated test file path

* Increase test servers launch timeout

* Increase test servers launch timeout

* Update format of tests

* Fix typo

* Increase test timeout for CockroachDB

* Add type overrides when creating fields through collections service

* Remove time field type conversion for Oracle

* Update collections list in test

* Remove check for time field in Oracle

* Add missing continue...

* Remove database override

* Add note for SQLite

* Rename flags and extract shared util

* Abstract remaining DB specific checks

* Revert flags renaming except renaming of test files

* Use date helper to add field flag

* Move field date typecasting upstream

* Use timestamp helper for date-created and date-updated

* Fix tests

* Remove unused vars

* Add tests for date-created

* Increase connection attempt count

* Fix test for mariadb

* Increase allowable difference to account for delays

* Add tests for date-updated

* Fix tests again for mariadb

* Add date helpers post merge

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-06 16:15:22 -04:00
Rijk van Zanten
f9457f5bdf Upgrade sharp (#12609)
Fixes #12440
2022-04-06 12:11:17 -04:00
ian
307cef8f5e Add permissions check for relational field only if child has filter (#12549)
* Add permissions check for relational field only if child has filter

* Allow id field for actions such as update and delete

* Use primary key instead of id

* Add test
2022-04-06 11:30:50 -04:00
ian
c6736c4f19 Fix access to count(*) aggregation (#12607) 2022-04-06 11:14:51 -04:00
Azri Kahar
f7e651cbe3 Set includeProjectDefault default value to false (#12601) 2022-04-06 10:07:56 -04:00
Jay Cammarano
70f36ac3d3 When no header icon is chosen use the panel types's icon for the default header icon rather than hardcoding "insert_chart" (#12541)
* panelTypeInfo.icon default for header

* migration: +nullable, -defaultTo('insert_chart')

* Rename migration file, use helper to fix oracle etc

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-05 15:29:11 +00:00
Aiden Foxx
26f626d552 Flatmap the oauth profile so we can use sub-values (#12457) 2022-04-05 11:14:49 -04:00
Azri Kahar
93a0369b99 Fix snapshot output (#12579) 2022-04-05 10:51:23 -04:00
Wryn (yage) Wagner
0930c2df97 Safe Metadata Upload (#12511)
* [Related to #11292] Safe Metadata Upload
- Created FILE_METADATA_ALLOWLIST
- Added test library for `FilesService`

* Rename ALLOWLIST->ALLOW_LIST to be consistent with other env vars

* Make sure it still works for files without Exif

* Prevent breaking changes in metadata formatting

* Allow * for all

* Fix md sup

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-04 20:43:56 -04:00
Azri Kahar
d0b0818cca Return 401 status code for expired tokens (#12281)
* Refresh token when it's expired & retry request

* move refresh token interceptor in autoRefresh flag

* add TOKEN_EXPIRED exception

* update interceptor condition & fix autoRefreshJob

* update docs

* revert auth drivers changes

* remove unused imports

* undo sdk auth refresh changes
2022-04-04 09:23:28 -04:00
Aiden Foxx
4cb8e8f0ca Always try to rebind on healthcheck error (#12532)
* Always attempt rebind on LDAP healthcheck error

* Fix linting error

* Update api/src/auth/drivers/ldap.ts
2022-04-04 09:17:06 -04:00