* Ensure redirects with domains are stored with the domain node id prefix.
* Handle removal of self-referencing redirect when domains are used.
* Use entity path to save further queries for retrieving ancestor IDs.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Applied refactoring suggested in code review.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Use empty folder under temp as localized text source folder in non umbraco core integration tests.
* Added clarifying comment to the GetLocalizedTextService override for tests
Handles rich text blocks created with TinyMCE in convert local links migration.
Refreshes internal datatype cache following migration requiring cache rebuild.
* Adding fix for self-referncing redirects for 17
* Using umbraco context on failing tests
* Tests to see if self referencing redirects gets deleted
* Refactoring and adding correct tests.
* Expanding tests for RedirectTrackerTests.cs
* Optimize by only retrieving th list of existing URLs for a content item if we have a valid route to create a redirect for.
* Extract method refactoring, added explanatory comment, fixed warnings and formatting.
* Resolved warnings in RedirectService.
* Minor naming and formatting refactor in tests.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Exclude the relate parent on delete relation type from checks for related documents and media on delete, when disable delete with references is enabled.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Applied suggestions from code review.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* sql column type map include dateonly and timeonly
* Split Mapper and add check null value
* Minor code tidy resolving a few warnings.
* add spaces
* clean code
---------
Co-authored-by: Lan Nguyen Thuy <lnt@umbraco.dk>
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Added integration tests for PropertyTypeUsageService and adjusted assert in management API permissions test.
* Commented or fixed management API integration tests verifying permissions where we were asserting on an error response.
* Add MoveFile it IFileSystem and implement on file systems.
* Rename media file on move to recycle bin.
* Rename file on restore from recycle bin.
* Add configuration to enabled recycle bin media protection.
* Expose backoffice authentication as cookie for non-backoffice usage.
Protected requests for media in recycle bin.
* Display protected image when viewing image cropper in the backoffice media recycle bin.
* Code tidy and comments.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Introduced helper class to DRY up repeated code between image cropper and file upload notification handlers.
* Reverted client-side and management API updates.
* Moved update of path to media file in recycle bin with deleted suffix to the server.
* Separate integration tests for add and remove.
* Use interpolated strings.
* Renamed variable.
* Move EnableMediaRecycleBinProtection to ContentSettings.
* Tidied up comments.
* Added TODO for 18.
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Make the RTE treat an "empty" value as a non-value
* Additional tests
* Add tests for invariant and variant content.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Remove unused help controller
* Correct documentation links
* Link to the new release site for compares
* Remove unused translation key with reference to Our
* Update NoNodes / NotFound to point to the forum instead of Our
* Change dashboards form Our to Forum and de-emphasize Discord as a support channel
* Removes Help controller reference
* Forgot to rename the css Id
* Update src/Umbraco.Web.UI.Client/src/assets/lang/ar.ts
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix typo in Community Forum help menu item name
* Refer to releases instead of a download page
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Update the default dashboard with better content and clearer headings
* Obsolete the HelpController instead
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Added check to only find .css files in FileSystemTreeServiceBase.cs
* Marking GetFiles as virtual and overriding it in StyleSheetTreeService.cs to only find .css files
* Redone tests to fit new format
* Fix tests to use file extensions
* Adding file extensions to all other relevant tests
* Adding file filter to remaining trees
* Adding tests to ensure invalid filetypes wont show
* Encapulation and resolved minor warnings in tests.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Added check to only find .css files in FileSystemTreeServiceBase.cs
* Marking GetFiles as virtual and overriding it in StyleSheetTreeService.cs to only find .css files
* Redone tests to fit new format
* Fix tests to use file extensions
* Adding file extensions to all other relevant tests
* Adding file filter to remaining trees
* Adding tests to ensure invalid filetypes wont show
* Encapulation and resolved minor warnings in tests.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Be consistent in use of GetOrCreateAsync overload in exists and retrieval.
Ensure nullability of ContentCacheNode is consistent in exists and retrieval.
* Applied suggestion from code review.
* Move seeding to Umbraco application starting rather than started, ensuring an initial request is served.
* Tighten up hybrid cache exists check with locking around check and remove, and use of cancellation token.
(cherry picked from commit 81a8a0c191)
* Be consistent in use of GetOrCreateAsync overload in exists and retrieval.
Ensure nullability of ContentCacheNode is consistent in exists and retrieval.
* Applied suggestion from code review.
* Move seeding to Umbraco application starting rather than started, ensuring an initial request is served.
* Tighten up hybrid cache exists check with locking around check and remove, and use of cancellation token.
* Store local time zone as UTC and do not throw validation error when stored time zone is different
* Additional fixes when switching between date time editors with and without time zone
* Additional fixes
* Ensure that an update is triggered when the expected value does not match the stored value
This will happen when switching between editors (with and without time zone) or switching between a specific time zone to the editor's local time zone.
* Fix inconsistencies with null and undefined
* Fix inconsistencies between date/time provided to the client and returned in the value converter (when switching between editors)
* Fix unit tests and small bug
* Adjust integration test
* Small improvement
* Update test data
* Adjust logic so that time zone offsets are updated every time the date value changes
* Do not pre-select time zone when switching between unspecified and time zone editors
* Introduce configurable batch size for indexing
* Stop using Examine indexing events for reporting index rebuild operation completeness (it is volatile)
* Added request caching to media picker media retrieval, to improve performance in save operations.
* WIP: Update or insert in bulk when updating property data.
* Add tests verifying UpdateBatch.
* Fixed issue with UpdateBatch and SQL Server.
* Removed stopwatch.
* Fix test on SQLite (failing on SQLServer).
* Added temporary test for direct call to NPoco UpdateBatch.
* Fixed test on SQLServer.
* Add integration test verifying the same property data is persisted as before the performance refactor.
* Log expected warning in DocumentUrlService as debug.
(cherry picked from commit 12adfd52bd)
* Added request caching to media picker media retrieval, to improve performance in save operations.
* WIP: Update or insert in bulk when updating property data.
* Add tests verifying UpdateBatch.
* Fixed issue with UpdateBatch and SQL Server.
* Removed stopwatch.
* Fix test on SQLite (failing on SQLServer).
* Added temporary test for direct call to NPoco UpdateBatch.
* Fixed test on SQLServer.
* Add integration test verifying the same property data is persisted as before the performance refactor.
* Log expected warning in DocumentUrlService as debug.
* V16: Cache Version Mechanism (#19747)
* Add RepositoryCacheVersion table
* Add repository
* Add Cache version lock
* Add GetAll method to repository
* Add RepositoryCacheVersionService
* Remember to add lock in data creator
* Work my way out of constructor hell
This is why we use DI folks. 🤦
* Add checks to specific cache policies
* Fix migration
* Add to schema creator
* Fix database access
* Initialize the cache version on in memory miss
* Make cache version service internal
* Add tests
* Apply suggestions from code review
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Add missing obsoletions
* Prefer full name
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* fixed merge
* V16/feature/move last synced id to db (#19884)
* Foundation work for moving last synced id
* register manager and repo in dependency injection
* Fixing to make tests work
* Replacing the use of the old LastSyncedFileManager.cs with the new LastSyncedManager.cs
* Testing to delete out of sync id and old entries
* changing some stuff to please the reviewer.
* Inverted saving methods id check and fixed documentation mishaps
* Loadbalancing: Add Cache Sync service to allow us to roll forward isolated caches when backoffice is load balanced. (#20398)
* Split cache refreshers into internal and external caches
* Add obsolete constructor for CacheInstructionsPruningJob
* Add xml docs
* Move lastID management into CacheInstructionService
* Cache last synced ids in memory
* Lock when processing instructions
* Sync caches when out of sync
* Fix constructors for ICacheSyncService
* Cache version on request
* Register caches as synced when instructions are processed
* Rename CacheVersionAccessor to IRepositoryCacheVersionAccessor
* Set caches as synced before actually syncing the caches
* Set caches as synced before syncing, within scope, this should also lock the cache version from being written to whilst updating caches
* Only check version for backoffice requests
* Clear request cache when caches are syned
* Default to using NOOP cache version service
* Don't generate local identity in database server messenger anymore
* Fix ambiguous constructor
* Add helper method to switch to load balanced isolated caches
* Fix LastSyncedManagerTests
* Fix RepositoryCacheVersionServiceTests
* Fix DefaultCachePolicyTests
* Use correct constructor in FullDataSetRepositoryCachePolicy
* Minor cleanup
* Add XML docs
* Add more xml docs
* Apply suggestions from code review
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
---------
Co-authored-by: Zeegaan <skrivdetud@gmail.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
* Fix migration plan
* fix tests
* Fix integration tests
* Fix changes from github review
* Move premigrations to v17
* Make lock constantws sequential
* Fix comment
* Make IRepositoryCacheVersionService and ICacheSyncService protected on EntityRepositoryBase
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Nicklas Kramer <nik@umbraco.dk>
Co-authored-by: NillasKA <kramernicklas@gmail.com>
Co-authored-by: Zeegaan <skrivdetud@gmail.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
* Serverside generated preview URLs
* Add URL provider notation to UrlInfo
* Change preview URL generation to happen at preview time based on provider alias
* Update XML docs
* Always add culture (if available) to preview URL
* Do not log user input (security vulnerability)
* Fix typo
* Re-generate TypeScript client
from Management API
* Deprecated `UmbDocumentPreviewRepository.enter()` (for v19)
Fixed TS errors
Added temp stub for `getPreviewUrl`
* Adds `previewOption` extension-type
* Adds "default" `previewOption` kind
* Relocated "Save and Preview" workspace action
reworked using the "default" `previewOption` kind.
* Added stub for "urlProvider" `previewOption` kind
* Renamed "workspace-action-default-kind.element.ts"
to a more suitable filename.
Exported element so can be reused in other packages,
e.g. documents, for the new "save and preview" feature.
* Refactored "Save and Preview" button
to work with first action's manifest/API.
* Reverted `previewOption` extension-type
Re-engineered to make a "urlProvider" kind for `workspaceActionMenuItem`.
This is to simplify the extension point and surrounding logic.
* Modified `saveAndPreview` Document Workspace Context
to accept a URL Provider Alias.
* Refactored "Save and Preview" button
to extend `UmbWorkspaceActionElement`.
This did mean exposing certain methods/properties to be overridable.
* Used `umbPeekError` to surface any errors to the user
* Renamed `urlProvider` kind to `previewOption`
* Relocated `urlProviderAlias` inside the `meta` property
* also throw an error
* Added missing `await`
* Fix build errors after forward merge
---------
Co-authored-by: leekelleher <leekelleher@gmail.com>
Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
Co-authored-by: Laura Neto <12862535+lauraneto@users.noreply.github.com>
Fix failing SQLServer integration tests
Adjusted the tests so that the created content is retrieved again after creation, instead of using the returned IContent.
This is needed because SQLServer, when using datetime, rounds to the closest .000, .003, or .007, which would cause the comparisons to fail.
We should consider moving away from datetime to datetime2, as the former should be avoided according to Microsoft.
https://learn.microsoft.com/en-us/sql/t-sql/data-types/datetime-transact-sql?view=sql-server-ver17
* Ports fix to regression of the caching of null representations for missing dictionary items.
* Fixed error raised in code review.
---------
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
* Retrieve only ISO codes from the database rather than full language objects if that's all we need.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Removed repository updates and migrated the new service method to an extension method.
* Fixed issue after merge.
* Removed left-over using
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
* Add migration to create missing tabs
In v13, if a tab had groups in both a composition and the content type, the tab might not exist on the content type itself.
Newer versions require such tabs to also exist directly on the content type. This migration ensures those tabs are created.
Also fixes an issue in LeftJoin where nested sql arguments were being discarded.
* Small fixes
* WIP: Integration test.
* Added asserts to show the current issue with the integration test.
* Adjusted the integration test
* Added logging of result. Minor re-order and extraction refactoring in integration test.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Started the implementation of the new date time property editor
* Display picked time in local and UTC
* Adjustments to the way the timezones are displayed and the picker is configured
* Filter out `Etc/` (offset) timezones from the list
* Additional adjustments
* Introduced date format and time zone options (all, local or custom)
* Adjustments to the property editor configuration and value converter
* Use UUICombobox instead of UUISelect for displaying time zone options. Display UTC offset instead of short offset name in label.
* Allow searching by offset
* Ignore case when searching for time zone
* Store dates consistently (always same format)
* Add custom PropertyIndexValueFactory for the new property editor
* Adjustments when switching between time zone modes
* Small fixes and cleanup
* Started improving time zone config selection
* Small adjustments
* Remove selected time zones from the list + display label instead of value
* Localizing labels
* Remove unwanted character
* Fix incorrect order of custom time zones list
* Small fixes (mostly validation)
* Rename input time zone component
* Small adjustments
* Using model for stored value
* Save examine value as ISO format
* Adjusting class names for consistency
* Small fixes
* Add default data type configuration
* Rename `TimeZone` to `UmbTimeZone`
* Fix failing tests
* Started adding unit tests for DateWithTimeZonePropertyEditor
* Additional tests
* Additional tests
* Additional tests
* Fixed searches with regex special characters throwing errors
* Remove offset from generic UmbTimeZone type and added new type specific for the property editor
* Adjust property editor to show error when selected time zone is no longer available, instead of pre-selecting another one
* Do not preselect a time zone if a date is stored without time zone
This most likely means that the configuration of the editor changed to add time zone support. In this case we want to force the editor to select the applicable time zone.
* Fix failing backoffice build
* Added tests for DateTimeWithTimeZonePropertyIndexValueFactory
* Improved picker validation
* Remove unused code
* Move models to their corresponding places
* Renaming `DateTimeWithTimeZone` to `DateTime2`
* Fix data type count tests
* Simplifying code + adjusting value converter to support old picker value
* Adjustments to property editor unit tests
* Fix validation issue
* Fix default configuration for 'Date Time (Unspecified)'
* Rename validator
* Fix comment
* Adjust database creator default DateTime2 data types
* Update tests after adjusting default data types
* Add integration test for DateTime2 returned value type
* Apply suggestions from code review
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Aligning DateTime2Validator with other JSON validators. Added new model for API.
* Removed unused code and updated tests
* Fix validation error message
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Splitting the new date time editor into multiple (per output type)
* Adjust tests in DateTime2PropertyIndexValueFactoryTest
* Update value converter tests
* Group the new date time tests
* Adjust new property editor tests
* Adjust property editor integration tests
* Update data editor count tests
* Naming adjustments
* Small fixes
* Cleanup
- Remove unused files
- Remove 'None' option from configuration and update all the tests
* Update luxon depedencies
* Move GetValueFromSource to the value converter
* Add new property editor examples to mock data
* Re-organizing the code
* Adjustments from code review
* Place the date time property index value factories in their own files
* Small adjustments for code consistency
* Small adjustments
* Minor adjustment
* Small fix from copilot review
* Completed the set of XML header comments.
* use already existing query property
* fail is form control element is null or undefined
* using lit ref for querying and form control registration
* state for timeZonePickerValue and remove _disableAddButton
* Adjustments to form control registration
* Remove unused declaration
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
* Improve GetManagementApiUrl to use the globally defined default version if not specified on the controller
* Add a test to check logic introduced in #20083
* Update tests/Umbraco.Tests.Integration/ManagementApi/Trees/DocumentTypeSiblingControllerTests.cs
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Update tests/Umbraco.Tests.Integration/ManagementApi/Trees/DocumentTypeSiblingControllerTests.cs
Co-authored-by: Andy Butland <abutland73@gmail.com>
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
* Adding member types sibling endpoints
* Introducing sibling endpoint for Partial Views and logic.
* Introducing sibling endpoint for stylesheets
* Introducing sibling endpoint for scripts
* Introducing FileSystemTreeServiceBase.cs
* Introducing interfaces for implementation specific services
* Introducing services for specific trees
* Modifying controller bases to fit new interface and logic.
* Obsoleting old constructors related to PartialView
* Obsoleting ctors related to Stylesheets
* Obsoleting ctors related to scripts
* Adding tests for scriptsTreeService
* Adding tests for siblings
* Removing unused dependencies
* Removing signs and replacing it with flags
* Fixing breaking changes by obsoletion
* Fixing more breaking changes
* Registering missing service
* Fixing breaking changes again
* Changing name of method GetSiblingsViewModels
* Rewritten tests for less bloat and less duplicate code
* Expanding tests to include other methods from service
* Test refactoring: avoided populating file systems that weren't under test, updated encapsulation, renaming, further re-use.
* Management API: Expanding the existing sibling endpoints to support trashed entities (#20154)
* Refactoring existing logic to include trashed items
* Including tests for trashed entities
* Groundwork for trashed siblings
* Documents trashed siblings endpoint
* Controller for Media trashed items
* Expanding tests to include a test for trashed siblings
* Code review corrections
* Resolving code review
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
Reworks update of user groups on a user by updating in place rather than deleting and re-adding.
Ensure user groups affected by the update are invalidated in the repository cache.
Co-authored-by: Kenn Jacobsen <kja@umbraco.dk>
* fix sql syntax issues
* unify all dtos, fix autoIncrement for NPoco.Insert and .BulkInsert
* fix Copilot review comments
* fix sql syntax in TrackedReferencesRepository.GetPagedDescendantsInReferences()
* remove changes in TemplateServiceTests
* Tweaks and fixes from first review.
* Reverted changes outside scope of PR.
* Use FirstOrDefault over SelectTop.
* Fix delete member issue.
* Fixed issue with create of webhooks.
* Reverted changes to default data install.
* Removed unused method.
* Rationalised use of quoting helpers.
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix nullability issue.
---------
Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>