Commit Graph

613 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
Pascal Jufer
d5395ce72c Follow-up on "Drop inline rendering of docs" (#17449)
* Follow-up of "Drop inline rendering of docs"

* Remove docs hack

---------

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2023-02-08 11:25:32 -05:00
Nitwel
b136d7c30d Support selecting multiple files in v-upload (#17394)
* support multiple on selection in v-upload

* run linter
2023-02-08 10:27:45 -05:00
Nitwel
78bda5c763 Fix span with space in it (#17432)
* Fix span with space in it

* run linter

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-02-08 01:19:33 +08:00
Addison Elliott
d31e0011b8 Fix issue with v-detail transition not working on initial collapse (#17325)
Bug only occurred if v-detail started out expanded, which is not extremely common.

Co-authored-by: Addison Elliott <addisone@becs.com>
2023-02-07 10:09:18 -05:00
Nitwel
5157c44dd8 Fix checkbox flickering (#17411) 2023-02-06 15:08:56 -05:00
Addison Elliott
39a812b4f3 Fix bug with v-checkbox-tree where leaf nodes are treated like branch (#17323)
nodes with no children

Bug introduced here in #15094

Co-authored-by: Addison Elliott <addisone@becs.com>
2023-01-27 15:53:17 -05:00
Nitwel
276cc479ce Revert "Disable field selection for alias fields in the system-filter component when functions are used (#14314)" (#17182) 2023-01-19 08:18:35 -05:00
ian
025bb7c053 Fix insights filtering (#16139)
* Parse string filter as JSON

* Parse content as JSON when toggling raw editor

* Refactor missing Dashboard type

* Convert filter to gql format

* Disable alias field filter selection in insights

* Use parseJSON util

* Refactor to allow selectivity of relational field for GraphQL filters

* Emit variables

* Skip emitting invalid JSON

* Add unit tests
2023-01-18 14:31:59 -05:00
Azri Kahar
0122c4da4b Add bottom margin to Slider interface to account for field note (#17024)
* add margin when thumb label is always visible

* add z-index to thumb label for field note

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2023-01-05 08:31:15 -05:00
Brainslug
9f60b0f31d Remove auto-increment primary key when saving as copy (#16966)
* check for auto increment when saving as copy

* updated check to cover uuid generated IDs

* attempt to test use-item composable

* updated test objects

* do not rely on is_generated

* fix readonly regression

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2023-01-05 19:07:11 +08:00
Brainslug
cbd2af050b Implements server sort in o2m table interface (#16897)
* implements server sort when dealing with multple relational pages

* always use server sort

* fixed unsetting sort

* removed frontend sorting

* make loading total count more accurate

* remove removed prop

Co-authored-by: Nitwel <mail@nitwel.de>
2023-01-04 16:32:05 +01:00
Gerard Lamusse
9f06c36e0d Disable field selection for alias fields in the system-filter component when functions are used (#14314)
* Disable selecting alias fields to filter on

* Only disable alias fields when in condition mode
2023-01-04 13:27:13 +01:00
Pascal Jufer
8f5a072352 Enhance loading logic in image component (#16538)
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-12-19 11:06:07 +01: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
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
ce8f571c72 Fix key combinations being prevented in dbSafe v-input when it's a leading number (#16668)
* Fix key combinations being prevented in v-input

* should normalize accented characters first

* add tests for processValue and emitValue

* export keyMap from use-shortcut to keep things DRY

* try to add test for use-shortcut composable

* move systemKeys to use-shortcut

* add "capslock" & "enter" to systemKeys
2022-11-30 19:56:44 +08:00
Azri Kahar
d1483b15b4 improve v-icon performance (#16511) 2022-11-28 14:39:38 -05:00
Azri Kahar
0a839b53b4 v-menu pointer event tweaks (#16512)
* v-menu pointer event tweaks

* apply tweak to .v-menu click & closeOnContentClick
2022-11-28 14:39:23 -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
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
Azri Kahar
efe7dce5bc Fix Paste Raw Value not staging field edit (#16132)
* fix Paste Raw Value not staging field edit

* use emitValue instead
2022-10-25 00:55:33 +08:00
Azri Kahar
8850aec88f Fix input-code height in form-field-raw-editor (#16135)
* Fix input-code height in form-field-raw-editor

* update test snapshot due to scoped css

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-24 16:32:59 +00:00
Rijk van Zanten
2d104e933b Patch Tuesday 🐸 (#16052)
* Update API non-majors

* Update major changes

* Temp fix for type warning in sdk

* Resolve missing new keyword in GraphQLNonNull use

* Lock versions in api

* Update and lock versions in shared

* Update lockfile

* Fix build type errors in api

* Update app patches/minors

* Upgrade major versions

* Lock versions

* Upgrade root deps

* Update packages

* Switch from pino-colada to pino-pretty

* Update snapshots

* Fix globby sync usage

* Remove globals from jest config

* No ranges

* Revert "Remove globals from jest config"

This reverts commit e249e2c8fe.

* Revert "Upgrade root deps"

This reverts commit 62add28a85.

* Update non-jest stuff

* We'll keep trying

* Update globby to latest minor only

* Test on all vendors

* Revert test on all vendors

* Fix linting

* Preserve request log format

* Preserve existing timestamp format and allow configuration

* Use lodash merge to allow for nested objects

Co-authored-by: ian <licitdev@gmail.com>
2022-10-20 09:31:17 -04:00
Nitwel
a0e2801501 Fix empty form info on translations (#15757)
* fix empty form info

* hide circle

* Allow setting prop icon to false in v-info

* Add inline prop to v-form to disable info icon

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-14 19:18:06 -04:00
Vincent Kempers
03d65e8363 Fix and improve raw value editor (#15868)
* this works in the form-field setting up for refactor

* refactored the useRaw and made form-field-raw-editor

* add defaults

* add tests for render submitting and cancelling

* add isNil

* delete the comment

* add a cancel button

* change let to const

* add the if statement when it's not a object

* delete the .raw-value and place it in the raw-editor form field

* rename submit to setRawValue

* change submit to set-raw-value

* add a possibility to add a placeholder to the system-raw-editor

* implement the system-raw-editor to the form-field-raw-editor

* update the snapshot and fix the emitted tests

* found out we can disable the gutter and line-numbers

* add a language prop to the system when it's not defined it should default to mustache

* delete style; add language and add type

* update the html in tests

* add input-code for the extended validation

* add default value

* Update form-field-raw-editor.vue language to plaintext

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

* update test

Co-authored-by: Vincent Kempers <vincentkempers@vincents-mbp.lan>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-10-14 14:17:24 -04:00
Azri Kahar
027696dd65 fix workspace size logic (#15637) 2022-10-12 14:42:39 -04:00
Nicola Krumschmidt
1a5d635efb Move key to component where v-for is defined (#15944) 2022-10-11 17:57:54 -04:00
Rijk van Zanten
b28633d597 Upgrade vite (#15943)
* Upgrade vite

* Update snapshots for updated vite plugin
2022-10-11 16:06:09 -04:00
Brainslug
69797776f1 Add fallback message when no fields are visible in a form (#14778)
* Add fallback page when no fields are visible in a form

* fixed spacing for the linter

* properly show empty form message for relational drawer items

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-09-24 18:53:34 +00:00
Azri Kahar
c8ae40f827 fix v-list-group active state (#15442) 2022-09-12 20:00:17 -04:00
Brainslug
e72ae3b2a7 Item Duplication for manually entered primary keys (#14947)
* disable save as copy for manually entered primary keys

* only mark primaryKey as readonly for generated pk's

* re-enable save-as-copy for manual ids
2022-09-12 17:23:54 -04:00
Azri Kahar
ac2275f3b8 Prevent v-highlight infinite loop (#15438) 2022-09-06 16:57:43 -04:00
GBSTR
213de3f5c6 fix divider not showing/ showing when not needed (drawer-item) (#14605)
* fix form divider when opened from drawer item

* remove redundant functions

* change back the form order to what is was

* add the option to swap between relation fields and junction fields

* fix language

* added m2m options as dropdown with more abilities

* remove the hide options and put off instead

* remove the off option from m2m junctionFieldLocation

Co-authored-by: Gabriel Shtenberg <gabriels@brainpop.com>
Co-authored-by: dev name <devn@brainpop.com>
2022-09-05 16:23:44 +02:00
Azri Kahar
7ccd787975 Fix context menu (#15376) 2022-09-03 21:16:33 +08: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
Brainslug
f5befa5bc5 Current items cleared in o2m/m2m when selecting nothing with "add existing" (#15337)
* don't update the state if nothing was selected

* temp disable clearValue for relational fields

Co-authored-by: Nitwel <nitwel@arcor.de>
2022-09-01 14:52:32 -04:00
Nitwel
f0fdd463a0 Fix drawer (#15336)
* start fixing the drawer

* debug

* fix drawer-item

* finish fixing all interfaces
2022-08-31 13:49:25 -04:00
Lukas Schätzle
6a6dab8b5f Always show all upload options (#15128)
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2022-08-31 13:46:49 -04:00
Brainslug
b2d127dcc8 Default values ignored for validations affected by conditions (#15310)
* added default values when validating items

* abstracted default value parsing to its own util

* Added a basic test

* updated tests

* fixed import

* implementing the same fix for conditions on the drawer-item
2022-08-30 16:46:38 +02:00
Azri Kahar
f77d12eff4 Fix thumbnail overflow in render-template (#15115)
* fix thumbnail overflow in render-template

* new fix for render-template thumbnail in table

* fix thumbnail not working in page titles

* prevent thumbnail overflow in page title
2022-08-29 15:06:57 -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
13bf30e90a Update workspace tile position only when there are values defined (#15164) 2022-08-19 10:10:05 -04:00
Brainslug
76964b67a3 v-form error: Cannot read properties of undefined (reading 'meta') (#15160)
* do optional chaining for fieldMeta in case it is not loaded yet

* using the loading prop instead of checking values

* Added better typing to catch undefined values
2022-08-19 09:11:47 -04:00
Brainslug
b9803456e0 Stop groups from rendering before the conditions are applied (#15144)
* update open state if already initialized

* prevent group rendering with default props before data is loaded

* prevent default field options before values are loaded
2022-08-18 15:40:17 -04:00
Rijk van Zanten
a21b28b423 Add "Run Script" operation (#15101)
* [WIP] Start working on script operation

* WIP Remove npx-import experiment

* Don't break on string value in options scope

* WIP Add module whitelist

* Mission critical import cleanup work

* Add translated labels

* Use nodeVM for everything

Keeps the export function callback structure consistent

* Tweak wording

* WIP start on tests

* Improve typing in shared define types

* Add missing base reactive properties in server store

* Add tests for exec index in app

* Add tests

* Optimize error handling
2022-08-18 15:39:25 -04:00
Gerard Lamusse
9c104519f0 Initial interface of O2M & M2M Table View (#12820)
* Fix lint issues
Merge in main

* Add support for resizing columns.
Disable sorting on json columns

* Replaced static text with translations

* remove unused variables

* add no collection/fields states to system-fields

* turn columns to notice when creating list-m2m

* tweak system-fields no fields background color

* add danger styling for deselect in table layout

* add tooltips

* prevent linking to items without ID yet

* fix launch icon for list layout

* tweak padding for per page

* Update missing types

* resolve ::v-deep to :deep warning

* minor style tweaks

* fix search

* fix destructuring crashing when no permissions

* remove unused variables

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-08-19 03:16:20 +08:00
Gerard Lamusse
394e577668 Fix searching custom value and text property on v-select (#15148) 2022-08-18 15:07:09 -04:00
Azri Kahar
d6bfef40cc Fix v-image's intersection observer sometimes preventing image load (#15082)
* Fix v-image's intersection observer

* check the last entry instead

* clean up

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-08-17 11:44:18 -04:00