Commit Graph

61 Commits

Author SHA1 Message Date
Rijk van Zanten
5067410e09 Fixed issue that could trigger update actions of children on manual sorting of a parent o2m instance (#6048)
Fixes #6041
2021-06-03 21:02:47 -04:00
Rijk van Zanten
77e00b7db4 Don't initialize database on file require (#6003) 2021-06-02 11:41:42 -04:00
rijkvanzanten
95307cee97 Fix o2m updates not saving revisions nested 2021-05-24 21:05:50 -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
MiniDigger | Martin
1cc9900317 fix occasional typeerror in payload service (#5763) 2021-05-19 14:51:06 +00:00
rijkvanzanten
53f2d690dc Add comment 2021-04-29 20:13:36 -04:00
rijkvanzanten
ba98f23d3d Fix TS errors 2021-04-29 16:18:09 -04:00
rijkvanzanten
801e868554 Fix remaining eslint errors
h/t @paescuj
2021-04-29 15:55:12 -04:00
Pascal Jufer
acd41eb0be Syntax fixes (#5367)
* Declare return types on functions

And a very few other type related minor fixes

* Minor syntax fixes

* Remove unnecessary escape chars in regexes
* Remove unnecessary awaits
* Replace deprecated req.connection with req.socket
* Replace deprecated upload with uploadOne
* Remove unnecessary eslint-disable-next-line comments
* Comment empty functions / catch or finally clauses
* Fix irregular whitespaces
* Add missing returns (null)
* Remove unreachable code
* A few logical fixes
* Remove / Handle non-null assertions which are certainly unnecessary (e.g. in
tests)
2021-04-29 12:11:43 -04:00
rijkvanzanten
2c557b2c9e Fix alignment of repeater row previews 2021-04-22 13:34:36 -04:00
Rijk van Zanten
3b05372713 Finalize services API (#5170)
* Start the xOne/xMany work

* Update update/upsert

* Finish updating itemsservice

* Add comments, add nested revisions on update

* Use new internal api

* Update collectionService to one/many structure

* Move files to one/many structure

* Move permissions to one/many structure

* Move relations service to one/many structure

* Move roles to one/many structure

* Move users service over

* Move webhooks to updated structure

* Move deprecated methods to the bottom

* Replace deprecated uses

* Use new methods in controllers, add batch update/delete by query

* Use updated methods in API

* Fix email being required

* Remove unnecessary DB call

* Fix batch update/delete validation
2021-04-20 18:06:27 -04:00
rijkvanzanten
5d1db82554 Fix auto-inserted timestamp transformers 2021-04-09 19:59:01 -04:00
Rijk van Zanten
c9d70de4c3 Rely on Knex for date parsing to vendor (#4949)
Fixes #3655
2021-04-09 18:36:58 -04:00
Rijk van Zanten
f90c31b798 GraphQL 2.0 (#4625)
* Start on GraphQL "2.0", add methodnotallowed exceptoin

* Fix relative file pointer in peer dep

* [WIP] Add pre-filtered schema to SchemaOverview

* Use root schema as is, add reduce-schema util

* Use reduceSchema in the wild

* Base schema on local reduced schema

* Remove todo

* Use graphql-compose to build out schema

* Start restructuring resolvers

* Add create mutation

* Return boolean true for empty create mutation selections

* Add update mutation

* Add delete mutation

* Add system/items scoping

* Fix merge conflicts for real now

* Use system services, rename ids->keys

* Start on docs on mutations

* Updates to match main

* Add fetch-by-id

* Add one/many resolvers for mutations

* Check system collection rows for singleton

* Fix resolver extraction for single read

* Share delete return type

* Add comments

* Use collection root name for readable type

* Add specs endpoint for GraphQL SDL

* Update docs

* Add note on SDL spec

* Fix delete single example

* Remove package-lock

* Fix collection read scoping in non-read
2021-03-30 17:06:35 -04:00
rijkvanzanten
03c1a5b5ce Remove forced sort on payloads 2021-03-30 13:15:47 -04:00
Rijk van Zanten
b562ceeb0c Add Tree-View Interface (#4602)
* Fix local type extraction

* Render basic tree in tree-view

* Render drawer-item in tree-view-group

* Retrieve nested draggable changes

* Default sort query to configured sortField

* Store nested group / sort to API

* Allow updating item values

* Figure out a dropzone approach on preview

* Finish editable tree view

* Set sort value based on sort field in relation

* Add create-new / add-existing

* Respect previously made nested edits

* Add description in setup

* Fix fetching level of o2m sort field

* Remove min height on empty root

* Remove unused types

* Add notice for invalid relationship type

* Allow recursive o2m in setup

* Styling tweak

* Revert changes in v-list

* Revert changes in groupable
2021-03-26 17:12:55 -04:00
Nicola Krumschmidt
08293b8570 Update Knex to version 0.95.0 (#4374)
* Update Knex to version 0.95.0

* Fix formatting in schema dialects

* Fix Knex imports

* Update package-lock

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
2021-03-03 19:37:44 -05:00
Rijk van Zanten
b0f3c0591a Add "explicit" o2m update syntax (#4295)
* Add support for a new o2m relational update structure

* Document these wonders
2021-02-25 14:08:57 -05:00
Rijk van Zanten
b7d87e581a System permissions for app access (#4004)
* Pass relations through schema, instead of individual reads

* Fetch field transforms upfront

* Fix length check

* List if user has app access or not in accountability

* Load permissions up front, merge app access minimal permissions

* Show app access required permissions in permissions overview

* Show system minimal permissions in permissions detail

* Fix app access check in authenticate for jwt use

* Fix minimal permissions for presets

* Remove /permissions/me in favor of root use w/ permissions

* Fix logical nested OR in an AND

* Use root permissions endpoint with filter instead of /me

* Allow filter query on /permissions

* Add system minimal app access permissions into result of /permissions

* Remove stray console log

* Remove stray console.dir

* Set current role as role for minimal permissions

* Fix no-permissions state for user detail

* Add filter items function that allows altering existing result set
2021-02-11 12:50:56 -05:00
Rijk van Zanten
817ccf3620 Overhaul docs (#3951)
* Add Quickstart Guide

* Update installation

* Remove unused files

* Update support/backing

* Tweaks in concepts

* Setup file structure for API reference 2.0

* Setup page layout for reference

* Add clean-urls plugin

* getting started updates

* Finish authentication rest

* getting started updates

* Render stylus in 2 spaces

* Various

* Various

* Finish activity docs

* Add collections reference

* Add extension reference

* concepts updates

* Fields/tweaks

* Add files doc

* Add revisions

* concepts docs

* More api reference

* Finish rest api reference (finally)

* initial concepts

* More things

* Add assets api ref

* Move sections from file to assets

* Add environment variables

* contributing docs

* Add field transforms page

* Left align table headers

* concept links

* Add API config

* Fix mobile nav

* Add migrating a project

* doc link fixes

Co-authored-by: Ben Haynes <ben@rngr.org>
2021-02-05 18:51:54 -05:00
Igor Savin
7cddb458cb Run prettier across app and api 2020-12-08 02:22:00 +02:00
rijkvanzanten
e8c2a61277 Fix wrong import 2020-11-27 20:58:10 -05:00
rijkvanzanten
1f88cd4a32 Add relational nested updates to API 2020-11-27 13:44:57 -05:00
rijkvanzanten
e02365e5c3 Treat MySQL 0000-00-00 as null 2020-11-11 14:50:00 -05:00
rijkvanzanten
8cbdfb409b Use prefetched schema info 2020-11-09 17:13:48 -05:00
rijkvanzanten
528112314d Remove outdated tests, fix imports 2020-11-09 12:29:01 -05:00
rijkvanzanten
e5d70ebde2 Fix nested m2m updates
Fixes #849
2020-11-03 17:51:16 -05:00
rijkvanzanten
d3ca132fad Move system relations out of db 2020-10-29 13:29:07 -04:00
rijkvanzanten
ee9baf02c0 Move system fields out of DB 2020-10-29 13:06:37 -04:00
rijkvanzanten
592ab925db Add toArray util 2020-10-15 18:00:27 -04:00
rijkvanzanten
2c3992b1f1 Add precision / scale support
Fixes #560
2020-10-15 17:22:39 -04:00
rijkvanzanten
191e1187fb Fix setting o2m to null 2020-10-14 13:28:01 -04:00
rijkvanzanten
7fcb4717a4 Fix o2m resetting too many items 2020-10-13 18:30:03 -04:00
rijkvanzanten
5dba15082f Handle non-o2m cases 2020-10-09 13:13:49 -04:00
rijkvanzanten
a8a69f1fb8 Tweak IO of o2m 2020-10-09 13:03:29 -04:00
rijkvanzanten
e40b9133cb Handle SQLite date strings
Fixes #475, fixes #512
2020-10-05 18:39:31 -04:00
rijkvanzanten
69c9a9f992 Add no-data special key to hide non-data fields in system 2020-10-05 16:49:06 -04:00
rijkvanzanten
306c4109a4 Check if item exists instead of relying on presence of pk 2020-09-30 15:32:38 -04:00
rijkvanzanten
f1159d08cd Fix date io in api 2020-09-28 18:16:27 -04:00
rijkvanzanten
07471b8208 Support primary keys in O2M patches
Fixes #247
2020-09-24 17:15:37 -04:00
rijkvanzanten
85ca7b5d17 Run prettier 2020-09-22 16:11:28 -04:00
rijkvanzanten
48fca55651 Restructure exports for services 2020-09-22 13:16:14 -04:00
rijkvanzanten
d87fc912f4 Fix date saving in MySQL
Ref #283
2020-09-18 12:57:26 -04:00
rijkvanzanten
b8eff4c788 Use CSV for special, add on create / on update for fields 2020-09-15 17:31:37 -04:00
rijkvanzanten
68e05a208a Add csv special type, return type based on special flag 2020-09-10 14:14:24 -04:00
rijkvanzanten
7f1f105349 Merge branch 'main' into feature-rate-limiting 2020-09-08 12:31:57 -04:00
rijkvanzanten
38e1cf4a55 Add permission variables support 2020-09-02 18:20:02 -04:00
rijkvanzanten
9d30b17a73 Fix limit / nested query
Fixes #168, fixes #179
2020-09-02 16:47:43 -04:00
rijkvanzanten
e4f8b16717 Add password reset flow 2020-09-01 15:58:12 -04:00
rijkvanzanten
4b5aaaa1ff Rename operation->action, add validate step 2020-08-27 11:56:01 -04:00