Commit Graph

1353 Commits

Author SHA1 Message Date
Oreille
5f43b20ebf Update geometric types and patch new field flow. (#9397)
* Update geometric types and patch new field flow.

* Add migration

* Fixed migrations

* Also fixed migrations

* Update migration ID

* Cleanup type selector a bit

* Add missing fallback interface/display for new types

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-04 21:47:54 -04:00
Oreille
ef3da32ab3 Properly handle M2A fields in fieldStore and useFieldTree (#9432)
* Properly handle M2A fields in fieldStore and useFieldTree

* Fix addNode

* Rewrote use-field-tree

* Remember visited paths

* Fix error whith undefined relation.meta
2021-11-04 20:35:05 -04:00
Rijk van Zanten
b2f3091826 Prevent negative hashes from being generated (#9501)
Fixes #9499
2021-11-04 20:21:39 -04:00
Rijk van Zanten
4b2b74840e Don't show all migrations logged on init (#9496) 2021-11-04 23:05:11 +00:00
Rijk van Zanten
dbe29554e7 Move union query application to applyQuery, fix where clause (#9494)
* Move union query application to applyQuery, fix where clause

Fixes #9228

* Handle case where union IDs length = 0

* Return modified db query

* Apply union last
2021-11-04 22:55:10 +00:00
Rijk van Zanten
2e0ad10ad1 Remove collection listing option from role settings (#9490)
* Fixes #8920

* Revert changes in seeds / migrations

* Add new migration to drop column

Co-authored-by: Yannick Mol <yannick@molmediasolutions.nl>
2021-11-04 21:55:34 +00:00
Farid Saud
493a35da90 Use hash instead of random for default index name (#9448)
* [Fix]: Use hash instead of random for default index name

* Move hash function to separate util file

* Reduce max size of index name to 60 from 64

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-04 21:37:03 +00:00
Nicola Krumschmidt
69d893123e Add exports fields to all packages (#9443) 2021-11-03 18:59:45 -04:00
Rijk van Zanten
c5bb836689 Tweak project-settings page (#9440) 2021-11-03 18:07:17 -04:00
Nicola Krumschmidt
03cf03b1bf Clean up API exports (#9418)
* Move API entrypoint to typescipt

* Remove explicit cli exort from API

The "./*" export should export all subpaths, so explicitly exporting the cli shouldn't be necessary.

* Remove dedicated start script from API

This script isn't even included in the final npm package and it's only used by the test Dockerfile.
2021-11-03 17:34:48 -04:00
Nicola Krumschmidt
3d0e086c55 Rework hook registration (#8027)
* Rework hook registration

* Remove event and action fields from hook payloads

* Move "error" action to "request.error" filter

* Emit meta and context objects in filters and actions

* Run filters sequentially

* Update hook templates

* Fix CLI hook test

* Also emit `<collection>.items.crud` when emitting `items.crud`.

* Update hook docs

Co-authored-by: Oreilles <oreilles.github@nitoref.io>
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-03 17:18:56 -04:00
Rijk van Zanten
65291b95c4 Allow dynamic user variables to be used with filter rules (cont.) (#9376)
* Move permissions extraction to accountability

* Fix permissions retrieval for public user

* Fetch user / role context in permissions middleware

* Remove unnecessary parseFilter

* Rename schemaCache to systemCache

* Add permissions caching

* Add system cache invalidation on permission changes

* Improve caching perf by reducing scope

* Add note to docs

* Clarify compatibility with conditional fields/filters

* Fix lint warning

* Allow nested vars in system-filter-input

* Add custom getter function that resolves arrays

* Add is-dynamic-variable util

* Export new util

* Cleanup parse filter

* Fix build

* Move debounce up to use-items

* Remove unused prop

* 🧹

* Fix input pattern usage w/ vars

* Remove debounce from search-input, increase throttle
2021-11-03 16:56:16 -04:00
Jay Cammarano
99f0c6c65f Fixed SET NULL on directus_files for MSSQL (#9425)
* fixed migration on mssql

* removed useless migration
2021-11-03 17:14:45 +00:00
Aiden Foxx
2f33f71a6a Added user rebinding on reconnect in LDAP (#9339)
* Added reconnect handling code for LDAP

* Update api/src/auth/drivers/ldap.ts

* Improved error handling

* Updated re-bind so we can await it when required

* Added bind check before operations to ensure client has user

* Cleaned up reconnect handling in LDAP

* Minor cleanup

* Minor cleanup
2021-11-03 11:12:50 -04:00
Azri Kahar
763398256a Set user token as unique (#9381) 2021-11-02 23:44:27 -04:00
Aiden Foxx
1379e8b5c9 Added openid fallback to user token info if profile URL not defined (#9368) 2021-11-02 14:09:05 -04:00
Nitwel
6ea29d8673 Fix date on sqlite (#7774)
* fix date on sqlite

* remove unused imports

* rename KnexSpatial to KnexDate

Co-authored-by: Jose Varela <joselcvarela@gmail.com>
2021-11-02 14:51:17 +00:00
Paul Boudewijn
d4095bc2aa Fix nullable boolean (#8497)
* nullable boolean can now be set to null again after it weas true or false

* Implementation changed to Composition API

* Implementation changed to Composition API

* fixed formatting issues

* fixed formatting issues

* fixed formatting issues

* fixed formatting issues

* run linters on branch

* run linters on branch

* run linters on branch

* run linters on branch

* fixed formatting issues

* changes to checkbox interface reverted

* changes to checkbox interface reverted

* Update boolean.vue
2021-11-02 10:39:39 -04:00
Hugues BUREAU
98112a866a fix(graphql): remove __typename from selection nodes when present (#9318)
* fix(graphql): remove __typename from selection nodes when present

* fix: cast selectionNode to FieldNode in filter callback
2021-11-01 18:52:17 -04:00
Oreille
cb22ddfa7c Added supported function to geometryHelper, added geometrySupport to serverinfo (#9290)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-01 17:31:34 -04:00
Nitwel
894b4975f2 Fix issues with fields config (#9324)
* Fix issues with fields config

* Fix /fields endpoint return type for alias fields

* Fix display selection in relational interfaces
2021-11-01 20:55:45 +00:00
Jay Cammarano
ad959e4472 Add SET NULL to directus_files.uploaded_by constraint (#9305)
* add set null to directus_files constraint

* SET NULL on created_by and modified_by

* "user_created" and "user_updated" => SET NULL

* SET NULL on collections optional system fields

* fixed dropColumn()

* Add line breaks, cause little OCD

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-01 14:58:52 -04:00
Theraloss
91aaad61cf prefix aggregation field with table name (#9314)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-01 14:20:26 -04:00
Aiden Foxx
179f06126e Added state param to oauth to make Okta happy (#9289)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-11-01 14:04:32 -04:00
Dorian Zedler
106d207238 Feat/custom ldap mail attribute (#9307)
* Allow custom email field for LDAP

* Update docs

* Break out into variable and don't cast to String
2021-11-01 15:57:57 +00:00
Aiden Foxx
4ef7203b88 Removed undefined type from LDAP userAccountControl (#9309) 2021-11-01 11:35:23 -04:00
Oreille
8df071a3a2 Fix generated columns being required. (#9200)
* Fix generated columns being required. Also prevent schema changes on generated columns.

* Fix type errors

* Disable `unique` and `nullable` instead of not showing them.

* Fix other type error

* Nullable check small refactor

* Fixed MSSQL query

* Fixed oracle query
2021-10-29 12:24:21 -04:00
Aiden Foxx
b7ee318e43 LDAP auth provider (#9074)
* Added LDAP implementation

* Cleanup and added refresh checking

* Added provider check to ldap

* Added LDAP docs

* Always update LDAP user role on authentication

* Fetched package-json from github

* Fixed lint error

* Update api/src/auth/drivers/ldap.ts

* Update api/src/auth/drivers/ldap.ts

* Added missing locale key

* Update docs/guides/api-config.md

* Update docs/configuration/config-options.md

* Update api/src/auth/drivers/ldap.ts

* Added back LDAP example

* Update config-options.md

* getUserID function sjhouldn't care about password

* Added LOCKOUT to INVALID_ACCOUNT_FLAGS

* Update styling approach for v-select

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-29 11:58:10 -04:00
Jakob
15b875728b Add configurable headers for webhooks (#8855)
* Add configurable headers for webhooks

* Update api/src/database/migrations/20211016A-add-webhook-headers.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-10-29 10:52:44 -04:00
Aiden Foxx
fc3e24be12 Clarified some oauth things in the docs (#9203) 2021-10-27 17:38:06 -04:00
Nicola Krumschmidt
2934b6ca76 Clean up App base url replacement (#9192) 2021-10-27 12:33:26 -04:00
Nicola Krumschmidt
ba2f8750e9 Set no-cache header on extension sources (#9186)
This should hopefully fix caching issues some users were experiencing.
2021-10-27 12:31:57 -04:00
Aiden Foxx
b6cb3253f6 Added the provider to auth hooks (#9059)
Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-26 15:36:08 -04:00
Aiden Foxx
5f9f9cbbdc Ignore email field in oauth and store email in external_identifier (#9153)
* Ignore email field in oauth and store email in external_identifier if needed

* Removed unused variable
2021-10-26 10:07:33 -04:00
rijkvanzanten
9197cae5c9 Fix type issues in busboy update 2021-10-25 22:38:03 -04:00
Rijk van Zanten
2720e0c18e Add new field flow (#9109)
* Add new grouping setup to interfaces

* [WIP] Start on new field flow

* Add preview svgs

* Update preview svg

* Add basic saving mechanism. Start on magic

* Add interface options to simple inputs

* Fix missing t

* Fix custom options not rendering

* Fix interface options overrides

* Sync m2o name key

* Setup m2o related collection input

* Add collections generation

* Add circular prevention & type syncing

* Small fixes in m2o context generation

* Move o2m options to fn structure

* Conclude o2m (i think)

* Start on toggle to advanced

* Style advanced toggle button

* Add localType File support, start documenting

* Add presentation/group localtypes

* Use function style interface options in m2m

* Don't require collection prop in field template component

* Implement most of m2m magic

* Restructure store updater

* Finish useFieldDetailStore restructure

* Only register root index in module folders

* Do the thing

* Finish m2m magic, tweak fallback styles

* Fix o2m display template setup

* Remove options comp for translations interface

* Show languages collection picker in translations

* Finish translations alterations

* Add magic for files type

* Officially wave goodbye to the old store setup

It served it's purpose, but what a nightmare to maintain. Welcome to the new version

* Update schema tab

* Add field pane

* Finish interface section

* Add display section

* Add conditions

* Update tabs to use localType from store

* Start on relationship tab

* Update m2m relational setup

* Start on m2o

* Finish m2o setup

* Finish o2m setup

* Add m2a magic

* Various tweaks

* Add m2a setup

* Add save button to advanced flow

* Load existing values on start

* Add upsert to stores, allow updating existing items

* Please the linter gods

* Remove seemingly redundant interface option

@Oreilles Seeing the geometry type is already configured in the schema configuration, this particular option on the interface feels redundant (?)

* Remove unnecessary option component overrides

* Track relationships in required fields for save state

* Fix relations previews on editing existing fields

* Use standard vs advanced for input options

* Remove note from simple field setup

* Add divider to field config

* Use background subdued

* Default required to false

* Add required icons to key/relationship

* Tweak colors

* Fix infinite loop in group creation

* Make setup responsive

* Allow switching interface at will

* Add m2a related collections picker

* Fix relations persisting on field deletion

* Add "Create in Advanced" shortcut

Just for you @joselcvarela

* Fix PK field staging on collection create

* Revert "Remove seemingly redundant interface option"

This reverts commit e5e09a051e.

* Fix map interface options
2021-10-25 20:29:04 -04:00
Oreille
c94d0c4bfe Use default filter operator for type in filter input. (#9103)
* Use default filter operator for type in filter input. Also fix error on geometry operator update.

* Fixed tests.

* Only reset geometry filter value when necessary

* Support `null` for boolean operators.
2021-10-25 11:28:44 -04:00
Oreille
d06abbd797 Always cast M2A related primary keys to text. (#9122) 2021-10-25 09:53:44 -04:00
Aiden Foxx
29a2e75206 Improved invalid JWT handling (#9058)
* Improved invalid token handling in oauth flows

* Fixed cookie name
2021-10-22 10:17:12 -04:00
Aiden Foxx
fa3b1171e8 New OpenID and OAuth2 drivers (#8660)
* Moved over oauth impl to new interface

* Fixed most build issues and started addind schema to auth drivers

* Finished up OAuth2 and OpenID drivers

* Removed unused migration and utils

* Fixed minor todos

* Removed old oauth flow

* Changed oauth flow to re-use refresh token

* Added new oauth frontend

* Added font awesome social icons

* Updated authentication documentation

* Update api/src/auth/drivers/oauth2.ts

* Tested implementation and fixed incorrect validation

* Updated docs

* Improved OAuth error handling and re-enabled creating users with provider/identifier

* Removed Session config from docs

* Update app/src/components/v-icon/v-icon.vue

* Removed oauth need to define default roleID

* Added FormatTitle to SSO links

* Prevent local auth without password

* Store OAuth access token in session data

* Update docs/guides/api-config.md

* Fixed copy and removed fontawesome-vue dependency

* More docs fixes

* Crucialy importend type fiks

* Update package-lock

* Remove is-email-allowed check

In favor of more advanced version based on filtering coming later

* Fix JSON type casting

* Delete unused util

* Update type signature to include name

* Add warning when code isn't found in oauth url

and remove obsolete imports

* Auto-continue on successful SSO login

* Tweak type signature

* More type casting shenanigans

* Please the TS gods

* Check for missing token before crashing

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-21 17:45:01 -04:00
Rijk van Zanten
7897a7a1f5 Cast "DB_EXCLUDE_TABLES" to array (#9029)
Fixes #9001
2021-10-21 15:19:37 -04:00
Oreille
1b0f75eec2 Fix o2m-resolver memory issue (#8944)
* Add limit to m2o fetching.

* Remove unused parameter

* Remove unused nested flag, move limit to apply

* Add limit to offset check

* Add usage note on union query

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-21 15:02:26 -04:00
Aiden Foxx
f6b250e25c Update users.ts (#9024) 2021-10-21 13:49:15 -04:00
Filip Prochazka
5741fcce57 Fix #8402 (#9012) 2021-10-21 13:37:08 -04:00
Azri Kahar
2c0b61fdf3 add default preset for webhooks page (#8937)
* add default preset for webhooks page

* Apply suggestions from code review

* Update api/src/database/system-data/fields/webhooks.yaml

🤦🏻‍♂️

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-10-19 15:39:56 +00:00
Oreille
15aecbe438 Only unflatten item properties that needs to be unflattened (#8814)
* Only unflatten item properties that needs to be unflattened

* Delete leftover aggregate keys

* Update api/src/services/payload.ts

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-10-18 12:32:57 -04:00
Rijk van Zanten
acb3c3cb4b Issue/8858 (#8864)
* Fix collections endpoint not filtering EXCLUDE env

Fixes #8858

* Tweak spacing for db-only section

* Make solution less error prone
2021-10-16 21:46:41 +00:00
rijkvanzanten
fe6cc3bc93 Fix recursive relation constraint for MSSQL 2021-10-15 20:01:21 -04:00
Rijk van Zanten
8f00e37daf Add improved collection organization setup (#8623)
* Add migrations, start on service

* Dont track TODO files

* Update collection types, add collection type

* Allow drag and drop sorting of collections

* Add tooltip

* Add grouping + collapsed state

* Fix nested closed state

* Tweak active drag styling

* Remove collapsed state

* Add folder creation/editing

* Render collections as nested tree in nav

* Fix open active state

* Add dense when collection count > 5

* Add visible toggle

* Add show-hidden toggle

* Fix css specificity

* Add support for query in v-list-group

* Add missing cascade

* Remove collapsed state

* Finish three-way toggle

* Add custom lock icon

* Fix icon size in non-dense

* Redirect to first & open tree on load

* Dont make prop required

* Fix search

* Only apply archive filter when enabled in settings

* Add archive view

* Add translations

* Hide organization fields

* Show system collections
2021-10-15 21:19:00 +00:00
Pascal Jufer
7060af9142 Use ActivityService/RevisionsService to save accountability records (#8485)
* Disable accountability for 'directus_activity' and 'directus_revisions'

* Use services to save accountability records

- Import ActivityService/RevisionsService in ItemsService and
  ItemsService in ActivityService/RevisionsService from "./internal" to
  prevent circular dependencies issue
- Use type PrimaryKey instead of number for onRevisionCreate method
  (was already used to collect PrimaryKeys in payload.ts anyway)

* Use index.ts to load activity & revision services

* Use for instead of forEach

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-10-14 15:37:55 +00:00