Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Validator] Only traverse arrays that are cascaded into #29800

Merged
merged 1 commit into from Apr 7, 2019

Conversation

corphi
Copy link
Contributor

@corphi corphi commented Jan 6, 2019

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #27090
License MIT
Doc PR -

Previously, array properties were traversed even if they were not annotated Valid.

@corphi corphi changed the title Only traverse arrays that are cascaded into [Validator] Only traverse arrays that are cascaded into Jan 6, 2019
@HeahDude
Copy link
Contributor

HeahDude commented Jan 6, 2019

Hello @corphi, this is not a bug but the expected behavior. Only objects are not traversed by default.
This would be a BC breaking new feature that should deal with a BC layer.

@@ -68,7 +68,7 @@ protected function initializeNestedConstraints()
}

if (!$field instanceof Optional && !$field instanceof Required) {
$this->fields[$fieldName] = $field = new Required($field);
$this->fields[$fieldName] = new Required($field);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a legit bug fix nevertheless.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be a big BC as well, I'm not sure we should merge such change.

@corphi
Copy link
Contributor Author

corphi commented Jan 6, 2019

The specification is pretty clear that cascading is only controlled by the Valid annotation. The failing test shows that traversing and cascading is also triggered by a Callback constraint on an array - or any other constraint, as noted in the original bug report. Without a constraint, the array is neither traversed nor its values validated. This is correct behaviour. Thus, “always“ has to be weakened to “if we actually want to cascade” - as expressed by the Valid constraint. The patch does exactly that and fixes accidentally cascading into the array.

Traversal strategies have been introduced by the 2.5 refactoring and don’t exist in the specification. I believe, this was done to deal with Traversables that mix more than one responsibility into a single class. This way, you can stop accidental traversals of e.g. lazy-loaded entries. The Java implementation doesn’t need this feature.

Bug fixes obviously break the incorrect behaviour. But the documentation has been incorrect for quite a while and could use some love.

@HeahDude
Copy link
Contributor

HeahDude commented Jan 6, 2019

I was considering this documentation: https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L357 as the expected behavior. I'm not sure how much we want to follow Java specs here.

@HeahDude
Copy link
Contributor

HeahDude commented Jan 7, 2019

Ok I got your point in #27090. But still, 2.5 is pretty old now, and breaking BC is not the same in both directions.

I mean with the current code, expectation may fail but invalid data should not be able to be persisted, displaying an invalid message instead.
With the proposed changes, expectation is right but some invalid data can be persisted without anyone or anything noticing.

But if the PR were to be merged, I think we should at least update the phpdoc I link above and some inline comment (i.e https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Validator/RecursiveContextualValidator.php#L372) consistently, even re-introduce this behavior in master with a proper BC layer.

@spackmat
Copy link
Contributor

spackmat commented Jan 7, 2019

I mean with the current code, expectation may fail but invalid data should not be able to be persisted, displaying an invalid message instead.
With the proposed changes, expectation is right but some invalid data can be persisted without anyone or anything noticing.

@HeahDude In my case, no invalid data is newly persisted (it is only invalid after changes, but legacy data is still in the database that must be updated on next edit). Now I cannot insert a relation to such legacy data elsewhere since the validation is (incorrectly) traversed and I cannot stop that behavior. Only @Valid constraints should trigger such traversal.

And to make things worse: In my case, there is no error shown at all unless I configure the error_mapping, as shown here #27090 (comment). (I have a collection field with one or more relations to another entity and for now I cannot use the Count-constraint to ensure at least one relation is persisted, which ist really bad.)

@corphi
Copy link
Contributor Author

corphi commented Jan 7, 2019

Unfortunately, the inline comments are often outdated. The comment in line 372 is correct, but misleading. It means: Traversal strategies are ignored on arrays. validateEachObjectIn() actually executes cascading into the array. So this condition is already met. (And both aspects are covered by test cases. 🎉) But the line 357 one is plain wrong. I’ll try to improve the comments. And probably the documentation, too.

The way I read it, the Java specification is the single source of truth:

The Validator component provides tools to validate values following the JSR-303 Bean Validation specification.
Symfony Validator documentation, first sentence

I linked the current version 2.0 (JSR-380) because of its nicer formatting, but the parts relevant to this issue haven’t changed since 1.0 (JSR-303). We are just lagging behind on the feature side.

About the BC layer: @HeahDude, do you suggest triggering a deprecation notice if the wrong annotation incorrectly causes traversal, and fixing the bug in 5.0? An opt-in for the correct behaviour seems a little over the top. A deprecation notice won’t hurt, though. I’d rather fix it sooner than later.

@corphi
Copy link
Contributor Author

corphi commented Jan 12, 2019

Adding a deprecation would mean that this fix had to target 4.3 and could only be corrected in 5.0, according to semantic versioning. A quick scan of existing deprecation messages showed that they are concerned with BC breaks according to the Symfony BC promise. It only covers changes to code structure, not changed behaviour. A message like “you might have been doing this wrong the entire time” didn’t fit the scheme.

Also, this is why I labeled this PR as without a BC; the rules are linked in the PR template.

@nicolas-grekas
Copy link
Member

Could you please rebase? That would remove all the short-array related diffs and ease reviews. Thanks!

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor details, no idea about the main topic sorry :)
more reviewers needed.

src/Symfony/Component/Validator/.gitignore Outdated Show resolved Hide resolved
src/Symfony/Component/Validator/composer.json Outdated Show resolved Hide resolved
@fabpot
Copy link
Member

fabpot commented Apr 7, 2019

Thank you @corphi.

@fabpot fabpot merged commit 7db9200 into symfony:3.4 Apr 7, 2019
fabpot added a commit that referenced this pull request Apr 7, 2019
…orphi)

This PR was squashed before being merged into the 3.4 branch (closes #29800).

Discussion
----------

[Validator] Only traverse arrays that are cascaded into

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #27090
| License       | MIT
| Doc PR        | -

Previously, array properties were traversed even if they were not annotated `Valid`.

Commits
-------

7db9200 [Validator] Only traverse arrays that are cascaded into
@corphi corphi deleted the fix-issue-27090 branch April 7, 2019 13:14
This was referenced Apr 16, 2019
franzwilding added a commit to unite-cms/unite-cms that referenced this pull request Apr 17, 2019
franzwilding added a commit to unite-cms/CoreBundle that referenced this pull request Apr 17, 2019
@salv1
Copy link

salv1 commented Apr 26, 2019

In certain situations, changes in RecursiveContextualValidator.php (line 657) can break form validation.
In such case you need to add Valid constraint.

franzwilding added a commit to franzwilding/test-split-repo that referenced this pull request Dec 20, 2019
franzwilding added a commit to unite-cms/CoreBundle that referenced this pull request Dec 20, 2019
* fix #458 [CoreBundle]: For the moment allow auto field only for content and setting types and not any nested subfield

* feature #468 [CoreBundle]: Add core integration for an api user implementation in 3rd party bundles

* fix #468 [CoreBundle]: ApiKeyUserProvider properties should be protected, so the provider an be extended

* fix #468 [CoreBundle]: Replace BaseApiUser with PlaceholderApiUser, implementations must replace PlaceholderApiUser and can't extend it

* fix #468 [CoreBundle]: Remove placeholder entity approach. Other bundles should use doctrine event listener to modify discrimination config

* feature #429 [CoreBundle]: add new view config for view actions and add/change some tests

* feature #429 [CoreBundle]: render action dropdown box

* feature #429 [CoreBundle]: implement review findings

* feature #429 [CoreBundle]: revert package.json yarn.lock

* Release version 0.8.0

* Fix [CoreBundle] Webhook: Delete event does now return ID in response GraphQL query

Previously returned null in-place of ID

* Fix duplicate reference selections

When a selection modal for a reference field is shown, an observer on
the `contentSelected` event is added. When an item is selected, the
observer is removed and the lightbox is closed. However, if the
lightbox is closed some other way (e.g. by hitting escape or by
clicking outside the modal), the observer won't be removed. This means
selections made in one modal can affect others. To replicate:

1. Add blank reference field rows to a collection field until there
   are at least two empty rows.
2. Click on a blank row to bring up the modal.
3. Close the modal without selecting anything (hit escape).
4. Click on another row to open its modal, and select an item.
5. Both rows will now update to show the selected item.

To resolve this issue, the observer is instead removed on the UIkit
modal's `beforeHide` event. This means the observer will be removed no
matter how the modal is closed.

The `closeModal` method in the `field/Reference.vue` component was
only used within this file, and was removed as it's no longer
necessary.

* Fix empty reference value selection modals

If a content type has both a Reference field and a reference_of field
(like a 'Category' content type with a 'Products' reference field and
a 'Child Caregories' field), the condition (parent.content = <id>)
used in the uniteViewDataFetcher object for the reference_of field
will "leak" and remain set if any other uniteViewDataFetcher objects
are created. In this example, this means any new rows added to the
'Products' reference collection will have empty modals when the plus
button is clicked, as they're they're fetching products that are
already children of the current category. This is becaue they have the
filter from the 'Child Categories' field applied when they do a
GraphQL query to fetch the options to show.

This occurs becase the uniteViewDataFetcher create function returns a
shallow clone of itself, while the filter conditions are an object
reference that isn't cloned. To work around the issue, this method now
does a deep clone initially, modifies it and returns it.

* fix #513: Missing select icons in reference modal table

In some cases, the table in the modal lightbox used to select an item
for a reference field would be missing the circular select icons. This
appeared to be due to the inline `width` style set on the table header
and body cell divs. This was either set to `0px` or a non-zero value.
If it was `0px`, the selection icon displayed correctly. If not, the
selection icon wouldn't be visible.

The inline width style is added by a Vue update lifecycle hook in
`TableContent.vue`. Changing this to always set the width to `0px`
appears to fix the issue.

* feature: Compile assets

* fix: missing select icons by setting a fixed with for the icon

* fix: revert set client width on update

* Fix empty reference value selection modals

If a content type has both a Reference field and a reference_of field
(like a 'Category' content type with a 'Products' reference field and
a 'Child Caregories' field), the condition (parent.content = <id>)
used in the uniteViewDataFetcher object for the reference_of field
will "leak" and remain set if any other uniteViewDataFetcher objects
are created. In this example, this means any new rows added to the
'Products' reference collection will have empty modals when the plus
button is clicked, as they're they're fetching products that are
already children of the current category. This is becaue they have the
filter from the 'Child Categories' field applied when they do a
GraphQL query to fetch the options to show.

This occurs becase the uniteViewDataFetcher create function returns a
shallow clone of itself, while the filter conditions are an object
reference that isn't cloned. To work around the issue, this method now
does a deep clone initially, modifies it and returns it.

* compile core assets

* Make default view search case-insensitive

The search field in collection views is currently case-sensitive,
which means searching for e.g. 'shoe' won't return results containing
'Shoe'. This commit:

- Adds a new ILIKE query operator, which is the same as LIKE but
  converts both operands to lowercase before comparing.
- Makes the default search filter operator ILIKE rather than LIKE, so
  that searches are case-insensitive.

* Fix moving tree items to lower levels

Previously, it wasn't possible to move tree view items to be children
of other items if the other item didn't already have children. This
was because the empty tree-view-children node wasn't rendered for
items without any children, meaning that potential new children had
nowhere to be moved to.

Also add the `uk-sortable` class to tree-view-children nodes. The
uikit3-nestable plugin uses this to determine which nodes items can be
nested under, so moving items under other items didn't work properly
without it.

* Add tests for ILIKE operator

* fix #528 [CoreBundle]: Allow to resize textareas vertical instead of horizontal

* merge master and recompile assets

* fix [CoreBundle]: When using preRemove event, content and id is available in event

* merge master and recompile assets

* fix [CoreBundle]: Only set uk-sortable to true if isSortable is set to true, fix a bug where you could not set parent to null

* fix #497 [CoreBundle] Use config from filesystem with variables instead of serialized config

* feature: Disable domain config diff, as it is not possible to show the difference between manual domain config and automatic serialized domain config

* remove ace diff from domain editor

* fix #497 [CoreBundle]: Fixate doctrine collection to version 1.5, little test fix

* fix [CoreBundle]: Downgrade doctrine/collections to 1.5.*, because of doctrine/collections#180

* remove domain default values enricher for the moment

* revert changes

* fix #497 [CoreBundle]: Set config from input and not from serialized domain

* Also use variables in command test

* feature #341 [CoreBundle]: Use ace diff for domain update change visualization

* fix #341 [CoreBundle]: Update test to reflect domain validaiton step changes

* fix #492, feature #292 [CoreBundle]: Provide more console commands, allows to import config and create organizations with existing config folder

* fix #502 [CoreBundle]: Allow to pass excluded ids to content_unique and content_uniquify

* fix #520 [CoreBundle]: Start implementing cast parameter for filter input

* fix #520 [CoreBundle]: Cast boolean values as string because of PDO

* fix #520 [CoreBundle]: Remove CAST_FLOAT, not working at the moment, adjust test cases to work

* fix #520 [CoreBundle]: Make sure, value is set before using it, create string ids for mocked content ids.

* fix #520 [CoreBundle, VariantsFieldBundle]: Changes according to new change: mocked content id is string and not int

* fix: Remove domain change visualization from domain delete view

* fix [CoreBundle]: Do not validate domain member type or organization on user invite

* fix #511 [CoreBundle]: Show a custom message, if the user is not allowed to view a field.

* fix #522 [CoreBundle]: preview action should also generate preview data if form is not valid

* fix #522 [CoreBundle]: Auto text field needs to submit values so not_empty error will not be shown

* fix #522 [CoreBundle]: bubble errors from child text to main element

* feature #540 [CoreBundle, CollectionFieldBundle, VariantsFieldBundle]: Start implementing a way, to allow auto fields also on nested types (variants, collection)

* feature #540 [CoreBundle, CollectionFieldBundle, VariantsFieldBundle]: also pass root data to nested fields

* feature: Pass content id (delta) of collections and variants to alter hook

* fix #540 [CoreBundle]: Allow auto field vue component to work with fields in collections

* fix test mock

* fix #540 [CoreBundle]: Auto text should also check look for json_arrays

* feature: Start implementing money field type

* feature #542 [CoreBundle]: Currency form and css improvements, unit tests

* Release version 0.8.1

* fix #552 [CoreBundle]: Domain import needs a request with set organization and a user for access checking

* feature #554 [CoreBundle]: Add language field type

* feature #555 [CoreBundle]: Implement domain config parameters that allow to use env variables and other global parameters in domain configs

* feature #556 [CoreBundle]: Implement location field (no UI yet)

* feature: Start to implement simple open street map based resolver. This should be replaced with better solutions (google maps, mapbox etc.)

* feature #563 [CoreBundle]: Add block definition to organization and domain navigation templates for easy overriding

* Update model because of symfony/symfony#29800

* Feature: Start implement schema type alteration

* feature: Add functional schema alteration test

* fix #567 [CoreBundle]: Set expanded to false when are using the form for the api.

* Add rows_per_page setting to table and tree views

This setting controls how many rows are rendered per page. Previously
this was hard-coded to 10, which caused problems for tree views - it
isn't possible to drag items from one page to another, so all the top-
level items need to fit on one page.

The `rows_per_page` setting is optional, and will default to 10 if not
specified. If specified, it must be an integer - floats and strings
are not accepted. An example of config using the setting:

```
{
  "content_types": [
    {
      "title": "Categories",
      "identifier": "category",
      "fields": [ ... ],
      "views": [
        {
          "title": "All",
          "identifier": "all",
          "type": "table",
          "settings": {
            "fields": { ... },
            "rows_per_page": 20
          }
        }
      ]
    }
  ]
}
```

* Validate that rows_per_page <= maximum_query_limit

- Modify TableViewConfiguration's constructor to accept a
  `$maxQueryLimit` parameter, and to validate the `rows_per_page`
  setting against this.
- Added factory classes for TableViewConfiguration and its child
  classes. The factories set the `$maxQueryLimit` parameter based
  on a value set in their constructors.
- Modify UniteCMSCoreExtension to inject the `maximum_query_limit`
  config setting as the first constructor argument of the
  table/tree/grid view configuration factory classes.
- Modify classes that previously directly instantiated
  TableViewConfiguration or its child classes to instead use the
  appropriate factory class.
- Updated TableViewConfiguration tests to cover the `$maxQueryLimit`
  parameter.

* Further test updates

Previous commit didn't include updates to tests affected by adding the
$tableViewConfigurationFactory param to the TableViewType constuctor.

* Fix nested cards width at 2100px+

At widths of 2100px or higher, nested elements with the `uk-card`
class will overflow to the right their parents. This is due to a fixed
width of 1600px. Setting a `min-width` resolves this by allowing the
outer pane to grow to be wider than the inner pane.

* Move FieldTypeManager dependency into factories

Move the FieldTypeManager dependency into the factory services, rather
than requiring it to be passed in to their `create` methods. The
FieldTypeManager service was no longer used by TableViewType, so it
was removed from that class.

Also remove the `createConfig` method from TreeViewType and
GridViewType, so they use the version inherited from TableViewType
(and so actually use the factory to create the config object).

* Update failing tests

* Validate not_empty setting on reference fields

The `not_empty` setting doesn't work for reference fields, as the
domain and content type values are always present even if the content
value is blank. These two values are enough to allow the `not_empty`
validation in UniteCMSCoreTypeExtension::buildForm to pass, even if no
content value has been provided.

This commit modifies the validateData method of the reference field
type to not skip validation when $data is empty if `not_empty` is set.
The existing validation code will then trigger an error if any of
domain/content_type/content are missing.

This commit also modifies the error message shown to be the standard
"This field is required", rather than a more complex message asking
the use to contact an administrator. A reference field can't be added
to the domain without specifying domain and content_type, so the only
reason validation should fail is because content is missing. The
simpler error message should be less confusing for less technical
users.

* feature: Try to refactor content type factory to fieldable type factory

* change member find methods to avoid confusion with content find methods

* feature: use new domain member voter for controller, fix getting domain member graphql response

* fix: Fixes according to new domain meber permission checking

* Add tests for not_empty reference fields

* fix #573 [CoreBundle]: Hide ct and st if user has no access to LIST / VIEW

* feature: Start refactoring setting view

* fix #572 [CoreBundle]: Remove locale form field complete from setting update form, after saving setting, redirect to the correct language

* feature #484 [CoreBundle]: Include base locale in setting translations

* feature #506 [CoreBundle]: Only alter field settings for defined types

* fix #582 [CoreBundle]: Fix config tests

* feature #383 [CoreBundle]: Implement country field type + fix a bug in language field type with custom languages settings

* feature #501 [CoreBundle]: Create content button in content sidebar

* feature: Start implementing form_group field option and alter form rendering

* feature #419 [CoreBundle]: Improve mobile ui, add field tests.

* fix #582 [CoreBundle, VariantsFieldBundle]: sometimes one cannot iterate over form.children, so we better use form for that

* feature #365 [CollectionFieldBundle, CoreBundle, VariantsFieldBundle]: Make it easier to handle large collection lists and collection lists containing variants fields

* feature: improve label hiding option for collections, collapse existing variants

* Release version 0.8.2

* feature: Only show domain member types in query, where user has LIST access

* fix tests

* feature: allow to access _name for domain members and add api functional tests

* feature: Use new domain member permissions to check, if a user is allowed to manage domain members

* fix tests for new domain member permission checking

* Update ApiFunctionalTest.php

* feature #416 [CoreBundle]: Start refactoring reference fields to also work with domain member types

* feature: Add additional tests for domain memebr type reference

* feature: add domain member default field in view

* feature: Draft implementation of extending reference field to user reference field

* Table view pagination improvements

- Currently, the 'left one page' arrow (single arrow) is missing for
  the first few pages. This commit modifies the pagination links so
  the left single arrow is visible on any page past the first.

- Show currently displayed items and total items below the pagination
  links, in `{from}-{to} of {total}` format. For example:

  `30-39 of 750`

* feature: Don't use fake view entity, instead allow to create view parameter bag also for domain member type entites

* Update ReferenceFieldType.php

* feature #602 [CoreBundle]: Change domain member id type to uuid

* fix #602 [CoreBundle]: Refactor tests to work with new uuid id format

* fix #603 [CoreBundle]: Try to move name field to domain accessor table

* fix #602 [CoreBundle]: Also use correct uuid id for this test run

* Revert "fix #603 [CoreBundle]: Try to move name field to domain accessor table"

This reverts commit b376abe.

* fix #603 [CoreBundle]: Allow to filter and sort domain members my _name field

* feature #417 [CoreBundle]: Start implementing field permissions

* fix #417 [CoreBundle]: Also check for LIST permission when building a fieldable form

* feature #417 [CoreBundle]: Add field permission tests for setting type and domain member type

* feature #417 [VariantsFieldBundle]: Implement field permisisons for variants fields

* fix #417 [CoreBundle]: Update tests because fieldable form builder now needs a security token

* fix #417 [CoreBundle]: Fix tests

* feature #523 [CoreBundle]: Use custom log entry class

* feature #523 [CoreBundle]: Save domain accessor to log entries, but this can be null if user was deleted

* fix #523 [CoreBundle]: Remove comment and whitespace

* fix #523 [CoreBundle]: Fix tests: user is set on kernel request, so we need to fake more kernel requests. And we also prevent saving the user on domain member save

* feature: Improve styling + compile assets

* fox #597 [CoreBundle]: Fix a bug where not all assets where dumped

* fix [CollectionFieldBundle, CoreBundle, VariantsFieldBundle]: Fix wrong namespace for fieldable field content class

* feature #614 [CoreBundle]: Allow reference_of fields on domain member types and add test cases

* feature #619 [CoreBundle]: Allow to set pre-set data on content create

* feature #617 [CoreBundle]: Cache schema and do not generate it on each request

* Start implementing schema cache

* fix #617 [CoreBundle]: Set enum values when using schema from cache

* fix #617 [CoreBundle]: Fix an issue withfieldable content result type and interface. We dont need the interface at all

* working on feature

* fix #617 [CoreBundle, VariantsFieldBundle]: Interfaces first should look for types in schema instead of schema type manager to avoid duplicated types

* pass nestinglevel and also save domain mapping information to cache

* fix #617 [CoreBundle]: Replace reference_of resolve function with default field resolver, because this is not wokring with cached schemas

* fix reference field problem when trying to resolve graphql data outside of a real graphql resolving call

* feature #617 [CoreBundle, VariantsFieldBundle]: Allow to set detectable variable when registering graphql types + do not decorate input schema types

* fix #617 [CoreBundle]: Only add mutation type to cache if it is not empty, small fixes on query type and api test case

* do not clear schema cache on every api call

* fix #617 [CoreBundle]: Fix tests because of cached schema types

* Update StateFieldTypeApiTest.php

* feature: fix schema cache tags

* clear domain cache at begining of api test run, this allows us to revert state field test changes

* we don't want unique here, it is already checked with @UniqueEntity. Also symfony 4.3 will tirgger an additional warning

* feature #624 [CollectionFieldBundle, CoreBundle, RecaptchaFieldBundle, StorageBundle, VariantsFieldBundle]: Remove nestinglevel and replace it with DocumentValidator rule: QueryDepth

* fix #626 [CollectionFieldBundle]: Create collection field row types from cached schema, make sure that tree view does not show too many nested children

* feature #631 [CoreBundle]: Only show CT and ST sidebar header, if at least one CT or ST is actually displayed

* feature #630 [CoreBundle]: Add a ignore_case flag to sort input

* fix #622 [CoreBundle]: Number, boolean and date fields should return null if empty which is not the same as "0" or "false"

* feature #635 [CoreBundle]: Change maximum nesting level to 16

* update composer packages

* fix #613 [CoreBundle]: Return null, of content was not found or user not allowed to access it

* fix tests according to change

* update dependencies, disable nestable sortable for the moment and add IE11 support by babel

* fix #640 [CoreBundle]: We need to cache different root queries seperately

* Merge pull request #646 from unite-cms/feature/494-standardize-variants-description-location closes #494

* feature #494 [VariantsFieldBundle]: Move description to settings sub_array because of consistency

* more choice card fixes

* Feature/refactor fieldable content actions (#647)

* feature: Implement fieldable content manager to abstract common content actions

* feature: Use new content manager also in graphql mutation type, setting and domain member controller

* always return array

* first check access, than if content is really deleted

* feature: Implement domain member revision actions (#648). This closes #67

* Add unite cms core version to bundle, show it in user menu and create a command to dump the version to VERSION.md (#649). This closes #487

* Remove a bunch of deprecations (#650)

* Remove a bunch of deprecations

* fixes because of deprecation chanes

* feature #3 [CoreBundle]: Implement _revisions field on fieldable cont… (#651). This closes #3.

* feature #3 [CoreBundle]: Implement _revisions field on fieldable content graphql response for user with permission UPDATE

* feature #3 [CoreBundle]: Implement revert action

* feature #4 [CoreBundle]: Implement content restore and delete definitely actions (#653). This closes #4

* feature #652 [CoreBundle]: Implement setting update & revert api actions (#654). Closes #652

* feature #652 [CoreBundle]: Implement setting update & revert api actions

* feature #652 [CoreBundle]: Implement api for domain member update, revert and delete mutations

* fix tests according to new api mutations

* remove domain member -> accessor test, we don't validate this anymore

* feature #252 [CoreBundle]: add new translate content permission fix #252 (#431). This closes #252

* feature #252 [CoreBundle]: add new translate content permission fix #252

* feature #252 [CoreBundle]: fix permissions, user was not able to do anything in the ui fix #252

* feature #252 [CoreBundle]: remove permission handling

* fix #252 [CoreBundle]: move permissions to content type

* when getting permissions, set translate permisison default to updatr

* fix tests

* only show translation actions if user has permission

* Update ContentType.php

* Update DeletedContentVoter.php

* Release version 0.9.0

* feature #658 [CoreBundle]: Sort domain member options by name (#659). Thiscloses #658

* feature #658 [CoreBundle]: Sort domain member options by name

* fix sorting logic

* fix #661 [CoreBundle]: Fix tree view + implement load more children button (#662)

* feature #664 [CoreBundle]: Allow cast view filter, fix tree nested fi… (#665). Closes #664

* feature #664 [CoreBundle]: Allow cast view filter, fix tree nested filter + load more when there are filters

* fix tree parameter test + nested filter for AND / OR filter

* fix: ignore missing _permission key in reference

* feature #666 [CoreBundle]: Allow to set not_empty on location and mon… (#667). Closes #666

* feature #666 [CoreBundle]: Allow to set not_empty on location and money field types

* money field: allow to set null by setting value to null

* need to set defaut values for location field

* fix add 'not_emoty' option to location field

* feature #671 [CoreBundle]: If new sortindex value is not default value, allow to set a value (#674). This closes #671

* fix #672 [CollectionFieldBundle, CoreBundle, StorageBundle]: Fix group swiping and selecting elemts when hitting enter (#676)

* Release version 0.9.1

* remove yarn.lock

* fix #680 [CoreBundle]: Fix not_empty link field option (#681)

* feature #541 [CoreBundle]: Implement simple id field that allows to store an uuid4 (#683). This closes #541

* Feature/658 sort domain member (#688)

* feature #658 [CoreBundle]: Sort domain member options by name

* fix sorting logic

* feature #658 [CoreBundle]: Use graphql and vue.js view for domain member list and implement better domain member _name sorting

* merge master by hand

* fix #658 [CoreBundle]

* feature #690 [CoreBundle]: Always set default field values, and alway… (#691). Closes #690

* feature #690 [CoreBundle]: Always set default field values, and always allow to alter field values and set default state value

* FIX #690 [CoreBundle]: Update test and fix logic else problem

* feature #692 [CoreBundle]: Implement a token field type that generates a url-ready token on create (#693). Closes #692

* Feature/refactor views (#696)

* feature [CoreBundle]: Update all js components and use js-core instead of babel

* Start refactoring view frontend

* working on field fetching

* Refactor most of the fields, implement vue draggable table sort

* Implement new row actions and refactor table css styling

* Refactor storage image field

* Implement most of the basic table features

* refactor grid view and improve image view field

* Start implement new tree view

* build

* woking on nested tree

* Working on tree view

* Finish tree view sorting

* update deleted behaviour

* finish table drag drop

* remove old view

* update collection and variants field + rebuild all assets

* We don't need to generare children field on server side anymore

* feature: Implement reference_of view field

* fix reference view field

* fix #697 [CoreBundle]: Allow to make a checkbox editable in the view + fix a bug in choice field (#698). This closes #697

* fix [CoreBundle]: Add missing description to special form fields

* Create Time field type

Add a new field type `TimeFieldType` which uses Symfony's core form type `TimeType`. This field is rendered as an input with the type `time`, which includes support for the `min`, `max` and `step` attributes.

Here is an example declaration of the field:

```
{
  "title": "Appointment Time",
  "identifier": "appointment_time",
  "type": "time",
  "settings": {
    "description": "",
    "min": "09:00:00",
    "max": "17:00:00",
    "step": 60
  }
},
```

* Constrain modal header width on screens wider than 2100px (#711)

This fix sets a max-width of 100% to prevent the header of a view modal
from overflowing horizontally.

This improves the look of the modals as it ensures the close icon is
always positioned in the top right corner of the modal, as well as the
search input always being visible.

* feature #715 [CoreBundle]: Allow to set "now" as date and datetime default values (#716). Closes #715

* implement "now" as default value

* Create Time field type (#708)

Add a new field type `TimeFieldType` which uses Symfony's core form type `TimeType`. This field is rendered as an input with the type `time`, which includes support for the `min`, `max` and `step` attributes.

Here is an example declaration of the field:

```
{
  "title": "Appointment Time",
  "identifier": "appointment_time",
  "type": "time",
  "settings": {
    "description": "",
    "min": "09:00:00",
    "max": "17:00:00",
    "step": 60
  }
},
```

* Pr/706 (#717)

* Add min, max & step settings for Date and DateTime fields

This feature adds support for the attributes `min`, `max` and `step` in
the field types `date` and `datetime`. These attributes are for the HTML5
input types `date` and `datetime-local`, which include validation to
ensure the attributes are successfully applied to the input elements.

An example of definition of these fields in the domain are as follows:

```
{
  "title": "Date Posted",
  "identifier": "date_posted",
  "type": "date",
  "settings": {
    "description": "",
    "min": "2019-01-01",
    "max": "2019-03-03",
    "step": 2
  }
},
{
  "title": "Date Time Posted",
  "identifier": "datetime_posted",
  "type": "datetime",
  "settings": {
    "description": "",
    "min": "2019-02-02T00:00",
    "max": "2019-03-03T12:59",
    "step": 2
  }
}
```

* Update DateTimeFieldTypeTest.php

* use core datetime form and validators instead of creating custom ones

* Add flatpickr as fallback for browsers, do not support native html5 pickers

* Pr/707 (#719)

* Add new ColourPicker field type

This feature allows selecting a colour using the Vue component vue-color. After selecting the input the picker dropdown will be displayed which allows selection of the colour's hue, saturation and alpha values.

Alternatively the hex code or rgba value can be entered, which is persisted to the database as a string.

For more information about `vue-color`, see http://vue-color.surge.sh

* Rename color picker and refactor vue field component

* compile assets

* Fix/fix 714 713 (#720)

* fix [CoreBundle]: fix #714  and fix #713

* add missing file

* V0.10.0 (#728)

* Remove all files (will be replaced)

* Init with code sprint draft

* Remove php 7.1 support + remove autogen. dirs

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Implement jwt token auth by asking the domain's user provider

* Implement a simple login action

* Implement SchemaProvider and FIeldData

* Remove all unused types from the final schema

* Draft implement embedded field data and listOf fields

* Found a generic solution for listOf fields, first draft implementation of embedded and reference types

* Use a dedicated field directive for each field type

* Start implement union types

* Validate content type and content type fields, allowing field types to take care of validation

* Implement first draft of reference_of field

* Improve schema extender and modifier for cases like when there is a conent type without a field

* Start implementation of user manager + user CRUD

* Working on UniteUser approaches, remove password for the moment

* Implement custom username/password and jwt authenticators

* Try auth credential implementation based on special fields

* Refactor graphql util + move user to security and usertype to contenttype

* Implement password authenticator

* Rename password authenticator and and make it more reusable

* resolve NULL scalar always to empty string

* Implement field type validator and @valide directive

* Move validation out of content manager and into core + improve constraint violations exception

* Update unite-cms.graphql

* Start to implement webhook functionallity

* Implement soft / hard delete + implement a CRUD api test

* Implement unite single content (old setting entity)

* Update Configuration.php

* Implement content revert

* Add a 2nd domain and fix kernel request listener prio

* Small fixes, add me type to UniteQuery, allow reference to user type

* Update CreateJWTTokenSubscriber.php

* Implement CORS listener, use real debug variable, improve password auth

* Implement content meta field

* Implement custom domain specific logger to log events for each domain

* Refactor schema test cases, add more basic field types

* move monolog to core bundle dep.

* Update default.graphql

* Add dummy email field

* Allow to add schema folders to domains, and also make this the default

* Update create user command

* fix: encode password

* Implement default parameter for most of the field types

* Refactor mutation resolver by implementing a FieldDataMapper

* Correctly implement @Valid annotation and add tests for it

* Implement content voter @access annotation + test

* Implement field access + add more access tests

* Add dummy geo location field

* Fixes + replace non-null fields with field validation, allowing to update only a subset of all fields

* Do not remove other JWT payload

* Implement user enable & user lock options with custom user checker

* Start implementing email password reset functionallity

* Implement year password reset email send out, requires swiftmailer, twig and transations

* Return different status codes, for disabled and locked users

* Implement account activation directive

* small fixes

* Start implement content filterering

* Refactor content filtering using doctrine collection criteria and implement order by

* Start implement where filter visitor mapper

* Start refactoring query filtering by allowing field types to define sortby and comparison objects

* First implementation of query filtering

* use latest version of doctrine json odm + use json unquote and use .data as default comparison key

* Improve query filtering using JSON_SEARCH

* Implement first draft of reference where filter

* fix reference_of filter and join collector

* Update ReferenceOfType.php

* Update TestUserManager.php

* validate reference and embedded fields

* Fix recursive content validator

* Use our own SaveExpressionLanguage instead of using core validator and security expression checker

* Refactor schema manager, allowing to resolve interface, union and scalar types + introduce defaultExpression

* . . .

* fix date and datetime value parsing

* Implement content manager transactional method

* Implement sequence field and fix date storage

* Update UniteContentResolver.php

* fix multi reference resolving + field data mapping of empty (but not null!) fields

* Fix embedded empty data problem + geo location fields

* Refactor content events and implement cascade delete / set null + content logging

* Implement isFullyAuthenticated method on user and use it to enable short and long living tokens

* Throw exception if user tries to update field without access

* Implement email change request + refactor email account resolver

* refactor email confirmation resolver (password reset, activation etc.) and implement generic user confirmation token storage

* Start to implement unite admin bundle as a vue SPA

* Start implementing admin navigation component

* Move graphql playground to admin dashboard

* Start implementing domain schema editor

* Refactor schema editor

* add log view with fake entries for the moment

* Start implement content listing + global alert system

* Start defining unite meta information for admin interface

* Extend uikit theme, completely remove graphql playground on unmount

* Implement log view + backend implementation of logger per domain

* Start to connect schema file editor with backend

* Update Schema.vue

* Implement schema editor

* Implement admin view definition by defining @adminView fragments

* Implement adminViewType system with custom directives

* Update AbstractAdminViewType.php

* Clean up demo schema

* Add text documents from old version

* Implement basic admin form for create and update views

* Fix content criteria for deleted content + Manage adminView route states

* Refactor content types with fieldablecontent base interface + implement content meta revisions

* Fix admin height + interface type resolving

* Pass field arguments to field type for resolving + use them in reference_of field

* Fix reference nullable problem + implement choice admin from / list types

* Refactor orm bundle persistence and flushing to make it compatible with doctrine 3 + add first orm bundle test

* Update isNew method on content

* Refactor base entities, fix a bug in isNew add doctrine ORM content manager test

* Fix BaseUser getFieldData, add func. test and auto logout user on network error

* Implement embedded form and list field + refactor form fields

* Persit and Remove ORM content only on flush

* Update ContentResolver.php

* Make sure that nonNull reference fields will always return something

* Start implementing referenceOf admin fields

* Refactor admin views + implement referenceOf field

* Implement admin field type configurators and one for geo location fields (google and algolia)

* Implement basic wysiwyg editor admin field

* Implement mustache titlePattern and small ux improvements

* catch expired exception in isTokenEmptyOrExpired method

* Implement domain parameters

* Implement required directive for soft non_null alternative

* Display validaton and network errors and map it to form fields

* Start to implement email invitation + add default configurable IS_ADMIN expression

* Update ContentTypeManager.php

* Start admin interface implementation of user invite

* Implement user invite action + admin confirm page

* Refactor security to allow all auch actions (like login) etc. without the need to pass a user type

* Fix: resolve false field data as false and not null / default

* Feature/media bundle uploader (#733)

* work on media bundle

* work on media bundle

* work on media bundle

* work on flysystem adapters

* rearrange structure, pass settings to flysystemmanager

* commit bundle dependencies and config

* add some testclass to try out basic things

* restructure bundle add test cases

* Refactor media bundle, remove all not-working code

* Implement media file upload basic implementation for s3

* add some logging and add path style endpoint parameter

* Start to implement media file upload using filePond

* Start implement media file field sith presigned URL upload

* Fix s3 pre-signed url method and work on vue field

* Start to implement real file upload field

* Start to implement: Display and load already uploaded files

* Implement first working draft of file upload

* Fix some upload file bugs for multi field

* Move s3 credentials to .env

* Implement basic file list field

* Refactor npm module loading

* Manage to make installation work from vendor using npm instead of yarn

* Remove autogen. config files

* Delete webpack_encore.yaml

* Delete symfony.lock

* Update composer + add symfony.lock to .gitignore

* Update .env

* Remove some deprecations

* fix some embedded field issues + add media file download plugin

* feature [CoreBundle] [DoctrineORMBundle] Add created / updated fields to content and user

* feature [AdminBundle] Implement setting view + introduce dashboard views + cleanup navigation

* fix [CoreBundle] add required php 7.4 inline if brakets

Co-authored-by: Stefan Kamsker <34944934+stefan-kamsker@users.noreply.github.com>
Co-authored-by: Dirk Arends <45986151+darends@users.noreply.github.com>
Co-authored-by: pspiller <pspiller@users.noreply.github.com>
Co-authored-by: joshua-sharp <47307388+joshua-sharp@users.noreply.github.com>
franzwilding added a commit to unite-cms/CoreBundle that referenced this pull request Dec 20, 2019
* fix #458 [CoreBundle]: For the moment allow auto field only for content and setting types and not any nested subfield

* feature #468 [CoreBundle]: Add core integration for an api user implementation in 3rd party bundles

* fix #468 [CoreBundle]: ApiKeyUserProvider properties should be protected, so the provider an be extended

* fix #468 [CoreBundle]: Replace BaseApiUser with PlaceholderApiUser, implementations must replace PlaceholderApiUser and can't extend it

* fix #468 [CoreBundle]: Remove placeholder entity approach. Other bundles should use doctrine event listener to modify discrimination config

* feature #429 [CoreBundle]: add new view config for view actions and add/change some tests

* feature #429 [CoreBundle]: render action dropdown box

* feature #429 [CoreBundle]: implement review findings

* feature #429 [CoreBundle]: revert package.json yarn.lock

* Release version 0.8.0

* Fix [CoreBundle] Webhook: Delete event does now return ID in response GraphQL query

Previously returned null in-place of ID

* Fix duplicate reference selections

When a selection modal for a reference field is shown, an observer on
the `contentSelected` event is added. When an item is selected, the
observer is removed and the lightbox is closed. However, if the
lightbox is closed some other way (e.g. by hitting escape or by
clicking outside the modal), the observer won't be removed. This means
selections made in one modal can affect others. To replicate:

1. Add blank reference field rows to a collection field until there
   are at least two empty rows.
2. Click on a blank row to bring up the modal.
3. Close the modal without selecting anything (hit escape).
4. Click on another row to open its modal, and select an item.
5. Both rows will now update to show the selected item.

To resolve this issue, the observer is instead removed on the UIkit
modal's `beforeHide` event. This means the observer will be removed no
matter how the modal is closed.

The `closeModal` method in the `field/Reference.vue` component was
only used within this file, and was removed as it's no longer
necessary.

* Fix empty reference value selection modals

If a content type has both a Reference field and a reference_of field
(like a 'Category' content type with a 'Products' reference field and
a 'Child Caregories' field), the condition (parent.content = <id>)
used in the uniteViewDataFetcher object for the reference_of field
will "leak" and remain set if any other uniteViewDataFetcher objects
are created. In this example, this means any new rows added to the
'Products' reference collection will have empty modals when the plus
button is clicked, as they're they're fetching products that are
already children of the current category. This is becaue they have the
filter from the 'Child Categories' field applied when they do a
GraphQL query to fetch the options to show.

This occurs becase the uniteViewDataFetcher create function returns a
shallow clone of itself, while the filter conditions are an object
reference that isn't cloned. To work around the issue, this method now
does a deep clone initially, modifies it and returns it.

* fix #513: Missing select icons in reference modal table

In some cases, the table in the modal lightbox used to select an item
for a reference field would be missing the circular select icons. This
appeared to be due to the inline `width` style set on the table header
and body cell divs. This was either set to `0px` or a non-zero value.
If it was `0px`, the selection icon displayed correctly. If not, the
selection icon wouldn't be visible.

The inline width style is added by a Vue update lifecycle hook in
`TableContent.vue`. Changing this to always set the width to `0px`
appears to fix the issue.

* feature: Compile assets

* fix: missing select icons by setting a fixed with for the icon

* fix: revert set client width on update

* Fix empty reference value selection modals

If a content type has both a Reference field and a reference_of field
(like a 'Category' content type with a 'Products' reference field and
a 'Child Caregories' field), the condition (parent.content = <id>)
used in the uniteViewDataFetcher object for the reference_of field
will "leak" and remain set if any other uniteViewDataFetcher objects
are created. In this example, this means any new rows added to the
'Products' reference collection will have empty modals when the plus
button is clicked, as they're they're fetching products that are
already children of the current category. This is becaue they have the
filter from the 'Child Categories' field applied when they do a
GraphQL query to fetch the options to show.

This occurs becase the uniteViewDataFetcher create function returns a
shallow clone of itself, while the filter conditions are an object
reference that isn't cloned. To work around the issue, this method now
does a deep clone initially, modifies it and returns it.

* compile core assets

* Make default view search case-insensitive

The search field in collection views is currently case-sensitive,
which means searching for e.g. 'shoe' won't return results containing
'Shoe'. This commit:

- Adds a new ILIKE query operator, which is the same as LIKE but
  converts both operands to lowercase before comparing.
- Makes the default search filter operator ILIKE rather than LIKE, so
  that searches are case-insensitive.

* Fix moving tree items to lower levels

Previously, it wasn't possible to move tree view items to be children
of other items if the other item didn't already have children. This
was because the empty tree-view-children node wasn't rendered for
items without any children, meaning that potential new children had
nowhere to be moved to.

Also add the `uk-sortable` class to tree-view-children nodes. The
uikit3-nestable plugin uses this to determine which nodes items can be
nested under, so moving items under other items didn't work properly
without it.

* Add tests for ILIKE operator

* fix #528 [CoreBundle]: Allow to resize textareas vertical instead of horizontal

* merge master and recompile assets

* fix [CoreBundle]: When using preRemove event, content and id is available in event

* merge master and recompile assets

* fix [CoreBundle]: Only set uk-sortable to true if isSortable is set to true, fix a bug where you could not set parent to null

* fix #497 [CoreBundle] Use config from filesystem with variables instead of serialized config

* feature: Disable domain config diff, as it is not possible to show the difference between manual domain config and automatic serialized domain config

* remove ace diff from domain editor

* fix #497 [CoreBundle]: Fixate doctrine collection to version 1.5, little test fix

* fix [CoreBundle]: Downgrade doctrine/collections to 1.5.*, because of doctrine/collections#180

* remove domain default values enricher for the moment

* revert changes

* fix #497 [CoreBundle]: Set config from input and not from serialized domain

* Also use variables in command test

* feature #341 [CoreBundle]: Use ace diff for domain update change visualization

* fix #341 [CoreBundle]: Update test to reflect domain validaiton step changes

* fix #492, feature #292 [CoreBundle]: Provide more console commands, allows to import config and create organizations with existing config folder

* fix #502 [CoreBundle]: Allow to pass excluded ids to content_unique and content_uniquify

* fix #520 [CoreBundle]: Start implementing cast parameter for filter input

* fix #520 [CoreBundle]: Cast boolean values as string because of PDO

* fix #520 [CoreBundle]: Remove CAST_FLOAT, not working at the moment, adjust test cases to work

* fix #520 [CoreBundle]: Make sure, value is set before using it, create string ids for mocked content ids.

* fix #520 [CoreBundle, VariantsFieldBundle]: Changes according to new change: mocked content id is string and not int

* fix: Remove domain change visualization from domain delete view

* fix [CoreBundle]: Do not validate domain member type or organization on user invite

* fix #511 [CoreBundle]: Show a custom message, if the user is not allowed to view a field.

* fix #522 [CoreBundle]: preview action should also generate preview data if form is not valid

* fix #522 [CoreBundle]: Auto text field needs to submit values so not_empty error will not be shown

* fix #522 [CoreBundle]: bubble errors from child text to main element

* feature #540 [CoreBundle, CollectionFieldBundle, VariantsFieldBundle]: Start implementing a way, to allow auto fields also on nested types (variants, collection)

* feature #540 [CoreBundle, CollectionFieldBundle, VariantsFieldBundle]: also pass root data to nested fields

* feature: Pass content id (delta) of collections and variants to alter hook

* fix #540 [CoreBundle]: Allow auto field vue component to work with fields in collections

* fix test mock

* fix #540 [CoreBundle]: Auto text should also check look for json_arrays

* feature: Start implementing money field type

* feature #542 [CoreBundle]: Currency form and css improvements, unit tests

* Release version 0.8.1

* fix #552 [CoreBundle]: Domain import needs a request with set organization and a user for access checking

* feature #554 [CoreBundle]: Add language field type

* feature #555 [CoreBundle]: Implement domain config parameters that allow to use env variables and other global parameters in domain configs

* feature #556 [CoreBundle]: Implement location field (no UI yet)

* feature: Start to implement simple open street map based resolver. This should be replaced with better solutions (google maps, mapbox etc.)

* feature #563 [CoreBundle]: Add block definition to organization and domain navigation templates for easy overriding

* Update model because of symfony/symfony#29800

* Feature: Start implement schema type alteration

* feature: Add functional schema alteration test

* fix #567 [CoreBundle]: Set expanded to false when are using the form for the api.

* Add rows_per_page setting to table and tree views

This setting controls how many rows are rendered per page. Previously
this was hard-coded to 10, which caused problems for tree views - it
isn't possible to drag items from one page to another, so all the top-
level items need to fit on one page.

The `rows_per_page` setting is optional, and will default to 10 if not
specified. If specified, it must be an integer - floats and strings
are not accepted. An example of config using the setting:

```
{
  "content_types": [
    {
      "title": "Categories",
      "identifier": "category",
      "fields": [ ... ],
      "views": [
        {
          "title": "All",
          "identifier": "all",
          "type": "table",
          "settings": {
            "fields": { ... },
            "rows_per_page": 20
          }
        }
      ]
    }
  ]
}
```

* Validate that rows_per_page <= maximum_query_limit

- Modify TableViewConfiguration's constructor to accept a
  `$maxQueryLimit` parameter, and to validate the `rows_per_page`
  setting against this.
- Added factory classes for TableViewConfiguration and its child
  classes. The factories set the `$maxQueryLimit` parameter based
  on a value set in their constructors.
- Modify UniteCMSCoreExtension to inject the `maximum_query_limit`
  config setting as the first constructor argument of the
  table/tree/grid view configuration factory classes.
- Modify classes that previously directly instantiated
  TableViewConfiguration or its child classes to instead use the
  appropriate factory class.
- Updated TableViewConfiguration tests to cover the `$maxQueryLimit`
  parameter.

* Further test updates

Previous commit didn't include updates to tests affected by adding the
$tableViewConfigurationFactory param to the TableViewType constuctor.

* Fix nested cards width at 2100px+

At widths of 2100px or higher, nested elements with the `uk-card`
class will overflow to the right their parents. This is due to a fixed
width of 1600px. Setting a `min-width` resolves this by allowing the
outer pane to grow to be wider than the inner pane.

* Move FieldTypeManager dependency into factories

Move the FieldTypeManager dependency into the factory services, rather
than requiring it to be passed in to their `create` methods. The
FieldTypeManager service was no longer used by TableViewType, so it
was removed from that class.

Also remove the `createConfig` method from TreeViewType and
GridViewType, so they use the version inherited from TableViewType
(and so actually use the factory to create the config object).

* Update failing tests

* Validate not_empty setting on reference fields

The `not_empty` setting doesn't work for reference fields, as the
domain and content type values are always present even if the content
value is blank. These two values are enough to allow the `not_empty`
validation in UniteCMSCoreTypeExtension::buildForm to pass, even if no
content value has been provided.

This commit modifies the validateData method of the reference field
type to not skip validation when $data is empty if `not_empty` is set.
The existing validation code will then trigger an error if any of
domain/content_type/content are missing.

This commit also modifies the error message shown to be the standard
"This field is required", rather than a more complex message asking
the use to contact an administrator. A reference field can't be added
to the domain without specifying domain and content_type, so the only
reason validation should fail is because content is missing. The
simpler error message should be less confusing for less technical
users.

* feature: Try to refactor content type factory to fieldable type factory

* change member find methods to avoid confusion with content find methods

* feature: use new domain member voter for controller, fix getting domain member graphql response

* fix: Fixes according to new domain meber permission checking

* Add tests for not_empty reference fields

* fix #573 [CoreBundle]: Hide ct and st if user has no access to LIST / VIEW

* feature: Start refactoring setting view

* fix #572 [CoreBundle]: Remove locale form field complete from setting update form, after saving setting, redirect to the correct language

* feature #484 [CoreBundle]: Include base locale in setting translations

* feature #506 [CoreBundle]: Only alter field settings for defined types

* fix #582 [CoreBundle]: Fix config tests

* feature #383 [CoreBundle]: Implement country field type + fix a bug in language field type with custom languages settings

* feature #501 [CoreBundle]: Create content button in content sidebar

* feature: Start implementing form_group field option and alter form rendering

* feature #419 [CoreBundle]: Improve mobile ui, add field tests.

* fix #582 [CoreBundle, VariantsFieldBundle]: sometimes one cannot iterate over form.children, so we better use form for that

* feature #365 [CollectionFieldBundle, CoreBundle, VariantsFieldBundle]: Make it easier to handle large collection lists and collection lists containing variants fields

* feature: improve label hiding option for collections, collapse existing variants

* Release version 0.8.2

* feature: Only show domain member types in query, where user has LIST access

* fix tests

* feature: allow to access _name for domain members and add api functional tests

* feature: Use new domain member permissions to check, if a user is allowed to manage domain members

* fix tests for new domain member permission checking

* Update ApiFunctionalTest.php

* feature #416 [CoreBundle]: Start refactoring reference fields to also work with domain member types

* feature: Add additional tests for domain memebr type reference

* feature: add domain member default field in view

* feature: Draft implementation of extending reference field to user reference field

* Table view pagination improvements

- Currently, the 'left one page' arrow (single arrow) is missing for
  the first few pages. This commit modifies the pagination links so
  the left single arrow is visible on any page past the first.

- Show currently displayed items and total items below the pagination
  links, in `{from}-{to} of {total}` format. For example:

  `30-39 of 750`

* feature: Don't use fake view entity, instead allow to create view parameter bag also for domain member type entites

* Update ReferenceFieldType.php

* feature #602 [CoreBundle]: Change domain member id type to uuid

* fix #602 [CoreBundle]: Refactor tests to work with new uuid id format

* fix #603 [CoreBundle]: Try to move name field to domain accessor table

* fix #602 [CoreBundle]: Also use correct uuid id for this test run

* Revert "fix #603 [CoreBundle]: Try to move name field to domain accessor table"

This reverts commit b376abe.

* fix #603 [CoreBundle]: Allow to filter and sort domain members my _name field

* feature #417 [CoreBundle]: Start implementing field permissions

* fix #417 [CoreBundle]: Also check for LIST permission when building a fieldable form

* feature #417 [CoreBundle]: Add field permission tests for setting type and domain member type

* feature #417 [VariantsFieldBundle]: Implement field permisisons for variants fields

* fix #417 [CoreBundle]: Update tests because fieldable form builder now needs a security token

* fix #417 [CoreBundle]: Fix tests

* feature #523 [CoreBundle]: Use custom log entry class

* feature #523 [CoreBundle]: Save domain accessor to log entries, but this can be null if user was deleted

* fix #523 [CoreBundle]: Remove comment and whitespace

* fix #523 [CoreBundle]: Fix tests: user is set on kernel request, so we need to fake more kernel requests. And we also prevent saving the user on domain member save

* feature: Improve styling + compile assets

* fox #597 [CoreBundle]: Fix a bug where not all assets where dumped

* fix [CollectionFieldBundle, CoreBundle, VariantsFieldBundle]: Fix wrong namespace for fieldable field content class

* feature #614 [CoreBundle]: Allow reference_of fields on domain member types and add test cases

* feature #619 [CoreBundle]: Allow to set pre-set data on content create

* feature #617 [CoreBundle]: Cache schema and do not generate it on each request

* Start implementing schema cache

* fix #617 [CoreBundle]: Set enum values when using schema from cache

* fix #617 [CoreBundle]: Fix an issue withfieldable content result type and interface. We dont need the interface at all

* working on feature

* fix #617 [CoreBundle, VariantsFieldBundle]: Interfaces first should look for types in schema instead of schema type manager to avoid duplicated types

* pass nestinglevel and also save domain mapping information to cache

* fix #617 [CoreBundle]: Replace reference_of resolve function with default field resolver, because this is not wokring with cached schemas

* fix reference field problem when trying to resolve graphql data outside of a real graphql resolving call

* feature #617 [CoreBundle, VariantsFieldBundle]: Allow to set detectable variable when registering graphql types + do not decorate input schema types

* fix #617 [CoreBundle]: Only add mutation type to cache if it is not empty, small fixes on query type and api test case

* do not clear schema cache on every api call

* fix #617 [CoreBundle]: Fix tests because of cached schema types

* Update StateFieldTypeApiTest.php

* feature: fix schema cache tags

* clear domain cache at begining of api test run, this allows us to revert state field test changes

* we don't want unique here, it is already checked with @UniqueEntity. Also symfony 4.3 will tirgger an additional warning

* feature #624 [CollectionFieldBundle, CoreBundle, RecaptchaFieldBundle, StorageBundle, VariantsFieldBundle]: Remove nestinglevel and replace it with DocumentValidator rule: QueryDepth

* fix #626 [CollectionFieldBundle]: Create collection field row types from cached schema, make sure that tree view does not show too many nested children

* feature #631 [CoreBundle]: Only show CT and ST sidebar header, if at least one CT or ST is actually displayed

* feature #630 [CoreBundle]: Add a ignore_case flag to sort input

* fix #622 [CoreBundle]: Number, boolean and date fields should return null if empty which is not the same as "0" or "false"

* feature #635 [CoreBundle]: Change maximum nesting level to 16

* update composer packages

* fix #613 [CoreBundle]: Return null, of content was not found or user not allowed to access it

* fix tests according to change

* update dependencies, disable nestable sortable for the moment and add IE11 support by babel

* fix #640 [CoreBundle]: We need to cache different root queries seperately

* Merge pull request #646 from unite-cms/feature/494-standardize-variants-description-location closes #494

* feature #494 [VariantsFieldBundle]: Move description to settings sub_array because of consistency

* more choice card fixes

* Feature/refactor fieldable content actions (#647)

* feature: Implement fieldable content manager to abstract common content actions

* feature: Use new content manager also in graphql mutation type, setting and domain member controller

* always return array

* first check access, than if content is really deleted

* feature: Implement domain member revision actions (#648). This closes #67

* Add unite cms core version to bundle, show it in user menu and create a command to dump the version to VERSION.md (#649). This closes #487

* Remove a bunch of deprecations (#650)

* Remove a bunch of deprecations

* fixes because of deprecation chanes

* feature #3 [CoreBundle]: Implement _revisions field on fieldable cont… (#651). This closes #3.

* feature #3 [CoreBundle]: Implement _revisions field on fieldable content graphql response for user with permission UPDATE

* feature #3 [CoreBundle]: Implement revert action

* feature #4 [CoreBundle]: Implement content restore and delete definitely actions (#653). This closes #4

* feature #652 [CoreBundle]: Implement setting update & revert api actions (#654). Closes #652

* feature #652 [CoreBundle]: Implement setting update & revert api actions

* feature #652 [CoreBundle]: Implement api for domain member update, revert and delete mutations

* fix tests according to new api mutations

* remove domain member -> accessor test, we don't validate this anymore

* feature #252 [CoreBundle]: add new translate content permission fix #252 (#431). This closes #252

* feature #252 [CoreBundle]: add new translate content permission fix #252

* feature #252 [CoreBundle]: fix permissions, user was not able to do anything in the ui fix #252

* feature #252 [CoreBundle]: remove permission handling

* fix #252 [CoreBundle]: move permissions to content type

* when getting permissions, set translate permisison default to updatr

* fix tests

* only show translation actions if user has permission

* Update ContentType.php

* Update DeletedContentVoter.php

* Release version 0.9.0

* feature #658 [CoreBundle]: Sort domain member options by name (#659). Thiscloses #658

* feature #658 [CoreBundle]: Sort domain member options by name

* fix sorting logic

* fix #661 [CoreBundle]: Fix tree view + implement load more children button (#662)

* feature #664 [CoreBundle]: Allow cast view filter, fix tree nested fi… (#665). Closes #664

* feature #664 [CoreBundle]: Allow cast view filter, fix tree nested filter + load more when there are filters

* fix tree parameter test + nested filter for AND / OR filter

* fix: ignore missing _permission key in reference

* feature #666 [CoreBundle]: Allow to set not_empty on location and mon… (#667). Closes #666

* feature #666 [CoreBundle]: Allow to set not_empty on location and money field types

* money field: allow to set null by setting value to null

* need to set defaut values for location field

* fix add 'not_emoty' option to location field

* feature #671 [CoreBundle]: If new sortindex value is not default value, allow to set a value (#674). This closes #671

* fix #672 [CollectionFieldBundle, CoreBundle, StorageBundle]: Fix group swiping and selecting elemts when hitting enter (#676)

* Release version 0.9.1

* remove yarn.lock

* fix #680 [CoreBundle]: Fix not_empty link field option (#681)

* feature #541 [CoreBundle]: Implement simple id field that allows to store an uuid4 (#683). This closes #541

* Feature/658 sort domain member (#688)

* feature #658 [CoreBundle]: Sort domain member options by name

* fix sorting logic

* feature #658 [CoreBundle]: Use graphql and vue.js view for domain member list and implement better domain member _name sorting

* merge master by hand

* fix #658 [CoreBundle]

* feature #690 [CoreBundle]: Always set default field values, and alway… (#691). Closes #690

* feature #690 [CoreBundle]: Always set default field values, and always allow to alter field values and set default state value

* FIX #690 [CoreBundle]: Update test and fix logic else problem

* feature #692 [CoreBundle]: Implement a token field type that generates a url-ready token on create (#693). Closes #692

* Feature/refactor views (#696)

* feature [CoreBundle]: Update all js components and use js-core instead of babel

* Start refactoring view frontend

* working on field fetching

* Refactor most of the fields, implement vue draggable table sort

* Implement new row actions and refactor table css styling

* Refactor storage image field

* Implement most of the basic table features

* refactor grid view and improve image view field

* Start implement new tree view

* build

* woking on nested tree

* Working on tree view

* Finish tree view sorting

* update deleted behaviour

* finish table drag drop

* remove old view

* update collection and variants field + rebuild all assets

* We don't need to generare children field on server side anymore

* feature: Implement reference_of view field

* fix reference view field

* fix #697 [CoreBundle]: Allow to make a checkbox editable in the view + fix a bug in choice field (#698). This closes #697

* fix [CoreBundle]: Add missing description to special form fields

* Create Time field type

Add a new field type `TimeFieldType` which uses Symfony's core form type `TimeType`. This field is rendered as an input with the type `time`, which includes support for the `min`, `max` and `step` attributes.

Here is an example declaration of the field:

```
{
  "title": "Appointment Time",
  "identifier": "appointment_time",
  "type": "time",
  "settings": {
    "description": "",
    "min": "09:00:00",
    "max": "17:00:00",
    "step": 60
  }
},
```

* Constrain modal header width on screens wider than 2100px (#711)

This fix sets a max-width of 100% to prevent the header of a view modal
from overflowing horizontally.

This improves the look of the modals as it ensures the close icon is
always positioned in the top right corner of the modal, as well as the
search input always being visible.

* feature #715 [CoreBundle]: Allow to set "now" as date and datetime default values (#716). Closes #715

* implement "now" as default value

* Create Time field type (#708)

Add a new field type `TimeFieldType` which uses Symfony's core form type `TimeType`. This field is rendered as an input with the type `time`, which includes support for the `min`, `max` and `step` attributes.

Here is an example declaration of the field:

```
{
  "title": "Appointment Time",
  "identifier": "appointment_time",
  "type": "time",
  "settings": {
    "description": "",
    "min": "09:00:00",
    "max": "17:00:00",
    "step": 60
  }
},
```

* Pr/706 (#717)

* Add min, max & step settings for Date and DateTime fields

This feature adds support for the attributes `min`, `max` and `step` in
the field types `date` and `datetime`. These attributes are for the HTML5
input types `date` and `datetime-local`, which include validation to
ensure the attributes are successfully applied to the input elements.

An example of definition of these fields in the domain are as follows:

```
{
  "title": "Date Posted",
  "identifier": "date_posted",
  "type": "date",
  "settings": {
    "description": "",
    "min": "2019-01-01",
    "max": "2019-03-03",
    "step": 2
  }
},
{
  "title": "Date Time Posted",
  "identifier": "datetime_posted",
  "type": "datetime",
  "settings": {
    "description": "",
    "min": "2019-02-02T00:00",
    "max": "2019-03-03T12:59",
    "step": 2
  }
}
```

* Update DateTimeFieldTypeTest.php

* use core datetime form and validators instead of creating custom ones

* Add flatpickr as fallback for browsers, do not support native html5 pickers

* Pr/707 (#719)

* Add new ColourPicker field type

This feature allows selecting a colour using the Vue component vue-color. After selecting the input the picker dropdown will be displayed which allows selection of the colour's hue, saturation and alpha values.

Alternatively the hex code or rgba value can be entered, which is persisted to the database as a string.

For more information about `vue-color`, see http://vue-color.surge.sh

* Rename color picker and refactor vue field component

* compile assets

* Fix/fix 714 713 (#720)

* fix [CoreBundle]: fix #714  and fix #713

* add missing file

* V0.10.0 (#728)

* Remove all files (will be replaced)

* Init with code sprint draft

* Remove php 7.1 support + remove autogen. dirs

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Set database url to phpunit and let teavis generate test database

* Implement jwt token auth by asking the domain's user provider

* Implement a simple login action

* Implement SchemaProvider and FIeldData

* Remove all unused types from the final schema

* Draft implement embedded field data and listOf fields

* Found a generic solution for listOf fields, first draft implementation of embedded and reference types

* Use a dedicated field directive for each field type

* Start implement union types

* Validate content type and content type fields, allowing field types to take care of validation

* Implement first draft of reference_of field

* Improve schema extender and modifier for cases like when there is a conent type without a field

* Start implementation of user manager + user CRUD

* Working on UniteUser approaches, remove password for the moment

* Implement custom username/password and jwt authenticators

* Try auth credential implementation based on special fields

* Refactor graphql util + move user to security and usertype to contenttype

* Implement password authenticator

* Rename password authenticator and and make it more reusable

* resolve NULL scalar always to empty string

* Implement field type validator and @valide directive

* Move validation out of content manager and into core + improve constraint violations exception

* Update unite-cms.graphql

* Start to implement webhook functionallity

* Implement soft / hard delete + implement a CRUD api test

* Implement unite single content (old setting entity)

* Update Configuration.php

* Implement content revert

* Add a 2nd domain and fix kernel request listener prio

* Small fixes, add me type to UniteQuery, allow reference to user type

* Update CreateJWTTokenSubscriber.php

* Implement CORS listener, use real debug variable, improve password auth

* Implement content meta field

* Implement custom domain specific logger to log events for each domain

* Refactor schema test cases, add more basic field types

* move monolog to core bundle dep.

* Update default.graphql

* Add dummy email field

* Allow to add schema folders to domains, and also make this the default

* Update create user command

* fix: encode password

* Implement default parameter for most of the field types

* Refactor mutation resolver by implementing a FieldDataMapper

* Correctly implement @Valid annotation and add tests for it

* Implement content voter @access annotation + test

* Implement field access + add more access tests

* Add dummy geo location field

* Fixes + replace non-null fields with field validation, allowing to update only a subset of all fields

* Do not remove other JWT payload

* Implement user enable & user lock options with custom user checker

* Start implementing email password reset functionallity

* Implement year password reset email send out, requires swiftmailer, twig and transations

* Return different status codes, for disabled and locked users

* Implement account activation directive

* small fixes

* Start implement content filterering

* Refactor content filtering using doctrine collection criteria and implement order by

* Start implement where filter visitor mapper

* Start refactoring query filtering by allowing field types to define sortby and comparison objects

* First implementation of query filtering

* use latest version of doctrine json odm + use json unquote and use .data as default comparison key

* Improve query filtering using JSON_SEARCH

* Implement first draft of reference where filter

* fix reference_of filter and join collector

* Update ReferenceOfType.php

* Update TestUserManager.php

* validate reference and embedded fields

* Fix recursive content validator

* Use our own SaveExpressionLanguage instead of using core validator and security expression checker

* Refactor schema manager, allowing to resolve interface, union and scalar types + introduce defaultExpression

* . . .

* fix date and datetime value parsing

* Implement content manager transactional method

* Implement sequence field and fix date storage

* Update UniteContentResolver.php

* fix multi reference resolving + field data mapping of empty (but not null!) fields

* Fix embedded empty data problem + geo location fields

* Refactor content events and implement cascade delete / set null + content logging

* Implement isFullyAuthenticated method on user and use it to enable short and long living tokens

* Throw exception if user tries to update field without access

* Implement email change request + refactor email account resolver

* refactor email confirmation resolver (password reset, activation etc.) and implement generic user confirmation token storage

* Start to implement unite admin bundle as a vue SPA

* Start implementing admin navigation component

* Move graphql playground to admin dashboard

* Start implementing domain schema editor

* Refactor schema editor

* add log view with fake entries for the moment

* Start implement content listing + global alert system

* Start defining unite meta information for admin interface

* Extend uikit theme, completely remove graphql playground on unmount

* Implement log view + backend implementation of logger per domain

* Start to connect schema file editor with backend

* Update Schema.vue

* Implement schema editor

* Implement admin view definition by defining @adminView fragments

* Implement adminViewType system with custom directives

* Update AbstractAdminViewType.php

* Clean up demo schema

* Add text documents from old version

* Implement basic admin form for create and update views

* Fix content criteria for deleted content + Manage adminView route states

* Refactor content types with fieldablecontent base interface + implement content meta revisions

* Fix admin height + interface type resolving

* Pass field arguments to field type for resolving + use them in reference_of field

* Fix reference nullable problem + implement choice admin from / list types

* Refactor orm bundle persistence and flushing to make it compatible with doctrine 3 + add first orm bundle test

* Update isNew method on content

* Refactor base entities, fix a bug in isNew add doctrine ORM content manager test

* Fix BaseUser getFieldData, add func. test and auto logout user on network error

* Implement embedded form and list field + refactor form fields

* Persit and Remove ORM content only on flush

* Update ContentResolver.php

* Make sure that nonNull reference fields will always return something

* Start implementing referenceOf admin fields

* Refactor admin views + implement referenceOf field

* Implement admin field type configurators and one for geo location fields (google and algolia)

* Implement basic wysiwyg editor admin field

* Implement mustache titlePattern and small ux improvements

* catch expired exception in isTokenEmptyOrExpired method

* Implement domain parameters

* Implement required directive for soft non_null alternative

* Display validaton and network errors and map it to form fields

* Start to implement email invitation + add default configurable IS_ADMIN expression

* Update ContentTypeManager.php

* Start admin interface implementation of user invite

* Implement user invite action + admin confirm page

* Refactor security to allow all auch actions (like login) etc. without the need to pass a user type

* Fix: resolve false field data as false and not null / default

* Feature/media bundle uploader (#733)

* work on media bundle

* work on media bundle

* work on media bundle

* work on flysystem adapters

* rearrange structure, pass settings to flysystemmanager

* commit bundle dependencies and config

* add some testclass to try out basic things

* restructure bundle add test cases

* Refactor media bundle, remove all not-working code

* Implement media file upload basic implementation for s3

* add some logging and add path style endpoint parameter

* Start to implement media file upload using filePond

* Start implement media file field sith presigned URL upload

* Fix s3 pre-signed url method and work on vue field

* Start to implement real file upload field

* Start to implement: Display and load already uploaded files

* Implement first working draft of file upload

* Fix some upload file bugs for multi field

* Move s3 credentials to .env

* Implement basic file list field

* Refactor npm module loading

* Manage to make installation work from vendor using npm instead of yarn

* Remove autogen. config files

* Delete webpack_encore.yaml

* Delete symfony.lock

* Update composer + add symfony.lock to .gitignore

* Update .env

* Remove some deprecations

* fix some embedded field issues + add media file download plugin

* feature [CoreBundle] [DoctrineORMBundle] Add created / updated fields to content and user

* feature [AdminBundle] Implement setting view + introduce dashboard views + cleanup navigation

* fix [CoreBundle] add required php 7.4 inline if brakets

* add bundle readme files

Co-authored-by: Stefan Kamsker <34944934+stefan-kamsker@users.noreply.github.com>
Co-authored-by: Dirk Arends <45986151+darends@users.noreply.github.com>
Co-authored-by: pspiller <pspiller@users.noreply.github.com>
Co-authored-by: joshua-sharp <47307388+joshua-sharp@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants