Commit Graph

2586 Commits

Author SHA1 Message Date
Brainslug
9d8f29b792 Add extra type check in apply-diff (#18783) 2023-06-05 15:05:00 +02:00
ian
cd344baac4 Fix parsing of Error objects when redacting (#18777)
* Fix parsing of Error objects when redacting

* Create perfect-ducks-add.md

* Move errorReplacer into redact util

* Use unknown instead of any

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-31 08:40:32 -04:00
rijkvanzanten
619d1f5726 v10.2.1 2023-05-26 14:21:39 -04:00
rijkvanzanten
ca73cc976e v10.2.0 2023-05-26 13:17:06 -04:00
Brainslug
f96dcc361f Translation string performance (#18097)
* broken migration

* fixed migration

* created new endpoints for translation strings

* updated to use core endpoint

* bad attempts at making the endpoints sensible

* merge changes

* implemented translation strings service

* re-integrating app logic part 1

* re-integrating app logic part 2

* fixed bad lodash import

* re-integrating app logic part 3

* removed obsolete tests

* make the linter happy

* Create tender-trees-buy.md

* added option to search-input

* implementing search

* fixed resizing and sidebar

* Fix linting

* Remove unused translations update into project settings

* Fix missing translations

* Require read permissions for app access

* Fetch translation strings only when authenticated

* Fix project default language not used when user has default language

* Remove commented line

* Rename variable as content has been changed

* Make the current user check more specific

* Remove translation_string from Settings type

* Remove settings reference in docs

* Update changeset

* Rename migration file to ensure date order

* Rename collection, route, service, controller

* Rename migration

* Adjust collection in settings route

* Fix translations service

* Use new `shouldClearCache` util

* Drop translation_strings column in migration

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

* Added basic api docs

* updated dictionary

* updated dictionary

* Update app/src/interfaces/_system/system-input-translated-string/input-translated-string.vue

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>

* Update app/src/modules/settings/routes/translation-strings/collection.vue

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>

* extracted getCurrentLanguage utility

* Use regular collections/items

* Use regular controller

* Fix item view

* Set correct system field config for translations

* Tweaks

* Use UUID

* Finish placeholders

* Use drawer-item

* Add create to the store

* Remove composables

* Add new placeholder

* Fix saving behavior

* Remove previous take

* Rename migration after merge of live preview

* Generate uuid when migrating

* Remove unused showFilter

* Fix linting

* Fix type warnings

* Not needed as settings no longer contain translation_strings

* Remove leftover blank line

* Update getCurrentLanguage with server default and use in hydrate

* Shift getCurrentLanguage to lang folder to be alongside setLanguage

* add elipsis to placeholder

* Remove slug from key, so you can use dots etc in the key

* updated translation value to be type text again

* Rehydrate fields for updated translation values

* Add tooltip

* updated documentation

* enforce key/language uniqueness in the TranslationService

* updated error message

* updated docs menu item to "custom translations"

* Dynamically fetch translation keys for input-translated-string interface

* use get current language in refresh

* Update docs/reference/system/translations.md

* Update docs/reference/system/translations.md

* Update .changeset/tender-trees-buy.md

* Fetch translation keys when new key is created

* Update api/src/services/translations.ts

* Remove translation_strings remnant

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* mark key, language and value as required

* correctly mark fields as required

* Catch duplicate key error when creating from input

* Translate translations :-)

* Update tender-trees-buy.md

---------

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-05-26 12:35:44 -04:00
Pascal Jufer
bce32d90a7 Implement update notifier in directus package (#18738)
* Include update notifier in `directus`

* Don't bundle

* Move updateCheck function to `update-check` package

* Create kind-shoes-jam.md

* Update kind-shoes-jam.md

* Remove wrong dep
2023-05-26 09:55:23 -04:00
ian
4c919bd8f8 Update handler response format for manual flows (#18741)
* Update handler response format for manual flows

* Create olive-ligers-tie.md
2023-05-26 12:32:46 +02:00
ian
1e8dd2c928 Patch following files max upload size (#18737)
* Prevent uncaught error

* Fix typing as null is returned on error

* Remove undefined values from uploadedFiles result

* Create good-ligers-teach.md
2023-05-25 17:42:59 -04:00
Pascal Jufer
065eea01af Fix fetching of all permissions (#18655)
* Fix fetching of all permissions

* Create orange-moose-punch.md

* Revert "Fix fetching of all permissions"

This reverts commit 3122bf03ee.

* temporary fix forcing limit=-1

* renamed query var

---------

Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: ian <licitdev@gmail.com>
2023-05-25 21:30:18 +00:00
Rijk van Zanten
2536d9e90b Add support for FILES_MIME_TYPE_ALLOW_LIST env var (#18736)
* Install minimatch

* Add support for `FILES_MIME_TYPE_ALLOW_LIST`

* Add reference

* Add changeset

* Update docs/self-hosted/config-options.md

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

---------

Co-authored-by: ian <licitdev@gmail.com>
2023-05-25 17:25:47 -04:00
Rijk van Zanten
3363ca6422 Add env var for max file upload size (#18735)
* Add limit to file size

* Delete temp db record on file upload failure

* Emit empty value on upload failure

* Rename assets->files

* Update reference

* Finalize rename

* Add changeset

* Add proper exception
2023-05-25 15:24:14 -04:00
ian
93cba4e1b6 Optimise countDistinct aggregation on primary key field (#18717)
* Optimise countDistinct aggregation on primary key field

* Create green-boxes-hope.md
2023-05-26 02:14:02 +08:00
Pascal Jufer
4683227272 Update openapi3-ts to v4 (#18722)
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2023-05-25 17:36:32 +02:00
Azri Kahar
c705227cdc Remove docs CDN from the base CSP config (#18728)
* remove docs cdn from the base CSP config

* changeset
2023-05-25 16:49:54 +02:00
Nitwel
ed8b0e0394 Live preview (#17794)
* Add split view to the private view

* add more functionality to split view

* change text

* add simple size settings

* finish basic live preview feature

* add reload functionality

* update pnpm-lock

* update to newer design

* remove console.log

* Fix height of main content

* update design

* finishing fixes

* run linter

* finishing cleanup

* rebuild lock file

* lint fix

* hide preview for collections without preview urls

* fix refresh and eslint error

* use v-text-overflow for preview url

* use bottom placement for consistency

because other buttons such as Open in New Window and Refresh shows their tooltip at the bottom.

* tiny code tweak with early return

* remove fun parts and change divider color

* fix preview for singletons

* slightly improve the refresh button feedback

* hide zoom in fullscreen/desktop view

it is disabled in fullcreen, but some users may think they can click it, so I've opted to hide it instead. Especially since switching from mobile to desktop mode always resets it to 100%.

* tiny early return tweak

* opt to fix v-select disabled state cursor

* reverse zoom scaling order

* prevent preview going out of bounds when zoomed

* fix dragging when pointer enters iframe

* reinstate previous code tweak

* regenerate lock file

* use lockfile from main

* Dear linter...

* chore: add live preview to sidebar

* docs: add frontmatter

* docs: add intro

* docs: before you start

* docs: live preview in directus

* docs: draft mode in nextjs

* docs: fetch with draft mode

* docs: preview content in directus

* docs: next steps

* docs: update

* docs: updates

* docs: add live preview to collections

* docs: add live preview to item

* docs: updates

* docs: update

* chore: updates to the nextjs guide

* chore: updates to collections

* chore: updates to items

* Nuxt 3 guide

* Small Next guide fixes

* Added tips

* Spellcheck fixes

* Rework resizement

* Move debounce to private-view

* Update Nuxt 3 guides - styling and sentence clarity.

* add refreshLivePreview custom property to window

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>

* remove remaining "window as any" typecasts

* Show 'grab-bar' only if wrapper is in viewport

* toggle preview instead of split in mobile view

* tweak to unwrap nested IF conditions

* do not change preview button icon when enabled

* hide grab-bar in mobile

* check main content width instead of window width

* Fix save-and-stay not updating preview url

* Update refresh button function call

* Add frame loader to prevent flashing

* Prevent scrollbar flashing when toggling splitview

* lift specific logic from v-resizable to private-view

This piece of logic was meant only for the content area and shouldn't affect every v-resizable usages

* use v-show instead of v-if to hide main content

v-resizable has an internalWidth that should not be reset when user resize the left navigation bar, as well as the form shouldn't be re-rendered

* check target to hide the grab-bar in toggle mode

as we're only hiding the target rather than disabling the wrapper, we had to check whether the target is visible as well to determine whether to show the grab-bar

* Fix zoom behaviour & remove leftovers

* remove wrapperIsVisible check

in favor of only relying on targetIsVisible check

* Revert "Add frame loader to prevent flashing"

This reverts commit e4c2d3d4bd.

* Final tweaks

- Enhance frame zoom
- Min width for frame
- Hide main content based on overall size
  (ensure it works for all browser sizes)
- Various enhancements & fixes

* Update migration date

* Create rare-bananas-melt.md

* Better naming for remaining width var

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

---------

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Esther Agbaje <folasadeagbaje@gmail.com>
Co-authored-by: Kevin Lewis <kvn@lws.io>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
2023-05-25 16:29:12 +02:00
ian
80cca54d18 Enable caching for requests from data studio (#18484)
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-25 08:37:54 +02:00
Nicola Krumschmidt
60be3c2b40 Add synchronization across horizontally scaled instances to schedule flows and hooks (#18584)
* Add synchronization to schedule flows and hooks

Fixes #15052

* Add changeset

* Add test

* Add to sequential list

* Fix spelling in changeset

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: ian <licitdev@gmail.com>
2023-05-24 17:16:42 -04:00
Pascal Jufer
bcda7d227d Disable disable depreacted marked options (#18685) 2023-05-22 11:19:21 -04:00
Pascal Jufer
7ecda9b2fa Clean-up package.json files (#18663)
* Remove publishConfig from all packages

* Remove invalid version field

* Move @directus/composables to devDependencies in app

* Resort all package.json files

* Align meta fields

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-05-19 17:54:10 -04:00
Rijk van Zanten
c7d0cd0c74 Move tsconfig package to monorepo (#18659)
* Move tsconfig package to monorepo

* Use local reference to tsconfig
2023-05-19 12:30:45 -04:00
Pascal Jufer
2e647d80e6 Patch Tuesday 🐸 (#18643)
* Update `directus-monorepo` deps

* Update `@directus/api` deps

* Update `@directus/app` deps

* Update `@directus/composables` deps

* Update `create-directus-extension` deps

* Update `@directus/exceptions` deps

* Update `@directus/data` deps

* Update `@directus/data-driver-postgres` deps

* Update `@directus/extensions-sdk` deps

* Update `@directus/pressure` deps

* Update `@directus/random` deps

* Update `@directus/release-notes-generator` deps

* Update `@directus/storage` deps

* Update `@directus/storage-driver-azure` deps

* Update `@directus/storage-driver-cloudinary` deps

* Update `@directus/storage-driver-gcs` deps

* Update `@directus/storage-driver-local` deps

* Update `@directus/storage-driver-s3` deps

* Update `@directus/types` deps

* Update `@directus/update-check` deps

* Update `@directus/utils` deps

* Update `docs` deps

* Update `tests-blackbox` deps

* Bump pnpm to 8.5.1

* Bump build-push-action in release workflow to v4

* Assign new spy instances before each test

See https://github.com/vitest-dev/vitest/pull/3386

* Create clean-needles-nail.md

* Remove leftover 'beforeAll' imports

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>

---------

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-05-19 10:48:21 -04:00
Pascal Jufer
a708ec79d8 Redact additional keys in logs of Flows (#18534)
* Redact additional keys in logs of Flows

* Create moody-poems-pump.md

* Move REDACTED_TEXT to constants package & update tests

* Revert "Move REDACTED_TEXT to constants package & update tests"

This reverts commit 0f5b227253.

* Update redacted value in blackbox test

* Use own redact implementation

* Move REDACTED_TEXT to constants package

* Replace outdated comment

* Fix misleading return type

Since values might change (redacted), output isn't necessarily the same type anymore
2023-05-19 09:41:04 -04:00
ian
cf1d6a640d Remove server info (#18648)
* Remove OS info

* Add changeset

* Update unit test

* Remove Directus version

* Remove unused dependency

* Update changeset

* Update example in docs

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>

* Update changeset

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-18 19:28:48 +00:00
rijkvanzanten
fa8c914978 v10.1.1 2023-05-16 14:03:02 -04:00
Pascal Jufer
377b2889ec More sensible default formats for image auto conversion (#18615)
* Prevent auto conversion of png to jpg images

* Create red-swans-march.md

* Update transformation tests

* Update blackbox test

* Fix image allocation

* Fix test again :-)

* Convert formats with transparency support to png (if no accept header)

* Update tests & add final fallback

* Update changeset

* Update blackbox test

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-05-16 13:50:27 -04:00
Brainslug
40129c9e2c Fix for unknown filter fields (#18630)
* fix api throwing 500 error for unknown filter fields

* Create lucky-falcons-collect.md

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-05-16 12:27:54 -04:00
Brainslug
de89e77ad5 Update vm2 dependency (#18616) 2023-05-16 09:24:45 +00:00
Aiden Foxx
62520c5057 Send null for auth_data if undefined (#18607)
* openid: Send null if auth_data is undefined

* oauth2: Send null if auth_data is undefined

* Create ninety-mails-heal.md

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-15 14:24:54 -04:00
ian
94e8153baf Sanitize column only when applying snapshot diff (#18579)
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-15 13:41:57 +02:00
Brainslug
af55402680 Adding a maximum for query limit (#17309)
* Adding a maximum for query limit

* fixed bad env check

* using the getEnv function to make it better testable

* updated sanitize-query tests

* added tests for the validate query function

* Added DEFAULT_QUERY_LIMIT as fallback instead

* make the linter happy

* accept infinity as max_query_limit

* fixed merge conflicts

* added missing import

* moved docs PR into main repo

* added missing import

* renamed vars

* basic page size limiting

* Update app/src/layouts/cards/cards.vue

* Update app/src/layouts/map/map.vue

* Update app/src/layouts/tabular/tabular.vue

* Update app/src/layouts/tabular/tabular.vue

* Create paginate util

* extracted page size logic to composable and implemented default usage in app

* updated paginate utility

* using the new fetch-all utility

* removed limit: -1 for api calls that do not support it

* fix linter

* removed console log

* making the linter happy

* Create loud-flowers-yawn.md

* Add tests for no / unlimited limit

* Cover all cases for max limit in sanitizeQuery

* Get rid of non-null assertion

* added test for composable

* Update var names in documentation

* replace hardcoded limit default with env var

* update default page size behavior

* fixed test

* update server info api reference

* include queryLimit in graphql server info

* use configured max limit in calendar layout

* use configured max limit in kanban layout

* account for max query limit in use-revisions

---------

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2023-05-12 21:59:03 +08:00
rijkvanzanten
703c5d9c69 v10.1.0 2023-05-11 17:22:00 -04:00
Brainslug
110413e473 clear item cache when permissions change (#18526)
* clear item cache when permissions change

* Create slow-timers-fold.md

* Add tests

---------

Co-authored-by: ian <licitdev@gmail.com>
2023-05-12 01:18:40 +08:00
Rijk van Zanten
20912f1645 Revert "Use vitest run instead of --watch=false (#18540)" (#18542)
This reverts commit 97f0af669e.
2023-05-10 13:33:28 -04:00
Rijk van Zanten
97f0af669e Use vitest run instead of --watch=false (#18540) 2023-05-10 13:24:30 -04:00
Rijk van Zanten
50e2c4220d Standardize TSConfig use (#18538)
* Use tsconfig.prod.json in packages

* Use prod tsconfig in api

* Install node types in storage
2023-05-10 13:22:30 -04:00
Rijk van Zanten
b56fc107a5 Add Pressure-based rate limiter (#17873)
* Start setting up @directus/pressure

* Build pressure middleware

* Add basic readme

* Install @directus/pressure

* Fix this binding

* Experiment

* Add defaults util

* Cleanup

* Fix export

* Use directus defaults

* Start tests

* Add random-utils package

* Finish testing for monitor

* Add prod deployment

* Stop building test files in prod

* My favorite

* Integrate pressure handler

* Add decent defaults

* Add retry header + custom error support

* Clean-up merge conflict & sort imports

* Fix build

* Remove default value for retry after

* Verify sampleInterval value

* ran eslint

* updated package lock

* updated vitest

* Create slimy-zebras-jam.md

* Added basic docs for config options

* updated pnpm lock and changeset

* Update & align new packages

* Update .changeset/slimy-zebras-jam.md

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
2023-05-10 14:17:53 +00:00
Tim Spickermann
d633e11631 Fix field presets for relational fields are not working (#16560)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2023-05-05 17:19:46 +02:00
Brainslug
4d1d0e61dd Updated vitest (#18483)
* updated vitest to 0.31.0

* Create late-tables-call.md
2023-05-04 11:29:54 -04:00
Arthur Yidi
13433b6ea7 Graceful database shutdown for bootstrap CLI (#18465)
* graceful shutdown for boostrap cli

changeset

sign contributors

* Update changeset

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-04 13:20:23 +02:00
Brainslug
a9f397de1f Prevent parsing non-decimal values in search (#18383)
* prevent parsing non-decimal values in search

* Create rare-deers-clap.md

* Adjust format of changeset

* Add explaining comment to return logic of validateNumber

* remove float with zeros check

---------

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-03 09:42:28 -04:00
Brainslug
c74b5da7b9 Improved flows error class handling (#18421)
* improved flows error handling

* Create gentle-cars-watch.md

* updated changeset
2023-05-03 09:40:45 -04:00
Rijk van Zanten
44b4863788 Require curly brackets in if statements when they're multi-line (#18387)
* Enable Curly rule

* Fix curly misuse
2023-05-02 16:02:43 -04:00
Brainslug
1fba5ebf94 Load cjs custom migrations (#18385) 2023-05-02 21:10:19 +02:00
ian
69061c1284 Add Cache option for Flows webhook trigger (#18277)
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-02 15:17:07 +00:00
Brainslug
06ff0c2ef9 Fixes _offset=0 in deep filters (#18382) 2023-05-02 12:34:50 +02:00
Jan Arends
8b8858da9a Support multipart/form-data to apply schema diffs (#18321)
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2023-05-02 10:24:46 +00:00
Nicola Krumschmidt
af2ce35d67 Add shared javascript file ext constant (#18350)
* Add shared javascript file ext constant

* Add changeset
2023-04-27 17:18:02 -04:00
Aiden Foxx
2f3fb229bc Correctly set user "auth_data" after auth.update hook (#18310) 2023-04-26 21:01:03 +02:00
Brainslug
2ced6b0a0b Prevent thumbnail duplication (#18316) 2023-04-26 20:39:20 +02:00
Rijk van Zanten
2bc226d16f Change license to BSL-1.1 (#18330)
* Change license to BSL1.1

* Mark major version

* Fix formatting

* Remove duplicate heading

* Update formatting

* Copy paste error

* Update license

* Update license

* Format covenants

* Update readme.md

* Update licenses for packages

* Update readme.md

* Update contributors.yml

OG... but to be clear, rijkvanzanten is the one who really built all of this ❤️

* Tweak license in openapi

* Update packages/specs/src/openapi.yaml

* Add MIT license headers

* Use v10 in examples

* Update additional examples

* Update generate-extensions-entrypoint.test.ts

* Update tests to use latest v9 and v10 versions

* use lowercase for naming consistency

* change casing for api license

* Update migrations doc

* Update dictionary

* Consistent ordering of license field in app/package.json

* Use major version in specs again (but as string)

So it's valid for all v10 versions

* Consolidate readme's

---------

Co-authored-by: Ben Haynes <ben@directus.io>
Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2023-04-26 14:10:42 -04:00