Commit Graph

15 Commits

Author SHA1 Message Date
Nikolaj Geisle
d5809da665 V14: Move towards get guid (#15889)
* Implement using keymap for member

* Remove current usages of GetUserById

* User userId resolver to resolve user key

* Refactor user repository to use GUID not int

* Add happy path test

* Remove user in cache when user gets updated

* Use await in async method

* Fix up according to review

* Update IMetricsConsentService.cs to have async method

* Fix according to review

* Fix more according to comments

* Revert "Fix up according to review"

This reverts commit a75acaaa

* Get current backoffice user from method

* Update user repository delete functionality

* Fix up more test

* Try to get user by id if key fails

* Add user key as required claim

* Fix tests

* Don't set claim in BackofficeController

* Create constant for the Sub claim

---------

Co-authored-by: kjac <kja@umbraco.dk>
2024-04-11 13:53:34 +02:00
Mole
9cb1d66b10 V14: Remove Newtonsoft from packed projects (#15811)
* Migrate ObjectJsonExtensions

* Use more generic exception to not use Newtonsoft

It should matter if it's a JsonReaderException, if we can't read we can't read

* Remove obsoleted constructors

* Use more generic exception in ContentValueSetBuilder

* Fix constructors

* Remove UdiRangeJsonConverter

* Remove more legacy newtonsoft stuff

* Migrate away from newtonsoft in CacheInstructionService

* Remove unused model binders

* Remove more newtonsoft

* Remove newtonsoft from DatabaseServerMessenger

* Remove now irrelevant benchmark

* Remove the usage of Newtonsoft from ImageCropperTemplateCoreExtensions

The value converter will never return JObject, JsonDocument, or JsonNode

* Remove usages of newtonsoft in ComplexPropertyEditorContentNotificationHandler

JTokens are no longer returned, so we don't need to check for it

* Remove newtonsoft references

* Re-add newtonsoft dependency to Umbraco.Tests.Common

* Fix package references

* move dependency

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-03-01 12:51:21 +01:00
Bjarke Berg
22b2f79d15 Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Common/DependencyInjection/UmbracoBuilderApiExtensions.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Infrastructure/CompatibilitySuppressions.xml
#	src/Umbraco.Web.Common/Profiler/WebProfiler.cs
2023-06-21 09:06:42 +02:00
Ronald Barendse
c989c5e214 Support publishing multiple notifications, filter on handler type and add IDistributedCacheNotificationHandler<TNotification> (optimizes cache refreshers) (#14332)
* Clean up DistributedCache and add additional checks

* Add IEnumerable overloads to DistributedCacheExtensions

* Update handlers to use new IEnumerable overloads

* Move DistributedCacheExtensions to Core

* Restructure cache refreshers into folders

* Add IDistributedCacheNotificationHandler

* Rewrite DistributedCacheBinder into seperate IDistributedCacheNotificationHandler implementations

* Obsolete DistributedCacheBinder and use new IDistributedCacheHandler implementations

* Clean up ServerMessengerBase

* Ensure cache refreshers only process distinct values

* Add support for publishing multiple notifications and filter on handler type

* Suppress compatibility issues

* Remove DistributedCacheBinder and suppress compatibility issues

* Add ScopedNotificationPublisher<TNotificationHandler>

* Improve notification type lookup/enumeration

* Ensure INotificationAsyncHandler handles multiple notitications sequentially

* Minimize cache instruction JSON

* Chunk notifications by type to keep publish order

* Only serialize required RefreshInstruction properties
2023-06-20 11:15:47 +02:00
Nikolaj Geisle
93da4371e3 V13: Rework attempt pattern to use userkey (#13964)
* Add default super user key to migrations

* Start refactoring all interfaces signatures with ids

* Refactor datatype service to use userKey pattern instead

* Refactor ContentEditingService to use userkeys

* Refactor services to userKey

* Refactor more services to use userkey instead of id

* Refactor RelationService to use userKeys

* Refactor template service to use keys instead of ids

* Refactor fileservice to use keys instead of ids

* Refactor LocalizationService to use keys instead of ids

* Refactor PackagingService to use keys instead of ids

* Refactor TemplateController to use current user keys

* Refactor DataTypeContainerService.cs

* Refactor DataTypeService to use keys instead of ids

* Fix up tests

* Fix up media editing service to use userkey instead of ID

* Update service ctor to avoid ambigious ctors

* refactor DataTypeService

* Refactor DataTypeService to not have a default value for parentKey

* Apply suggestions from code review

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>

* Update comment

* Add suppression file

* Add backoffice CompatibilitySuppressions

---------

Co-authored-by: Zeegaan <nge@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2023-03-21 12:41:20 +01:00
Kenn Jacobsen
8caee5297b Use ISO codes instead of language IDs for fallback languages and translations (#13751)
* Use language ISO code for language fallback instead of language ID

* Remove language and language ID from dictionary item and dictionary item translation

* ADd unit test for dictionary item translation value extension

* Make the internal service implementations sealed

* Rename translation ISO code to be more explicit in its origin (Language)

* Add breaking changes suppression

* Handle save of invalid fallback iso code

* Fixed test

* Only allow non-UserCustomCulture's

* Fixed and added tests

* Rename ISO code validation method

* Fix language telemetry test (create Swedish with the correct ISO code)

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2023-02-01 09:37:37 +01:00
Kenn Jacobsen
0297152249 Split localization service into dedicated services (#13731)
* Rework language service and API

* Revert unintended commit of Directory.Build.props

* Create OS conditional test for invalid ISO codes

* Reintroduce and obsolete old Delete method on ILocalizationService + make new Delete method delete by ISO code + add obsoletion attrs to service implementation

* Review comments + utilize new Delete method

* Do not allow model reuse when creating a new language

* Fix bad merge

* Split localization service into dedicated services for language and dictionary item handling

* Replaced ILocalizationService usage in management API (as much as can be done for now)

* Ensure we can create dictionary items with explicit keys (but no duplicates)

* Fix culture controller so it works properly with pagination

* Update OpenAPI JSON

* Actually update the language being updated...

* Unit test for invalid ISO now no longer needs to differ between OS :)

* A little bit of code health improvements

* A litte less code duplication

* Remove duplicate validation
2023-01-26 13:34:11 +01:00
Kenn Jacobsen
ff2d90d775 Rework dictionary CRUD operations (#13688)
* Rework dictionary CRUD operations

* Update OpenAPI json

* Move responsibility to localization service, introduce new attempt pattern for create and update operations, update unit tests accordingly

* Fix merge

* Rollback assumption that we can map entities from scratch (entity relations got in the way)

* Update OpenAPI JSON

* Add breakage supressions

* Add compat suppressions for integration test project

* Make dictionary item deletion follow same pattern as create and update

* Review comments + update delete to use new pattern

* Update breakage suppressions to match the new Delete method
2023-01-20 13:40:24 +01:00
Nikolaj Geisle
7aeb400fce V10: fix build warnings in test projects (#12509)
* Run code cleanup

* Dotnet format benchmarks project

* Fix up Test.Common

* Run dotnet format + manual cleanup

* Run code cleanup for unit tests

* Run dotnet format

* Fix up errors

* Manual cleanup of Unit test project

* Update tests/Umbraco.Tests.Benchmarks/HexStringBenchmarks.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Integration/Testing/TestDbMeta.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Benchmarks/TypeFinderBenchmarks.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Update tests/Umbraco.Tests.Integration/Umbraco.Core/Events/EventAggregatorTests.cs

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>

* Fix according to review

* Fix after merge

* Fix errors

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
Co-authored-by: Zeegaan <nge@umbraco.dk>
2022-06-21 08:09:38 +02:00
Ronald Barendse
f00bfc408e v10: Make language name editable (#12243)
* Update language models to get and set manual name

* Save custom language name in controller

* Rewrite AngularJS language edit view and controller

* Cleanup language overview

* Remove icon from language overview

* Make styling of control group the same as properties

* Ensure both ISO code and culture name are set in language model

* Use new language model constructor

* Update tests to use new language constructor

* Update culture name in dictionary package export

* Use language name in dictionary

* Fix language nullability issues

* Cleanup GetAllCultures and added null checks

* Re-add obsolete constructors

* Make language name required and update Cypress test

* Fix routing/saveNewLanguages Cypress test

* Make language name optional (improved backwards compatibility)

Co-authored-by: Ronald Barendse <ronald@panoramastudios.nl>
2022-05-02 15:42:19 +02:00
Paul Johnson
95aa143db0 v10 make migration from v9 less painful WRT IScope (#12293)
* Restore IEventDispatcher

* Fix breaking changes WRT IScopeProvider and IScope

* Update internal usage.

* Update src/Umbraco.Core/Services/UserService.cs

* Better obsolete message

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-04-26 10:22:37 +01:00
Paul Johnson
a1e562cab6 Switch ConfigureServices back to protected.
Downstream users may wish to subclass and add their application specific
services.
2022-02-12 11:57:28 +00:00
Paul Johnson
c1fddd98be Additional refactoring I have been meaning to get around to for a while. 2022-02-11 20:39:57 +00:00
Paul Johnson
ae2ff856fb Remove IEventDispatcher, it's no longer used. 2022-01-11 17:02:20 +00:00
Paul Johnson
00133e880d Move test projects from src/ to tests/ (#11357)
* Update gitignore

* Move csproj

* Update project references

* Update solutions

* Update build scripts

* Tests used to share editorconfig with projects in src

* Fix broken tests.

* Stop copying around .editorconfig

merged root one with linting

* csharp_style_expression_bodied -> suggestion

* Move StyleCop rulesets to matching directories and update shared build properties

* Remove legacy build files, update NuGet.cofig and solution files

* Restore myget source

* Clean up .gitignore

* Update .gitignore

* Move new test classes to tests after merge

* Gitignore + nuget config

* Move new test

Co-authored-by: Ronald Barendse <ronald@barend.se>
2021-10-18 08:14:04 +01:00