851 Commits

Author SHA1 Message Date
rijkvanzanten
fb252ca4ce v9.9.0 2022-04-15 14:26:54 -04:00
Lukas Breitstadt
09d9b4b323 Await when token is refreshing & reinstate msRefreshBeforeExpires flag (#12649) 2022-04-12 07:52:33 -04:00
ian
28fe1b243f Cast to number for joi between (#12666)
* Cast to number for joi between

* Fix between range as inclusive

* Update unit test
2022-04-11 09:50:07 -04:00
Azri Kahar
835d7e425d add missing query parameters in SDK (#12632)
* add missing query parameters in SDK

* add @directus/shared as dependency

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-08 11:43:17 -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
Azri Kahar
2f0921ffa9 Prevent empty string as id in SDK (#12595)
* Prevent empty string as id in SDK

* test
2022-04-06 10:42:29 -04:00
Azri Kahar
d023b36838 Add import file method to SDK (#12575) 2022-04-05 10:39:29 -04:00
rijkvanzanten
2a6db01c42 v9.8.0 2022-04-01 14:41:08 -04:00
Jake Cattrall
d24dacd075 Use date (epoch) compare workflow instead of timer to refresh token in SDK (#12399)
* use date compare workflow instead of timer

* convert milliseconds to seconds

* add missing references to auth_expired_at key

* correct calculation and presume getTime returns milliseconds

* resolve issue with static tokens

* prevents token refresh before everything else is initialized

* remove timer based authentication tests

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-04-01 09:31:11 -04:00
Rijk van Zanten
90f5b0a471 Add functions support to the app + add count function (#12488)
* Rename date functions to fn, add json_array_length for pg

* Add json count to mssql

* Add json array count support to other vendors

* Add UI for selecting API functions

* Make it not break

* Render functions in filter preview better

* Include functions in field altering

* Add schema access to database helper

* Allow filtering against o2m/m2m/m2a count

* Add data function execution helpers in utils

* Fix type issue

* Inject function results in validate step

* Render field keys with function names translated

* Allow selecting nested/functions in field validation step

* Make sure number comparisons are treated as numbers

* Add check if instanceof date when casting to a Number

* Prevent selecting foreign keys for junction sort (#12463)

* [SDK] Add further request options to `items` functions (#12503)

* add possibility to set further options to the request

* fix options type

* add typings to interface

* add test if headers are passed thourght

* create reusable options param

* set higher priority to options param

* Small stylistic cleanup

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Jürg Hunziker <juerg.hunziker@gmail.com>
2022-03-31 16:56:26 -04:00
Jürg Hunziker
a7f79a1761 [SDK] Add further request options to items functions (#12503)
* add possibility to set further options to the request

* fix options type

* add typings to interface

* add test if headers are passed thourght

* create reusable options param

* set higher priority to options param
2022-03-31 14:06:52 -04:00
Azri Kahar
31cfb8266f Bookmark improvements (#12031)
* add icon & color to bookmarks

* update current bookmark title on edit

* clean up edit bookmark dialog on cancel

* remove unused bookmark-edit component

* interaction improvements

* sort based on scope and alphabetically

* prevent hover when locked & use tooltip

* Reduce size of right hand icon in bookmark

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-28 11:23:00 -04:00
Rijk van Zanten
175fb849c4 Add field-level validation (#12363)
* Add field validation column

* Add frontend config for validation

* Make it work

* Add regex to filter configuration

* Fix const/let

* Add custom validation message support

* Add custom validation message tooltip inline

* Fix custom names in validation errors up top

* Fix type error

* Nog eentje om het af te leren

* resolve unused import warnings
2022-03-25 18:03:36 -04:00
CommanderRoot
d81adcd674 refactor: replace deprecated String.prototype.substr() (#12344)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-25 13:36:18 -04:00
rijkvanzanten
7b15947276 v9.7.1 2022-03-23 14:50:51 -04:00
Azri Kahar
37cbaa0be5 Add App Translation Strings in Settings (#12170)
* add migration for translation strings

* add to navigation

* WIP

* fix dialog overflow

* update translation keys

* Update logic

* add placeholder to system-language

* fix translation

* remove unused import

* reset dialog on create new

* ensure search input is visible when searching

* merge translation strings on set language

* merge translation strings on update

* hydrate

* make sure null translation do not get merged

* change dialog to drawer

* update placeholder text

* fix form value

* revert dialog style change

* rename drawer component

* Force safe key name

* Move interface to system interfaces

The saved values are Directus app proprietary, so to prevent confusion in what it's supposed to do, we'll move it to system.

* Move composable to root composables

* Use new languages input in interface/display options

* hide translation strings field in project settings

* set system true to system-input-translated-string

* use this in field detail notes

* use in list options

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-22 09:39:04 -04:00
ian
d0aa61e94a Prevent errors when using string filters with empty values (#11836)
* Prevent errors when using string filters with empty values

* Add tests

* String schema validation forced to false for null values
2022-03-21 14:03:42 -04:00
rijkvanzanten
c1da41d671 v9.7.0 2022-03-18 16:34:35 -04:00
Rijk van Zanten
1c3e94d830 Add new export experience (#12201)
* Use script setup

* Start on export dialog

* Use new system field interface, replace limit with numeric input

* Set placeholder

* Add sort config

* Use folder picker, correct layoutQuery use

* Add local download button

* Allow writing exports to file

* Add notification after export

* Fix sort config, use new export endpoint

* Setup notification hints

* Add information notice

* Fix local limit, cancel button

* Add (basic) docs for export functionality

* Fix json export file format

* Implement xml batch stitching

* Resolve review points
2022-03-17 15:43:45 -04:00
Azri Kahar
76f463c608 Form error validation improvements (#12001)
* expand groups on save when they contain error(s)

* bubble to top & scroll top

* fix groups validation errors watcher

* fix group acordion's first error field selection

* update global error notice

* WIP - field validation

* tweak validation errors list styling

* more validation-errors-list tweaks

* click and scroll to field

* move validation error notice to a component

* tweak use-item validate

* validate drawer item

* extract validateItem function

* Revert "WIP - field validation"

This reverts commit f6ffd836c4.
2022-03-09 16:48:10 -05:00
Azri Kahar
13bae1f0c2 Add Edit Role context menu in User Directory (#12048)
* add Edit Role context menu in User DIrectory

* reuse Role type

* ensure hiding delete button for last admin works
2022-03-09 12:53:43 -05:00
rijkvanzanten
6af5a6534f Update special cases 2022-03-07 14:19:09 -05:00
rijkvanzanten
eba2576227 v9.6.0 2022-03-04 20:25:43 -05:00
Rijk van Zanten
6a3eb823c3 Update base theme of the App (#11952)
* Add migration to remove default value from project_color

* Upgrade the default theme

* Do a pass over the header buttons

* Do another pass over --warning uses

* Little things

* Tweak smoke

* Use updated map

* Use dark system elements in dark mode

* Remove outdated files, update toasts

* Use correct delete button style for role

* Use primary for created point

* Tweak spacing in revisions section

* Use primary for sidebar sections

* Various color tweaks and changes

* Update base color palette

* Update "css reset" code

* Remove splashscreens, add default favicon

* Add primary highlight to datamodel page

* dark mode color update

* fix sign out hover color

* Does this help?!

* This fixes some loading issues

Fixes https://github.com/directus/directus/issues/10707

* Calculate default pretty background?

* Fix public view with logo

* Fix responsiveness of login page

* adjust notification group width to be equal

* Do an absolute pointless task that doesn't do anything

It was suggested that it could fix the stylelint error in tests, but alas

* Remove stylelint

Doesn't seem to play nice with script setup and other changes

Co-authored-by: Ben Haynes <ben@rngr.org>
2022-03-04 18:53:39 -05:00
Rijk van Zanten
962af79dbc Replace union query approach with updated table scan (#11246)
* Start by stripping out the previous Union attempt

* Then set limit to -1, causing massive memory issues on big data sets

* Now fix the memory problem by batching the responses

* Use env var for max relational batch size

* Rename env var, add to docs
2022-03-01 18:20:00 -05:00
rijkvanzanten
47a5da78fb v9.5.2 2022-02-18 11:45:07 -05:00
Abdón Rodríguez Davila
3de9bc1ada Update rollup-plugin-styles to v4 (#11689)
* Update rollup-plugin-styles to v4

* Update Rollup packages
2022-02-18 11:25:50 -05:00
José Varela
de5b34d87b SDK: split readMany into itself and readByQuery (#11204)
* split readMany into self and readByQuery

* add tests

* run tests only on `test` folder

* fix docs

* fix in `cli`
2022-02-16 09:52:42 -05:00
rijkvanzanten
c0c412d30b v9.5.1 2022-02-03 20:41:49 -05:00
Rijk van Zanten
79ce3c8765 Add parsePreset helper function (#11423) 2022-02-04 00:29:28 +00:00
Jay Cammarano
f40a3e94a0 Add strings to accepted fields for Insights Panel "Metrics" (#10828)
* extension takes context object

* v-model with options object

* removed comments

* added typing

* fixed typing

* state is saved on field-configuration

* extension-options uses object for objectOptions

* removed unnecessary context

* more props instead of context object

* remove unused import

* move Panel type to shared

* passing edits.options => whole edit object

* alterOptions check => edits watch

* props on extension types have defaults

* returning the whole panel not just .options

* panels without functions load

* only displaying first, last, and count

* first last count working

* string values displayed!

* removed unused vars

* choices disabled not removed

* options.function resets to count

* fills in values when editing a panel

* field resets when collection changes

* doesn't wipe collection on edit

* panel cleared when panel type changes

* removed resolved comment

* package.json

* Advanced Field Detail working

* divider on type of function

* divider option removed unneeded values

* removed unneeded v-if

* Don't check against function type in panel options

* Tweaks to resolve my own commentary

* 🧹 Cleanup tweaks

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-02-03 16:55:15 -05:00
Nicola Krumschmidt
b8a627d0a2 Mark shared as side effects free (#11329)
Since #11099 the extensions-sdk isn't externalized anymore when bundling API extensions.
This causes rollup to pull in a lot of unnecessary dependencies that aren't automatically tree-shaken.

Fixes #11275
2022-02-02 03:48:20 +01:00
Nicola Krumschmidt
35ee3f4151 Add a few missing DefinitelyTyped dependencies (#11381) 2022-02-02 03:47:28 +01:00
Azri Kahar
9ac1bb146c Fix update file endpoint (#11347)
* fix files patch request

* add multipart/data to file Patch request specs
2022-01-31 10:31:21 -05:00
Azri Kahar
047b45cec1 Update OpenAPI schema for file/files (#11290) 2022-01-26 07:57:08 -05:00
Rijk van Zanten
c01f507696 Use correct import for crdb dialect from schema-inspector (#11269)
Fixes #11266
2022-01-25 15:08:20 -05:00
Rijk van Zanten
bac787aeed Fix PG10 support in knex-schema-inspector (#11268) 2022-01-25 19:51:26 +00:00
rijkvanzanten
78a25fe953 v9.5.0 2022-01-24 15:53:29 -05:00
Rijk van Zanten
47f71bd60b Update knex-schema-inspector (#11238) 2022-01-24 12:05:54 -05:00
Nicola Krumschmidt
4eed883329 Add DefinitelyTyped deps to shared (#11231)
This also moves type-only deps to "peerDependencies".

Fixes #10658
2022-01-24 10:18:36 -05:00
Rijk van Zanten
973e2dc6bb Update knex-schema-inspector (#11203) 2022-01-21 09:38:27 -05:00
Rijk van Zanten
88c87f3920 Set CRDB options to avoid inconsistencies between vendors (#11193)
* Set correct CRDB options

* Add missing SETs to pool config for e2e

* How about now

* Better solution for the same problem
2022-01-20 20:18:22 -05:00
Nicola Krumschmidt
889668f972 Remove API extension types from the API (#11191)
There is little value in keeping these types inside the API package.
We should instead focus on improving the types in shared.
2022-01-20 22:19:52 +00:00
Michael Schramm
75b5f33727 Implement CockroachDB support (#10113)
* base changes for cockroachdb

* allow creating of tables

* allow deleting of fields

* allow deleting of tables

* rebase

* fix migrations

* bump knex-schema-inspector to 1.7.0

* Update package-lock

* Add cockroach to debugging docker-compose file

* Remove unused import

* Tweak name in example.env

* Force nullable primary keys in cockroach

* Tweak shares migration to run on cockroach

* Rename var for clarification

* suggestion for migration helper

* change to schema and update remaining migrations

* Remove custom cockroach schema in favor of sharing with pg

* Fix migrations for CockroachDB

* Hopefully fix Oracle migrations 🤞🏻

* Make ~~aiden~~ oracle happy

* Resolve branching paths in migrations

* Enable tests for cockroach

* Fix test config

* One more config change for good measure

* Adjust test to match cockroach's bigint auto-int structure

* Increase request timeout for mssql

* Update api/src/database/helpers/schema/types.ts

Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Oreille <33065839+Oreilles@users.noreply.github.com>
Co-authored-by: Aiden Foxx <aiden.foxx.mail@gmail.com>
2022-01-20 14:14:38 -05:00
John Huffsmith
e7ada1f173 Moving schema and relation types into shared package (#11179)
* moving schema and relation types into shared package

* updating SchemaOverview imports

* removing duplicate import
2022-01-20 13:36:19 -05:00
Will Foxall
5cf57b4e2d Added the 4 "_starts/ends_with" filter defs (#11162) 2022-01-19 13:05:14 -05:00
Aiden Foxx
4af091d67a Added LDAP to formatTitle special cases (#11119) 2022-01-17 17:37:31 -05:00
Rijk van Zanten
b3f43ff1a2 Upgrade dependencies (#11118)
* Update marked in app

* Upgrade marked in cli

* Update nested deps
2022-01-17 21:42:04 +00:00
Nicola Krumschmidt
a128836145 Rename sourceMaps flag to sourcemap to align with other tools and add no-minify flag to the extensions-sdk CLI (#11106)
* Rename sourceMaps CLI flag to sourcemap to align with other tools

* Add no-minify flag to the extensions-sdk CLI
2022-01-17 13:50:14 -05:00
Nicola Krumschmidt
9237a6452a Remove extensions-sdk and axios from the list of shared deps (#11099)
This ensures that extensions work with an out-of-root extensions folder.
Instead of leaving the list of API shared deps empty, this adds `directus` as the only shared dep
because it is never a good idea to bundle the Directus API into an extension.
2022-01-17 10:22:52 -05:00