Commit Graph

226 Commits

Author SHA1 Message Date
Nicola Krumschmidt
7dfc5dc6af Use root-relative base url for app and extensions (#6923)
* Add Url util class

* Use relative base url for app and extensions

Also use utils/url when working with PUBLIC_URL in other places.
2021-08-26 17:11:21 -04:00
Azri Kahar
2d3f1c4aa3 fix asset transformation withEnlargement type (#7553) 2021-08-24 14:49:11 -04:00
Oreille
49e4a9b0de Don't allow empty filter for non-string types. Add null filter. (#7501) 2021-08-19 10:02:54 -04:00
Nitwel
07f4acdaca Add edge case using mysql for tinyint as boolean (#7460)
* revert #7287

* add edge case for mysql to tinyint/boolean

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-17 12:56:41 -04:00
Sam Milledge
19424feefa Fixes for GraphQL variables in HTTP GET requests (#7416)
* Fix missing GraphQL variables in HTTP GET requests

* Fix GraphQL query request caching

 - Fix incorrect response when the query contains variables
 - Added tests for cache keys and cache middleware

* Update api/src/utils/get-cache-key.test.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-16 23:16:41 +00: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
rijkvanzanten
bf733afe4b Treat alias-only fields properly 2021-08-11 12:07:42 -04:00
rijkvanzanten
a31523aed1 Add import ref for TS 2021-08-10 15:23:06 -04:00
Rijk van Zanten
3f3b3f0e16 Fix graphql GET request cache query extraction (#7319)
Fixes #7298
2021-08-10 17:16:29 +02:00
rijkvanzanten
5b92d7fa66 Import access from fs-extra instead of fs/promises 2021-08-10 10:52:16 -04:00
Pascal Jufer
123c3b1182 Add perm check for sqlite, upload, extensions dirs (#7310)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-08-10 09:39:47 -04:00
Jay Cammarano
d8889d777e Only treat tinyint(1) and tinyint(0) as booleans (#7287)
* added an if catch for tinyint(1) and tinyint(0)

* made suggested changes toLowerCase()
2021-08-09 15:36:24 -04:00
rijkvanzanten
1867489a3e Treat sqlite integerfirst as int 2021-08-06 14:26:00 -04: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
faa71c7595 Add cache connection fallbacks (#7226) 2021-08-05 22:27:10 +02:00
Rijk van Zanten
78ed041ee1 Warn if a collection includes a space (#7223) 2021-08-05 20:02:38 +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
rijkvanzanten
fe354dc4c7 don't fetch unused column 2021-08-03 19:01:46 -04:00
Rijk van Zanten
725c95783c Show any sso login warnings in stdout (#7170)
* Show any sso login warnings in stdout

Ref #6897

* Throw more detailed error on email extraction

* Fix CSVs in env var value not cast as array
2021-08-04 00:22:52 +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
Rijk van Zanten
6e9102d414 Fix cache-key generation for query params (#7139)
Fixes #7131
2021-08-02 21:17:09 +02:00
rijkvanzanten
72ff97266c Fix linter warnings 2021-07-31 13:59:19 -04:00
Rijk van Zanten
956c590f0c Stall login/pw reset to prevent email leaking (#7105) 2021-07-30 15:01:07 -04:00
Rijk van Zanten
206f2380b5 Fix cache-key causing problems in memcached (#7021)
* Add memcached to docker-compose

* Use object hash for cache key

Fixes #6823
2021-07-28 01:18:09 +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
Nicola Krumschmidt
7d8aa9fced Replace DIRECTUS_DEV env var with NODE_ENV and SERVE_APP (#6929) 2021-07-22 23:47:56 +02: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
Rijk van Zanten
be60fa9f31 Use [String] for CSV type in GraphQL (#6808)
Fixes #6653
2021-07-15 02:34:40 +02:00
Nicola Krumschmidt
051df415df Fix extensions (#6377)
* Add support for npm extensions

* Allow extensions to import vue from the main app

* Bundle app extensions on server startup

* Fix return type of useLayoutState

* Add shared package

* Add extension-sdk package

* Add type declaration files to allow deep import of shared package

* Add extension loading to shared

* Refactor extension loading to use shared package

* Remove app bundle newline replacement

* Fix extension loading in development

* Rename extension entrypoints

* Update extension build instructions

* Remove vite auto-replacement workaround

* Update package-lock.json

* Remove newline from generated extension entrypoint

* Update package-lock.json

* Build shared package as cjs and esm

* Move useLayoutState composable to shared

* Reverse vite base env check

* Share useLayoutState composable through extension-sdk

* Update layout docs

* Update package versions

* Small cleanup

* Fix layout docs

* Fix imports

* Add nickrum to codeowners

* Fix typo

* Add 'em to vite config too

* Fix email

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-06-23 12:43:06 -04:00
Rijk van Zanten
44082c60e1 Add schema caching (#6456)
* Rework cache handler to be function export

* Add default schema caching

* Add schema cache

* Auto purge schema cache on schema change from api

* Only set last_access value on login

* Add note on schema cache setting
2021-06-22 20:50:20 -04:00
Rijk van Zanten
1cb9181052 Add support for starts/ends with filters (#6437) 2021-06-22 14:28:11 -04:00
Nacho García
0b8fb9fae8 Change cache-control heeaders (#6355) 2021-06-17 14:55:27 -04:00
Rijk van Zanten
d56f02697a Allow overriding the s-maxage cache header (#6294)
* Allow overriding the s-maxage cache header

* Only load expiry / set headers when cache exists
2021-06-15 17:11:29 -04:00
Aiden Foxx
86a920d587 Looks like a console log spliped though? (#6252) 2021-06-14 11:02:48 -04:00
Nicola Krumschmidt
1d851221a3 Add missing return type to adjustDate() (#6253)
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-06-14 10:07:06 -04:00
rijkvanzanten
28847faee6 Add missing return type 2021-06-14 09:56:42 -04:00
rijkvanzanten
000e1976ae Fix val check 2021-06-11 21:18:46 -04:00
Rijk van Zanten
8e92c6beaa Add date adjustment to NOW variable (#6221) 2021-06-11 20:59:50 -04:00
Oreille
46c77f70c8 Moved special check above localTypeMap check. (#6208) 2021-06-11 08:59:20 -04:00
Adam Sparks
c1b30a6d8c match url whitelist to domain (#5694)
* match url whitelist to domain

* Improve url-domain check

* Update lockfile

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-06-09 15:12:34 -04:00
Rijk van Zanten
61f2e48ced Allow any of grant's (nested) configuration parameters (oAuth) (#6155)
* Allow underscore configuration extraction

* Allow any of grants config properties
2021-06-09 12:08:48 -04:00
rijkvanzanten
91253a241d Fix linter warning 2021-06-04 12:44:10 -04:00
Rijk van Zanten
85d33d9ffc Fixed an issue that would cause "text" fields to show up as varchar with length -1 in MS SQL (#6055)
Fixes #5944
2021-06-03 22:35:07 -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
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
c3589d138f Remove remaining leftovers from deprecated single query param 2021-05-25 11:38:33 -04:00
Rijk van Zanten
ce59ce0d2f Support top-level filter through relational m2a items (#5855)
Fixes #5850
2021-05-24 12:20:15 -04:00
Oreille
bb14309b9c Add support for mssql uniqueidentifier type (#5804) 2021-05-21 10:08:02 -04:00