Commit Graph

2354 Commits

Author SHA1 Message Date
Andy Butland
63b77b7743 Further NRT amends (#12363)
* Amended nullability of base Deploy classes.

* Ensured ContentItemDisplay.Variants is non-nullable.

* Set IArtifactSignature.Dependencies to be non-nullable.

* Update template collection retrieval to be non-nullable.

* IMediaService.GetRootMedia to be non-nullable.

* Non-nullable collection for IMemberService.GetMembersByMemberType.

* Non-nullable collection for member role retrieval.

* Non-nullable collection for root dictionary items.

* Non-nullable collection for child dictionary items.

* Applied suggestions from code review

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>

* Remove extra dot

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-05-06 10:13:58 +02:00
Bjarke Berg
daac1a4bac Merge remote-tracking branch 'origin/v10/contrib' into v10/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/package-lock.json
2022-05-03 21:17:10 +02:00
Chad
9f4ff0a398 async tree search (#12344) 2022-05-03 21:13:27 +02:00
Ronald Barendse
23072a500c v10: Fix Block List settings exception and optimize PVCs (#12342)
* Don't use MapModelType to get model type

* Optimize block list item activation (cache constructors)

* Fix exceptions in NestedContentSingleValueConverter (zero content types or multiple stored items)

* Add IPublishedModelFactory.GetModelType method to remove work-around
2022-05-03 19:23:15 +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
Andy Butland
96d33201aa Few more NRT tweaks (#12323)
* Amended GetAll() on IDataTypeService to return an empty collection rather than null.

* Added a ClearSessionValue method to ISessionManager (given you can no longer set a value to null).

* Allow for null values in a StatefulNotification.

* Removed obsoletion of synchronous messages on TreeControllerBase.

* Fixed further CS8620 warnings in core project.

* Further fix to nullable warning.

* Aligned nullablility of retreiving tree nodes and menus, synchronously or asynchronously (such that we no longer can get null values, always empty collection objects).
2022-05-01 08:18:09 +02:00
Ronald Barendse
1a82e0854a v10: Update to ImageSharp v2 (#12185)
* Update to ImageSharp 2.1.0 and ImageSharp.Web 2.0.0-alpha.0.23

* Rename CachedNameLength to CacheHashLength and add CacheFolderDepth setting

* Replace PhysicalFileSystemProvider with WebRootImageProvider

* Support EXIF-orientation in image dimention extractor

* Remove virtual methods on FileProviderImageProvider

* Simplify FileInfoImageResolver

* Update to SixLabors.ImageSharp.Web 2.0.0-alpha.0.25 and remove custom providers

* Make CropWebProcessor EXIF orientation-aware

* Improve width/height sanitization

* Also use 'v' as cache buster value

* Add WebP to supported image file types

* Update to SixLabors.ImageSharp.Web 2.0.0-alpha.0.27 and fix test

* Fix rounding error and add test cases

* Update to newest and stable releases

* Move ImageSharpImageUrlGenerator to Umbraco.Web.Common

* Use IConfigureOptions to configure ImageSharp options

* Implement IEquatable on ImageUrlGenerationOptions classes

* Fix empty/null values in image URL generation and corresponding tests

* Use IsSupportedImageFormat extension method

* Remove unneeded reflection
2022-04-29 13:16:24 +02:00
Andy Butland
b187c89113 Updates to null reference types (#12317)
* Amended IFileSystem OpenFile to return Stream.Null rather than a nullable stream.

* Updated IUmbracoMapper to map enumerables without null elements given non-null inputs.

* Amended EntityRepositoryBase to not return null collections.

* Made IPublishedElement.Properties a non-nullable collection.
2022-04-29 08:19:34 +02:00
Nikolaj Geisle
83419a30ea Fix build errors after merging 2022-04-22 12:37:20 +02:00
Nikolaj Geisle
70a75d8c9b Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice
# Conflicts:
#	src/Umbraco.Core/Models/Mapping/MemberTabsAndPropertiesMapper.cs
#	src/Umbraco.Core/Models/Member.cs
#	src/Umbraco.Core/Models/Membership/User.cs
#	src/Umbraco.Core/Services/MemberService.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Infrastructure/Security/MemberUserStore.cs
2022-04-22 12:32:57 +02:00
Mole
7df4f84247 V10: Migrate member properties to columns on the member table (#12205)
* Add new columns to the member table

* Add missing IsApproved column

* Add joins with nested query

* Add query for selecting new column values from existing members

* Update the member data from the same query

* Make escapes work for sqlite

* Use GetFieldNameForUpdate instead of GetFieldName

* Left join on memberDto

* Remove the now unused property types and data

* Don't create member columns as properties anymore

* Store old properties in fields on member

Also switch the dates to nullable since they can be null

* Map columns when mapping from DTO to Member object

* Display columns in the member content app

* Fix null exception when creating new user

* Hide value if user doesn't have access to sensitive data

* Remove hardcoded member properties

* Obsolete old member alias constants

* Map and persist member properties

* Correctly update LastLogin when member logs in

* Map IsApproved and IsLockedOut when saving member in backoffice

* Update the query mappers for members

* Fix member service tracks dirty changes test

* Remove no longer existing property types from member type builder

* Fix null error in UpdateMemberProperties

* Fix builder tests

* Fix SetupMemberTestData in MemberControllerUnitTests

* Let LastLoginDate be null and handle check in controller

There's no reason to default a perfectly nullable property to default(DateTime)

* Add translation key for is approved and use that instead of constant

* Obsolete old label constants

* Fix whitespace post merge

* Fix up test comments

* Apply suggestions from code review

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

* Fix member properties always being sensitive

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2022-04-21 14:47:27 +02:00
Sebastiaan Janssen
6d0a0fff9c Merge branch 'v9/dev' into v10/dev 2022-04-21 14:37:28 +02:00
Mole
9b864ddbeb Fix member properties always being sensitive (#12282) 2022-04-21 13:51:24 +02:00
Nikolaj Geisle
060e0181a7 Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco.Web.Backoffice
# Conflicts:
#	src/Umbraco.Core/DependencyInjection/UmbracoBuilder.Collections.cs
#	src/Umbraco.Core/Extensions/PublishedContentExtensions.cs
#	src/Umbraco.Core/Telemetry/Models/TelemetryReportData.cs
#	src/Umbraco.Infrastructure/PropertyEditors/ValueConverters/MultiUrlPickerValueConverter.cs
#	src/Umbraco.PublishedCache.NuCache/ContentStore.cs
#	src/Umbraco.Web.BackOffice/Trees/MemberTypeTreeController.cs
#	src/Umbraco.Web.Common/ModelsBuilder/InMemoryModelFactory.cs
#	src/Umbraco.Web.Common/Security/MemberManager.cs
#	src/Umbraco.Web.Website/Routing/ControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/IControllerActionSearcher.cs
#	src/Umbraco.Web.Website/Routing/UmbracoRouteValueTransformer.cs
2022-04-21 10:26:51 +02:00
Bjarke Berg
23a49161d6 Merge remote-tracking branch 'origin/v9/dev' into v10/dev
# Conflicts:
#	build/build.ps1
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/dotnetcli.host.json
#	build/templates/UmbracoProject/.template.config/ide.host.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Umbraco.Core/Constants-System.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	umbraco-netcore-only.sln
2022-04-20 11:09:28 +02:00
Nikolaj Geisle
927d687192 Fix bad null check 2022-04-20 08:38:14 +02:00
Nikolaj Geisle
c07ffb68fc v9: Implement telemetry levels (#12267)
* Add initial classes

* Add TelemetryProviders

* Add new NodeCountService.cs and NodeTelemetryProvider

* Add data contract attribute to UsageInformation

Otherwise it wont serialize correctly

* Implement more providers

* Fix builders and propertyEditorTelemetry

* Add MediaTelemetryProvider

* Add MediaTelemetryProvider

* Fix doubling of media telemetry

* Move contentCount from NodeCountTelemetryProvider and move to ContentTelemetryProvider

* Revert ContentTelemetryProvider changes

* Add detailed information to TelemetryService

* Add integration tests

* Add more tests and todos for tests

* Fix stylecop warnings

* Use yield return instead of instantiating local list

* Implement Macro test

* Inject interface instead of implementation in TelemetryService

* Fix TelemetryServiceTests.cs

* Implement media tests

* Implement propertyTypeTests

* Implement constants instead of hardcoded strings

* Add SystemInformationTelemetryProvider

* Use SystemInformationTableDataProvider in UserDataService

* Implement more properties

* Add UsageInformation

* Replace UserDataService with SystemInformationTelemetryProvider

* Undo changes to UserDataService and obsolete it

* Remove ISystemInformationTableDataProvider

* Register SystemInformationTelemetryProvider as telemetry provider

* Use constants for telemetry names

* Make UserDataServiceTests test SystemInformationTelemetryProvider instead

* Update UserDataServiceTests to cover new data

* Add unit tests

* Add integration test testing expected data is returned

* Implement Analytics dashboard

* Improve assertion message

* Add text and styling to analyticspage

* Rename consent to analytic

* implement save button for consent level

* Implement save button

* Fix system information test

* Add TelemetryResource

* Move telemetry providers to infrastructure

* Add database provider to system information

* Set startvalue for slider

* Fix unit tests

* Implement MetricsConsentService using KeyValueService

* Return void hen setting the telemetry level

* fix startposition when not reloading

* Add a couple tests

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

* Rename ConsentLevel.cs

* Use direct Enum instead of parsing

* rename consent resource

* add lazy database

* refactor slider

* Implement ng-if and propers pips

* Make classes internal

* Fix slider not loading when navigating to tab

* Add telemetry level check to TelemetryService.cs

* Add Consent for analytics text

* Fix build errors for unit tests

* Fix TelemetryServiceTests

* revert package-lock.json

* Fix integration test

* Update slider

* Update TelemetryService.cs

* Apply suggestions from code review

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

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: nikolajlauridsen <nikolajlauridsen@protonmail.ch>
2022-04-19 15:06:10 +02:00
Bjarke Berg
852305b7d1 Simplified setup of 2FA for users (#12142)
* Added functionality to enable 2FA for users..

* Do not use the obsolete ctor in tests

* cleanup

* Cleanup

* Convert User view from overlay to infinite editor

* Add support for having additional editors on top of the user (2fa) which overlay does not support
* Add controllerAs syntax in the template
* Remove unused dependencies

* Adjustments to 2fa login view

* organize elements
* add translations
* add a11y helpers
* add autocompletion = one-time-code
* change to controllerAs syntax

* add callback to cancel 2fa and fix error where submit button was not reset when all other validations were

* add a cancel/go back button to the 2fa view

* replace header with something less obstrusive

* move logout button to the footer in the new editor view

* change 'edit profile' to an umb-box and move ng-if for password fields out to reduce amount of checks

* Add umb-box to external login provider section

* add umb-box to user history section

* bug: fix bug where notificationsService would not allow new notifications if removeAll had been called

* add styling and a11y to configureTwoFactor view

- also ensure that the view reloads when changes happen in the custom user view to enable 2fa
- ensure that view updates when disabling 2fa
- add extra button to show options (disable) for each 2fa provider

* add notification when 2fa is disabled

* add data-element to support the intro tour

also changed a minor selector in the cypress test

* correct usage of umb-box with umb-box-content

* do not use the .form class twice to prevent double box-shadow

* make tranlastion for 2fa placeholder shorter

* ensure that field with 2fa provider is always visible when more than 1 provider

* move error state of 2fa field to token field

* update translation of multiple 2fa providers

* move CTA buttons to right side to follow general UI practices

* rename options to disable

* add disabled state

* add helper folders to gitignore so you can work with plugins and custom code without committing it accidentally

* move the disable functionality to its own infinite editor view

* use properties from umb-control-group correctly

* add 'track by' to repeater

* make use of umb-control-group

* remove unused functions

* clean up translations

* add Danish translations

* copy translations to english

* Only return enabled 2fa providers as expected

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-04-19 08:33:03 +02:00
Nikolaj Geisle
7994f5c326 Add nullability to Web.Website, Sqlite & SqlServer 2022-04-04 14:47:54 +02:00
Nikolaj Geisle
4710951185 fix build errors 2022-04-04 12:45:06 +02:00
Nikolaj Geisle
0a7e698883 Fix non-nullable array to nullable 2022-04-04 09:21:52 +02:00
Nikolaj Geisle
c6e7e139e9 Fix up build errors 2022-04-01 14:49:39 +02:00
Nikolaj Geisle
70a00901b4 Finish up Web.Backoffice 2022-04-01 14:35:18 +02:00
Nikolaj Geisle
1a6f0e4d7b Start work on controllers 2022-04-01 11:09:51 +02:00
Nikolaj Geisle
0fc310cc4e start work on controllers 2022-03-31 15:57:23 +02:00
Nikolaj Geisle
4571ecb0e3 More work on nullable reference types 2022-03-31 14:35:23 +02:00
Nikolaj Geisle
2460c82e02 Fix trees 2022-03-31 12:52:26 +02:00
Nikolaj Geisle
05a08bef63 Add nullability to nucache & lucene projects 2022-03-30 13:34:56 +02:00
Nikolaj Geisle
b52c4e50cf Add nullability to web.common 2022-03-29 13:44:21 +02:00
Nikolaj Geisle
f78b62fcb6 Fix all build errors 2022-03-17 09:44:45 +01:00
Nikolaj Geisle
214bcceffc Merge v10/dev into infrastructure 2022-03-16 14:39:28 +01:00
Nikolaj Geisle
4ebd20bb66 Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco-Core
# Conflicts:
#	build/build.ps1
#	src/Umbraco.Core/Configuration/ConfigConnectionString.cs
#	src/Umbraco.Core/Configuration/Models/ConnectionStrings.cs
#	src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs
#	src/Umbraco.Core/Models/ContentType.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs
#	tests/Umbraco.Tests.AcceptanceTest/package.json
2022-03-16 13:00:38 +01:00
Bjarke Berg
981e66a673 Merge remote-tracking branch 'origin/v9/dev' into v10/dev
# Conflicts:
#	src/Umbraco.Core/Telemetry/TelemetryService.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.CoreServices.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
#	src/Umbraco.Infrastructure/HostedServices/ScheduledPublishing.cs
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Infrastructure/Runtime/SqlMainDomLock.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/DashboardController.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/HostedServices/ScheduledPublishingTests.cs
2022-03-10 14:36:30 +01:00
Elitsa Marinovska
d9d5dc5626 Item tracking improvements (#11919)
* Adding TrackedReferencesController

* Adding/changing views

* Adding/Editing js files

* RelationService changes

* RelationRepository changes

* Adding missing translations

* Adding/Modifying tests

* Beginning of #9125 migration

* Introducing a new component + refactoring based on that

* Abstracting + refactoring

* Work on content unpublishing

* Work on media.delete

* Various small changes

* Beginning of #9119 migration

* Changes on content.delete

* Various fixes

* Adding new keys used in the listview bulk actions

* Adding methods to get the items used in relations from array of ids

* Adding the checkLinkedItems function to the trackedReferencesResource

* Passing the selected items from a listview to unpublish and delete

* Adding umb-tracked-references-listview

* Adding umb-tracked-references-listview-table with language column

* Fixes for tracked references

* Changes in listview unpublish dialog

* Changes in listview delete dialog

* Removing Variants logic as it is not currently supported

* Visual fixes

* Closing dialogs on click

* Fix wording

* Fix breaking changes

* Change to a single title "Items in use" instead of 2 different for Content and Media

* No need for obsoleting because we can change new controllers

* Return ActionResult from actions

* V9:  Prevent delete or unpublish of items that have references (#12047)

* Introducing config settings that prevent delete or unpublish of items referenced by other items

* Disable deletion of content items and show a new warning

* Disable deletion of media items and show a new warning

* Disable deletion of list view items

* Disable unpublish and bulk unpublish

* Add a new warning

* V9: Displaying descendants in use as part of item tracking (#12039)

* Replace HasReferencesInDescendants with GetPagedDescendantsInReferences

* Display descendants in use on parent's info tab

* Add getPagedDescendantsInReferences to trackedReferencesResource

* Add lang keys for Descendants in use

* Refactoring controller actions

* Don't call check descendants usage when it is a new item

* rename busfy to busy

* always show references

* rearrange for scrollbar to appear at the edge of the dialog

* use the word referenced instead of used

* change fallback texts

* Added "IsDependency" to relation types

* refactor of umb-tracked-references

* rename checkLinkedItems to getPagedReferencedItems

* rename check to load, to be consistent with the rest.

* Refactored backend . Needs frontend fixes

* Cleanup

* Use filters

* Front-end refactor to match refactored end-points

* Fixed bug + warning

* Fixed query (more then 2100 descensdants) and optimized it (using nested select instead of inner join).

* remove comment

* hideNoneDependencies including varying text for the configuration

* Hack for SqlCE :(

* some final adjustments for item tracking ui

* Unbreak change

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-03-07 22:46:16 +01:00
Sebastiaan Janssen
d8551e4640 Merge branch 'v9/dev' into v9/contrib 2022-03-07 11:41:25 +01:00
Callum Whyte
10d252819d Adding null check to IsCulturePublished on IContent 2022-03-05 03:05:31 +01:00
nikolajlauridsen
5ef013ca62 Ensure ContentType is only marked as dirty when it's actually changed 2022-03-02 10:49:06 +01:00
nikolajlauridsen
1cdc6f0fd2 Make HistoryCleanup register as dirty in ContentType 2022-03-02 10:15:50 +01:00
nikolajlauridsen
49e0e6c1c9 Implement BeingDirtyBase on HistoryCleanup 2022-03-02 10:11:48 +01:00
patrickdemooij9
a27da0fced Content app for dictionary items (#11553) 2022-02-28 15:01:18 +01:00
Nikolaj Geisle
915e68e72e Fix last build errors 2022-02-28 13:14:02 +01:00
Nikolaj Geisle
d1cf640f2a more build errors in Core 2022-02-27 21:20:50 +01:00
Nikolaj Geisle
2009f7585b Fix last build errors 2022-02-24 15:28:41 +01:00
Nikolaj Geisle
ed13237177 Fixing more errors with nullable reference types 2022-02-24 09:24:56 +01:00
Nikolaj Geisle
a8cf6ee127 More work on nullable references 2022-02-22 13:35:32 +01:00
Nikolaj Geisle
315e8d6fe6 Merge branch 'v10/feature/nullable-reference-types-in-Umbraco-Core' into v10/feature/nullable-reference-types-in-Umbraco-Infrastructure 2022-02-21 12:51:49 +01:00
Nikolaj Geisle
57f32100cb Fix errors 2022-02-21 12:49:17 +01:00
Nikolaj Geisle
f69d264d8d Add more nullability 2022-02-21 10:12:51 +01:00
Bjarke Berg
cb44dc70f3 Rollback issues with signatures 2022-02-21 10:06:57 +01:00
Nikolaj Geisle
b442a60403 Start work on nullable-reference types in Infrastructure project 2022-02-18 14:32:51 +01:00