Commit Graph

9669 Commits

Author SHA1 Message Date
ian
0ac08da7ed Fix legacy permissions for M2O fields in GraphQL (#16430)
* Remove relation for legacy permission without allowed field

* Remove deprecated formatError and improve error handling

* Add unit test

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-17 11:04:56 -05:00
Azri Kahar
ed53673b0f Fix condition operation passing even when the checked field isn't present in the payload (#16483)
* use requireAll in validatePayload for condition

* add/update tests
2022-11-17 10:55:43 -05:00
Nicola Krumschmidt
5d25c19836 Detect used package manager in extension CLI (#15909)
* Detect used package manager in extension CLI

* Add tests

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-11-17 10:53:54 -05:00
Rijk van Zanten
0bb34f0f0d Patch Tuesday 🐸 (#16475)
* Update monorepo root

* Update API dependencies

* Use unranged version

* Update app deps

* Upgrade packages dependencies

* Fix shared build

* Fix type warning in api

* Fix test runner

* Get rekt by ya boy comma-,

* Fix missing unit deprecation for sass color.mix()

Co-authored-by: ian <licitdev@gmail.com>
2022-11-17 08:51:42 -05:00
Azri Kahar
6f8f5219af fix list-folders test on Windows (#16484) 2022-11-17 08:17:44 -05:00
Nicola Krumschmidt
7bf90efa62 Add support for a package extension bundle type (#15672)
* Add bundle type to constants and types

* Add support for API bundle extensions

* Rename generateExtensionsEntry to generateExtensionsEntrypoint

* Add support for App bundle extensions

* Refactor App extension registration

* Replace extensions inject with useExtensions()

* Replace getInterfaces() with useExtensions()

* Replace getDisplays() with useExtensions()

* Replace getLayouts() with useExtensions()

* Replace getModules() with useExtensions()

* Replace getPanels() with useExtensions()

* Replace getOperations() with useExtensions()

* Add useExtension() composable

* Replace useExtensions() with useExtension() where applicable

* Remove interface getters

* Remove display getters

* Remove layout getters

* Remove module getter

* Remove panel getters

* Remove operation getters

* Rename extension register.ts files to index.ts

* Perform module pre register check in parallel

* Remove Refs from AppExtensionConfigs type

* Remove old extension shims

* Ensure registration of modules is awaited when hydrating

* Add support for scaffolding package extensions

* Add support for building bundle extensions

* Add JsonValue type

* Use json for complex command line flags

* Load internal extensions if custom ones are not available

* Fix extension manifest validation for pack extensions

* Fix tests in shared

* Add SplitEntrypoint type

* Move command specific utils to helpers

* Add SDK version getter

* Move extension dev deps generation to helpers

* Move template path to getter util

* Move template copying to a helper

* Only rename copied template files

* Add directus-extension add command

* Convert provided extension source path to url

* Replace deprecated import.meta.globEager

* Mock URL.createObjectURL to make App unit tests pass

* Update rollup-plugin-typescript2

* indentation

* sort vite glob imported modules

* fix unintentional wrong commit

* Simplify app extension import logic

* reinstall @rollup/plugin-virtual

* add test for getInterfaces() expected sort order

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-11-16 11:28:52 -05:00
Azri Kahar
0859102a61 sanitize comment-input (#16471) 2022-11-16 10:31:57 -05:00
Nitwel
7248d36940 Only pass needed values when sorting (#16283)
* only pass needed values when sorting

* fix sort for files

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-16 10:23:40 -05:00
Nitwel
568479712f fix preset resetting itself (#16473) 2022-11-16 09:34:14 -05:00
Pascal Jufer
45eb4941fc Small clean-up after Jest to Vitest switch in API (#16462)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-15 17:20:45 -05:00
ian
e79720735a Fix unsupported date_part() in CrDB (#16461) 2022-11-15 15:22:12 -05:00
Pascal Jufer
adeabdfe7b Clean-up and unify all package.json files (#16447)
* Clean-up & unify all package.json files

* Sort all package.json files the same way

Using 'sort-package-json'

* Add funding link to packages
2022-11-15 11:35:28 -05:00
Azri Kahar
b0529d4951 Optimize number of times cache is being cleared in ItemsService updateBatch (#16453)
* improve cache clearing for updateBatch

* add service level data-is-array check

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-15 10:14:35 -05:00
ian
addb077d48 Emit action events with updated schema (#15576)
* Emit action events with updated schema

* Fix collections service consistency

* Pass action event upstream for createMany item

* Pass action event upstream when processing payload

* Skip unnecessary retrival of updated schema

* Fix folder tests

* Fields service consistency

* Prevent duplicate cache clearing when deleting fields

* Add tests_extensions_log table

* Update collections crud tests

* Add fields crud tests

* Add action verify schema tests

* Bypass system cache purge in relations service

* Bypass system cache purge in nested field deletion

* Update source for consistency when creating from collection
2022-11-15 10:02:45 -05:00
Pascal Jufer
df495edae0 Exclude unnecessary files from packages (#16374)
* Exclude unnecessary files from packages

* Add back 'copyfiles' in api to copy yaml and liquid files to dist

* Exclude declaration maps and all declaration files for drive packages

Excluding all declaration map files from published packages

Since the "drive" packages are only expected to be used internally, it's
enough to have the declaration files present when developing locally - no
need to include the types in the published packages

* Remove unnecessary entries in "files" field of app/package.json

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-15 09:51:04 -05:00
Michal Szycko
96de8994a3 Keep SidebarOpen state in local storage (#15861)
* save sidebarOpen state in local storage

* handle errors while setting value to local storage

* use useLocalStorage to keep sidebarOpen state, add default value to useLocalStorage, cleanup

* move logic to useLocalStorage, remove LocalStorageObject

* use parseJSON utility

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-11-15 14:30:11 +01:00
Pascal Jufer
c303bdcf10 Finish switch from Jest to Vitest in API (#16263)
* build:  add vitest and update test scripts

* build: 🔧 add vitest config

* build:  Migrate tests to vitest

Remove jest references from test api test files and replace with vitest equivalents.

Tests: 13 tests are failing.

* build: 🚚 move vite.config.ts to api/src folder

* build: 🔥 remove unused vitest.config from api root

* build:  import vitest modules for tests

* build:  add type conversion for actual object

* Finish switch from Jest to Vitest in API

* Replace some leftovers

* Load "sharp" before tests

* Try with cjs

* Temporary enable verbose reporter

* Try with globalSetup

* Fix path to globalSetup

* Provide default export in globalSetup

* Final clean-up

* Remove @vitest/ui & update vitest to 0.25.0

* Add vitest c8 coverage dependency

* Update vitest to v0.25.1

* Replace unnecessary Vitest workaround

* Rework new tests

* Resolve build errors

Co-authored-by: Dorian C Brown <brown.3794@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-14 16:09:47 -05:00
Rijk van Zanten
20b8146221 Replace rollup-plugin-terser with @rollup/plugin-terser (#16441) 2022-11-14 15:07:49 -05:00
Azri Kahar
0fc4c501c3 Allow admin to update Directus User provider and external_identifier (#16436)
* allow admin to update `provider` & `external_id`

* remove unused external_id field

* test for provider and external_identifier

* remove unused test code
2022-11-14 09:46:22 -05:00
Azri Kahar
d3388eb139 fix cast-csv read action for csv field's revisions (#16438)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-14 14:44:47 +00:00
ian
4dfc00cf74 Fix limit in nested a2o queries (#16435)
* Set the limit into the correct query for a2o

* Revert -1 limit and set foreignIds size as limit
2022-11-14 09:41:36 -05:00
ian
6cf77668d1 Check original field name when aliased (#16234)
* Check original field name when aliased

* Rename to aliasMap

* Extract original field name

* Refactor for legibility

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

* Fix linting

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-11-14 09:40:15 -05:00
ian
282d5ae54e Fix date functions for databases not in UTC timezone (#16027)
* Fix date functions for databases not in UTC timezone

* Fix passing raw date objects to DB

* Add unit test

* Use global timezone for mysql and maria

* Fix unit test timezone inconsistency as date object is in local timezone

* Date and datetime fields should be in local timezone

* Fix missing padStart in local string

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-14 09:38:40 -05:00
Brainslug
692b8c4807 CockroachDB can't recreate constraints with the same name (#15984)
* use a different constraint name whyen recreating constraints for cockroachdb

* implement cockroach specific logic in the appropriate helper

Co-authored-by: ian <licitdev@gmail.com>
2022-11-14 13:21:23 +01:00
Nitwel
32a363b803 Reset page when changing pageSize (#16412) 2022-11-11 17:45:23 -08:00
ian
8e400504ea Fix __typename selection for functions in GraphQL (#16413) 2022-11-11 17:32:00 -08:00
Azri Kahar
cc55d5608e Fix "create an item" requestBody schema in OAS (#16294) 2022-11-09 19:50:01 -08:00
Nitwel
10ebe7c523 use correct collection for translation (#16280) 2022-11-09 19:44:19 -08:00
Azri Kahar
24f1e539ba Fix base email template footer link & logo aspect ratio (#16233)
* fix email base template footer link

* fix logo box to be square

* clean up unused classes & attributes

* only add url if user has app access

* add test for notifications service

* re-add database mock

* attempt to fix mock in test

* mock PUBLIC_URL

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-09 07:52:44 -08:00
ian
4b1789afa1 Update last value when triggering nested flows with array values (#16180)
* Update last payload when triggering array values

* Reuse keyedData when triggering other flows

* Expose flows data chain variables in run script operation

* Fix unit test

* Separate context for child flows

* Remove global variables from run script operation

* Simplify by using omit
2022-11-09 07:51:55 -08:00
Azri Kahar
f1448e2e73 fix numeric precision and scale default value (#16368) 2022-11-09 07:49:44 -08:00
keesvanbemmel
37894fd71b Returns the nodemailer promise (#16099)
* Returns the nodemailer promise

* Requested change

* Added code to add type to return value
2022-11-09 07:47:12 -08:00
Nitwel
25c6248b0a add editsGuard to drawerItem (#16375)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-09 07:31:55 -08:00
Azri Kahar
b5b073b0cb Allow disabling same width for attached dropdown menu (#16365)
* allow configuring width for attached menu

* add prop to v-select

* simpler prop naming

* update test snapshot
2022-11-09 07:31:14 -08:00
Nitwel
4e70be6da7 fix sortField selection (#16379) 2022-11-09 07:29:00 -08:00
Pascal Jufer
20a06a6c0e Clean-up lint / format set-up (#16380)
* Format json & all yaml files and update ignore files

* Fix resulting formatting issues
2022-11-09 07:26:54 -08:00
ian
6e730956af Update last value when triggering nested flows with array values (#16180)
* Update last payload when triggering array values

* Reuse keyedData when triggering other flows

* Expose flows data chain variables in run script operation

* Fix unit test

* Separate context for child flows

* Remove global variables from run script operation

* Simplify by using omit
2022-11-08 17:37:12 -08:00
ian
adff255d91 Skip checking of virtual alias fields (#16320)
* Default virtual fields as alias type

* Make the condition more verbose instead of defaulting

* Remove unnecessary optional chaining

* Add tests

* Revert to alias defaulting in #d06d62

* Shift condition up
2022-11-08 15:49:49 -08:00
Pascal Jufer
8d998f662a Update the Makefile for testing the Docker image build process (#16360) 2022-11-08 15:39:04 -08:00
ian
7899f6a267 Remove dev dependencies when running blackbox tests (#16271)
* Remove dev dependencies when running blackbox tests

* Install dev dependencies in workspace root to run tests

* Shift dependency to see if tests fail

* Revert dependency shifting test

* Remove specifying of shell
2022-11-03 09:15:48 -04:00
Azri Kahar
3e96584bad Test locale translations (#16267)
* fix es-CL locale import

* add test for locale files

* re-enable html warn and minor tweaks

* test whether import is successful
2022-11-03 09:14:55 -04:00
ian
13d8dde534 v9.20.4 v9.20.4 2022-11-03 11:01:46 +00:00
ian
64bffa60e9 Skip serialization for empty or string bigint values in GraphQL (#16297) 2022-11-03 18:37:56 +08:00
Rijk van Zanten
d78ccf5898 New Crowdin updates (#16272)
* New translations en-US.yaml (Turkish)

* New translations en-US.yaml (Italian)

* New translations en-US.yaml (Hungarian)

* New translations en-US.yaml (Arabic)

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

* New translations en-US.yaml (German)
2022-11-03 18:37:24 +08:00
rijkvanzanten
c70211c48d v9.20.3 v9.20.3 2022-11-02 12:12:52 -04:00
José Varela
0dce20c0b8 Fix check for alias fields (#16282)
They do not exist on fields definition
2022-11-03 00:10:28 +08:00
Brainslug
8242159b4b minified the role fetch used for navigation (#16274) v9.20.2 2022-11-02 08:57:04 -04:00
rijkvanzanten
d09d087fc9 v9.20.2 2022-11-02 08:56:09 -04:00
ian
ca2c761bde Skip alias type change check when type is not updated (#16270) 2022-11-02 08:54:35 -04:00
rijkvanzanten
b5d7db2ea0 v9.20.1 v9.20.1 2022-11-01 21:36:16 -04:00