Commit Graph

2242 Commits

Author SHA1 Message Date
José Varela
5087fcd1e4 Graphql: Fix geometry type in arguments (#15050)
* Handle matrixes as args
This was the less intrusive way I figure out.
We may need to refactor this parseArgs properly in order to handle this types

* App/Graphql: Send filter query as proper JSON instead of escaped string

* Make panel variables readonly when no-editing
Prevents Geometry type mismatch error

* Fix proper way to parse args
2022-08-15 09:58:43 -04:00
Rijk van Zanten
6d08672c88 Update knex-schema-inspector to 2.0.4 (#15047) 2022-08-12 11:02:17 -04:00
Azri Kahar
8fc7218c55 Add Content-Type header when applicable (#15029) 2022-08-11 11:23:16 -04:00
ian
3586409a0b Only allow null filter operators for fields with "conceal" special (#15010)
* Only allow null filter operators for fields with "conceal" special

* Add tests

* Use GraphQLHash type for fields with "conceal" special

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-08-10 11:19:04 -04:00
ian
d29536208c Encode webhook url only if it does not contain encoded values (#15009) 2022-08-10 10:17:27 -04:00
ian
0fd492cdd2 Send error status only if no data is written (#15007) 2022-08-10 09:28:08 -04:00
Azri Kahar
59b62d4655 Fix macos-release error in server info (#14840) 2022-08-05 16:53:33 -04:00
Bjørnar Hagen
3757167d4b Fix duplicate env keys (#14845) 2022-08-05 16:34:25 -04:00
ian
2a5314f753 Encode file import url if not already encoded (#14854) 2022-08-05 15:21:24 -04:00
rijkvanzanten
1ebda96a69 v9.15.1 2022-08-05 14:50:06 -04:00
ian
62a19b40d5 Fix filter type check for functions (#14885)
* Fix filter type check for functions

* Use stripFunction util

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-08-05 11:56:22 -04:00
rijkvanzanten
3270df00c1 9.15.0 2022-08-04 18:19:19 -04:00
José Varela
cc343fdf91 Improve cache performance by compressing records (#14833)
* Utils to compress/decompress data
Gzip was chosen because we want smaller data but quick algorithm since this will be ran for every request

* Compress system cache

* Decompress system cache

* Set/Get compressed cache for individual requests

* Switch from gzip to snappy, use json compression too

* Fix cache exp set/get

* Remove unused import

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-08-04 17:35:27 -04:00
ian
3dedf1cb3f Check for allowed filter operators when applying filter (#14829)
* Check for allowed filter operators when applying filter

* Add hash type to GraphQL

* Add tests

* Specify text type
2022-08-03 14:14:19 -04:00
Azri Kahar
5d96d752f4 Support custom aspect ratios in image editor (#14786)
* Support custom aspect ratios in image editor

* Add custom aspect ratios in file items as well

* Revert file item custom-aspect-ratio changes

* Use globally configured custom aspect ratios

* Remove previos custom-aspect-ratio logic

* code style tweak

* use migration instead of seed

* rename field to custom_aspect_ratios

* keep defaults + change icon

Co-authored-by: qborisb <boris@qdentity.nl>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-08-03 22:25:25 +08:00
Erick Torres
791854ab08 Move serializers option to the right place for pino-http (#14803) 2022-08-03 08:43:45 -04:00
rijkvanzanten
73d31b7c53 Fix location of head return call 2022-08-02 14:39:11 -04:00
rijkvanzanten
8085b0d788 Don't crash on invalid file storage paths 2022-08-02 13:21:44 -04:00
Brainslug
eaec9b1f63 500 error when using scoped fields query when not applicable (#14627)
* Initial hacky fix for invalid field formats

* preventing parseFields from recursively parsing fields for non applicable relations

* removed unneeded parsefields exception
2022-08-01 12:10:58 -04:00
Azri Kahar
ab8be3621a Change notifications timestamp to nullable & default to now (#14323)
* Change notifications timestamp to nullable

* check special flags that generate data

* create and use new updateType helper

* update migration identifier

* use changeToType() where applicable

* fix method name used in new migration

* bump identifier again

* Remove changeToString

* update migrations

* add conditional text/string type for compatibility

* bump migration identifier

* bump

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: ian <licitdev@gmail.com>
2022-08-01 21:05:38 +08:00
Azri Kahar
ab045cffce Fix Emit Events for item CRUD operations in Flows (#14741) 2022-07-29 10:52:28 -04:00
Rijk van Zanten
15be1c60b0 Support running prod locally through ./api/cli.js (#14728) 2022-07-28 15:17:31 -04:00
ian
732b49f482 Replace functions within arrays in GraphQL (#14705) 2022-07-27 12:32:39 -04:00
Phillip Wheatley
c8188e3ea1 Extend OpenAPI schemas for JSON-backed fields (#14581)
* Confirm issue with test case

* Generate schema for json field types when nested fields are specified

* Return untyped schema for json fields

* Fix linter warnings

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-25 18:03:24 -04:00
Aiden Foxx
28d60131a3 Handle not unique errors during auto-registration (#14625)
* Handle RecordNotUniqueException in oauth

* Handle RecordNotUniqueException in openid

* Added RecordNotUniqueException handling for ldap

* Update api/src/auth/drivers/oauth2.ts

* Update api/src/auth/drivers/ldap.ts

* Add LDAP unique user log

* Added unique user log to oauth

* Added unique user log to OpenID

* Update api/src/auth/drivers/ldap.ts

* Update api/src/auth/drivers/oauth2.ts
2022-07-25 14:09:51 -04:00
Nicola Krumschmidt
81cd748c6d Add support for operation extensions to the Extensions SDK (#14410)
* Clean up extensions build logging

* Expose defineOperation* helpers through extensions-sdk

* Add support for scaffolding operation extensions

* Refactor extension type constants

* Improve extension-related tests in shared

* Improve wording when scaffolding extension fails due to wrong type

* Make spinner text bold when scaffolding extensions

* Add support for building operation extensions

* Fix operations tile name

* Make extension config type spacing consistent

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-07-25 11:36:52 -04:00
rijkvanzanten
6e4738e4c0 v9.14.5 2022-07-22 14:45:15 -04:00
rijkvanzanten
aec37f6198 v9.14.4 2022-07-22 10:38:33 -04:00
Azri Kahar
7d62a70007 Fix GraphQL aggregate query (#14560)
* FIx aggregate query in GraphQL

* change type to Query and alter previous logic

* test
2022-07-22 09:55:51 -04:00
rijkvanzanten
cf41b07100 v9.14.3 2022-07-21 16:16:14 -04:00
Rijk van Zanten
e223a9d1cd Remove oracledb from package.json (#14556) 2022-07-21 15:55:51 -04:00
rijkvanzanten
6d1e5b3432 v9.14.2 2022-07-21 15:17:56 -04:00
ian
9f9ef45846 Disable foreign check on SQLite when deleting fields (#14512)
* Disable foreign check on SQLite when deleting fields

* Add default on_delete constraint

* Add test

* Rename methods

* Fix test sequence
2022-07-21 14:44:05 -04:00
ian
8d9991abe3 Process relational collection's permissions in functions (#13870)
* Process relational collection's permissions in functions

* Fix deep usage of functions in GraphQL

* Add unit test for updated SQL query with permissions

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-21 14:42:22 -04:00
ian
40d71f309b Fix filter column aliasing (#14423)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-21 14:37:08 -04:00
Rijk van Zanten
600f55e4a2 Resolve lintw arnings (#14555) 2022-07-21 12:44:16 -04:00
Ian Pirro
23912e5232 Fix: Error applying schemas with nested collection(s) (#13949)
* Fix nested collection creation when parent exists

* tests

* desc | comments

* typo

* minor tweak

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-07-21 15:29:12 +08:00
Danilo Polani
8b116f6deb Add "security" commands to api CLI (#9400)
* add command to generate app key

* add command to generate secret

* group security commands under the security group

* add new security commands to cli docs

* add disclaimer on deploy secret generation

* remove duplicate hubspot embed code

* remove .env overwrite feature to security commands

* update the cli docs for security commands

* return key generation directly in output

* restore package-lock.json

* Write secret directly

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-20 16:44:35 -04:00
Rijk van Zanten
931a7bde46 Add missing _between/_nbetween filter operators to GQL (#14540)
Fixes #13782
2022-07-20 16:42:59 -04:00
Jay Cammarano
820457690f Optimize media loading across app (#10592)
* v-image and "lazy load" working

* fixed vars

* all the other img uses

* No longer require access token in url for files

* Add lazy loading and size limits

* Rename map-component source prop

* Fix lint warning

* Update app/src/views/public/public-view.vue

Co-authored-by: ian <licitdev@gmail.com>

* Fix lint

* Fix missing file type icon

* Fix null imageInfo error

* Use video.js for media playback

* Fix .js file display

* Update package-lock.json

* Update package-lock.json

* update package.json

* Update pnpm-lock.yaml

* Remove unrelated addition on VDatePicker

* Remove folder abstraction

* Use image data based aspect ratio on preview

* Base app rate throttle on API rate limit config

* Configure app rate limit throttle based on api config

* Convert v-image to script[setup]

* Convert v-media to script[setup]

* Cleanup v-media

* Remove unneeded addTokenToUrl usages

* Remove video.js

It doesn't do authorization headers for mp4/mp3, so it's pointless

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: ian <licitdev@gmail.com>
2022-07-20 15:52:38 -04:00
José Varela
f7a8c36ee6 Do not try to convert Dates (considered an object) (#14520) 2022-07-19 17:54:14 -04:00
Clayton Gulick
ec77b0a203 Enable extensions cache (#14499)
* enable caching for extension assets with ASSETS_CACHE_TTL setting

* simplify implementation
2022-07-19 11:51:32 -04:00
Azri Kahar
f9826afd87 Fix apply snapshot for UUID primary keys (#14506)
* fix apply snapshot for char to uuid primary keys

* account for is_primary_key
2022-07-19 11:24:34 -04:00
Christopher Kapic
090671ea1e Update Knex version to fix CockroachDB relationships showing multiple times (#14509)
* update knex version

* Update all knex uses

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-19 10:44:14 -04:00
Rijk van Zanten
27cc3e1bec Move repo to pnpm based workflow (#14350)
* Use pnpm instead of npm

* Setup workspace

* Replace scripts / lerna root stuff

* Add todo file

* Update lock, start updating packages

* Update todo

* [WIP] Keep going on module resolution in pnpm

* Fix final missing deps/types for complete build

* [WIP] Replace npm commands with pnpm alternatives

* Update jest config for v28

* Fix missing package under schema

* Update workflow

* Run CI on fork

* Use local reference

* Remove version from local workflow

* Add build to prepare

* Add Node's max old space size flag to linter

* Idemdito for codeql

* Hyphens? Underscores?

* Bang

* Only build one thing at a time

* Underscores after all?

* Match 7gb of GH

* Set env on prepare

* Jest is driving me nuts

* Downgrade jest

* Add root jest

* We'll get there, eventually.

* 🥳

* Het houdt niet op, niet vanzelf

* attempt to fix e2e

* fix unit test & shared import

* add `debug: true` to CodeQL action

* Fix dev call in shared

* Add missing cross-env

* Add missing geo-json dependency for app

* add flag to prepare action to skip build

* remove debug flag from codeql action

* fix invalid env syntax

* add tslib to app dependencies for tests

* another attempt

* Added missing rimraf dependency for the api prebuild/cleanup scripts

* Added missing ts-node dependency for the api cli script

* update E2E tests readme to use pnpm

* Undo move of extensions sdk

* Fixes nested groups in accordions not rendering fields (#14369)

* initial fix for nested groups in accordions

* removed debug code

* Fix strict relative dates showing "incorrect" (#14390)

* Set rounding method of relative formatted date to floor when strict option is selected

* Add round fn as an option

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

* Don't use locales in generated camelCased values from env (#14401)

Ref https://github.com/directus/directus/discussions/14122

* Fix list panel descending sort (#14396)

* fix list panel descending sort

* Handle missing or explicit desc value

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

* Fix query primary field for system tables (#14402)

* New Crowdin updates (#14403)

* Update source file en-US.yaml

* New translations en-US.yaml (Spanish, Chile)

* New translations en-US.yaml (Spanish, Latin America)

* New translations en-US.yaml (Greek)

* New translations en-US.yaml (Italian)

* New translations en-US.yaml (French, Canada)

* Fix/wysiwyg context menu (#14404)

* New translations en-US.yaml (Polish) (#14407)

* Encoded the url using encodeURIComponent, so that the url gets sanitzed and so, we did not get 404 error. (#14418)

* Encoded the url using encodeURIComponent, so that the url gets sanitized and we did not get 404 error.

* Added required changes as stated by the reviewer

* Used encodeURI instead of encodeURIComponent to encode the params only

* Solved linting error

* Solved linting errors

* checked with npm run lint, no linting errors found

* fix generateJoi error due to empty permissions when creating new role (#14416)

* fix empty permissions when creating new role

* basic test

* move logic up

* additional test

* Update api/tests/utils/filter-items.test.ts

Co-authored-by: ian <licitdev@gmail.com>

Co-authored-by: ian <licitdev@gmail.com>

* Recreate lockfile

* Fix build of extensions-sdk

* Add missing dependency

* Add some more missing deps

* Update blackbox to use pnpm

* Update workflow to use main

* Update pack to work with pnpm

* Simplify commands

* Remove todo file (completed)

* ADd missing types dep

* Use local test version

* Remove version from local reference

* Call super with context

* Add missing dep

* Simplify workflows

Ref https://github.com/directus/organization/issues/135

* Simplify some more

* Linter is on root

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: brainslug <tim@brainslug.nl>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Gerard Lamusse <gerardlamo@gmail.com>
Co-authored-by: José Varela <joselcvarela@gmail.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Zeel Pathak <60271095+zeel-pathak@users.noreply.github.com>
2022-07-15 17:41:49 -04:00
José Varela
dc850c115e Use same types as count for countDistinct (#14460) 2022-07-15 13:13:45 -04:00
Rijk van Zanten
47e660cb76 Update knex-schema-inspector to 2.0.3 (#14437) 2022-07-14 16:22:41 -04:00
Rijk van Zanten
838770b2be Add GraphQL query POST caching (#14371)
* Add GraphQL query POST caching

Followup to #11462

* Fix condition check
2022-07-14 12:48:47 -04:00
Azri Kahar
64acd2fdb3 fix generateJoi error due to empty permissions when creating new role (#14416)
* fix empty permissions when creating new role

* basic test

* move logic up

* additional test

* Update api/tests/utils/filter-items.test.ts

Co-authored-by: ian <licitdev@gmail.com>

Co-authored-by: ian <licitdev@gmail.com>
2022-07-14 09:14:59 -04:00
Zeel Pathak
4127db78ea Encoded the url using encodeURIComponent, so that the url gets sanitzed and so, we did not get 404 error. (#14418)
* Encoded the url using encodeURIComponent, so that the url gets sanitized and we did not get 404 error.

* Added required changes as stated by the reviewer

* Used encodeURI instead of encodeURIComponent to encode the params only

* Solved linting error

* Solved linting errors

* checked with npm run lint, no linting errors found
2022-07-14 12:43:53 +02:00