Commit Graph

796 Commits

Author SHA1 Message Date
Nicola Krumschmidt
79b7fc9d4c Fix applyFilter (#13497)
* Revert changes from #11737 to applyFilter

* Add case insensitive operators

* Improve ordering of operators

* Make filters test values more generic and improve structure
2022-05-24 09:37:13 -04:00
Bernat Vadell
7e1b946b20 Add support to insensitive case operators (#11737)
* feat: refactor apply-query & implements icontains

* feat: implements icontains in app

* New translations en-US.yaml

* tests: fix returns the filter operators for binary

* implement rest insensitive operators

* fix: proposal to fix #5996 (convert "in" into "exists")

* delete unused imports

* fix: prevent error when operator filter value is null

* fix: apply-query imports

* some tests

* fix: _nstarts_with not applied correctly

* tests: add some filter mathematical tests
2022-05-18 09:58:53 -04:00
Rijk van Zanten
10eff1c751 Init count of soft limit in wysiwyg on first render (#13242)
Fixes #13235
2022-05-11 12:18:45 -04:00
Rijk van Zanten
a9422b23e9 Show edit drawer as preview for disabled many to one (#13207)
Fixes #13201
2022-05-10 10:56:49 -04:00
Brainslug
15d8e86c64 fetching id's for nested relations in the o2m interface (#13151)
* initial working fix for #13042 and #13058

* found an existing utility function that does exactly what was needed

* Apply O2M fields fix for similar interfaces
2022-05-09 15:53:16 -04:00
Josh Soref
0b01923b0d Spelling (#13072) 2022-05-02 13:16:03 -04:00
Rijk van Zanten
cbf7b54e28 Fix translations interface when using a single language (#13021)
Fixes #13017
2022-04-26 16:35:27 -04:00
Rijk van Zanten
5534736bae Fix default display template lookup in m2o interface (#13012)
Fixes #11825
2022-04-26 10:35:47 -04:00
Azri Kahar
6828a74d4e Fix translations error when finding item (#13011)
* Fix translations error when finding item

* shorter syntax
2022-04-26 09:59:59 -04:00
Rijk van Zanten
81483a8012 Only watch for wysiwyg changes on first interaction (#12936) 2022-04-21 16:59:11 -04:00
Azri Kahar
5bfd3b7b90 Add missing import for color package (#12919) 2022-04-21 09:39:19 +00:00
Azri Kahar
ec2d0dd16d Input translated string improvements (#12869)
* Input translated string improvements

* Update app/src/interfaces/_system/system-input-translated-string/input-translated-string.vue

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2022-04-20 13:36:03 +00:00
Jay Cammarano
f7c8789800 Move more utils to shared (#12825)
* getEndpoint()

* cssVar() and abbreviateNumber

* remove unneeded type. Tests.

* better tests

* getEndpoint Tests

* cssVar => browser folder, test not passing yet

* tests passing
2022-04-19 11:25:48 -04:00
Rijk van Zanten
0a315dcf74 Fix related primary key lookup in list-m2m (#12840)
* Fix related primary key lookup in list-m2m

Fixes #12836

* Apply the same fix for m2a
2022-04-18 19:11:30 -04:00
Nitwel
bbd5676b7c Show pagination on readonly (#12800)
* show pagination on readonly

* allow to preview disabled items
2022-04-18 10:18:30 -04:00
Nitwel
3db1fff840 fix uploading new files not working (#12821) 2022-04-18 10:16:49 -04:00
rijkvanzanten
14d8338403 Fix linter warning 2022-04-18 10:16:23 -04:00
Nitwel
3e1fce8968 Relational Interfaces Rework 🐰🕳️ (#12082)
* add basic util function for later use

* sketch up useRelationMultiple implementation

* update relation util and start reworking relational interfaces

* support filter in m2o

* start working on useRelationMultiple

* continue working on relational foundation

* finish basic use-relation-multiple composable

* get o2m pretty close to being finished

* finish up list-o2m

* replace old interfaces

* copy existing interface

* rewrite vue file

* highlight deleted items

* use Search instead of Get

* support selection on m2m

* finish up m2m

* replace old files

* update files interface

* fix permission checks

* fix styling

* add sketches to explain relations

* rewrite m2a interface

* add usage hint to use-relation-multiple

* update file interface to use new composable

* update file-image interface

* fix image not being shown

* revert names

* fix selection of existing items

* fix loading selected items

* in between commit

* update translations interface

* try using composable recursive

* try linear approach on value modeling

* finish rewriting list-o2m-tree-view interface

* revert api changes

* fix sorting for list-o2m-tree-view

* fix selected items in created array

* Add direct download option to files interface

* Fix linter warnings

* Weird that it's being difficult, but ok

* Cast existingItemCount to number at all times

* fix page gets set below 1

* align pagination to the right

* highlight deselecting row

* show min 1 skeleton loader

* only filter selected when item exists

* fix working on new items

* Fix linter warning

* fix deselecting selected items

* show different icon depending if icon is local

* add changes from #12611

* Add _some vs _none support to o2m

* finish filtering out selected items

* Use get instead of search request

* fix save and stay

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

* fix adding items to m2o

* Fix linter warning

* Handle no-type better

* Clean up axios usage

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
Co-authored-by: Azri Kahar <42867097+azrikahar@users.noreply.github.com>
2022-04-14 22:57:17 +02:00
Rijk van Zanten
ea3555bd88 Render full field path in system fields interface (#12742)
Fixes #12735
2022-04-13 14:48:53 -04:00
programmarchy
fc9190e76e Display fullscreen rich text input below dialog instead of exiting fullscreen (#12045)
Co-authored-by: ian <licitdev@gmail.com>
2022-04-12 09:39:14 -04:00
Azri Kahar
7b0de4eb9b Fix primitive values for JSON code input (#12703) 2022-04-12 07:50:56 -04:00
Azri Kahar
48ae9f870f Reset existing image error after replacing it (#12697) 2022-04-12 07:33:43 -04:00
Rijk van Zanten
9c3ac3eb62 Don't crash on non-image files in image interface (#12692)
Fixes #10475
2022-04-11 19:49:04 -04:00
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