Commit Graph

773 Commits

Author SHA1 Message Date
Azri Kahar
8a3ca353b6 Fix expressions/functions as default values for datetime field (#12052)
* prevent formatting invalid date/time

* fix placeholder

* indicate default value as placeholder when valid

* assume default value as a valid function

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-04-11 20:36:56 +00:00
Azri Kahar
f854109e23 Fix M2A editing of new but unsaved items (#12630)
* Fix M2A editing of new but unsaved items

* fix key
2022-04-08 09:23:25 -04:00
Azri Kahar
948e25d496 Check create & update permissions for M2O field (#12611)
* check create & update perms for m2o field

* remove unused imports
2022-04-07 08:57:02 -04:00
Azri Kahar
4f7abf0733 Default filter operator to eq for field with choices (#12598)
* Default filter to 'eq' for field with choices

* fix function name type
2022-04-06 10:31:59 -04:00
Azri Kahar
f7e651cbe3 Set includeProjectDefault default value to false (#12601) 2022-04-06 10:07:56 -04:00
Azri Kahar
accb5a20e3 Add autofocus prop to input translated string (#12596) 2022-04-06 09:26:10 -04:00
Azri Kahar
17edc01f6f Prevent boolean as string when switching filter (#12597) 2022-04-06 09:25:00 -04:00
Markus
d814502355 Fix repeater interface (#12592)
Adding items was not possible if value was no array
2022-04-05 17:27:29 -04:00
Azri Kahar
703fb8426f Fix app lint warnings (#12552) 2022-04-04 03:53:02 +00:00
Christian Rendl
0206a3d2cc Added default locale before login (#8196)
* Added default locale before login

* Use project_language as default language for new users

* Revert "Use project_language as default language for new users"

* Allow user's language field to be nullable; Use project_language whenever language is unset;

* Apply suggestions from code review

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

* Make "Project Default" option in system-language interface configurable

* Set language only if user language is not null

* Introduced translation for project_language field; Use translation in system-language interface

* Set app language only from app.vue;
Included watcher to restore project_language if user's language is (re)set to null

* Removed .alter() in knex migration since it's not needed for changing default and breaks checks

* Reverted previous change in migration; .alter() is needed for changing column defaults

* Reverted migration to use .defaultTo(null) to set default value

* Update position of project language field in settings

* Fix cockroachdb test error in knex migration

* Fix cockroachdb test error in knex migration

* Apply migration fix also on oracle databases

* Apply changes from code review

* Rename migration to fix migration key error

* Move setLanguage calls to server.ts and hydrate.ts

Co-authored-by: Nicola Krumschmidt <nicola.krumschmidt@freenet.de>
Co-authored-by: jaycammarano <jay.cammarano@gmail.com>
Co-authored-by: Christian Rendl <cr@mutor.at>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-01 14:30:56 -04:00
Nicola Krumschmidt
ca59a8e4d0 Prevent password managers from triggering on input-hash fields (#12465)
This was already attempted in 65daa69 and subsequently reverted in #8344.
2022-04-01 14:21:01 -04:00
Nicola Krumschmidt
8d0e2a8fdc Fix v-form overwriting type of input-hash interface (#12464)
This was causing the password field on the user details page
to show the password in clear text when inputting a new one.
2022-04-01 13:30:10 -04:00
Azri Kahar
8a0fa660bf fix color interface showing black color when empty (#12445)
* fix color interface showing black color when empty

* Default interface value to null

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-04-01 13:25:19 -04:00
Rijk van Zanten
90f5b0a471 Add functions support to the app + add count function (#12488)
* Rename date functions to fn, add json_array_length for pg

* Add json count to mssql

* Add json array count support to other vendors

* Add UI for selecting API functions

* Make it not break

* Render functions in filter preview better

* Include functions in field altering

* Add schema access to database helper

* Allow filtering against o2m/m2m/m2a count

* Add data function execution helpers in utils

* Fix type issue

* Inject function results in validate step

* Render field keys with function names translated

* Allow selecting nested/functions in field validation step

* Make sure number comparisons are treated as numbers

* Add check if instanceof date when casting to a Number

* Prevent selecting foreign keys for junction sort (#12463)

* [SDK] Add further request options to `items` functions (#12503)

* add possibility to set further options to the request

* fix options type

* add typings to interface

* add test if headers are passed thourght

* create reusable options param

* set higher priority to options param

* Small stylistic cleanup

Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Jürg Hunziker <juerg.hunziker@gmail.com>
2022-03-31 16:56:26 -04:00
Nicola Krumschmidt
6e8ab78c0e Fix prop type check issue in filter interface (#12468) 2022-03-29 17:52:28 -04:00
Nicola Krumschmidt
5856d991d4 Fix field validations showing filter interface with all fields (#12467) 2022-03-29 17:51:56 -04:00
rijkvanzanten
31fda8fd98 Tweak preset section overflow 2022-03-28 13:57:53 -04:00
rijkvanzanten
b27ecacd6f Fix collection name usage 2022-03-25 19:42:02 -04:00
rijkvanzanten
a7a07221b0 Fix system-filter button check 2022-03-25 19:39:38 -04:00
Rijk van Zanten
175fb849c4 Add field-level validation (#12363)
* Add field validation column

* Add frontend config for validation

* Make it work

* Add regex to filter configuration

* Fix const/let

* Add custom validation message support

* Add custom validation message tooltip inline

* Fix custom names in validation errors up top

* Fix type error

* Nog eentje om het af te leren

* resolve unused import warnings
2022-03-25 18:03:36 -04:00
CommanderRoot
d81adcd674 refactor: replace deprecated String.prototype.substr() (#12344)
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated

Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
2022-03-25 13:36:18 -04:00
Azri Kahar
6acd0b31a2 Update system-filter interface to use v-field-list (#12320)
* update system filter to use v-field-list

* remove unused code

* use v-field-list in nodes

* prevent node name wrapping

* use prepend as the correct term

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-25 12:27:25 -04:00
Azri Kahar
0f3e5a4463 Fix action for updateAllowed in M2M usePerms (#12371) 2022-03-25 02:55:07 +00:00
rijkvanzanten
0f1dd6739d Use correct interface in dropdown choices 2022-03-23 14:35:52 -04:00
Azri Kahar
d086b7dc82 Prevent M2M item edits without permission via app (#12312) 2022-03-23 11:05:08 -04:00
Azri Kahar
37cbaa0be5 Add App Translation Strings in Settings (#12170)
* add migration for translation strings

* add to navigation

* WIP

* fix dialog overflow

* update translation keys

* Update logic

* add placeholder to system-language

* fix translation

* remove unused import

* reset dialog on create new

* ensure search input is visible when searching

* merge translation strings on set language

* merge translation strings on update

* hydrate

* make sure null translation do not get merged

* change dialog to drawer

* update placeholder text

* fix form value

* revert dialog style change

* rename drawer component

* Force safe key name

* Move interface to system interfaces

The saved values are Directus app proprietary, so to prevent confusion in what it's supposed to do, we'll move it to system.

* Move composable to root composables

* Use new languages input in interface/display options

* hide translation strings field in project settings

* set system true to system-input-translated-string

* use this in field detail notes

* use in list options

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-22 09:39:04 -04:00
Rijk van Zanten
9b8d72ec5c Fix start setting of detail group (#12280)
Fixes #12257
2022-03-21 11:42:24 -04:00
Rijk van Zanten
f40df2443d Fix color translation keys (#12279) 2022-03-21 11:40:33 -04:00
Azri Kahar
e6e129615e fix M2O field deletion (#11538)
* fix M2O field deletion

* fix lint

* fix for MySQL

* Pull final dropColumn out of transaction

* Forget that, check for existing constraint before deleting it instead

* Fix lint warning in unrelated file

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-18 15:36:50 -04:00
ian
6d8b17ed6a Improvements to WYSIWYG interface (#12216)
* Ignore field value updating if it is disabled

* WYSiWYG: Allow to undo Insert image, Insert link, Insert media and Edit source code custom actions

* Bind MutationObserver to correct tinyMCE node

* Fix apply for disabled fields

* Emit null when empty

Co-authored-by: Andrew <trubay.andrey@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-03-18 14:53:57 -04:00
Ben Haynes
2474a0ddc0 Style updates (#12229)
* default badge color to red

* update notice styling to avoid color variants

* darker warning color

* update dark mode primary color

* update svg previews

* show slider values by default

* add subtle glow to field focus

* add additional color options

* no yellow in settings

* Give status display proper defaults

* Use setup script + translations

* Add low-contrast flag to preset

* update date-picker header style

* add placeholder to datetime interface

* Fix sizing of image preview

* Fix spacing / border situation

* select color

* Render small images at original size

* More file library love

* update datetime placeholder

* datetime font weights

* Fix style lint issue

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2022-03-18 15:52:04 +00:00
ian
bc0f23f092 Fix WYSIWYG link keyboard shortcut and add parent anchor tag detection (#12218)
* Fix WYSIWYG link keyboard shortcut and add parent anchor tag detection

* Fix saving of link on parent anchor tag
2022-03-18 08:51:14 -04:00
Azri Kahar
c790f0355a fix number input step up/down when undefined (#12222) 2022-03-18 08:50:13 -04:00
Rijk van Zanten
69280c8ecf Add direct download option to files interface (#12220) 2022-03-17 18:19:10 -04:00
Rijk van Zanten
1c3e94d830 Add new export experience (#12201)
* Use script setup

* Start on export dialog

* Use new system field interface, replace limit with numeric input

* Set placeholder

* Add sort config

* Use folder picker, correct layoutQuery use

* Add local download button

* Allow writing exports to file

* Add notification after export

* Fix sort config, use new export endpoint

* Setup notification hints

* Add information notice

* Fix local limit, cancel button

* Add (basic) docs for export functionality

* Fix json export file format

* Implement xml batch stitching

* Resolve review points
2022-03-17 15:43:45 -04:00
Azri Kahar
b114dc0ad4 use type json for select-color preset option field (#12192) 2022-03-16 09:36:34 -04:00
Andrey Trubay
cf3e86bebd Collection name layout fix (#12169) 2022-03-15 10:37:14 -04:00
Azri Kahar
76f463c608 Form error validation improvements (#12001)
* expand groups on save when they contain error(s)

* bubble to top & scroll top

* fix groups validation errors watcher

* fix group acordion's first error field selection

* update global error notice

* WIP - field validation

* tweak validation errors list styling

* more validation-errors-list tweaks

* click and scroll to field

* move validation error notice to a component

* tweak use-item validate

* validate drawer item

* extract validateItem function

* Revert "WIP - field validation"

This reverts commit f6ffd836c4.
2022-03-09 16:48:10 -05:00
ian
079cf60425 Close WYSIWYG fullscreen when opening drawer or dialog (#12037) 2022-03-08 12:06:14 -05:00
rijkvanzanten
a0733f7dab Fix video rendering in wysiwyg 2022-03-07 18:32:52 -05:00
Rijk van Zanten
6a3eb823c3 Update base theme of the App (#11952)
* Add migration to remove default value from project_color

* Upgrade the default theme

* Do a pass over the header buttons

* Do another pass over --warning uses

* Little things

* Tweak smoke

* Use updated map

* Use dark system elements in dark mode

* Remove outdated files, update toasts

* Use correct delete button style for role

* Use primary for created point

* Tweak spacing in revisions section

* Use primary for sidebar sections

* Various color tweaks and changes

* Update base color palette

* Update "css reset" code

* Remove splashscreens, add default favicon

* Add primary highlight to datamodel page

* dark mode color update

* fix sign out hover color

* Does this help?!

* This fixes some loading issues

Fixes https://github.com/directus/directus/issues/10707

* Calculate default pretty background?

* Fix public view with logo

* Fix responsiveness of login page

* adjust notification group width to be equal

* Do an absolute pointless task that doesn't do anything

It was suggested that it could fix the stylelint error in tests, but alas

* Remove stylelint

Doesn't seem to play nice with script setup and other changes

Co-authored-by: Ben Haynes <ben@rngr.org>
2022-03-04 18:53:39 -05:00
Azri Kahar
b44f9dd8d0 add number to prop type for radio and dropdown (#11924) 2022-03-03 10:38:08 -05:00
Azri Kahar
dec85f5659 add style to links in notice (#11925)
* add style to links in notice

* fix for stylelint

* unrelated: fix eslint warning for unused variables
2022-03-03 09:56:38 -05:00
Abdón Rodríguez Davila
838f37b9be Respect the disable the o2m sort option (#11893) 2022-02-28 18:42:15 +00:00
Azri Kahar
fc585000a0 Datetime interface improvements (#11783)
* Datetime interface improvements

* tweak click event
2022-02-28 12:23:23 -05:00
Azri Kahar
c85515ada6 Fix relational interfaces to return null when the array is empty after deselecting item(s) (#11765)
* Fix relational interfaces to return null on delete

* add fix to m2a

* fix treeview not clearing displayed list
2022-02-21 11:19:32 -05:00
Azri Kahar
00175ff1cb fix copy/paste for readonly code interface (#11769) 2022-02-21 11:14:48 -05:00
Azri Kahar
6b02935116 fix translations resetting for new records (#11746) 2022-02-20 17:52:45 -05:00
Azri Kahar
240a2b09f7 Align displayed time for 24 hours format (#11703) 2022-02-18 10:22:12 -05:00
Azri Kahar
abb2ecdf2e fix translations for singleton (#11697) 2022-02-18 10:21:26 -05:00