Commit Graph

797 Commits

Author SHA1 Message Date
Paul Johnson
2a4c974568 Move services infra -> core 2022-01-14 11:34:08 +00:00
Paul Johnson
39c3fecc45 Prep for moving some services 2022-01-13 23:46:21 +00:00
Paul Johnson
eb841a7b98 Remove database properties from IScope 2022-01-13 17:44:40 +00:00
Paul Johnson
3258a676c0 ScopeProvider can create its own logger if required. 2022-01-13 09:31:08 +00:00
Paul Johnson
71ce038330 Scope no longer uses MediaFileManager.
Deleting media via services results in a published MediaDeletedNotification
via scope.Notifications, these are fired on Scope.Complete() and picked up
by the registered handlers.
2022-01-13 09:24:30 +00:00
Paul Johnson
ae2ff856fb Remove IEventDispatcher, it's no longer used. 2022-01-11 17:02:20 +00:00
Bjarke Berg
642c216f94 Serve Media and App_Plugins using WebRootFileProvider (and allow changing the physical media path) (#11783)
* Allow changing UmbracoMediaPath to an absolute path. Also ensure Imagesharp are handing requests outside of the wwwroot folder.

* Let UmbracoMediaUrl fallback to UmbracoMediaPath when empty

* Add FileSystemFileProvider to expose an IFileSystem as IFileProvider

* Replace IUmbracoMediaFileProvider with IFileProviderFactory implementation

* Fix issue resolving relative paths when media URL has changed

* Remove FileSystemFileProvider and require explicitly implementing IFileProviderFactory

* Update tests (UnauthorizedAccessException isn't thrown anymore for rooted files)

* Update test to use UmbracoMediaUrl

* Add UmbracoMediaPhysicalRootPath global setting

* Remove MediaFileManagerImageProvider and use composited file providers

* Move CreateFileProvider to IFileSystem extension method

* Add rooted path tests

Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-01-06 13:35:24 +01:00
Mole
53e5a25df8 Remove ugly CharCollection hack
By adding a new configuration and mapping the old CharCollection to that, we can get around having to return null the first time, by obsoleting the old one and redirecting to the new GetCharReplacements method
2021-12-22 11:29:04 +01:00
Mole
80cda3364b Make CharCollection return the merged result
Since this is the way it's been previously, we cannot change the behaviour of this. Unfortunately due to how the config binding works, we have to make sure it returns null the very first time it's called by the framework to ensure that overrides actually gets registered.
2021-12-21 13:35:30 +01:00
Mole
d77e198d31 Move unit test to the new location 2021-12-21 10:44:36 +01:00
Mole
8a8b1e3247 Rename CharacterReplacement back to CharItem
Since the class is public renaming this would be a breaking change, since if anyone is directly referring to the class it would break
2021-12-21 10:30:19 +01:00
Mole
c4f8944add Merge branch 'v9/contrib' into temp-11381 2021-12-21 09:42:39 +01:00
Ronald Barendse
0ba51f87ea Move member properties to Member Content App (V9 merge regression) (#11768)
* Fix regression after merging to v9

* Update test to align with removed member properties
2021-12-20 08:45:11 +01:00
Bjarke Berg
2ec92057c5 Started using nullable reference types.. 2021-12-16 13:44:20 +01:00
Bjarke Berg
47c1058195 Merge remote-tracking branch 'origin/v9/dev' into v10/dev
# Conflicts:
#	src/Umbraco.Infrastructure/HostedServices/ReportSiteTask.cs
2021-12-15 14:41:49 +01:00
Mole
2268b1e187 Package telemetry (#11738)
* Add TelemetryService

Currently it only allows you to get a list of the name of all the installed packages

* Create model class for package telemetry

And move the telemetry report data out of ReportSiteTask

* Add version as an option in package manifest

* Use TelemetryService to generate telemetry data

Instead of doing it directly in the ReportSiteTask

* Seal TelemetryService

This should not be overwritten

* Add option for package creators to opt out

* Add global setting to restrict package telemetry

* Add TelemetryService unit tests

* Add ManifestParser tests for new properties

* Clean

* Update src/Umbraco.Core/Telemetry/TelemetryService.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Create interface for telemetry service

* Use IOptionsMonitor instead of IOptions

However I chose to use CurrentValue since according to microsoft: "Some file systems, such as Docker containers and network shares, may not reliably send change notifications.", additionally TelemetryService only runs once pr. day, so it shouldn't be too much of an issue that it doesn't cache the result.

* Use is false instead of negation

It's a bit more readable

* Track restrict package telemetry value

* Save RestrictPackageTelemetry in report data

Not packages, since it'll be the same for all packages

* Fix TelemetryService unit tests

* Clean

* Update src/Umbraco.Core/Telemetry/ITelemetryService.cs

Co-authored-by: Bjarke Berg <mail@bergmania.dk>

* Remove RestrictPackageTelemetry

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-12-14 16:09:31 +01:00
Elitsa Marinovska
a6903d8abe V9: Display configured log levels (#11715)
* Adding ILogLevelLoader to get Serilog level values (global one and umbraco) and the corresponding dependencies

* Obsoleting old methods

* Fix tests

* Front-end changes

* Changes requested in a review
2021-12-06 11:06:55 +01:00
Bjarke Berg
568dc19929 Merge remote-tracking branch 'origin/v9/9.1' into v9/dev
# Conflicts:
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
2021-12-03 07:20:19 +01:00
Bjarke Berg
915f1cb34c V9: Fix for migration of non-default configurated users/members (#11684)
* https://github.com/umbraco/Umbraco-CMS/issues/11366
Fallback to try login using super legacy HMACSHA1 even when the algorithm is stated as being HMACSHA256. The issue is that v8 saves HMACSHA256 on the user, but when configured to use legacy encoding it actually uses HMACSHA1

* Support migration of members with:
UseLegacyEncoding+Clear
UseLegacyEncoding+Encrypted (Requires machine key)
UseLegacyEncoding+Hashed

* Fixes unit tests

* Avoid exceptions + unit tests

* Save unknown algorithm if we dont know it, instead of persisting a wrong algorithm.

* Added setting to enable clear text password rehashes.

* Removed support for migration of clear text passwords

* Fixed unit test
2021-12-02 10:54:24 +00:00
Paul Johnson
08f106a23f Fix smidge bundles not always invalidated between backoffice versions. (#11700)
* Introduced new smidge CacheBuster with sensible defaults.

* Bring back reset functionality in SmidgeRuntimeMinifier

* Clearer obsolete messaging.
2021-12-02 11:32:19 +01:00
Nikolaj Geisle
e0701ccd48 Merge branch 'v9/dev' into v9/feature/update-imagesharp-web
# Conflicts:
#	src/Umbraco.Tests.AcceptanceTest/cypress/integration/Users/users.ts
#	src/Umbraco.Web.UI/umbraco/config/lang/cy.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/it.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
#	tests/Umbraco.Tests.AcceptanceTest/cypress/integration/DataTypes/dataTypes.ts
2021-11-24 09:11:52 +01:00
Bjarke Berg
78dc2d5721 Merge remote-tracking branch 'origin/v9/dev' into v10/dev
# Conflicts:
#	build/azure-pipelines.yml
#	src/Umbraco.Core/Routing/DefaultUrlProvider.cs
#	src/Umbraco.Core/Routing/UrlProviderExtensions.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/DocumentRepository.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.PublishedCache.NuCache/DataSource/BTree.ContentDataSerializer.cs
#	src/Umbraco.PublishedCache.NuCache/Persistence/NuCacheContentRepository.cs
#	src/Umbraco.Web.UI.Client/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package-lock.json
#	tests/Umbraco.Tests.AcceptanceTest/package.json
#	tests/Umbraco.Tests.Integration/Umbraco.Infrastructure/Services/ContentServiceTests.cs
2021-11-22 19:43:20 +01:00
Elitsa Marinovska
61f459670c Update to .NET6 and ASP.NET Core 6 (#11652)
* Changed targetFramework in nuspec file & project files + updated NuGet dependencies

* Updated .net version in pipelines

* Updated .net version in templates

* Update more dependencies

* Fixed ambiguous call to DistinctBy() - part of Umbraco.Extensions and System.Linq

* Disabling the Razor source generators in .NET 6 due to error: "Cannot find the fallback endpoint specified by route values..."

* Fixed unit tests

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-11-18 15:35:42 +01:00
Bjarke Berg
b0a4a92f57 ContentVersion cleanup backoffice UI (#11637) (#11644)
* ContentVersion cleanup backoffice UI (#11637)

* init rollback ui prototype

* add busy state to button, deselect version, add pagination status

* add localisation

* style current version

* disable rollback button when nothing is selected

* stop click event

* Endpoints for paginated content versions.
Light on tests, tight on time.

* Endpoints to "pin" content versions

* camel case json output.
Not sure why json formatter not set for controller, bit risky to add it now

* wire up paging

* wire up pin/unpin

* rename getPagedRollbackVersions to getPagedContentVersions

* prevent selection of current version and current draft

* add current draft and current version to UI

* remove pointer if the row is not selectable

* Improve warning for globally disabled cleanup feature.

* Fix current loses prevent cleanup state on publish.

* Added umbracoLog audit entries for "pin" / "unpin"

* Match v9 defaults for keepVersions settings

* Fix - losing preventCleanup on save current with content changes

* update pin/unpin button labels

* fix pagination bug

* add missing "

* always send culture when a doc type can vary

Co-authored-by: Mads Rasmussen <madsr@hey.com>
# Conflicts:
#	src/Umbraco.Core/ContentEditing/ContentVersionMetaViewModel.cs
#	src/Umbraco.Core/Models/HistoricContentVersionMeta.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.Tests/Persistence/Repositories/DocumentVersionRepository_Tests_Integration.cs
#	src/Umbraco.Tests/Services/ContentVersionCleanupService_Tests_UnitTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI/config/umbracoSettings.Release.config
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web/Umbraco.Web.csproj

* Added tests

* Misc - missed translation update

* Bugfix - DocumentVersionRepository.Get should not join culture variation

* Bugfix - Missing write lock

* Removed unnecessary view model

* Misc - kill some warnings

* Misc - Kill some more warnings

* Fixed cypress rollback test

* Bugfix - Policy returns items to delete not items to keep.
Switch to inverse behavior.

# Conflicts:
#	src/Umbraco.Tests/Services/DefaultContentVersionCleanupPolicy_Tests_UnitTests.cs

Co-authored-by: Paul Johnson <pmj@umbraco.com>
2021-11-16 13:04:31 +01:00
Nikolaj Geisle
f5ea5df8f3 v9: Don't load all translation files (#11576)
* Update systemInformation.ts

* Added lazy loading

* Update systemInformation.ts

* Update systemInformation.ts

* Use CharArrays.ForwardSlash instead of hardcoded string

* Align braces

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2021-11-10 11:48:09 +01:00
Paul Johnson
cf38e3a97b Separate customizations for clarity 2021-11-09 19:40:20 +00:00
Bjarke Berg
17abf0474c Added unit tests for ContentVersionService (#11597)
* Added unit tests for ContentVersionService

* Clean up

* Fixed tests after using ConfigureMembers = true

* Fixed tests after using ConfigureMembers = true
2021-11-09 16:48:50 +00:00
Bjarke Berg
7f061bd818 Merge pull request #11570 from umbraco/v9/feature/merge_v9_contrib_03-11-2021
V9: Merge `v9/contrib` 03-11-2021
2021-11-03 14:54:59 +01:00
Bjarke Berg
be65f12ed7 Updated nuget dependencies 2021-11-03 14:29:59 +01:00
Sebastiaan Janssen
692f952293 Merge branch 'v9/contrib' into v9/dev
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs
2021-11-03 13:05:43 +01:00
Bjarke Berg
109487f117 Merge pull request #11568 from umbraco/v9/feature/merge_v8_03-11-2021
V9: Merge v8: 03-11-2021
2021-11-03 12:56:23 +01:00
Bjarke Berg
a91d708bc5 cleanup 2021-11-03 12:11:05 +01:00
Bjarke Berg
fb953ad532 Only run this test on windows 2021-11-03 12:10:42 +01:00
Elitsa Marinovska
236bf88143 Cleanup 2021-11-03 10:23:50 +01:00
Bjarke Berg
ab96e7c17d fix for linux+mac 2021-11-03 09:11:30 +01:00
Bjarke Berg
c3ebbe23fd Merge remote-tracking branch 'origin/v8/dev' into v9/feature/merge_v8_03-11-2021
# Conflicts:
#	src/Umbraco.Core/Configuration/GlobalSettings.cs
#	src/Umbraco.Core/Configuration/IGlobalSettings.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Tests/Umbraco.Tests.csproj
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/Editors/ContentTypeController.cs
#	src/Umbraco.Web/HealthCheck/Checks/Security/BaseHttpHeaderCheck.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Configurations/LanguageXmlTests.cs
2021-11-03 08:44:12 +01:00
Bjarke Berg
b7d5fd4b26 Cleanup and fixed tests 2021-11-02 09:18:15 +01:00
Bjarke Berg
53631ee48b Merge remote-tracking branch 'origin/v8/feature/version-history-cleanup-ui' into v9/dev
# Conflicts:
#	src/Umbraco.Core/Composing/CompositionExtensions/Repositories.cs
#	src/Umbraco.Core/Composing/CompositionExtensions/Services.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
#	src/Umbraco.Core/ContentEditing/HistoryCleanup.cs
#	src/Umbraco.Core/Models/ContentEditing/DocumentTypeDisplay.cs
#	src/Umbraco.Core/Models/ContentType.cs
#	src/Umbraco.Core/Models/Mapping/ContentTypeMapDefinition.cs
#	src/Umbraco.Core/Persistence/Repositories/DocumentVersionRepository.cs
#	src/Umbraco.Core/Scheduling/ContentVersionCleanup.cs
#	src/Umbraco.Core/Services/DefaultContentVersionCleanupPolicy.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ContentTypeCommonRepository.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config
#	src/Umbraco.Tests/TestHelpers/Entities/MockedContent.cs
#	src/Umbraco.Tests/TestHelpers/Entities/MockedContentTypes.cs
#	src/Umbraco.Tests/Umbraco.Tests.csproj
#	src/Umbraco.Web.UI.Client/package-lock.json
#	src/Umbraco.Web.UI/config/umbracoSettings.Release.config
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web/Scheduling/SchedulerComponent.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
#	tests/Umbraco.Tests.Common/Extensions/AutoMoqDataAttribute.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Persistence/Repositories/DocumentVersionRepository_Tests_Integration.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Scheduling/ContentVersionCleanup_Tests_UnitTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupService_Tests_Integration.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/ContentVersionCleanupService_Tests_UnitTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Services/DefaultContentVersionCleanupPolicy_Tests_UnitTests.cs
2021-10-29 15:00:27 +02:00
Bjarke Berg
14fc4b6e25 Unbreak a breaking change :( 2021-10-29 11:08:40 +02:00
Bjarke Berg
bf5f1364fd Fix build after merge 2021-10-29 10:14:52 +02:00
Shannon Deminick
c77dc5dc00 Migrating tests that depend on Published Cache from the old test project (#11242)
* starts cleaning up old test project, removing ones we'll never convert, moves new test to where it should be.

* Makes ContentNodeKit immutable properties, moves first nucache tests over

* Gets the Nucache unit tests working and refactors a bit to use builder pattern for models.

* Migrates first xml based cache test to use nucache.

* Migrates a bunch more

* Migrates remaining tests for PublishedContentTests

* Moves PublishedRouterTests

* Moves PublishedContentExtensionTests

* Moves more tests.

* committing wip

* committing wip

* Gets PublishedContentLanguageVariantTests converted and working.

* Fixes DataTable ext method and moves PublishedContentDataTableTests

* Moves PublishedMediaTests

* wip - moving EntityXmlSerializerTests

* Moves more tests

* moves more tests

* moves more tests

* Move another test

* Moves more tests

* Fix test

* move another test

* Moves more tests

* Moves more tests

* Moves more tests

* wip before merge

* More tests

* More tests

* More tests

* More tests

* More tests

* More tests

* Cleanup and moving classes.

* Remove unused code

* Fixed failing tests, due to new null checks, that did not exist in v8

* Avoid breaking changes

* Unbreak more things, even that it the old solution was crazy..

* Fixed bug where ordering of stream readings was changed..

* cleanup

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-10-19 14:11:54 +02:00
Paul Johnson
14e1f7f7fc V10/feature/content schedule performance (#11398)
* Nuke Content.ContentSchedule

Can't make an omelette without breaking eggs

* Fix read view models

* Fix Save, Save & Schedule, Save & Publish

* Fix scheduled publish/unpublish

* Fix unit tests

* Fix bugs & integration tests

* Cleanup action result signatures

* Update tests from #11356, new method for saving contentschedule
2021-10-19 12:29:25 +02:00
Matthew Care
aee9bbbb7d Merge remote-tracking branch 'upstream/v9/contrib' into temp-11381 2021-10-19 08:44:05 +01:00
Paul Johnson
ad66d61b04 Move new test 2021-10-18 08:32:24 +01:00
Paul Johnson
8be613cad7 Merge branch 'v9/dev' into v9/contrib 2021-10-18 08:31:20 +01:00
Paul Johnson
f214d58f0b Merge branch 'v9/dev' into v10/dev 2021-10-18 08:20:52 +01: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