1067 Commits

Author SHA1 Message Date
Pascal Jufer
37faf3bd5d Patch Tuesday 🐸 (#17530)
* Update root deps

* Reformat files with new prettier version

* Update `directus` deps

* Update `@directus/app` deps

* Update `@directus/shared` deps

* Update components snapshots after updates

prop order has changed

* Update `extensions-sdk` deps

* pin version of zod in shared

* Update `@directus/storage` deps

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

* Update `storage-driver-cloudinary` deps

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

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

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

* Update `@directus/utils` deps

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-02-16 17:47:39 +08:00
Nitwel
acd4078239 Fix using strings for flow trigger collections (#17441) 2023-02-08 12:59:23 -05:00
Rijk van Zanten
2fa46e18f5 Drop inline rendering of docs (#17434) 2023-02-07 13:52:53 -05:00
Nitwel
3600d726e0 make sort fields hidden by default (#17416) 2023-02-06 12:16:15 -05:00
Nitwel
cc7d3db099 fix applying corresponding changes (#17392) 2023-02-03 16:01:42 +01:00
Jay Bharadia
b13efb61ef Fix field configuration view not updating when navigating between different fields in New Field drawer (#17254)
* Fix field configuration view not updating when navigating between different fields in New Field drawer

* Used Vue toRef instead of computed as per the feedback

* Make type reactive too

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-01-23 13:05:25 -05:00
Jay Bharadia
bb176c44fb Fix/issue 16692 and issue 16437 (#17186)
* Issue 16437 solved

* Cleanup optional check

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-01-19 11:34:27 -05:00
Brainslug
66f4e89978 added frontend sorting for flows (#17202) 2023-01-17 11:07:38 +01:00
Pascal Jufer
c16be6f644 Type fixes in app (part 1) (#16545)
* Fix paths of imports

* Process not-found.vue as ts

To prevent the following error from 'vue-tsc':
  error TS6504: File '/Users/pascal/Development/directus/app/src/modules/insights/routes/not-found.vue.js' is a JavaScript file. Did you mean to enable the 'allowJs' option?

Note: We could also enable 'allowJS' but since this is the only js file
this seems to be a more fitting fix

* Drop hljs language definition for GraphQL (now in core)

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-01-09 18:29:03 +00:00
Brainslug
511c8d368b Fix json serialization (#16558)
* fix copying json fields

* fixed preset filter type

* handling fallback in copyToClipboard function

* add test

* try parsing json content on paste

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-12-15 10:40:43 +01:00
Brainslug
807bda3dcb Follow up user Roles not loading (#16278)
* applied the same role fix too users invite

* added same fix when saving permissions

* Prevent loading users unecessarily on the permission page

* Added proper `deep` query typing

* fixed typing for tests

* apply similar fix for navigation folder
2022-12-13 15:05:14 +01:00
Azri Kahar
1c93cc661e Reduce translate function calls in the App (#16038)
* translate fields during hydration

* patch untranslated raw values on field edit

* simplify/remove existing translate usages

* minor codestyle

* translate field note and validation_message

* stub api call in fleld-detail store test

* skip fields translation before user locale sets in

* optimize hydration calls

* use translateLiteral for note & validation_message

* cherry pick field meta properties to patch

* reduce setLanguage calls & settings requests

* settings store test & type update

* tweak variable casing

* test server store & fix existing type/ref issues

* update fields store test for skipTranslation

* fix render-display merge

* await field update before opening drawer

* fetch meta at the end to load relationships first

* add loading state to prevent editing some fields

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-11-30 13:33:31 +01:00
Azri Kahar
ecb0998a8f optimize stores hydration calls (#16591) 2022-11-23 17:24:20 -05:00
Pascal Jufer
47db8e5d2f Clean-up dependencies (#16481)
* Clean-up api

- Remove unnecessary deps
- rimraf -> del-cli

* Clean-up app

- bytes -> pretty-bytes
- Remove ms as we already have pretty-ms
- Remove other unnecessary deps
- Add storybook build to gitignore

* Clean-up drive packages

- Simplify cleanup scripts
- rimraf -> del-cli
- Remove unnecessary deps

* Clean-up schema

- Remove unnecessary dep (lodash)
- Replace 'npm-watch' with native watch mode

* Clean-up shared

- Remove unnecessary dep (c8, adding @vitest/coverage-c8 will be addressed in
  other PR)
- rimraf -> del-cli
- npm-run-all -> concurrently

* Clean-up root

- Add missing eslint-plugin-jest dep
- listr -> listr2

* Make build output a bit friendlier

* Remove cleanup scripts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-11-18 17:02:41 +00: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
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
Nitwel
10ebe7c523 use correct collection for translation (#16280) 2022-11-09 19:44:19 -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
Brainslug
8242159b4b minified the role fetch used for navigation (#16274) 2022-11-02 08:57:04 -04:00
Azri Kahar
995f92f7c2 fix back button on item pages after login (#16218) 2022-11-01 16:56:00 -04:00
ian
c996accb00 Fix recursive fields on existing columns (#15621)
* Prevent changing to or from alias type

* Prevent infinite delete loop

* Display error when saving

* More validation for M2M and M2A

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-10-26 11:51:01 -04:00
Azri Kahar
107c6d297b Add name to routes with empty path (#16174)
* add name to routes with empty path

* use same naming convention for redirects
2022-10-26 13:53:26 +08:00
Azri Kahar
7d7a7308ae reset selections for manual trigger (#16069) 2022-10-20 09:09:48 -04:00
ian
0f6ed82953 Optimise data model sorting (#16039)
* Add collections batch update endpoint

* Use collections batch update when sorting in data model

* Add autoPurgeSystemCache option

* Change type to false for consistency

* Refactor to InvalidPayloadException

* Add collection batch update test

* Bump default max payload size to 1mb

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-18 19:19:36 +00:00
Azri Kahar
175c7ab556 Add try/catch block to Users Module navigation and system-scope interface (#16037)
* add try/catch to users navigation

* add try/catch to system-scope interface
2022-10-18 10:34:46 -04:00
Azri Kahar
18bf1344e1 Set special flags when configuring db-only fields (#15640)
Co-authored-by: ian <licitdev@gmail.com>
2022-10-15 12:15:27 +08:00
Azri Kahar
372d042a48 remove warning type for empty presets page (#15571)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-14 23:25:07 -04:00
Azri Kahar
9ee740e2c5 fix flow operations staged edits (#15662) 2022-10-14 23:02:57 -04:00
Azri Kahar
bb51d5a618 Reset junction collection/fields for field relationships with junction table (#15904)
* use `localType` to disable related collection in m2m

this is because `localType` dictates the relationship type (eg. m2m, files), but `type` was only field type (eg. alias, string)

* reset files junction when re-enabling auto fill

* prevent m2m clearing related collection

When re-enabled auto-fill, the updates only contain the autofill, not the m2o related collection value, so it was unintentionally resetting the value even when we are only toggling autofill

* fix autofill for translations

* fix m2a junction autofill toggles

* use getCurrent instead of state

* basic test for fieldDetailStore

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-15 01:56:03 +00:00
Azri Kahar
dc7c62f0ef Allow triggering manual flow without selection(s) (#15977)
* allow running manual flow without selection

* test for flows store

* update no items selected tooltip
2022-10-14 21:47:54 -04:00
Azri Kahar
67c3834783 Add search to field creation drawer (#15981)
* add search to field creation drawer

* lowercase id just in case for custom interfaces
2022-10-14 21:44:14 -04:00
Nitwel
413d21fe4b treat empty array as null on relational field (#15958)
* treat empty array as null on relational field

* Run prettier

* add unit test

* Fix linter warnings

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-10-14 18:38:53 +00:00
Azri Kahar
3ec17671e9 Only pass singleton prop in CollectionOrItem component when necessary (#15570)
* Disable attribute inheritance for layout wrapper

* only pass singleton prop when necessary
2022-09-15 14:52:08 +02:00
Jonathan Schneider
212481ff07 Add missing download and token parameter in File interface (#14871)
* add missing download and token parameter

* add download name

* update all file download links (:download and :href), update icon, add single file drawer download

* add filename_download to adjustFieldsForDisplays

* add new computed use asset url logic

* switch composable to utility function

* switch to new URL and add tests

* add getAssetUrl to file-image

* Update app/src/interfaces/files/files.vue

Co-authored-by: Nitwel <mail@nitwel.de>

* update code style error

* add download to drawer of file-image, fix wrong css selector and update preview download icon

* Remove debugging database

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Nitwel <mail@nitwel.de>
2022-09-12 16:30:43 -04:00
Chaiwat Trisuwan
06cff9457a fix: add arrow-placement logic check if folder empty (#15405) (#15441) 2022-09-08 17:32:14 +02:00
Rijk van Zanten
4eae2de686 Move updated components to app (#15374)
* Move updated components to app

* Make sure storybook is alive
2022-09-02 14:42:00 -04:00
Nitwel
5fe28db539 Add Components Package (#15094)
* move components without dependencies to packages

* make every components use vue script setup

* move components and utils from shared to @directus/components

* fix imports

* move over some more components

* get rid of unnecessary isEmpty and notEmpty

* move pagination

* fix missing !

* move groupable components

* move text-overflow and useElementSize

* fix icons not being shown

* add first unit tests

* remove capitalizeFirst

* simple cleanup

* add css-var unit test

* move over most other components

* make every component use script setup

* add some more unit tests

* add more tests and burn v-switch to the ground. 🔥

* add checkbox tests

* start with next test

* add storybook

* add more pages to storybook

* add final stories

* fix stories actions

* improve action fix

* cleaning props and adding tests

* unit tests -.-

* add some documentation to components

* Add docs to each prop

* clean storybook paths

* add more unit tests

* apply v-select fix

* update lock file

* small tweaks

* move back to shared

* fix imports

* fix imports

* cleaning

* stories to typescript

* Fix version number

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-09-01 16:07:31 -04:00
Azri Kahar
425ef2f080 refresh on flow run & prompt unsaved changes (#14700) 2022-08-30 14:43:36 -04:00
Nitwel
6e19683a00 add collection info to conditions (#15238)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-08-30 14:40:12 -04:00
ian
a971455216 Add origin to accountability (#15273)
* Add origin to accountability

* Remove origin column from seeds
2022-08-30 14:15:44 -04:00
ian
05d05f2cb8 Return empty array if scope is not defined (#15228)
* Return empty array if scope is not defined

* Add empty event trigger text when option is removed
2022-08-24 17:34:04 -04:00
Nitwel
61a8cca102 Fix filter not resetting on bookmarks (#15236)
* fix bug and make code consistent

* clean up unnecessary complexity
2022-08-24 15:21:13 -04:00
ian
6c0e60a7f7 Hide item link for delete action in activity feed (#15131)
* Hide item link for delete action in activity feed

* Store translated action separately
2022-08-19 01:19:31 +08:00
Azri Kahar
b2683e6d75 fix name removal in Presets & Bookmarks (#15141) 2022-08-18 08:55:42 -04:00
Lukas Schätzle
a803331b4a Unify download icon (#15132) 2022-08-17 16:44:41 -04:00
ian
122f8cfed0 Fix URL for subfolder assets (#15126)
* Prevent duplicate rootPath for image in file-preview

* Add rootPath to file and file-image for downloading

* Revert change to v-image

* Patch rootPaths accordingly

* Fix missing file name on download
2022-08-17 14:03:29 -04:00
ian
dca0290d1f Remove check button when displaying activity log item (#15107) 2022-08-17 11:40:38 -04:00
Azri Kahar
14f0acbcc6 Fix manually typed o2m sort field (#15065) 2022-08-15 10:13:18 -04:00
ian
de7ac8ff14 Prevent clearing of trigger options when initialising (#15005) 2022-08-10 10:22:19 -04:00