Commit Graph

1049 Commits

Author SHA1 Message Date
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
Azri Kahar
94393be968 fix Flow operations update bug (#14998) 2022-08-10 09:33:23 -04:00
Ramon van Bezouw
df054f294d RTL support in translation interface (#14665)
* first draft for translations rtl implementation

* make direction field dybamic

* Fixed default direction field

* added directionality to: tags, input-multiline, repeater (list)

* added directionality for wysiwyg, input-autocomplete, groups

* reverted directionality in wysiwyg-editor

* removed hardcoded rtl, ltr buttons from wysiwyg toolbar

* working directionality in wysiwyg editor

* also add v-if to await language for second language (split-view) in translations.vue

* added watcher for changing wysiwyg directionality on language change

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Martijn de Voogd <devoogd@kissthefrog.nl>
Co-authored-by: Martijn <73393707+martijn-dev@users.noreply.github.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-08-09 15:23:05 +02:00
José Varela
36c824e364 App: Do not allow to link folders to M2A relationship (#14952)
* Do not allow to link `folders` to M2A relationship

* Apply same getter to another relations
2022-08-08 14:11:31 -04:00
Azri Kahar
2b8a2f10cc Fix show hidden collections for nested collections (#14935) 2022-08-08 14:05:09 -04:00
Gerard Lamusse
9508ed4f7a Exclude relationship fields on field validation (#14818)
* Exclude relationship fields on field validation

* Refactor to includeRelations. Also add to conditions
2022-08-03 15:20:13 -04:00
Brainslug
04fc6dc9b6 added loading state check to sidebar components (#14776) 2022-08-01 09:21:52 -04:00
Azri Kahar
1054ca69ed fix fallback icon styling for interfaces (#14693) 2022-07-27 11:38:35 -04:00
Brainslug
ef397e97b1 broken assets paths when serving Directus from a subfolder (#14650)
* removing getrootpath

* removed redundant getRootPath from components

* We use leading / everywhere else in api usage

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-26 11:29:14 -04:00
Rijk van Zanten
88c5edf7a3 Add app unit tests using vitest (#14583)
* Install / bootstrap vitest

* Install c8

* Add tests for add-query-to-path

* Don't set global maplibre token on individual style

This feels wrong to me. We have a single global access token that should be used for these things. Overriding that with a token that's found for individual styles on top of the same global object in order of configured maps feels weird, as the latter tokens will override the earlier ones. Needs more research though

* Install testing libraries

* Use happy-dom as env in vitest

* Enable ts checking in tests

* Remove unused jest config

* Organize store imports

* Remove types from TSDoc in add-query-to-path

* Improve check in add-related-primary-key-to-fields

* Add reusable stub for anything touching nanoid

* Add tests for add-related-primary-key-to-fields

* Move adjust date to shared

* Remove arraysAreEqual util in favor of relying on lodash

* Fix add-related-primary-key-to-fields test

* Add test coverage for capitlize-first

* Add TSDoc/tests for extract-field-from-function

* Add test coverage for formatFieldFunction

* Add test coverage for format-filesize

* Add test coverage for get-groups

* Add tests for get-root-path

* cleanup imports

* Move tests to live next to source files

* Add tests for user-name

* Update type to match function behavior

* Add test coverage for point-on-line

* Add tests for is-empty

* Add test coverage for is-hex

* Remove getSetting util

Bit pointless to have a util function to just read a value from a store

* Add test coverage for get-related-collection

* Add test coverage for get-theme

* Add test coverage for get-with-arrays

* Add test coverage for hide-drag-image

* Add test coverage for is-permission-empty

* Remove unused import

* Add test for jwt-payload

* Add snapshot rendering test for v-sheet

* Add whitespace

* Rename __test_utils__ -> __utils__

* Add composable test

* Update app/tsconfig.json

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

Co-authored-by: Pascal Jufer <pascal-jufer@bluewin.ch>
2022-07-25 16:23:45 -04:00
Adrian Dimitrov
515ea4e4d2 Fix list-group clickable; Fix navigation-item initial state (#14637)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-07-25 14:16:41 -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
Azri Kahar
811da6e762 fix revisions drawer detail ref type (#14615) 2022-07-25 09:52:12 -04:00
Rijk van Zanten
d6846d74eb Refactor unnecessary nested app folders (#14580)
* Remove unused nested folders from components

* Remove nested folders

* Standardize composables output

* Fix import inconsistencies

* Same trick for directives

* Same for routes

* Replace reliance root grouped export in favor of explicit imports

* Replace reliance on implicit imports

* Remove nested folder structure

* Consistent use of non-default exports in utils

* Remove nested folder structure from private components

* Fix test mock

* Remove extraneous component registration for valuenull

* Fix stores provider

* Fix logo sprite
2022-07-22 15:10:28 -04:00
Rijk van Zanten
600f55e4a2 Resolve lintw arnings (#14555) 2022-07-21 12:44:16 -04:00
rijkvanzanten
ab36a31e29 Remove warnings re revisions sidebar detail 2022-07-21 10:55:27 -04:00
Rijk van Zanten
353d01d620 Fix singleton navigation temporarily using wrong ID (#14542)
* Convert content/items.vue to script[setup]

* Don't rely on outdated primary key while loading in singleton navigation

Fixes #13856
2022-07-20 17:08:48 -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
Azri Kahar
9015667d02 Add raw editor toggle for using variables in flows operations (#14021)
* add raw editor for flows operation options

* add comment to explain reasoning for watcher

* add simple raw editor with syntax highlighting

* Add multiline to text fields & hide in json fields

* update input icon for toggle

* do not unset value for text fields

* fix mustache tag value checking

* enable raw editor for Insights

* remove lint warning

* Reduce size + inline icons

* add background-highlight when active toggle

* change multiline prop to type prop

* show toggle for all field types (including json)

* remove watcher to toggle rawEditor on load

* fix raw editor emit

* fix request operation headers field type json

* fix raw editor value passed to codemirror

* prevent tags from crashing

* do not unset values anymore when toggling raw

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-15 11:38:23 -04:00