* PropertyType constructor sets the DataTypeKey if passed IDataType has identity
* Updated unit tests to verify behaviour.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Display the latest update date in document collection view
* Don't consider "" as a missing option when initializing the drop down list.
* Don't flag "" as a missing option when validatng server-side.
---------
Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
* Directly convert from double or float when possible. Also fixes string parsing to work on all cultures. Fixes#20214
* Added unit tests to verify behaviour.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Initial implementation of non existing property editor
* Adjust `MissingPropertyEditor` to not require registering in PropertyEditorCollection
* Add `MissingPropertyEditor.name` back
* Remove unused dependencies from DataTypeService
* Removed reference to non existing property
* Add parameterless constructor back to MissingPropertyEditor
* Add validation error on document open to property with missing editor
* Update labels
* Removed public editor alias const
* Update src/Umbraco.Web.UI.Client/src/packages/property-editors/missing/manifests.ts
* Add test that checks whether the new MissingPropertyEditor is returned when an editor is not found
* Also check if the editor UI alias is correct in the test
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Share property editor instances between properties
* Only store missing property editors in memory in `ContentMapDefinition.MapValueViewModels()`
* Add value converter for the missing property editor to always return a string (same as the Label did previously)
* Small improvements to code block
* Adjust property validation to accept missing property editors
* Return the current value when trying to update a property with a missing editor
Same logic as for when the property is readonly.
* Fix failing unit tests
* Small fix
* Add unit test
* Remove client validation
* UI adjustments
* Adjustments from code review
* Adjust test
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Renaming the providers, collection builder and model
* Renaming the items using signs
* Renaming in controllers
* Renaming mapping flags
* Renaming sign tests to flags
* Changing the test files names from signs to flags
* Updated a couple more references.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Support querystring and anchor for local links in Delivery API output (#20142)
* Support querystring and anchor for local links in Delivery API output
* Add default implementation for backwards compat
* Add default implementation for backwards compat (also on the interface)
* Fix default implementation
* Add extra tests proving that querystring/postfix can be handled for local links in both legacy and current format.
* Adding a check to see if the posted value's source path isn't null or empty.
* Moving validation logic to proper files
* Moved logic to a required validator
* Adding tests to ensure validation works
* Minor tidy up: XML header comments, re-use in tests, clarified test names.
* Adding unit tests for file upload validation
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Adding signs to variants and adjusting HasPendingChangesSignProvider.cs
* HasPendingChangesSignProvider.cs now populates variants & refactoring to move logic to DocumentPresentationFactory.cs
* Working HasScheduleSignProvider.cs to provide variant signs
* Refactoring ISignProvider.cs to take an IEnumerable again
* Moving code from controllers to factories
* Refactoring HasPendingChangesSignProvider.cs to use the right Interface method
* Refactoring HasScheduleSignProvider.cs to be less bloated, and more readable (hopefully)
* Refactoring tests to look at variants and include a list
* Changing instantiation to be better
* Fixed minor logic issue in HasScheduleSignProvider.cs
* Refactoring to include just 1 database call.
* Adjusting tests to use the new methods.
* Reverted breaking changes
* Converting DateTime.MinValue to sqlDateTime's minimum value
* Changing code to be a bit less hacky
* Changing hard coded value to a variable based on SqlDateTime
* Removing unused code
* Moving date converter logic to DateTimePropertyEditor.cs
* Replacing tests with proper version
* Removing unused import
* Removing unused imports again
* Creating new logic, to ensure formatting is more precise.
* Rewriting tests to be more precise and include testing on odd format separators
* Used parsing to determine timeonly date picker data type configuration format.
Fixed casing on key for data type configuration format.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Changed to use TryParse
* Changed to be a null check instead
* Update to "is false" syntax and add unit tests.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Create sign provider collection and call registered providers on rendering a page of tree item view models.
Re-work tree controller constructors to provide registered providers as a collection.
* Stub implementation of sign provider for documents with a scheduled publish pending.
* Complete implementation of tree sign for pending scheduled publish.
* Added integration test for new method on IContentService.
* Added unit test for HasScheduleSignProvider.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Tidied usings and clarified method header comments.
* Adding a fixed prefix to all future signs, and removing the provider property
* Adding a sign for protected tree documents.
* Adding IsProtectedSignProviderTest.cs & correcting HasScheduleSignProviderTests.cs to no longer assert the provider
* Fixing minor things in accordance with CR
* Adding collection items compatibility
* Introduced IHasSigns interface to provide more re-use across trees and collections.
Fixed updates to base content controllers (no need to introduce a new type variable).
Removed passing entities for populating tree signs (we aren't using it, so simplifies things).
* Refactoring a bit to make existing code less duplicated and fixing some constructor obsoletion
* Introducing a has pending changes sign.
* Applying changes based on CR
* Introducing tests for HasPendingChangesSignProvider.cs and stopped the use of contentService
* Introducing tests for HasPendingChangesSignProvider.cs and slight logic change
* Introduced HasCollectionSignProvider.cs and tests.
* Introducing collection signs to Media Tree & Media Collection items
* Introducing Plain Items and tests. Refactoring tests as well
* Introduced alternative CanProvideSigns() implementation on IsProtectedSignProvider.cs
* Slight refactoring to reduce bloating.
* Adding [ActivatorUtilitiesConstructor] since it threw an error otherwise
* Minor cleanup.
* Updated OpenApi.json.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: NillasKA <kramernicklas@gmail.com>
* fix some test which are not running
* resolve code review comments
* Moved cleaned up tests to unit tests (as they are unit tests, not integration tests).
Removed tests marked as no longer necessary.
Update tests name to better reflect test case.
* Made explict test faster so it could run on the pipeline.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Added configuration option UseStrictDomainMatching, which allows control over whether content is routed without a matching domain.
* Fixed typo in comment.
* Addressed comments from code review.
* Optimize document and media seeding by looking up from database in batches.
* Ensure null values aren't stored in the cache when checking existance.
* Fixed failing integration tests.
* Resolved issue with not writing to the L1 cache on an L2 hit.
* Tidied up and populated XML header comments.
* Address issue raised in code review.
* Adds support for the "folders only" flag on retrieving siblings of a node.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Updated test code.
* Removed double secondary ordering by node Id and ensured we include this clause for all sort orders.
* Ensure that ordering by node Id is always added only once and last, and only if it's not already been included in the order by clause.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Provides an abstraction for creating the JavaScriptEncoder used in SystemTextConfigurationEditorJsonSerializer.
* Generalised JSON serialization encoder factory to work for all System.Tex.Json serializers.
Added the serializer's name as a parameter to allow for different encodings per serializer if required.
* Fixed tests by removing use of obsolete constructors.
* Removed name parameter and used a generic type instead.
* Added user start node restrictions to sibling endpoints.
* Further integration tests.
* Tidy up.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert previous update.
* Retrieves item counts before and after the target for sibling endpoints and returns in API response.
* Applied previous update correctly.
* Removed blank line.
* Fix build and test asserts following merge.
* Update OpenApi.json.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: mole <nikolajlauridsen@protonmail.ch>
* Cleanup obsoleted methods
* Add a way to disable UmbracoFile default sink
* Abstract LogViewService so only UmbracoFile sink related things are in the default interface implementation.
* Abstract LogViewRepository so only UmbracoFile sink related things are in the default interface implementation.
* Move GetGlobalLogLevelEventMinLevel to base
* Removed unused internal class and obsoleted its base
* Added missing XML header comments and resolved warnings in service and repository classes.
* Made private method static.
* Addressed issues raised in code review.
* Expose repository from the service base class.
* Restored further obsoleted code we can't remove yet.
* Removed log viewer tests on removed class. We have integration tests for the new service.
* Obsoleted ILogViewer interface.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Started implementing new LongRunningOperationService and adjusting tasks to use this service
This service will manage operations that require status to be synced between servers (load balanced setup).
* Missing migration to add new lock. Other simplifications.
* Add job to cleanup the LongRunningOperations entries
* Add new DatabaseCacheRebuilder.RebuildAsync method
This is both async and returns an attempt, which will fail if a rebuild operation is already running.
* Missing LongRunningOperation database table creation on clean install
* Store expire date in the long running operation. Better handling of non-background operations.
Storing an expiration date allows setting different expiration times depending on the type of operation, and whether it is running in the background or not.
* Added integration tests for LongRunningOperationRepository
* Added unit tests for LongRunningOperationService
* Add type as a parameter to more repository calls. Distinguish between expiration and deletion in `LongRunningOperationRepository.CleanOperations`.
* Fix failing unit test
* Fixed `PerformPublishBranchAsync` result not being deserialized correctly
* Remove unnecessary DatabaseCacheRebuildResult value
* Add status to `LongRunningOperationService.GetResult` attempt to inform on why a result could not be retrieved
* General improvements
* Missing rename
* Improve the handling of long running operations that are not in background and stale operations
* Fix failing unit tests
* Fixed small mismatch between interface and implementation
* Use a fire and forget task instead of the background queue
* Apply suggestions from code review
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Make sure exceptions are caught when running in the background
* Alignment with other repositories (async + pagination)
* Additional fixes
* Add Async suffix to service methods
* Missing adjustment
* Moved hardcoded settings to IOptions
* Fix issue in SQL Server where 0 is not accepted as requested number of rows
* Fix issue in SQL Server where query provided to count cannot contain orderby
* Additional SQL Server fixes
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Return 404 on delivery API requests for segments that are invalid or not created.
* Handled case with no segmented properties.
* Let the property decide if it has a value or not
---------
Co-authored-by: kjac <kja@umbraco.dk>
* Add a backing field for EditorUIAlias and track changes when its set.
* Add previously failing unit test to verify fix.
* Aligned backing field casing with property name.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Pass notification state to cache refreshers.
Pass previous user name into member saved notification state and use when refreshing cache to clear the member by keys based on this.
* Fixed issue raised in code review.
* Fixed casing for state key.
* Added removed parameter to unit tests.
* Fix breaking change.
* PoC implementation
* Move to controller base
* Implement solution that seems worse, but works better
* Don't require parent key in repository method
* Fix typos
* Add siblings for data type, media type and media
* Add endpoint for template
* Add DocumentType and DocumentBlueprint controllers
* Fix naming
* Fix case if siblings are under root
* Take item ordering into account
not all entities are ordered by sort order
* Add default implementation
* Fix parentkey
* Add tests
* Format optimizations for split view
* Add test covered requirement to description
* Cover positive case and make test case output more readable
* reduce allocations
* Clarify test
---------
Co-authored-by: Migaroez <geusens@gmail.com>
* Passes the preview flag to the cache retrieval when resolving the delivery API object for the MNTP property editor.
* Added unit test verifying fix and adjusted mocks for tests to acoomodate.
* Provided preview flag for Razor rendering.
* Fix for https://github.com/umbraco/Umbraco-CMS/issues/18872
* Parsing added for current value
* Build fix.
* Cyclomatic complexity fix
* Resolved breaking change.
* Pass content key.
* Simplified collections.
* Added unit tests to verify behaviour.
* Allow file upload on block list.
* Added unit test verifying added property.
* Added unit test verifying removed property.
* Restored null return for null value fixing failing integration tests.
* Logic has been updated according edge cases
* Logic to copy files from block list items has been added.
* Logic to delete files from block list items on content deletion has been added
* Test fix.
* Refactoring.
* WIP: Resolved breaking changes, minor refactoring.
* Consistently return null over empty, resolving failure in integration test.
* Removed unnecessary code nesting.
* Handle distinct paths.
* Handles clean up of files added via file upload in rich text blocks on delete of the content.
* Update src/Umbraco.Infrastructure/PropertyEditors/FileUploadPropertyEditor.cs
Co-authored-by: Sven Geusens <geusens@gmail.com>
* Fixed build of integration tests project.
* Handled delete of file uploads when deleting a block from an RTE using a file upload property.
* Refactored ensure of property type property populated on rich text values to a common helper extension method.
* Fixed integration tests build.
* Handle create of new file from file upload block in an RTE when the document is copied.
* Fixed failing integration tests.
* Refactored notification handlers relating to file uploads into separate classes.
* Handle nested rich text editor block with file upload when copying content.
* Handle nested rich text editor block with file upload when deleting content.
* Minor refactor.
* Integration test compatibility supressions.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Sven Geusens <geusens@gmail.com>
* Assert dates in content editing integration tests to millisecond only.
* Add date time extension unit tests and refactor to switch statement.
* Removed whitespace.
* v16 cherry pick of member partial cache invalidator see #19314
# Resolved merge conflic in src/Umbraco.Core/Cache/Refreshers/Implement/MemberCacheRefresher.cs
* Take nullmember cacheitems into account
* Thow if attempting to use the default unique media path scheme with version 7 GUIDs.
* Expanded unittests, fixed null params, chose a better exception
* Use parameters in test.
---------
Co-authored-by: Migaroez <geusens@gmail.com>
* Removes unnecessary newlines from rich text as JSON delivery API output.
* Fix case from PR feedback.
# Conflicts:
# src/Umbraco.Infrastructure/DeliveryApi/ApiRichTextElementParser.cs
# tests/Umbraco.Tests.UnitTests/Umbraco.Core/DeliveryApi/RichTextParserTests.cs
* Fix for invalid state in JsonBlockValueConverter when an unused layout has a nested array
* Improved comments as suggested by copilot review, also fixed code style miss
* Added check for malformed JSON with more closing array tokens then opening tokens
* fix: split attribute regex into two to be able to ignore the order of attributes
* the regex should not care for the ending of the tag
* test: adds test cases to test order of attributes
* remove image sources using new regex
* adds more documentation
* adds test cases to test removal of source with and without parameters
* test for null value
* test: adds more cases for null and reversed parameters
* Cherry-pick from 13 and adjust.
* Resolve circular dependency references and clear OpenIddict tokens on purging sessions associated with removed login providers.
* Removed out of date comment.
* Removed incorrect casing update for SQLite.
* Added logging and try/catch around retrieval of references, so we don't block critical operations following an incompatible data type change.
* Added a little more detail to the log message.
* Added a little more detail to the log message.
* Fix unittest mock dependency
---------
Co-authored-by: Migaroez <geusens@gmail.com>
* Ensures cultures set on content are correctly cased and verifies with integration tests.
* Improved test comments.
* Move culture casing check into an extension method and use from content service.
* Deduplicated test code and added more test cases
* Only run invalid culture codes test on Windows
---------
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>