Commit Graph

1318 Commits

Author SHA1 Message Date
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
Pascal Jufer
e3bfe69de3 Translation fixes (#8695)
* Implement translation for activity items

Fixes #8415

Also fixes issue with "Open item" link for system collection

* Fix 'Create New' btn translation in list interface

Fixes #8427
Default values needs to return a function to be dynamic
Same for "Empty item" translation

Also use field.name instead of field.field value for field title

* Fix translation of default values in boolean & dropdown interfaces

* Translate note field of system collections in edit mode

* Translate remaining "hard-coded" values

* Add dedicated translation for open folder

* Update app/src/interfaces/list/list.vue

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

* Use translate-object-values and check if collection starts with
'directus_'

* Use already existing translation keys for activity items

As discussed

* Translate whole data object if system collection

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-10-14 11:29:48 -04:00
Daniel Krásný
446da89a38 Add descriptions for Panels and Dashboards (#8657) (#8684) 2021-10-12 17:36:50 +00:00
Rijk van Zanten
e2191c14b7 Add missing arguments in aggregated resolver (#8729) 2021-10-12 15:44:00 +00:00
Azri Kahar
68869474b5 fix directus_fields group cleanup on delete (#8707) 2021-10-12 09:55:40 -04:00
Pascal Jufer
23a126b026 Fix eslint warnings and cleanup unused disable-directives (#8718)
* Fix eslint warnings

* Remove unused eslint disable-directives
2021-10-12 09:49:01 -04:00
Rijk van Zanten
fb36ded825 Remove deprecated code (#8670)
* Remove deprecated code

Just for you @aidenfoxx

* Fix type signature
2021-10-08 18:45:17 +00:00
Alejandro Castaño González
829e996574 Exclude creation of primary and unique indexes (#8640) 2021-10-08 10:29:23 -04:00
Rijk van Zanten
f64a5bef7e Add new advanced filters experience (#8570)
* Remove advanced filter sidebar detail

So long, and thanks for all the fish.

* Remove filter conversion logic

* Start replacing/removing old skool filters

* Add inline mode for usages in search bar

* Make filter work in header bar

* Emit empty string as null in filter

* Move shared filter types to shared

* Upgrade use-items

* Fix manual sort on tabular

* Cleanup styling in search bar usage

* Tweak styling

* Fix filtering issues

* Update cards

* Remove activeFilterCount from tabular

* Update maps to work with new filters

* Update calendar to new filter/sort structure

* Fix activity module nav/search

* Fix no-results message

* Update file library filtering

* Finalize user search

* Allow filtering in drawer-collection

* Handle cancelled responses semi-gracefully

* Add loading start state timeout

* Replace sort type in api

* Last commit before redoing a bunch

* Finish new visual style

* Remove unused rounded prop from v-menu

* Tweak sizing

* Enough size tweaking for now

* Count all filter operators instead of top

* Fix archive casting

* Fix api build

* Add merge filters util

* Split filter in user vs system

* Fix export sidebar detail

* Show field label on permissions configuration

* Add migration for filter/sort

* Use filters in insights
2021-10-07 18:06:03 -04:00
heyarne
0d7d63f9fe Check for duplicate migration keys (#8597)
* Check for duplicate migration keys

* Run prettier
2021-10-07 18:00:31 -04:00
Azri Kahar
11d259b585 fix field permissions check in aggregate (#8575) 2021-10-06 10:10:49 -04:00
Azri Kahar
fae138fe0f pass MutationOptions to createOne (#8553) 2021-10-05 09:29:00 -04:00
Aiden Foxx
4f4a276379 Update users.ts (#8526)
Fixes #8521
2021-10-04 10:03:43 -04:00
Adrian Dimitrov
de2c0fad42 Set integer type on tileSize (#8528)
Fixes an issue when setting tile size for custom map.

```
Error: sources.aaaaa.tileSize: number expected, string found
    at Object.Tn [as emitValidationErrors] (validate_style.js:37)
    at Ue (style.js:46)
    at i2._load (style.js:245)
    at style.js:235
```
2021-10-04 09:40:11 -04:00
Nicola Krumschmidt
1389586593 Disable Cron hooks when only the CLI is running (#8490)
Depends on #8478
Fixes #8457
2021-10-01 18:23:49 -04:00
Nicola Krumschmidt
c816b3be92 Move extension management into a class (#8478) 2021-10-01 11:13:11 -04:00
Jay Cammarano
2be2c36dc2 Unit tests for get-extensions.ts (#8470)
* root removed

* get extensions passing, 95% coverage

* removed root

* fixed root on listExtensionsChildren
2021-10-01 11:01:33 -04:00
rijkvanzanten
42f72acb60 Fix aggregation 2021-09-29 11:46:55 -04:00
José Varela
15859e5316 Fix sanitize aggregate on parse objects (#8423) 2021-09-29 11:32:06 -04:00
José Varela
1ff3adbb46 Convert to object default json value (#8041)
* convert to object default json value

* return same value if falsy or parse fail
2021-09-28 19:16:30 -04:00
Rijk van Zanten
ec32c9e0fe Fix group migration on MySQL (#8404)
* Remove groupsInUse check

* Fix group migration on MySQL

Fixes #8369
2021-09-28 22:46:26 +00:00
ian
1b92d711d4 Refactor action value from authenticate to login in directus_activity (#8397)
* Refactor action value from authenticate to login in directus_activity

* Fix incorrect where clause in migration

* Add missing authenticate uses

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-09-28 20:59:27 +00:00
Rijk van Zanten
1ffd1c7bc3 Fix email migration for MS SQL (#8399)
Fixes #8396
2021-09-28 16:23:50 -04:00
Rijk van Zanten
01c65f5fe7 Add defaults for null fields in permissions (#8391)
Fixes #8253
2021-09-28 11:27:27 -04:00
Aiden Foxx
f475c877ec Send correct payload to auth provider for oauth (#8389) 2021-09-28 14:21:03 +00:00
Azri Kahar
18b20e7d54 fix "add conditions to fields" migration (#8375) 2021-09-28 10:04:35 -04:00
Nicola Krumschmidt
7eb2b53927 Remove duplicate directus_migrations collection (#8383)
The collection is already defined on line 29.
2021-09-28 09:48:27 -04:00
Nitwel
cf05527f0e Add dedicated "files" interface (#8110)
* add download button for m2m

* create files interface

* Add migration to use new files interface

* Fix linter warnings

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-09-27 22:27:03 +00:00
rijkvanzanten
c2c9ad4116 Add missing data field in sessions 2021-09-27 17:34:38 -04:00
Aiden Foxx
084c6117b7 Modular authentication (#6942)
* Moved refactoring from LDAP branch

* Moved Auth into packages

* Updated frontend to support custom auth providers and make implementation more flexible

* Fixed exception handling and numerous bugs. Also added provider support to graphql

* Updated frontend to be able to set provider and identifier

* Fixed issue with setting the auth provider in app

* Updated package-lock.json

* Updated package-lock.json

* Cleanup, adding type handling and disabled changing provider

* Added title formatting to SSO links

* Fixed incorrect type export

* Fixed incorrect rc

* Update api/src/services/authentication.ts

* Updated sub-dependencies to rc87

* Fixed linting errors

* Prefer sending provider name as config var

* Pass clone of user info to auth provider instead of reference

* Moved auth from packages into core

* Removed generic login handler

* Fixed graphql complaint

* Moved exception back to api and cleaned up URLs

* Minor tweak

* Pulled across improvements from openid branch

* Fixed fix that wasn't a fix

* Update auth.ts

* Update auth.ts

* Update authentication.ts

* Update login-form.vue

* Regression fixes and cleanup

* Minor flow improvements

* Flipped if and fixed linting warning

* Un-expanded object that didn't need to be expanded!

* Trimmed auth interface for consistency when verifying passwords

* Removed auth-manager, changed login endpoint, broke out SSO links, removed username support, disabled updating external_identifier, generate provider options as part of field generation

* Cleaned up some code comments

* Use named exports in local driver

* Use async defaults for auth abstract class

* Use JSON for auth_data field

* Move session data blob to directus_sessions

* Remove unused export, rename auth->authDriver

* Opinionated changes

* Move login route registration to driver file

* Revert app changes in favor of PR #8277

* Send session token to auth provider and opinionated changes

* Added missing translation

* Fixed empty elements for users without email

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

* Move pw verify to local driver, remove CRUD

* Opinions > logical reasoning

* Use session data, cleanup login method on auth serv

* Remove useless null

* Fixed breaking changes from refactor, and fixed build

* Fixed lint warning

* Ignore typescript nonsense

* Update api/src/services/authentication.ts

* Fix provider name passthrough

Co-authored-by: Aiden Foxx <aiden.foxx@sbab.se>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2021-09-27 17:18:20 -04:00
Rijk van Zanten
356b96e3e2 Migrate down chronologically instead of by version (#8357)
Fixes #8254
2021-09-27 16:45:50 -04:00
Rijk van Zanten
ac0bade2b4 Don't track primary keys of relations/fields (#8355)
Fixes #8161
2021-09-27 15:45:28 -04:00
Rijk van Zanten
292c66c4b2 Don't error on missing meta key for collection (#8352) 2021-09-27 15:26:47 -04:00
Rijk van Zanten
2fe8626b54 Add missing system data points (#8351) 2021-09-27 15:18:59 -04:00
Jay Cammarano
a7b0cbe69b GitHub workflow to run tests on pushes to main and PRs (#8247)
* testing workflow

* name changed

* generateHash working

* changed pendingMock() to 0 because ticks > 5000

* removed empty tests

* removed empty tests

* Update packages/sdk/tests/utils.ts

Co-authored-by: José Varela <joselcvarela@gmail.com>

* updated workflow to add build

* added npm run build

* fixed get-filter-operators

* added env to workflow

* potential fix to index.test.ts

* added env variables for index.test.ts

* added caching and node-version matrix

* added all supported node versions

* only supported node versions

* updated to only support 16

* removed duplicate workflow caching

Co-authored-by: José Varela <joselcvarela@gmail.com>
2021-09-27 15:10:29 -04:00
Rijk van Zanten
f5f68417cf Use field key instead of ID for group value (#8349)
* Add migration to replace group ID with group name

* Replace group IDs with field names

* Tweak group interfaces

* Ignore schema export
2021-09-27 15:06:19 -04:00