Commit Graph

579 Commits

Author SHA1 Message Date
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
Gerard Lamusse
b1449dd1cc Show sub fields if parent exists (#15041)
* Show sub fields if parent exists
Search relationship fields

* Revert back to 20
2022-08-17 10:02:33 -04:00
Azri Kahar
edc431764e fix filter by folder for file and files interface (#15073) 2022-08-15 09:38:41 -04:00
ian
225822541e Allow fields nested in groups to be visible (#15044) 2022-08-12 10:39:20 -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
Gerard Lamusse
fadaea28ab Remove disabled override (#14913) 2022-08-08 10:14:58 -04:00
Azri Kahar
a748e0d31d add styling to links in field note (#14878) 2022-08-05 12:35:12 -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
ian
59643d7fd0 Check for null initialValues (#14806) 2022-08-03 10:52:31 +02:00
John Flow
40467bb960 Make DrawerItem, DrawerBatch global components (#14751)
* Made DrawerItem, DrawerBatch global components

https://github.com/directus/directus/discussions/13139

* Added DrawerItem, DrawerBatch to src/components/register

* Removed DrawerItem, DrawerBatch from src/views/register

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-08-02 09:55:45 -04:00
Brainslug
1d196e968c don't delete values when resetting to the initial value (#14791) 2022-08-02 09:19:48 -04:00
rijkvanzanten
0b78a1bbd0 Fix header offset in tiles 2022-08-01 17:59:52 -04:00
ian
1884c081f5 Cast values to string when matching in v-select (#14685) 2022-07-27 10:01:28 -04:00
ian
ce01288307 Reload image view when src is updated (#14646)
* Reload image view when src is updated

* Regenerate random ID after saving to bust cache
2022-07-26 11:52:50 -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
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
Brainslug
3ceec97f66 Using formFields which is filtered over the fields property (#14569) 2022-07-22 09:30:25 -04:00
Brainslug
8bc098c337 Conditions not working (partially) (#14488)
* changed way of storing the formfield data in v-form

* hacky translation implementation

* updated translations without bombing the performance

* removed debug code and refactored initial implementation

* removed redundant useFormFields in users route

* making proper use of useFormField results to not break the grid layout

* removed limitation for conditions

* Fix selection of foreign keys for value field in time series panel

* Revert "removed redundant useFormFields in users route"

This reverts commit c6f4f23cf8.

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-07-21 14:39:43 -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
Rijk van Zanten
254ba38a5a Skip disabled field check when using set-field-value event (#14532)
Fixes #14531
2022-07-20 11:31:49 -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
Brainslug
e3643a2c5d Performance improvements for groups within v-form (#14188)
* added explicit change check before updating the internal value

* bunch of attempted fixes

* Revert "bunch of attempted fixes"

This reverts commit 17b7a5340f.

* nested v-form performance improvements
preventing re-rendering of some groups

* tries to fix accordion always re-rendering

* abnstracted the fix to its own functions

* abstracted the fix to its own functions

* fixes bug with rendering and saving data in accordion groups

* removed unneeded if statement

Co-authored-by: ian <licitdev@gmail.com>
2022-07-07 21:55:35 +08:00
Azri Kahar
750e9d9969 remove open prop (#14252) 2022-07-01 23:12:20 -04:00
ian
7a7540ddaa Fix rendering of social icons (#14195) 2022-06-29 14:41:13 -04:00
Azri Kahar
ad7d39203f Fix v-select search & selection of groups (#14154)
* fix search not matching parent items

* make group selectable in v-select

* fix wrong prop name

* set selected group to active for highlighted style

* Fix typings

Co-authored-by: ian <licitdev@gmail.com>
2022-06-28 15:06:18 -04:00
Azri Kahar
68eeab8ae2 Add search in v-select (#13867)
* Add search in v-select

* only show search when nested items more than 20

* auto open when there's only one child

* persist search input when item count reduces
2022-06-27 15:53:51 -04:00
Rijk van Zanten
32dd709778 Insights 2.0 (#14096)
* query function added to list

* dashboard reading query, adding to object

* typecasting of filter vals needed still

* numbers accepting strings too

* json-to-graphql-query => devD

* fixed unneeded return in list index.ts

* stitching and calling but not actually calling

* calls on panel change

* query object += new panel before dashboard save

* uuid generated in app not api

* fixed panel ids in query

* fixed the tests I just wrote

* passing the query data down!

* list showing data

* objDiff test moved to test

* metric bug fixes + data

* dashboard logic

* time series conversion started

* timeseries GQL query almost there

* query querying

* chart loading

* aggregate handling improved

* error handling for aggregate+filter errors

* removed query on empty queryObj

* maybe more error handling

* more error handling working

* improvements to erorr handling

* stitchGQL() error return type corrected

* added string fields to COUNT

* pushing up but needs work

* not an endless recursion

* its not pretty but it works.

* throws an error

* system collections supported

* refactor to solve some errors

* loading correct

* metric function fixed

* data loading but not blocking rendering

* removed redundant code.

* relational fields

* deep nesting relations

* options.precision has a default

* relational fields fix. (thanks azri)

* the limit

* limit and time series

* range has a default

* datat to workspace

* v-if

* panels loading

* workspaces dont get data anymore

* package.json

* requested changes

* loading

* get groups util

* timeseries => script setup

* list => script setup

* metric => script setup

* label => script setup

* declare optional props

* loadingPanels: only loading spinner on loading panels

* remove unneeded parseDate!!

* applyDataToPanels tests

* -.only

* remove unneeded steps

* processQuery tests

* tests

* removed unused var

* jest.config and some queryCaller tests

* one more test

* query tests

* typo

* clean up

* fix some but not all bugs

* bugs from merge fixed

* Start cleaning up 🧹

* Refactor custom input type

* Small tweaks in list index

* Cleanup imports

* Require Query object to be returned from query prop

* Tweak return statement

* Fix imports

* Cleanup metric watch effect

* Tweaks tweaks tweaks

* Don't rely on options, simplify fetch logic

* Add paths to validation errors

* [WIP] Start handling things in the store

* Rework query fetching logic into store

* Clean up data passing

* Use composition setup for insights store

* Remove outdated

* Fix missing return

* Allow batch updating in REST API

Allows sending an array of partial items to the endpoints, updating all to their own values

* Add batch update to graphql

* Start integrating edits

* Readd clear

* Add deletion

* Add duplication

* Finish create flow

* Resolve cache refresh on panel config

* Prevent warnings about component name

* Improve loading state

* Finalize dashboard overhaul

* Add auto-refresh sidebar detail

* Add efficient panel reloading

* Set/remove errors on succeeded requests

* Move options rendering to shared

* Fix wrong imports, render options in app

* Selectively reload panels with changed variables

* Ensure newly added panels don't lose data

* Only refresh panel if data query changed

* Never use empty filter object in metric query

* Add default value support to variable panel

* Centralize no-data state

* Only reload data on var change when query is altered

* Fix build

* Fix time series order

* Remove unused utils

* Remove no-longer-used logic

* Mark batch update result as non-nullable in GraphQL schema

* Interim flows fix

* Skip parsing undefined keys

* Refresh insights dashboard when discarding changes

* Don't submit primary key when updating batch

* Handle null prop field better

* Tweak panel padding

Co-authored-by: jaycammarano <jay.cammarano@gmail.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
2022-06-27 15:26:42 -04:00
Azri Kahar
f0552b3660 Use conditional props for links in v-list-item (#14124) 2022-06-27 10:58:10 -04:00
Brainslug
c3334e5765 Major input delays on text fields in complex documents (#14035)
* first successful performance improvement separating the values and rendering the form from a frozen list

* this does not work, the reactivity of formFields is in the way

* disabled field conditions

* splitting the apply-conditions logic from the fields ref used for the input loop

* removed the original object.freeze attempt

* using fieldsMeta as object instead of array and using the correct variable for looping
2022-06-22 13:54:01 -04:00
Azri Kahar
4111436999 prevent translations validation error match parent (#13930) 2022-06-17 17:49:25 -04:00
Azri Kahar
6596bc1620 use conditional props for component in v-button (#13840) 2022-06-17 13:21:50 -04:00
Brainslug
dea0669aac fix batch edit checkbox on the wrong line (#13952) 2022-06-17 13:31:06 +02:00
Ben Haynes
42cb679fed invert color shades (#13940)
* invert color shades

* Fix input glow

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-06-16 21:26:18 +00:00
Brainslug
f60b12c8ef using the openSelection variable to manage the open groups (#13752) 2022-06-16 10:28:24 -04:00