Commit Graph

307 Commits

Author SHA1 Message Date
Nicola Krumschmidt
d64ca14348 Explicitly set catch parameters to any type (#7654)
This fixes not being able to build the repo due to type issues
introduced by the Typescript 4.4 option "useUnknownInCatchVariables",
which is enabled by default in strict mode.
2021-08-27 10:33:30 -04:00
Rijk van Zanten
de8c2f5c67 Fix uploaded_by not always setting user (#7581)
Fixes #7498
2021-08-24 14:12:35 -04:00
Oreille
5b6354d6be Add postgres constructor to getGeometryHelper (#7561) 2021-08-24 08:56:53 -04:00
Jay Cammarano
ba8e30ab2e added translation vars to fields (#7554) 2021-08-23 21:19:51 +00:00
rijkvanzanten
256139ffd2 Fix double drop relation 2021-08-19 17:11:49 -04:00
Rijk van Zanten
3b409fe385 Fix typecasting of required field (#7392)
Fixes #7356
2021-08-13 00:53:40 +02:00
Oreille
83e8814b2d Add support for Geometry type, add Map Layout & Interface (#5684)
* Added map layout

* Cleanup and bug fixes

* Removed package-lock

* Cleanup and fixes

* Small fix

* Added back package-lock

* Saved camera, autofitting option, bug fixes

* Refactor and ui improvements

* Improvements

* Added seled mode

* Removed unused dependency

* Changed selection behaviour, cleanup.

* update import and dependencies

* make custom style into drawer

* remove unused imports

* use lodash functions

* add popups

* allow header to become small

* reorganize settings

* add styling to popup

* change default template

* add projection option

* add basic map interface

* finish simple map

* add mapbox style

* support more mapbox layouts

* add api key option

* add mapbox backgrounds to layout

* warn when no api key is set

* fix for latest version

* Improved map layout and interface, bug fixes, refactoring.

.

.

* Added postgis geometry format, added marker icon shadow

* Made map buttons bigger and their icons thinner. Added transition to header bar.

* Bug fixes and error handling in map interface.

* Moved box-select control out of the map component. Removed material icons sprite and use addImage for marker support.

* Handle MultiGeometry -> Geometry interface error.

* Removed hardcoded styles. Added migrations for basemap column. Lots of refactoring.

Removed hardcoded styles. Added migrations for basemap column. Lots of refactoring.

* Fixed style reloading error. Added translations.

* Moved worker code to lib.

* Removed worker code. Prevent Mapbox from removing access_token from the URL.

* Refactoring.

* Change basemap selection to in-map dropdown for layout and interface.

* Touchscreen selection support and small fixes.

* Small change.

* Fixed unused imports.

* Added support for PostgreSQL identity column

* Renamed migration. Added crs translation.

* Only show fields using the map interface in the map layout.

* Removed logging.

* Reverted Dockerfile change.

* Improved crs support.

* Fixed translations.

* Check for schema identity before updating it.

* Fixed popup not updating on feature hover.

* Added feature hover styling. Fixed layer customization input. Added out of bounds error handling.

* Added geometry type and support for database native geometries.

* Fixed linting.

* Fixed layout.

* Fixed layout.

* Actually fixed linting

* Full support for native geometries
Fixed basemap input
Improved feature popup on hover
Locked interfaced support

* Fixed geometryType option not updating

* Bug fixes in interface

* Fixed crash when empty basemap settings. Fixed fitBounds option not updating.

* Added back storage type option. Improved interface behaviour.

* Dropped wkb because of vendor inconsistency with binary data

* Updated layout to match new geometry type. Fixed geojson payload transform.

* Added missing geometry_format attributes to local types.

* Fixed typos & refactoring

* Removed dependency on proj4

* Fix error when empty map interface options

* Set geometry SRID to 4326 when inserting into the database

* Add support for selectMode

* Fix error on initial source load

* Added geocoder, use GeoJSON for api i/o, removed geometry_format option, refactoring

* Added geometry intersects filter. Created geometry helper class.

* Fix error when null geometryOptions, added mapbox_key setting.

* Moved all geometry parsing/serializing into processGeometries in `payload.ts`. Fixed type errors.

* Migrate to Vue 3

* Use wellknown instead of wkx

* Fixed basemap selection.

* Added available operator for geometry type

* Added nintersects filter, fixed map interface for filter input

* Added intersects_bbox filter & bug fixes.

* Fixed icons rendering

* Fixed cursor icon in select mode

* Added geometry aggregate function

* Fixed geometry processing bug when imported from relational field.

* Fixed error with geocoder instanciation

* Removed @types/maplibre-gl dependency

* Removed fitViewToData options

* Merge remote-tracking branch 'upstream/main' into map-layout

* Fixed style and geometryType in map interface options

* Fixed style change on map interface.

* Improved fitViewToData behaviour

* Fixed type imports and previous merge conflict

* Fixed linting

* Added available operators

* Fix and merge migrations

* Remove outdated p-queue dep

* Fix get-schema column extract

* Replace pg with postgis for local debugging

* Re-add missing import

* Add mapbox as a basemap when key exists

* Remove unused tz flag

* Process delta in payloadservice

* Set default map, add limit number styling

* Default display template to just PK

* Tweak styling of error dialog

* Fix method usage in helpers

* Move sdo_geo to oracle section

* Remove extensions from ts config exclude

* Move geo types to shared, remove _Geometry

* Remove unused type

* Tiny Tweaks

* Remove fit to bounds option in favor of on

* Validate incoming intersects query

* Deepmap filter values

* Add GraphQL support

* No defaultValue for geometryType

* Resolve c

* Fix translations

Co-authored-by: Nitwel <nitwel@arcor.de>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-12 22:01:34 +02:00
Adrian Dimitrov
8fefc31a31 Add missing translations (#7358) 2021-08-11 13:42:00 -04:00
Rijk van Zanten
f6a7853e7d Rely on RETURNING when possible (#7259)
* WIP use returning clause instead of max from id

* Use returning where applicable, fallback to fetch

Fixes #6279
2021-08-07 00:21:50 +02:00
Pascal Jufer
bea3794f0a Switch to exifr for image metadata extraction (#6922)
* Switch to exifr for image metadata extraction

* Fix migrations on pg

* Prevent double divider

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-08-05 19:19:18 -04:00
Rijk van Zanten
627d843aed Update/tweak groups (#7229)
* Split detail/raw groups, tweak accordion

* Add update groups migration
2021-08-06 00:27:26 +02:00
Rijk van Zanten
d0f6cb35e3 Support dynamic variables in conditional fields (#7202)
* Move accountability type to shared

* Rely on shared for parse-filter

* Install date-fns

* Support dynamic variables in conditional fields

Closes #7157
2021-08-05 01:51:15 +02:00
Rijk van Zanten
ce234f3165 Fix timezone problems in dateTime type (#7200)
* Disable useTZ option from MS SQL by default

* Fix recognition of OracleDB timestamp

* Smoothen out knex default in useTz for datatypes

* Fix timezone parsing for dateTime fields

* Remove unused import
2021-08-05 01:19:24 +02:00
Rijk van Zanten
ef3d618d6c Add support for app-required field state (#7166)
* Add "required" option to fields

* Move some exceptions to shared

* Do client side validation for required

* Add conditional required support
2021-08-03 23:04:24 +02:00
Jay Cammarano
0b17fdcf81 Warn on Missing Migrations (#6580)
* added warn when migrations have not all been run

* fixed imports

* added better error handling

* Update api/src/database/index.ts

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

* migration is its own file

* added custom migrations path

* Handle non-existing custom migrations folder

Co-authored-by: jaycammarano <jaycammarano@gmail.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-02 15:52:10 -04:00
Rijk van Zanten
38896075d4 Add accordion group (#7130)
* Start on accordion group

* Add some basic styling to accordion sections

* Update style, add multiple option, add shift-click

* Only toggle-all on multiple option

* Finish styling of accordion sections

* Tweak styling

* Add 'start' option to accordion

* Rename group-raw -> group-standard, add header option

* Replace group-divider with group-standard
2021-08-02 18:12:52 +02:00
Rijk van Zanten
a55d1bc4a7 Fix users accountability tracking (#7104) 2021-07-30 19:17:06 +02:00
Rijk van Zanten
92e1ee77bd Add support for Conditional Fields (#6864)
* Add conditions field to directus_fields

* Add conditions configuration

* Apply conditional overrides

* Handle conditions in nested groups

* Fix reverse mutating conditions

* Start on filter setup interface

* Move field types/constants to shared

* [WIP] Updated client side filter validation

* Support logical operators in client validation step

* Use new validation util in conditions check

* Add nesting in filter seutp

* Add filter rule setup configurator

* Fixes that should've been done in the merge

* Strip out filter-settings interface

TBD in a new PR

* Move browser to index
2021-07-26 18:02:24 -04:00
Rijk van Zanten
87ab9b3dfa Improve error reporting on CLI bootstrap command (#6977)
* Show full DB error on bootstrap connection issue

* Show full DB error on bootstrap
2021-07-26 17:10:10 +00:00
Adrian Dimitrov
efe7b076a3 Add default-folder option (#3209)
* Allow set folder for imported files

* Allow passing folder in file/files component; Allow pick folder for file/files/image interfaces.

* Added folder system component for picking folders; Move folder picker the field from data to interface (file, files, image).

* Add custom folder interface; use props for interfaces file/files/image in upload component

* Allow set folder for imported files

* Allow passing folder in file/files component; Allow pick folder for file/files/image interfaces.

* Added folder system component for picking folders; Move folder picker the field from data to interface (file, files, image).

* Add custom folder interface; use props for interfaces file/files/image in upload component

* Update after rebase

* Add storage_default_folder setting, use folder when deploy file

* Fix files options; Add default label option for folder interface.

* Fix set folder for file

* UX

* Add migration for column, undo seed change

* Update nomanclature

* Make sure file library always submits folder, cleanup setting retrieval

* Use indexName on down migrate

* Fix import default folder, rename customPresets->folderPreset

* Rename interface import

* Use undefined as default folder

* Remove deprecated lang file

* Fix display of folder interface, treat null as value

* Move shared composable

* Remove unused ref

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-07-21 17:29:21 -04:00
Tim
2c9ff3bca6 Allow custom transformations of assets (#6593)
* Allow custom transformations of assets

This exposes one query parameter `transforms`, which is a JSON array of
shard transformation operations.

It also updates the asset presets. The UX for this still needs some work

* Rename options to arguments for presets

More explicit

* options -> arguments in setting spec

* Better errors for invalid JSON in asset presets

* Add limit to transforms query parameter

* Use flattened option for extra transforms

* Fix placeholder color of code input

* Allow "simple mode" aliases

* Add documentation

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-07-21 15:57:47 -04:00
Aiden Foxx
2f3db645ef Fixed migration changing filesize failing on Oracle (#6722) 2021-07-12 14:09:50 +02:00
Zorin Sergey
3ef8d25bef Changed filesize to bigint for large files (#6516)
* Changed filesize to bigint for large files

* Update api/src/database/migrations/20210626A-change-filesize-bigint.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-06-28 14:11:37 -04:00
rijkvanzanten
5756954dd7 Fix edge case in fk replacing 2021-06-26 21:27:46 -04:00
Rijk van Zanten
c79e682327 Add missing field for required app access (#6481)
Fixes #6475
2021-06-24 12:37:43 -04:00
Rijk van Zanten
0d899f097d Add ability to specify what fields to clone on "Save as Copy" (#6379)
* Start on tree-select component

* Stop propagation on label click as well

* Setup temp debug route

* Add value-combining=all

* Add branch mode

* Add leaf mode

* Add indeterminate state

* Add search

* Keep group state alive during search

* Fetch existing item based on clone fields data

* Add interface for setup

* Tweak field structure of m2a items

* Use collection name in checkbox

* Remove temp test
2021-06-18 16:37:27 -04:00
Aiden Foxx
980be7cb53 Fixed invalid onDelete constraint for some schemas (#6308)
* Fixed invalid onDelete clause for some schemas

* Ran prettier

* Updated all onDelete statements to be Oracle friendly

Co-authored-by: Aiden Foxx <aiden.foxx@sbab.se>
2021-06-17 15:43:32 -04:00
rijkvanzanten
95f4b1c521 Fix console log usages in linter 2021-06-14 15:10:50 -04:00
Aiden Foxx
36ae50c4e5 Fix Oracle env error (#6225)
* Fix Oracle env error

Fix for #6224.

* Update index.ts
2021-06-14 10:42:55 -04:00
Aiden Foxx
051fbfcebd Fixed migrations for fresh Oracle install (#6228) 2021-06-12 13:18:35 -04:00
Rijk van Zanten
bc8370d084 Add item duplicate fields configuration option to directus_collections (#6140)
* Add item_duplication_fields field

* Add types for item duplicate fields
2021-06-08 17:57:28 -04:00
Rijk van Zanten
babe6cdc08 Fixed issue that would prevent usage of limit -1 on deep limit (#6054)
Fixes #5960
2021-06-03 21:47:58 -04:00
Rijk van Zanten
2270d870f9 Prevent foreign key constraint names from exceeding 64 characters (#6043)
* Add index name generator function

* Ensure foreign keys are 64 chars or less
2021-06-03 17:31:58 -04:00
Rijk van Zanten
1cdbc91593 Handle illegal/corrupt relational rows better (#6040)
Fixes #6013
2021-06-03 15:26:02 -04:00
Oreille
22f2e4662f Add support for adding a collection accent color (#5818)
* Added icon_color to directus_collections
Added migrations
Added color property to select-icon
Fixed select-icon placeholder

* Use icon color in collection header bar.

* Set `collection` and `note` fields to hald witdh

* Rename icon_color->color

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-06-03 13:04:19 -04:00
Rijk van Zanten
45730c6860 Resolve linter warnings (#6008) 2021-06-02 13:21:13 -04:00
Rijk van Zanten
77e00b7db4 Don't initialize database on file require (#6003) 2021-06-02 11:41:42 -04:00
Rijk van Zanten
02fc696c53 Fix env var validation in database loading step (#6002)
Fixes #5980
2021-06-02 11:17:50 -04:00
rijkvanzanten
c4b4e3586f Cleanup FK indexes in MySQL uses 2021-06-01 18:49:52 -04:00
rijkvanzanten
65240fff3b Make DB migrations for FK constraints safer 2021-06-01 16:44:10 -04:00
Rijk van Zanten
9335372400 Foreign Key Constraints (#5615)
* Bump knex-schema-inspector

* Fix cli role name attr

* Update relation type

* Restructure relations

* Restructure relations table

* Update api type for relation record

* Fetch relations in new structure

* Update schema-inspector

* Use new relations schema structure in api

* Update relations GETters

* Add default value to one deselect

* Add create relationship on existing field

* Add updating existing relationship

* Add delete relations

* Add relations query resolver

* Add graphql mutations for relations

* Fix reading from wrong name

* Fix wrong method name

* No idea why this flip flops every install

* Update relation type

* Accept null in use-collection composable

* Use new relations structure in translations

* Use new relations structure in new-collection

* Start updating field detail store

* Renames for new relations structure

* Silently ignore passed collection/field in relation update

* Fix setting pk field in m2o relational setup

* Small tweaks in o2m setup

* Fix m2m setup

* Tweak m2o setup

* Fix m2a setup

* Allow null for related collection (m2a)

* Fix languages code name

* Fix migration default value

* Fix relational cleanup in collections/fields

* Fix transaction problem in field delete

* Fix inserting relational o2m items

* Don't execute updateByQuery on empty item set

Fixes #5710, fixes #5070

* Show referential action input on m2o

* Finish language for m2o

* Show triggers config on o2m

* Delete items on one_deselect_item delete

* Fix naming, show relational trigger config on m2m

* Tweak language, add setup to m2a

* Fix linter warnings

* Add trigger setup for translations

* fix Edit non-schema relationship issue

* Sync existing on_delete triggers in o2m setup

* Add migration to setup foreign key constraints

* Update illegal FK values before setting constraint

* Fix MySQL unsigned vs not-unsigned in FK creation

* Use pretty names for labels in relational triggers

* Prefix auto-junction when system table

Fixes #5493

* Add system foreign key triggers

Fixes #5749

* Update docs
2021-05-19 12:29:16 -04:00
rijkvanzanten
7b6bff1692 Use correct interface for collection module nav setup 2021-05-14 16:26:45 -04:00
rijkvanzanten
1ea544b261 Fix mfa-setup interface name 2021-05-14 16:10:19 -04:00
Aiden Foxx
e8e295ef6a Fix string to text migrations for Oracle (#5462)
* Disabled string to text migrations for Oracle

* Added oracle specific alter table migrations

* Added notNull parameter to Oracle alter function

* Wrapped notNull in if

* Removed public oracle column alter function
2021-05-14 12:30:17 -04:00
Robert Gieseke
61761135ee Sort custom and internal migrations by version prefix (#5685)
See discussion #5675
2021-05-14 15:34:53 +00:00
rijkvanzanten
be20fafb8b Fix migration on MySQL 5
Fixes #5545
2021-05-07 16:36:01 -04:00
rijkvanzanten
fa86a06a7a Stringify json options 2021-05-07 11:48:36 -04:00
Rijk van Zanten
c4ae4b66cc Finalize interface names (#5521)
* Rename button-links->presentation-links

* Rename checkboxes->select-multiple-checkbox

* Rename code->input-code

* Rename checkboxes files

* Rename color->select-color

* Rename divider->presentation-divider

* Rename dropdown-multiselect->select-multiple-dropdown

* Rename hash->input-hash

* Rename icon->select-icon

* Rename image->file-image

* Rename m2a-builder->list-m2a

* Rename many-to-many->list-m2m

* Rename many-to-one->select-dropdown-m2o

* Rename markdown->input-rich-text-md

* Rename notice->presentation-notice

* Rename one-to-many->list-o2m

* Rename radio-buttons->select-radio

* Rename repeater->list

* Rename text-input->input

* Rename textarea->input-multiline

* Rename toggle->boolean

* Rename tree-view->list-o2m-tree-view

* Rename wysiwyg->input-rich-text-html

* Use correct interfaces in system defaults

* Rename collection->system-collection

* Rename collections->system-collections

* Rename display-template->system-display-template

* Rename field->system-field

* Rename interface->system-interface

* Rename interface-options->system-interface-options

* Rename scope->interface-scope

* Rename tfa-setup->system-mfa-setup

* Fix oversights

* Remove old todo

* Some more tweaks

* Add migration, fix dropdown name in system use

* Merge numeric + input

* Replace dropdown->select-dropdown in app use

* Merge slug->input, user->select-dropdown-m2o

* Fix type issue

* Fix seeder field name
2021-05-06 16:49:32 -04:00
rijkvanzanten
74861e6f81 Add default display template for directus_files
Fixes #5364
2021-04-29 20:40:52 -04:00
rijkvanzanten
801e868554 Fix remaining eslint errors
h/t @paescuj
2021-04-29 15:55:12 -04:00