Compare commits

...
Author SHA1 Message Date
Nikolaj 2bcf052d9b Fix missing import statements in FileSystemMainDomLock 2022-06-13 10:02:05 +02:00
Nikolaj 39eec09209 Bump version 2022-06-13 08:35:03 +02:00
Paul JohnsonandBjarke Berg e536f9fd10 Fix attempting to write lock files to LocalTempPath before it exists (#12563) 2022-06-10 14:09:24 +02:00
Bjarke BergandGitHub a5b7794207 Merge pull request #12555 from umbraco/v9/hotfix/fix_relation_issue_when_moving_root_item_to_recycle_bin
V9: fix relation issue when moving root item to recycle bin
2022-06-09 10:49:12 +02:00
Bjarke Berg 1923a20da7 Fixes relation issue, when moving a root item to recycle bin, the "Relate Parent Media Folder On Delete"/"Relate Parent Document On Delete" cannot get the parent node type, because it is a fake root. 2022-06-09 09:46:42 +02:00
Paul Johnson 54077725c3 Improve FlagOutOfDateModels property behaviour. 2022-06-08 08:25:25 +01:00
Paul JohnsonandGitHub 6b0149803a Fix logic error WRT models builder flag out of date models. (#12548) 2022-06-08 09:16:26 +02:00
Jacob OvergaardandBjarke Berg 833c2ed13b update jquery to 3.6.0 and jquery-ui to 1.13.1 because of CVE-2021-41184 (#12533)
(cherry picked from commit 61068e6ef0)
2022-06-08 09:06:55 +02:00
Bjarke BergandGitHub 3cd17b7ede Fixed query after tests on sqlite (#12544)
(cherry picked from commit 0beaf19063)
2022-06-07 15:26:32 +02:00
Paul JohnsonandGitHub 406576ddfa Fix unable to authorize upgrade from versions < 9.3.0 (#12494) 2022-06-01 17:26:27 +02:00
Lasse FredslundandGitHub 57babbe441 Changed manic to marvelous (#12514) 2022-06-01 14:28:39 +02:00
c08f7f211c Query optimization in TrackedReferencesRepository (#12488)
* Rewrote query

https://github.com/umbraco/Umbraco-CMS/issues/12308

* Reuse new query

* Updated the other queries in TrackedReferencesRepository

* Fix GetPagedRelationsForItem to not include self

* Update src/Umbraco.Infrastructure/Persistence/NPocoSqlExtensions.cs

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

Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-05-31 15:55:29 +02:00
MoleandGitHub 156fe5976c Send content type notifications on copy (#12463) 2022-05-31 14:26:34 +02:00
ac61f85e70 Fixes issue with redirects not being generated when an invariant cont… (#12453)
* Fixes issue with redirects not being generated when an invariant content has variant ancestors. In this case we wanna create redirects for all languages

https://github.com/umbraco/Umbraco-CMS/issues/12452

* Handle Url routing of invariant items with variant parents, when no culture is given

* Cleanup

* Update src/Umbraco.Core/Routing/UrlProvider.cs

Co-authored-by: Ronald Barendse <ronald@barend.se>

* Refactor styling and added else if

Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-05-31 13:19:01 +02:00
Nikolaj 2f498be587 Bump version to 9.5.1 2022-05-24 14:57:26 +02:00
Bjarke BergandGitHub 8d2fb538fd Fixed issue in https://github.com/umbraco/Umbraco-CMS/issues/12384 (#12420)
We need to use invariant culture when doing ToString of user ints
2022-05-23 08:19:59 +02:00
Mole 2126696559 Fix domain for invariant content nodes (#12404) 2022-05-18 14:41:00 +02:00
Nikolaj 1c39c27e22 Bump version to non-rc 2022-05-04 09:21:31 +02:00
nikolajlauridsen eba7e41fd4 Bump version to rc3 2022-05-02 09:43:16 +02:00
8148e4aee0 V9: make hardcoded text localized (#12325)
* use localize keys instead of hard coded text

* Update text

* Remove duplicate -

* Add italics to bottom text

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-05-02 09:38:22 +02:00
Jacob OvergaardandGitHub 35acaa2b13 Regression: User cannot change password using the user pane (#12320)
* add support for UserService to change password

* for 'users' section use UserService to change password

* user infinite editor should now use the changepassword dialog as seen in the 'users' section

* add some autocomplete and name changes to change-password form to support autofill and password managers

* Revert "for 'users' section use UserService to change password"

This reverts commit 68c5972777.

* Revert "add support for UserService to change password"

This reverts commit a64b756ad3.

* use the currentUserResource to change password

* only return true on success since notifications are handled in the resource
2022-04-29 14:41:17 +02:00
Andy ButlandandNikolaj a51c3f4cdb Updated references to latest versions of Forms and Deploy in JSONSchema project. (#12305) 2022-04-26 11:18:22 +02:00
8dfcdeea23 V9/feature/log telemetry level changing (#12299)
* Add logging to SetConsentLevel

* Obsolete old ctor and change logging to email

* Fixed a few issues with MetricsConsentService logging

* Fixed null check

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-04-26 08:55:11 +02:00
nikolajlauridsen f025b72d6b Bump version to rc2 2022-04-25 09:44:33 +02:00
Jacob OvergaardandGitHub ef0e3d649f Allow admins to disable 2fa for other users without code (#12290)
* add functionality to allow admins to disable 2fa for other users

* add new translations
2022-04-22 14:59:08 +02:00
Nikolaj cd00bcb1e1 Filter out providers with no setup view 2022-04-22 11:06:14 +02:00
Mole 64c451bf91 Fix member properties always being sensitive (#12282) 2022-04-21 19:27:20 +02:00
Bjarke BergandNikolaj c77bf2c270 Added notification when requires user 2fa, so implementors can use this to send emails etc. 2022-04-20 11:01:12 +02:00
VWA Software internetandNikolaj f45d4a84f7 Include the PluginController Area when searching for matching surface… (#12218) 2022-04-20 08:25:46 +02:00
Nikolaj ce6a3d6751 Fix TelemetryServiceTests 2022-04-19 15:19:25 +02:00
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
Sebastiaan Janssen 2d31913837 Merge branch 'v9/dev' into v9/contrib 2022-04-19 13:16:20 +02:00
bef052ad3a V9/tmp nucache lock (#12149)
* wrapping SetAllFastSortedLocked in try catch

* Potential issue mitigation by retrieving all data from the database at once instead of one at a time while populating the NuCache file.

* Moved content retrieval to within the try-catch block.

* using InGroupsOf() to retrieve content without loading absolutely everything into memory.

* added "old" method signatures to prevent breaking change in ContentStore

* Revert code style cleanups for clarity

Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
2022-04-19 13:01:38 +02:00
Nikolaj GeisleandGitHub 89f996902b Merge pull request #12207 from umbraco/v9/bugfix/member-last-login-date
Fix member last login date not being set
2022-04-19 10:31:16 +02:00
Bjarke Berg c7c3a68691 fixes breaking changes by reintroducing old ctor 2022-04-19 08:55:13 +02:00
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
68353f9d06 Fixes RedirectToUmbracoPageResult to handle redirects to pages with domains defined on them (#12259)
* Fixes RedirectToUmbracoPageResult to handle redirects to pages with domains defined on them.

* Renamed variable to match with updated service type.

* Apply suggestions from code review

Co-authored-by: Ronald Barendse <ronald@barend.se>

* Fixed usage of IUrlHelper.

Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-04-19 08:13:24 +02:00
Sebastiaan JanssenandGitHub f7615a93d5 Ignore the views folder apart from required files (#12260)
* Ignore the views folder apart from required files

* Only ship the views that we know we want
2022-04-18 02:17:05 +02:00
Sebastiaan Janssen 184397a327 Adds PR first response action 2022-04-15 19:14:23 +02:00
Sebastiaan Janssen 6519b88dfc Fix wrong picker, related to changes in #12122 2022-04-14 14:15:25 +02:00
Sebastiaan JanssenandGitHub 48dbe959f6 Merge pull request #12249 from umbraco/v9/feature/merge-v9-contrib 2022-04-14 11:44:24 +02:00
Sebastiaan Janssen 70a48596ba The {umbracoApplicationUrl} magic string does nothing here 2022-04-14 10:39:30 +02:00
Sebastiaan Janssen faa561da2b Fixes error on first running the Web.UI because of an invalid config 2022-04-14 10:06:01 +02:00
Ronald BarendseandGitHub df01eabcf1 Merge pull request #12045 from umbraco/v9/feature/projecttemplate-cleanup
Clean up and improve project templates
2022-04-12 16:29:24 +02:00
Ronald Barendse 8969bd23bb Fix UseHttpsRedirect spacing 2022-04-12 16:27:55 +02:00
Sebastiaan Janssen 75613cf061 Revert "Block List Settings throws exception if Models builder mode is set to "Nothing" (#11725)"
This reverts commit 62b289e179.
2022-04-12 13:45:15 +02:00
Sebastiaan Janssen 4e71d6f2f6 Merge branch 'v9/dev' into v9/contrib
# Conflicts:
#	src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs
2022-04-12 13:41:34 +02:00
Ronald Barendse c0b0a47612 Merge branch 'v9/dev' into v9/feature/projecttemplate-cleanup 2022-04-12 11:16:16 +02:00
Ronald BarendseandSebastiaan Janssen 20666218d2 Move templates to root 2022-04-12 11:00:59 +02:00
Sebastiaan JanssenandGitHub 5bac054311 Add discord badge 2022-04-07 16:36:30 +02:00
patrickdemooij9andSebastiaan Janssen 597d28b399 Remove statuscodepages middleware 2022-04-07 11:03:07 +02:00
Paul JohnsonandGitHub 80c90f23d1 Fix issue - changing a document type broke the nucache data structure (#12209)
(cherry picked from commit 15df448274)
2022-04-06 08:42:10 +01:00
7d8a07e703 Fix KeepAlive Config so that value from appsettings.json is used (#12224)
* Fix KeepAlive Config so that value from appsettings.json is used if present

* update comment to reflect get-set on KeepAlivePingUrl

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2022-04-06 09:35:53 +10:00
Nathan WoulfeandMichael Latouche 6423529dd0 ensure proper cleanup to avoid lingering scopes causing memory leaks 2022-04-05 11:14:54 +02:00
Nathan WoulfeandMichael Latouche 45e7c10cb8 busfy => busy 2022-04-05 01:35:25 +02:00
Johannes LantzandGitHub 057b304a5a Added "move" action for dictionaries (#12193)
* Added "move" action for dictionaries

* Replaced DictionaryMove with MoveOrCopy for PostMove

* Removed int parse for dictionary postmove id & parentId, changed paramtype for move in dictionary.resource

* Added localizedText for new dictionary validationProblems &  adjusted nullcheck for move.ParentId

* Fixed logic for move dictionary parent
2022-04-04 17:14:03 +02:00
Bjarne FyrstenborgandNathan Woulfe 534ca928b4 Use icon component for icons 2022-04-04 08:47:58 +10:00
dependabot[bot]andNathan Woulfe ddddaeb113 Bump minimist from 1.2.5 to 1.2.6 in /tests/Umbraco.Tests.AcceptanceTest
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-04 08:46:29 +10:00
nikolajlauridsen 146f938051 Do a full save on first member login 2022-04-01 13:30:32 +02:00
ReiterandMichael Latouche 6eebd96605 add null check to multiurlpickervalueconverter IsValue() function umbraco#12186 2022-04-01 04:20:02 +02:00
Corné HoskamandMichael Latouche c218c068bd Update nl.xml 2022-03-31 17:38:47 +02:00
Bjarke Berg ad51832b5d Merge remote-tracking branch 'origin/v9/9.4' into v9/dev
# Conflicts:
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
2022-03-31 11:54:33 +02:00
Bjarke BergandGitHub 93badabcb1 Added extra (unnessasary) WHERE-clause to help sql server generate a smarter query plan (#12198) 2022-03-31 11:52:02 +02:00
Marc GoodsonandGitHub db12594332 Making an update for appearances sake (#12199)
* Update spelling of appearance

in 'Editor appearance' key was incorrectly apperance

* Update spelling of appearance

in 'headlineEditorAppearance' key was incorrectly apperance
2022-03-30 18:48:31 +02:00
Ji Pattison-SmithandMichael Latouche 9203cffd27 Pass culture code into GetAtRoot method in Siblings extensions to ensure the passed culture code is respected 2022-03-30 03:32:25 +02:00
Bjarke Berg 181a7cb27d Bump versions to 9.4.2 2022-03-29 09:33:37 +02:00
Andy ButlandandBjarke Berg 0418be4318 Corrected the base URL to use when retrieving and setting public access details. (#12178)
* Corrected the base URL to use when retrieving and setting public access details.

* Fixed original issue from a merge conflict.. Now using the correct v9+ resource

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-03-29 09:19:59 +02:00
1ff6a953bb Corrected the base URL to use when retrieving and setting public access details. (#12178)
* Corrected the base URL to use when retrieving and setting public access details.

* Fixed original issue from a merge conflict.. Now using the correct v9+ resource

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-03-29 09:05:40 +02:00
7d18914ae6 v9: fix cannot map mvc route to client side request (#12088)
* Implement UmbracoRequestOptions and check in UmbracoRequestMiddleware.cs

* Fix breaking change

* Add suggestion from Marc

* Amend names

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-03-29 08:32:02 +02:00
ReiterandMichael Latouche 76c1bce7d7 only show groups user has access to 2022-03-28 01:03:00 +02:00
Corné HoskamandGitHub b594936463 Update UmbracoProject.csproj (#12164)
* Update UmbracoProject.csproj

Changing the comment would make the intent of the comment more clear, as you cannot use InMemoryAuto on compiled Razor views, but you're still allowed to keep it as false if you're using a different ModelsBuilder mode.

* Update UmbracoProject.csproj

Hoping this kicks off the PR checks...
2022-03-28 07:32:23 +10:00
02e76c8227 Configuration to control the creation of default data (#12122)
* Added configuration and checks for creation of default Umbraco data.

* Fixed configuration binding issues.

* Updated comments.

* Added DefaultDataCreationSettings to the JSON schema.

* Removed option to not install default relation types as Umbraco relies on (and will recreate) them if they aren't there.

* Renamed configuration class used for install of default data and converted to named optios.

* Fix to failing unit tests.

* Fixes for integration tests.

* Apply suggestions from code review

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

* Further fix from code review.

* Updated naming as per PR review suggestions.

* Update src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs

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

Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2022-03-25 08:58:07 +01:00
Ronald Barendse c511f19cc8 Merge branch 'v9/feature/move-templates-to-root' into v9/feature/projecttemplate-cleanup 2022-03-24 13:57:38 +01:00
Ronald Barendse f5d0abc28b Move templates to root 2022-03-24 13:48:43 +01:00
Ronald BarendseandPaul Johnson 037580b305 Fix obsolete constructor in RecurringHostedServiceBase (#12172)
* Use NullLogger in obsoleted constructor

* Create missing logger during execution instead

(cherry picked from commit d0823d4236)
2022-03-24 10:37:52 +00:00
Ronald BarendseandGitHub d0823d4236 Fix obsolete constructor in RecurringHostedServiceBase (#12172)
* Use NullLogger in obsoleted constructor

* Create missing logger during execution instead
2022-03-24 10:34:29 +00:00
PhyxionNLandMichael Latouche 538fb173c2 Fixes #11169
Should also be ported to v10.
2022-03-24 02:49:59 +01:00
Mole c1552cf7fc Bump versions 2022-03-23 11:36:34 +01:00
535008ebc1 Fix custom block view (#12104)
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-03-23 10:42:24 +01:00
Mole 4fffb9f7a7 Bump versions to non-rc 2022-03-23 09:48:21 +01:00
Mole 4e519d4c96 Merge branch 'v9/9.4' into v9/dev
# Conflicts:
#	src/Umbraco.Core/Security/LegacyPasswordSecurity.cs
#	src/Umbraco.Web.UI.Client/src/common/directives/components/references/umbtrackedreferences.component.js
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	tests/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/UmbracoPasswordHasherTests.cs
2022-03-23 09:44:53 +01:00
78cfb29908 Item tracking fixes (#12146)
* Cleanup; Fix lang keys

* Documentation

* Typos

* Distinct the results

* Changed GetPagedRelationsForItems to GetPagedRelationsForItem as we would only expect a single id to be passed when calling this + fix more docs

* Changed to the correct reference

* Unused code

* Only load references when info tab is clicked

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-03-23 09:33:36 +01:00
Nikolaj Geisle 20f0ceeda6 Merge pull request #12161 from umbraco/v9/bugfix/amend_breaking_change_in_RecurringHostedServiceBase
Amend breaking change in RecurringHostedServiceBase
2022-03-23 09:15:27 +01:00
Nikolaj GeisleandGitHub cde05c1197 Merge pull request #12161 from umbraco/v9/bugfix/amend_breaking_change_in_RecurringHostedServiceBase
Amend breaking change in RecurringHostedServiceBase
2022-03-23 09:05:30 +01:00
Nikolaj Geisle 7114c564da Amend unintentional change 2022-03-23 08:27:48 +01:00
Nikolaj Geisle 496e281f2a Add back service name 2022-03-22 15:34:27 +01:00
Nikolaj Geisle 10ae512731 Use ILoggerFactory instead of StaticApplicationLogging 2022-03-22 15:12:51 +01:00
Nikolaj Geisle 3f7f2797a6 Add CreateLogger method so we still can get types using the legacy ctor 2022-03-22 14:52:39 +01:00
c6bfc61909 Update src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs
Co-authored-by: Paul Johnson <pmj@umbraco.com>
2022-03-22 14:21:53 +01:00
fd701068ae Update src/Umbraco.Infrastructure/HostedServices/RecurringHostedServiceBase.cs
Co-authored-by: Paul Johnson <pmj@umbraco.com>
2022-03-22 14:18:12 +01:00
Nikolaj Geisle cca29bf723 Don't commit test classes. 2022-03-22 14:16:46 +01:00
Nikolaj Geisle b55ee70fe8 Switched from service location to StaticAplicationLogging 2022-03-22 14:14:54 +01:00
Nikolaj Geisle 5a613bacf0 Amend breaking change v2 2022-03-22 14:09:47 +01:00
Nikolaj Geisle fe1df8d4ea Amend breaking change 2022-03-22 13:47:58 +01:00
Nikolaj GeisleandNikolaj Geisle 0d836875c7 Merge pull request #12153 from vsilvar/v9/bugfix/12022_recurring_hosted_service_scope_leak
Fixes RecurringHostServices leaking the execution context / ambient scope
2022-03-22 13:03:14 +01:00
Nikolaj GeisleandGitHub bd8084ac99 Merge pull request #12153 from vsilvar/v9/bugfix/12022_recurring_hosted_service_scope_leak
Fixes RecurringHostServices leaking the execution context / ambient scope
2022-03-22 12:58:38 +01:00
Sebastiaan Janssen 04c292f167 Merge pull request #12155 from umbraco/v9/bugfix/10066
Same fix as #12154 - fixes #10066

(cherry picked from commit a302b10f66)
2022-03-22 10:09:36 +01:00
Nikolaj GeisleandGitHub a302b10f66 Merge pull request #12155 from umbraco/v9/bugfix/10066
Same fix as #12154 - fixes #10066
2022-03-22 08:34:27 +01:00
Nikolaj GeisleandGitHub b97d016c13 Merge pull request #12156 from umbraco/v9/bugfix/youtube-link
Use an umbra.co link for the TV replacement channel
2022-03-22 08:19:58 +01:00
Sebastiaan Janssen 0aa4d1956a Also update Umbraco TV link + text in the help panel 2022-03-21 16:14:48 +01:00
Vitor Rodrigues 267df80161 Ensure exceptions are caught for all recurring hosted services 2022-03-21 16:03:16 +01:00
Sebastiaan Janssen cde312b6d4 Use an umbra.co link for the TV replacement channel so we can change it in the future if we need to 2022-03-21 15:47:51 +01:00
59eee2e5dd Implemented PR suggestions - is instead of equality operator
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-03-21 15:34:32 +01:00
b3b4059ec8 Implemented PR suggestions - code simplification
Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-03-21 15:34:04 +01:00
Sebastiaan Janssen f3c5c0976d Same fix as #12154 - fixes #10066 2022-03-21 14:59:23 +01:00
Nikolaj GeisleandNikolaj Geisle a9daab5a15 Merge pull request #12139 from umbraco/v9/bugfix/track-media-items-picked-as-macro-params
Fix media tracking of items added via macro parameters in RTE and Grid
2022-03-21 08:34:36 +01:00
Nikolaj GeisleandGitHub 6f7a9cbd7b Merge pull request #12139 from umbraco/v9/bugfix/track-media-items-picked-as-macro-params
Fix media tracking of items added via macro parameters in RTE and Grid
2022-03-21 08:24:19 +01:00
Vitor Rodrigues 18c2a18ec8 Fixes RecurringHostServices leaking the execution context / ambient scope (#12022)
As timers flow the execution context by default this resulted in the Ambient context scope being shared
2022-03-20 13:12:45 +01:00
Marc GoodsonandMichael Latouche defe9d432b Add a basic oEmbedProvider for LottieFiles animations 2022-03-19 03:19:34 +01:00
Nikolaj Geisle a02ef3c101 Try to make test non-flaky 2022-03-18 14:52:57 +01:00
Nikolaj GeisleandGitHub 93432a2658 Apply suggestions from code review 2022-03-18 14:26:25 +01:00
Nikolaj Geisle 8e78de4dc5 Abstract ParameterValueEditors 2022-03-18 14:24:04 +01:00
Sebastiaan Janssen 4469191c99 Updating some more obsolete Code of Conduct usages 2022-03-18 13:40:03 +01:00
Sebastiaan Janssen ead813989d Code of conduct has been moved to an organization-wide repository 2022-03-18 13:36:40 +01:00
Nikolaj Geisle 0f3aa320be Fix caching & contentPicker in parameter 2022-03-18 12:54:19 +01:00
3044f8df04 Item tracking fixes (#12146)
* Cleanup; Fix lang keys

* Documentation

* Typos

* Distinct the results

* Changed GetPagedRelationsForItems to GetPagedRelationsForItem as we would only expect a single id to be passed when calling this + fix more docs

* Changed to the correct reference

* Unused code

* Only load references when info tab is clicked

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-03-18 11:21:49 +01:00
Bjarke Berg 608a65147f Fixes 2022-03-18 08:02:44 +01:00
c7e45ae13a Encode path (#12132)
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-03-17 14:53:53 +01:00
30a30731ec Encode path (#12132)
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-03-17 14:52:15 +01:00
Elitsa Marinovska c08921d3e6 Merge remote-tracking branch 'origin/v9/dev' into v9/bugfix/track-media-items-picked-as-macro-params 2022-03-16 15:11:58 +01:00
Elitsa Marinovska 5bebf98339 Test + fix 2022-03-16 14:19:25 +01:00
Elitsa Marinovska 5d08caae8c Cleanup 2022-03-16 14:18:24 +01:00
Elitsa Marinovska 22b7771305 Changing the way we implement the new Macro service and repository 2022-03-16 14:15:46 +01:00
Elitsa Marinovska cf9f4f39e4 Adds/Fixes xdoc comments 2022-03-16 10:30:02 +01:00
patrickdemooij9andMichael Latouche 886d7f1a25 Add allowedChildren call to Outgoing Editor events 2022-03-15 23:49:22 +01:00
8c9410a307 v9/bugfix/remove_useless_tolists: removed useless tolist()'s (#12123)
Co-authored-by: Reiter <michaelreiter2000@gmail.com>
2022-03-14 08:46:35 +10:00
Paul JohnsonandGitHub ff2865c1dc Further enhancements for legacy password support. (#12124)
* Further enhancements for legacy password support.

For users - try new style passwords first and fallback on failure seeing
as a valid modern password is the norm, rehash is only one time.

For both users and members also deals with the fact that for
useLegacyEncoding we could store any old thing in passwordConfig
e.g. it's possible to get Umbraco8 to store "HMACSHA384" alongside
the hash even though it's really HMACSHA1 with password used as key
(try it out by tweaking machine key settings and setting
useLegacyEncoding=true).

Has behavioral breaking changes in LegacyPasswordSecurity as the
code now expects consumers to to respect IsSupportedHashAlgorithm
rather than ignoring it.

* Less rushed removals
2022-03-11 10:41:04 +00:00
Elitsa Marinovska 92480b8446 Changes in the editors so we can track the items 2022-03-10 16:29:56 +01:00
Elitsa Marinovska c22b9dbb76 Adding a new parser to get the media references in a macro 2022-03-10 16:28:33 +01:00
Elitsa Marinovska cbb19b1d93 Implementations of the new interfaces 2022-03-10 16:27:31 +01:00
Elitsa Marinovska 2aa79c7494 Adding repository caching of macro definition by alias 2022-03-10 16:26:16 +01:00
Elitsa Marinovska 17266dacb1 New service and repo to get macros by alias 2022-03-10 16:25:47 +01:00
Paul JohnsonandBjarke Berg 1ab0bb9254 fix additional legacy password formats (#12120)
* Added failing test to demo issue.

* Handle old machine key default.
2022-03-10 15:00:16 +01:00
Paul JohnsonandGitHub cc05428640 fix additional legacy password formats (#12120)
* Added failing test to demo issue.

* Handle old machine key default.
2022-03-10 14:59:19 +01:00
Bjarne FyrstenborgandGitHub cade6cb684 Add missing copy member type menu action (#12089) 2022-03-09 17:18:28 +01:00
vsilvarandSebastiaan Janssen 3c40c20d27 Made sure Umbraco files aren't included twice
This fixes CS8785 RazorSourceGenerator failures due to repeated files in .Net 6
2022-03-09 17:10:53 +01:00
Sebastiaan Janssen 097645eadd Merge branch 'v9/dev' into v9/contrib 2022-03-09 16:52:37 +01:00
Andrey KarandashovandGitHub 62b289e179 Block List Settings throws exception if Models builder mode is set to "Nothing" (#11725) 2022-03-09 16:47:54 +01:00
Ronald Barendse 8d82f86c29 Re-use DefaultItemExcludes from StaticAssets 2022-03-09 15:40:24 +01:00
Nikolaj GeisleandGitHub 1ac77680e0 Merge pull request #12114 from umbraco/v9/feature/move-created-packages
Move created packages out of webroot
2022-03-09 15:20:05 +01:00
Bjarke Berg 8746d4c13d Small typos fixed.. 2022-03-09 14:59:55 +01:00
Nikolaj fbb80c4a94 Merge remote-tracking branch 'origin/v9/9.4' into v9/dev 2022-03-09 14:50:47 +01:00
Ronald Barendse 7e8f23e514 Properly clean existing package files 2022-03-09 11:38:52 +01:00
Ronald Barendse 3afad96aa7 Move created packages out of webroot 2022-03-09 11:06:30 +01:00
a98b52a46b Possible NullReferenceException in MultiUrlPickerValueConverter (#12109)
* Fixed a bug in the MultiUrlPickerValueConverter file, where an invalid value being set will result in a NullReferenceException

* Change to checking for whitespace values before de-serializing

Co-authored-by: Paul Woodland <paul.woodland@pwnewmedia.com>
2022-03-09 08:51:49 +00:00
Andy ButlandandNikolaj 5d9e2b0bb8 Updates JSON schema to reference latest Forms and Deploy. (#12106) 2022-03-09 09:19:34 +01:00
Bjarke BergandGitHub c20f45dcfc Fixed issue with pageindex (0-indexed) vs pagenumber (1 indexed) (#12113) 2022-03-09 08:53:18 +01:00
Andy ButlandandGitHub 215bf69cb0 Updates JSON schema to reference latest Forms and Deploy. (#12106) 2022-03-08 16:33:43 +01:00
MoleandGitHub fff3e5e9d4 Fix saving content not updating the page (#12108)
* Fix relation type tests

* Fix saving content not updating the UI

We have to map to display after we've saved content or we'll be missing information generated when saving content such as ID

* Dont map to display to get isBlueprint
2022-03-08 11:33:22 +01:00
413a278373 V9: Fix missing EditedCultures and Name in content saving notifications (#12070)
* Map dirty culture to EditedCultures before saving

And set the name of the content when setting default culture variant name

* Update src/Umbraco.Web.BackOffice/Controllers/ContentController.cs

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

Co-authored-by: nikolajlauridsen <nel@umbraco.dk>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-03-08 09:23:44 +01:00
Bjarke Berg 5d6fc6005c Unbreak breaking change 2022-03-08 07:45:53 +01:00
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
Bjarke Berg 2ff2ae3f0a Unbreak a change.. 2022-03-07 22:14:21 +01:00
Bjarke Berg cfacf4e150 Rollback unnecessary breaking change 2022-03-07 22:07:50 +01:00
Sebastiaan Janssen d8551e4640 Merge branch 'v9/dev' into v9/contrib 2022-03-07 11:41:25 +01:00
Owain WilliamsandGitHub 373138d70f Make GridPropertyEditor dirty if a control is removed
This is the same fix that @inetzo made for a PR I checked earlier today except the fix was for U8.  Since I didn't notice it was U8 until I had merged, I thought I'd fix it here but credit should go to @inetzo 

#12097
2022-03-05 17:24:19 +00:00
Callum WhyteandMichael Latouche 10d252819d Adding null check to IsCulturePublished on IContent 2022-03-05 03:05:31 +01:00
Paul JohnsonandGitHub ca5c85e656 v9 fix misc issues external member login (#12093)
* Add missing override for SetTokenAsync

* Fix mismatch between expected scheme prefix and exception message

* Store tokens on member update
2022-03-03 17:18:39 +00:00
a6aaf4b0b1 Introduced new "large" overlay size (#11945)
* Introduced new "large" overlay size (1/2)

* Introduced new "large" overlay size (2/2)

* #H5IS

Co-authored-by: Owain <owilliams@spindogs.com>
2022-03-03 12:53:58 +00:00
Matt BrailsfordandGitHub 44e8808079 Check form and querystring when validating ufprt in ValidateUmbracoFormRouteStringAttribute (#11957)
* Check form and querystring when validating ufprt

Checks to see if the request has form data before validating the `ufprt` parameter, and if it doesn't assumes it must be on the querystring

* Create GetUfprt extension method

* Use GetUfprt extension

* Update UmbracoRouteValueTransformer to use GetUfrpt()

* Added missing using statement

* Check for StringValues.Empty
2022-03-03 10:42:14 +00:00
dependabot[bot]GitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
59b0224eff Bump karma from 6.3.14 to 6.3.16 in /src/Umbraco.Web.UI.Client (#12090)
Bumps [karma](https://github.com/karma-runner/karma) from 6.3.14 to 6.3.16.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v6.3.14...v6.3.16)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-02 15:06:45 +01:00
Nikolaj GeisleandGitHub 65723ea9ec Merge pull request #12087 from umbraco/v9/bugfix/history-cleanup-make-contenttype-dirty
V9: Fix history cleanup not making content type dirty
2022-03-02 12:23:24 +01:00
Nikolaj GeisleandGitHub 50a239a016 Merge pull request #12081 from umbraco/v9/bugfix/fix-invariant-redirect-tracking
Fix invariant redirect tracking
2022-03-02 12:20:15 +01:00
nikolajlauridsen 5ef013ca62 Ensure ContentType is only marked as dirty when it's actually changed 2022-03-02 10:49:06 +01:00
ff477c3930 Update src/Umbraco.Infrastructure/Routing/RedirectTrackingHandler.cs
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
2022-03-02 10:26:23 +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
nikolajlauridsen 7e9def9df4 Add tests 2022-03-02 10:11:33 +01:00
009b36b49e Send key from frontend to postsave (#12080)
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-03-02 09:12:07 +01:00
44ddf7acef Add extra check (#12075)
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-03-02 08:47:35 +01:00
Chad CurrieandMichael Latouche 6b3a589aa0 Check Debug logs are enabled for hot path 2022-03-02 02:06:52 +01:00
nikolajlauridsen 95f1ed33ec Make empty string invariant culture in DefaultUrlProvider 2022-03-01 14:14:48 +01:00
nikolajlauridsen 993c582bd9 Handle empty string as invariant when generating cache key 2022-03-01 13:51:21 +01:00
Bjarne FyrstenborgandNathan Woulfe a72698e1a9 Transition of lazy loaded image 2022-03-01 17:16:32 +10:00
Martin BentancourandGitHub c905fdd9b5 Validate that imageUrl param is a relative path (#11606)
* Validate that imageUrl param is a relative path

To prevent open redirects, the imagePath should point to a relative path (i.e. not point to a different domain).

* LocalRedirectResult instead of RedirectResult

Uri.Relative does not prevent paths like //google.com/test.jpg
Checking for both relative and local seems to cover all the cases.
2022-02-28 23:59:18 +01:00
34bfd3a8f3 Fixes issue with OrderByDescending generating invalid SQL (#11673)
* Fixes issue with OrderByDescending generating invalid SQL

* Update OrderByDexcending with single field for consistecy

Co-authored-by: Michael <michael@crossingpaths.be>
2022-02-28 23:06:59 +01:00
nikolajlauridsen dfbb182a94 Handle invariant culture in RedirectTrackingHandler
GetRouteById and RedirectUrlService expects the culture to be null if it's invariant, however, Cultures in IPublished content uses empty string for invariant culture
2022-02-28 17:29:11 +01:00
Corné HoskamandGitHub aba4f02bad (umbraCollab) Check media Parent for permissions when setting correct MediaType (#11858) 2022-02-28 16:29:23 +01:00
patrickdemooij9andGitHub a27da0fced Content app for dictionary items (#11553) 2022-02-28 15:01:18 +01:00
0c7ef06031 V9: Fix missing site identifier (#12040)
* Add SiteIdentifierService

* Use SiteIdentifierService in TelemetryService

* Use SiteIdentifierService when installing

* Remove timeout

* Use TryGetOrCreateSiteIdentifier in TelemetryService

* Add site identifier to dashboard url

* Fix and add tests

* Don't accept empty guid as valid site identifier

* Fix dashboard controller

* Fix site id query parameter

* Use Optionsmonitor onchange

Co-authored-by: nikolajlauridsen <nel@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-02-28 13:59:39 +01:00
MehmetandGitHub e6d6dce3a8 Fix mssing image caption in RTE (#11807) 2022-02-28 13:17:17 +01:00
Blake IrwinandGitHub 24d2dcf363 Fix JsonConfigManipulator causing upgrades to fail when appsettings.json files are not present (#11222) 2022-02-28 10:52:03 +01:00
Scott BradyandGitHub 25ea5cdb1b Prevent non-backoffice auth schemes being overridden (#11630) 2022-02-28 10:40:51 +01:00
Bjarne FyrstenborgandGitHub cf3d697bc5 Update RemoveTreeController to use TController (#11795) 2022-02-28 09:36:35 +01:00
Bjarne FyrstenborgandGitHub 6fd45f653c Media entry editor listview children (#12061) 2022-02-27 17:46:40 +01:00
Bjarne FyrstenborgandSebastiaan Janssen d97d0040c2 Remove unused variable 2022-02-27 16:57:57 +01:00
Bjarne FyrstenborgandSebastiaan Janssen aa62417916 Update mapping so we know if it is blueprint on first save before content has been created 2022-02-27 16:57:57 +01:00
Bjarne FyrstenborgandSebastiaan Janssen 62e3286c71 Vary localization based on content or blueprint 2022-02-27 16:57:57 +01:00
dependabot[bot]andSebastiaan Janssen d433991b61 Bump karma from 4.4.1 to 6.3.14 in /src/Umbraco.Web.UI.Client
Bumps [karma](https://github.com/karma-runner/karma) from 4.4.1 to 6.3.14.
- [Release notes](https://github.com/karma-runner/karma/releases)
- [Changelog](https://github.com/karma-runner/karma/blob/master/CHANGELOG.md)
- [Commits](https://github.com/karma-runner/karma/compare/v4.4.1...v6.3.14)

---
updated-dependencies:
- dependency-name: karma
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-27 12:29:42 +01:00
dependabot[bot]andSebastiaan Janssen bc24efa812 Bump url-parse from 1.5.7 to 1.5.10 in /src/Umbraco.Web.UI.Client
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.7 to 1.5.10.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.7...1.5.10)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-27 11:58:35 +01:00
Bjarne FyrstenborgandGitHub 6d52a2f3da Babel adjustments (#12044) 2022-02-27 11:56:10 +01:00
ChadandGitHub 66961d18dc Prevent DatabaseServerMessenger handle leak (#12013) 2022-02-27 11:43:35 +01:00
patrickdemooij9andGitHub fa0027d4f1 Added property way of seeing composition (#11811) 2022-02-27 10:09:35 +01:00
Blake IrwinandGitHub a24b099831 V9: Fix Umbraco:CMS:Global:SqlWriteLockTimeOut setting value ignored (#11492) 2022-02-27 09:52:07 +01:00
Bjarne FyrstenborgandGitHub 6860d0b27d Filter block cards and show empty message (#11729) 2022-02-27 09:36:43 +01:00
AndyBootandGitHub dad1c190fc Settings Dashboard Umbraco.tv References (#12034) 2022-02-27 09:31:22 +01:00
Arkadiusz BielandSebastiaan Janssen 36faff6917 add null check for case when index is not implementing LuceneDirectoryIndexOptions 2022-02-27 09:19:23 +01:00
ChadandGitHub 7ddddb7500 Support async in TreeController (#12016) 2022-02-27 09:16:33 +01:00
Jason ElkinandGitHub b56f0f7062 Make views compatible with Nullable Reference Types (#11370) 2022-02-27 09:10:08 +01:00
Bartlomiej KomendarczukandMichael Latouche 9121879e1a 11921: Update CultureName after language change 2022-02-26 03:53:52 +01:00
Bjarne FyrstenborgandGitHub 69132faffa Set current selected master template in tree (#12042)
* Set current selected master template in tree

* Adjust styling for tree icon

* Code adjustment
2022-02-26 02:48:02 +01:00
Paul JohnsonandGitHub 4a6c409a1f Explicitly close release signal file. (#12057) 2022-02-25 10:56:45 +00:00
Paul JohnsonandGitHub 4351ce6ee4 Further changes requested during review of #12049 (#12053) 2022-02-25 08:22:37 +00:00
vsilvarandMichael Latouche 1b56a260b8 Allow configuring TinyMCE scripting sanitization 2022-02-25 01:38:54 +01:00
Paul JohnsonandGitHub de4b3af28f Resolve various points related to deficiencies in FileSystemMainDomLock (#12052)
* Resolve various points related to deficiencies in FileSystemMainDomLock

See GH #12049

* Increasing backoff time for retry when deleting lock release signal file
However reducing max tries, really hoping this never actually happens
and if it does, failing to boot ASAP seems reasonable.
2022-02-24 14:38:33 +00:00
Bjarke BergandGitHub 321d5b49bd Fix docfx namespace (#12048)
* Temp hack for building docs on pr

* Fix namespace

* revert hack to build docs on pr
2022-02-24 12:40:06 +01:00
Ronald Barendse ee3f7520b3 Conditionally update Umbraco version in templates 2022-02-24 11:41:31 +01:00
Ronald Barendse 5a3578eca9 Fix updating default Umbraco version in templates 2022-02-24 11:37:22 +01:00
Bjarke BergandGitHub 366d7c0fce Update docfx dependency (#12046)
* Update docfx

* temp commit to test out azure pipeline

* Rollback temp fix
2022-02-24 11:30:20 +01:00
Paul JohnsonandGitHub 860c8e8ae2 Filesystem based MainDomLock & extract interface for MainDomKey generation (#12037)
* Extract MainDomKey generation to its own class to ease customization.

Also add discriminator config value to GlobalSettings for advanced users.
Prevents a mandatory custom implementation, should be good enough for
the vast majority of use cases.

* Prevent duplicate runs of ScheduledPublishing during slot swap.

* Add filesystem based MainDomLock
2022-02-24 10:17:34 +00:00
Ronald Barendse 05d606d6a7 Fix artifact build and ensure the version of future templates are also updated 2022-02-24 10:42:59 +01:00
Ronald Barendse 2dc9ccda6d Disable packaging of JsonSchema and test projects 2022-02-24 10:24:27 +01:00
Ronald Barendse 9187186c62 Generate lowercase telemetry ID 2022-02-24 10:21:15 +01:00
Ronald Barendse 5813a8aadf Clean up and improve project templates 2022-02-23 23:20:13 +01:00
Patrick de MooijandNathan Woulfe 15bedfbc76 11777: Remove sorting because we need the correct order 2022-02-24 07:46:58 +10:00
Ronald Barendse 4c037774de Move templates to root 2022-02-23 22:45:35 +01:00
Chad CurrieandNathan Woulfe fe0ec420eb Add using statements for IDisposables 2022-02-24 06:46:11 +10:00
Sebastiaan Janssen 860792ff3f Revert "UmbEditorHeaders hide-icon on "true"" #11661
This reverts commit ff6a8d781d.
2022-02-23 14:38:47 +01:00
Bjarne FyrstenborgandSebastiaan Janssen 169d07b0cc Grant access to get all content types so content templates can be moved to content section 2022-02-23 14:13:07 +01:00
dependabot[bot]andSebastiaan Janssen 8c5a5af41b Bump follow-redirects in /src/Umbraco.Web.UI.Client
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.7 to 1.14.8.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.7...v1.14.8)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-23 10:17:39 +01:00
Sebastiaan JanssenandGitHub 411fb0c120 Update CODE_OF_CONDUCT.md 2022-02-23 09:56:21 +01:00
Sebastiaan JanssenandGitHub 27c60277f2 Update CODE_OF_CONDUCT.md 2022-02-23 09:25:40 +01:00
Nikolaj GeisleandGitHub dafd7f298d Merge pull request #12024 from umbraco/v9/feature/add_user_group_tests
Add user group tests
2022-02-22 10:48:40 +01:00
Paul JohnsonandGitHub e67da0b198 Ignore certificate errors for KeepAlive task. (#12019) 2022-02-22 09:49:56 +01:00
4f0a837e20 V9: Fix login timeout (#12029)
* Turn SlidingExpiration off and only renew cookie of not RemainingSeconds request

Also adds the TicketExpiresClaim before validating the the security stamp, otherwise the claim won't be merged and "dissappear", leading to the user being instantly logged out

Also only EnsureValidSessionId if not RemainingSeconds request, otherwise the session will always be valid, since the remaining seconds request renews it.

* Don't ignore SessionIdClaimType and Cookiepath when merging claims

Besides what the comment used to state these claims are only issued when logging in, leading you to be logged out once the claims are merged, furthermore when we check the session ID we verify that you session has not expired.

* Manually specify Issued and Expires when renewing token

If we don't we lose 30 minutes of our ExpireTimeSpan every time the principal refreshes

* Re-add ignored claims

And use MergeAllClaims on refreshing principal instead.

* EnsureValidSessionId before updating IssuedUtc

* Fix comment

* Update src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeCookieOptions.cs

Co-authored-by: nikolajlauridsen <nel@umbraco.dk>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-02-22 08:29:27 +01:00
dependabot[bot]andSebastiaan Janssen 864fd2a45a Bump url-parse from 1.5.3 to 1.5.7 in /src/Umbraco.Web.UI.Client
Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.5.3 to 1.5.7.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.5.3...1.5.7)

---
updated-dependencies:
- dependency-name: url-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-21 11:32:51 +01:00
Daniël KnippersandSebastiaan Janssen 8877c9c73d Fix Empty Recycle Bin view not found on Linux 2022-02-21 11:32:02 +01:00
Sebastiaan Janssen ab870347ed Merge branch 'v9/dev' into v9/contrib
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/pages/login.less
2022-02-21 10:06:08 +01:00
Robert FosterandGitHub 06f2408ebc Fix for #11977 - Content Name auto-numbering correction (#11996) 2022-02-21 10:20:08 +10:00
Mark DrakeandNathan Woulfe a53d28310f new stick top position for rte toolbar if tabs are present, issue #11870 2022-02-21 10:19:10 +10:00
LantzifyandNathan Woulfe 9568d0cd6d Added name & color description for umbAvatar 2022-02-21 10:02:41 +10:00
Anders BjernerandNathan Woulfe aba5edce02 Fixed issue in umbeditorheader.directive.js examples 2022-02-21 08:25:04 +10:00
Paul Johnson 791e4f92a1 Quick fix for PrefixLocalCallsWithThis 2022-02-18 11:41:27 +00:00
Nikolaj Geisle 566648de3f Add user group tests 2022-02-18 09:26:47 +01:00
Mole a13e66d559 Merge branch 'v9/9.3' into v9/dev
# Conflicts:
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
2022-02-17 15:09:55 +01:00
Bjarke BergandGitHub 3a269ed329 Fix issue with migration from 8 and added support for 8.18 migration (#12020)
* Fixed issue with migration from 8, because the external login table is changed in 9.3, but added in 9.0. we need to use the legacy models when running 9.0 migrations

* Support migration from 8.18 (final state)
2022-02-17 15:06:25 +01:00
Ronald BarendseandMole 7f762df952 Fix DataValueEditor incorrectly serializing JSON value (#12015)
* Remove JSON serialization

* Skip JSON serialization of strings
2022-02-17 13:34:48 +01:00
Ronald BarendseandGitHub 27a3431e76 Fix DataValueEditor incorrectly serializing JSON value (#12015)
* Remove JSON serialization

* Skip JSON serialization of strings
2022-02-17 13:33:45 +01:00
Mole 7cc495dc65 Bump version to 9.3.1 2022-02-17 13:20:53 +01:00
Bjarke BergandMole b581a45e05 Fix for rooted UNC paths (#11982) 2022-02-17 13:17:53 +01:00
Bjarke BergandGitHub 76fc3f8201 Fix for rooted UNC paths (#11982) 2022-02-17 10:59:35 +00:00
555b4fadf1 Lookup plugin lang / icons folders in a case insensitive way (#11985)
* Use lowercase lang folder name for packages lang files

Use lowercase lang folder name for packages lang files to be consistent with Umbraco's casing

* Case insensitive `lang` folder lookup

* Comment grammar

* Setup lower case appl_plugin icons folder path

* Update Constants-SystemDirectories.cs

* Check both casings for the AppPluginIcons path

* Fixed spelling mistake + avoid multiple Exists checks

* Add IsCaseSensitiveFileSystem to IHostingEnvironment

* Add IsCaseSensitiveFileSystem to AspNetCoreHostingEnvironment

* Undo last changes

* Undo last changed

* Add FileSystemUtility

* Only perform second iconPath if OS is case sensitive

* Undo changes

* Undo changes

* Remove filesystem utils file

* Added HostingEnvironmentExtensions.cs

* Use IsCaseSensitiveFileSystem extension method

* Use the Umbraco.Extensions namespace

* Simplify IsCaseSensitiveFileSystem

* Better naming

* Use PluginIcons

* Remove unused using statement

* Delete HostingEnvironmentExtensions.cs

* Update IconService.cs

* Comment clarity

* Update src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs

Co-authored-by: Paul Johnson <pmj+github@ologn.co.uk>

Co-authored-by: Paul Johnson <pmj+github@ologn.co.uk>
Co-authored-by: Michael Latouche <michael@crossingpaths.be>
2022-02-17 00:04:41 +01:00
Søren KottalandMichael Latouche 79817f5463 Makes group name wider to fit long group names 2022-02-16 02:20:21 +01:00
LantzifyandNathan Woulfe ff6a8d781d UmbEditorHeaders hide-icon on "true" 2022-02-16 09:43:43 +10:00
Bjarne FyrstenborgandGitHub 789a908a31 Adjust z-index of notifications (#11634)
* Store notification z-index in variable

* Only show unordered list if any notifications

* Move notificaion layers to same parent as overlays so layers can be controlled via z-index
2022-02-16 09:27:13 +10:00
Søren KottalandNathan Woulfe 336f2c2d5b Makes the template column i NC config expandable 2022-02-16 09:17:59 +10:00
JeavonandNathan Woulfe 8b6c844a55 Exclude the Umbraco Log files from UmbracoProject template gitignore 2022-02-16 07:57:06 +10:00
f1c83fbd80 Only select ItemIdFieldName in PublishedContentQuery.Search to improve performance (#11950)
* Fix code styling

* Only select ItemIdFieldName and fix exception when variation context is null

* Save hashset instead of making on on each request (indirectly)

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-02-15 16:46:20 +01:00
Bjarke Berg 0f4020dc7b Merge remote-tracking branch 'origin/v8/dev' into v9/dev
# Conflicts:
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/IContentSection.cs
#	src/Umbraco.Examine/Umbraco.Examine.csproj
#	src/Umbraco.Tests/Umbraco.Tests.csproj
#	src/Umbraco.Web.UI.Client/src/assets/img/application/umbraco_logo_large_blue.svg
#	src/Umbraco.Web.UI.Client/src/assets/img/application/umbraco_logomark_white.svg
#	src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbappheader.directive.js
#	src/Umbraco.Web.UI.Client/src/less/components/application/umb-app-header.less
#	src/Umbraco.Web.UI.Client/src/views/components/application/umb-app-header.html
#	src/Umbraco.Web.UI.Client/src/views/content/content.protect.controller.js
#	src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.controller.js
#	src/Umbraco.Web.UI.Client/src/views/packages/views/install-local.html
#	src/Umbraco.Web/Editors/BackOfficeServerVariables.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
2022-02-15 14:10:17 +01:00
62fa1695df Add config to hide backoffice logo (#11999)
* Added config to hide backoffice logo

* rename to hideBackofficeLogo

* hide on mobile

* add hideBackofficeLogo

* implement hideBackofficeLogo + toggle on click

* Updated c# syntax

Co-authored-by: Niels Lyngsø <niels.lyngso@gmail.com>
2022-02-15 10:48:52 +01:00
Andy ButlandandGitHub de2668a621 Added section for promoted packages in the back-office. (#11947)
* Added section for promoted packages in the back-office.

* Updates from PR review.
2022-02-14 17:41:12 +01:00
Paul Johnson a34e278a40 Fix whitespace in sln 2022-02-14 14:46:37 +00:00
Paul Johnson 461043bd82 Change web projects TargetFrameworkMoniker to 4.5.2 to stop VS 2022 err 2022-02-14 14:43:33 +00:00
Sebastiaan JanssenandNathan Woulfe 7f9b143e1a Fix items found in PVS-Studio analysis 2022-02-14 08:08:42 +10:00
Paul JohnsonandGitHub 91c4c77676 Switch a lot of warnings to suggestions until we are able to resolve. (#11974)
* Switch a lot of warnings to suggestions until we are able to resolve.

* Make stylecop respect more csharp_style rules

e.g. csharp_using_directive_placement

* Added cheatsheet

* Drop sorting requirements for using directives.
2022-02-11 16:24:53 +00:00
Erik-Jan WestendorpandNathan Woulfe d1f1817744 Translate "Create dictionary item" to Dutch 2022-02-11 08:43:34 +10:00
Paul JohnsonandGitHub 8393a5ba04 Merge pull request #11952 from mattbrailsford/patch-7
Don't hold static UmbracoContext reference
2022-02-10 18:10:01 +00:00
Paul JohnsonandGitHub cf410ab91e Attempt to make app local icu setup less problematic. (#11961)
* Attempt to make app local icu setup less problematic.

Prevents issues for windows build agent -> linux app server.

On Windows version is split at first '.' e.g. 68.2.0.9 ->  icuuc68.dll
https://github.com/dotnet/runtime/blob/205f70e/src/libraries/System.Private.CoreLib/src/System/Globalization/GlobalizationMode.Windows.cs

On Linux we are looking for libicuuc.so.68.2.0.9
https://github.com/dotnet/runtime/blob/205f70e/src/libraries/System.Private.CoreLib/src/System/Globalization/GlobalizationMode.Unix.cs

On macos we don't have a native library in a shiny nuget package so hope
folks are building on their macs or setting the rid until we have a
better solution.

* Combine elements
2022-02-10 12:03:35 +00:00
df6c8a4ecc refactor setTitle in MediaPicker.Controller.js (#11428)
* refactor setTitle in MediaPicker.Controller.js

* adding vm.activeTab

Co-authored-by: inada <inada@2p.com.sa>
2022-02-10 09:20:18 +10:00
Bjarne FyrstenborgandNathan Woulfe be6e0879e4 Align tags vertically in content type property component 2022-02-10 08:52:39 +10:00
Bjarne FyrstenborgandNathan Woulfe 731b06a987 Use pointer cursor pointer for keyboard shortcuts overview 2022-02-10 08:04:38 +10:00
Mark DrakeandGitHub 6f89bf2a45 fixes umbraco logo appearance on backoffice login page, issue #11830 (#11900)
* fixes umbraco logo appearance on backoffice login page, issue #11830

* gives umbraco logo minimum width of 30px, issue #11830
2022-02-10 08:00:57 +10:00
Callum WhyteandGitHub 4eda091fdb Lookup backoffice section name in route locationTitle (#11816)
* Lookup backoffice section name in route locationTitle

* Getting original title from $rootScope
2022-02-10 07:56:59 +10:00
nikolajlauridsen b63aa4b19c Merge remote-tracking branch 'origin/v9/9.3' into v9/dev
# Conflicts:
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
2022-02-09 13:31:49 +01:00
Matt BrailsfordandGitHub 8c780573f4 Don't hold static UmbracoContext reference
Fixes #11951 by changing `UmbracoContext` to be an expression rather than being a static setter thus ensuring the current umbraco context is always returned, rather than a cached version from initial execution
2022-02-08 09:41:35 +00:00
Niels LyngsøandGitHub 0b0182f550 Apply the Umbraco logo to BackOffice (#11949)
* adding logo as text in replacement of umbraco_logo_white, this will enable existing configuration to continue to work and minimise the breaking change of this PR.

* adjust logo position to fit with logged-in logomark. Allowing for the logo and customised logo to be very wide.

* adding logomark in topbar of backoffice

* login box style

* correction of shadow

* Logo modal, to display more information about the product including linking to the website

* rename to modal

* stop hidden when mouse is out

* Version line without Umbraco

* focus link and use blur as the indication for closing.

* correcting to rgba

* focus and click outside needs a little help to work well

* use @zindexUmbOverlay to ensure right depth going forward.

* adding large logo svg

* append ;

* tidy logo svg file
2022-02-08 10:35:06 +01:00
Bjarke Berg 158f4d29f6 Bump version to 9.4.0-rc 2022-02-04 13:02:19 +01:00
Bjarke BergandGitHub 139c5791a5 Merge pull request #11926 from umbraco/v9/bugfix/replicas-write-to-server-table
Don't write to server table if not using ElectedServerRoleAccessor
2022-02-01 14:53:37 +01:00
Bjarke BergandGitHub 27ef97bf34 Merge pull request #11924 from umbraco/v9/feature/override-sitename-from-config
Allow setting the site name from appsettings
2022-02-01 14:38:39 +01:00
Bjarke BergandGitHub d6f968eee4 Merge pull request #11874 from umbraco/v9/feature/play-nice-with-ServiceBasedControllerActivator
Prevent issues for those who wish use ServiceBasedControllerActivator.
2022-02-01 14:34:37 +01:00
Sebastiaan Janssen a6ce7bcdf6 Merge branch 'v8/dev' into v8/8.18 2022-02-01 11:36:26 +01:00
Sebastiaan Janssen 0200434227 Merge branch 'v8/contrib' into v8/dev 2022-02-01 11:09:02 +01:00
Kenn JacobsenandGitHub 9a5bcf290d Retain mculture when clicking results from global search (#7192) 2022-02-01 01:50:22 +01:00
Sebastiaan Janssen ec183e481c Bump version to 8.18.0-rc 2022-01-31 15:47:51 +01:00
Sebastiaan Janssen 924a819baa Upgrade ClientDependency to 1.9.10 2022-01-31 15:39:34 +01:00
3af6645ad8 Fix URL with culture (#11886)
* Ignore casing when comparing default culture

* Ignore casing in GetAssignedWithCulture

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-01-31 15:02:25 +01:00
Mole 824bc2ac28 Fix word salad in comment 2022-01-31 14:58:45 +01:00
Mole febdac5713 Fix tests 2022-01-31 14:46:25 +01:00
Mole 22dd3a214c Stop TouchServerTask is registered role accessor is not elected 2022-01-31 14:39:29 +01:00
Sebastiaan Janssen 4382868f82 Upgrade Examine to v1.2.2 2022-01-31 14:18:55 +01:00
Sebastiaan Janssen 5c019a1557 Merge branch 'v8/contrib' into v8/dev 2022-01-31 14:15:03 +01:00
Mole bdcb5d859e Get site name from appsettings if possible 2022-01-31 10:12:02 +01:00
Paul Johnson 1810cec80a Simplify registration for ambiguous ctor
ActivatorUtilitiesConstructor respected.
2022-01-31 08:39:33 +00:00
Bjarne FyrstenborgandGitHub 472cc716c4 Accept zip as extension in local package installer (#11109)
* Update ngf-pattern and accept

* Restructure less

* Remove ng-invalid again
2022-01-31 02:40:15 +01:00
andreymkarandashovandMichael Latouche 3167c8b213 encode group name to avoid the issue 2022-01-31 01:35:03 +01:00
Arul PrabakaranandGitHub 2abf455abf Updated border radius of .umb-notifications__notification to match button radius (#11745) 2022-01-31 09:08:51 +10:00
Bjarne FyrstenborgandGitHub f2450fb539 Constant icon blueprint (#11812)
* Add constant for blueprint icon

* Use constant for folder icon

* Create empty array of IEntitySlim as the GetAll() method returns IEnumerable<IEntitySlim>

* Use constant
2022-01-31 08:34:37 +10:00
c0dfb33916 Fix importing DocType if parent folder already exists (#11885)
* Don't try to create parent folder if it already exists

* Fix typo

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-01-28 12:30:44 +01:00
Lennard FonteijnandMichael Latouche 477697a70c Removed if-check to allow empty values from blocks 2022-01-28 03:43:53 +01:00
Bjarke BergandGitHub 5de36f5669 Merge pull request #11916 from umbraco/v9/feature/merge_v8_27012022
V9/feature/merge v8 27012022
2022-01-27 17:38:32 +01:00
a71529a058 V9/feature/merge v8 27012022 (#11915)
* Add allowlist for HelpPage

* Use current request for emails (#11775)

* Use current request for emails

* Fix tests

* Bump version to 8.17.2

* Use Umbraco Path instead of constant

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-01-27 17:37:32 +01:00
Bjarke Berg deff17e622 Merge remote-tracking branch 'origin/v8/dev' into v9/dev
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/ConfigsExtensions.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/Editors/AuthenticationController.cs
#	src/Umbraco.Web/Editors/HelpController.cs
#	src/Umbraco.Web/Editors/UsersController.cs
2022-01-27 17:35:47 +01:00
Bjarke Berg 8c822c59ac Merge remote-tracking branch 'origin/v8/8.17' into v8/dev
# Conflicts:
#	src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
#	src/Umbraco.Web/Editors/UsersController.cs
2022-01-27 16:04:50 +01:00
Bjarke Berg c79380191b Use Umbraco Path instead of constant 2022-01-27 15:57:22 +01:00
Bjarke Berg a779803763 Bump version to 8.17.2 2022-01-27 13:18:21 +01:00
MoleandBjarke Berg 1b98f8985e Use current request for emails (#11775)
* Use current request for emails

* Fix tests
2022-01-27 12:59:45 +01:00
MoleandGitHub 56d54d441f Merge pull request #11907 from umbraco/v8/feature/allowlist-for-help-page
V8: Add allowlist for HelpPage
2022-01-26 13:07:40 +01:00
Mole 9dbe2d211c Add allowlist for HelpPage 2022-01-26 10:57:49 +01:00
LantzifyandSebastiaan Janssen aae8694618 Added description to entityResource.getSafeAlias 2022-01-21 10:56:04 +01:00
Bjarne FyrstenborgandSebastiaan Janssen 6a95ff366f Ensure query is not null before using Trim() 2022-01-21 10:54:29 +01:00
dependabot[bot]andSebastiaan Janssen c3b619fbbf Bump follow-redirects in /src/Umbraco.Web.UI.Client
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.14.4 to 1.14.7.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.14.4...v1.14.7)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 10:50:35 +01:00
Paul Johnson 366a8ba565 Prevent issues for those who wish use ServiceBasedControllerActivator.
Adds registration for CurrentUserController which has ambiguous constructors.
Register our controllers so that issues are visible during dev/test.
2022-01-18 00:40:39 +00:00
Søren KottalandSebastiaan Janssen 50da4a77de Adds support for simple markdown in property descriptions, and extended property descriptions (#11628)
* Adds support for simple markdown in property descriptions, and extended descriptions

* removes max-width for property descriptions (doesn't make sense to limit these IMO)

(cherry picked from commit 8393fdecfb)
2021-12-14 14:28:02 +01:00
494 changed files with 35434 additions and 5684 deletions
-43
View File
@@ -306,48 +306,6 @@ dotnet_naming_rule.other_public_protected_fields_disallowed_rule.symbols
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.style = disallowed_style
dotnet_naming_rule.other_public_protected_fields_disallowed_rule.severity = error
##########################################
# StyleCop Field Naming Rules
# Naming rules for fields follow the StyleCop analyzers
# This does not override any rules using disallowed_style above
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
##########################################
# All constant fields must be PascalCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.severity = warning
# All static readonly fields must be PascalCase
# Ajusted to ignore private fields.
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.severity = warning
# No non-private instance fields are allowed
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.severity = error
# Local variables must be camelCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md
dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local
dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.severity = silent
# This rule should never fire. However, it's included for at least two purposes:
# First, it helps to understand, reason about, and root-case certain types of issues, such as bugs in .editorconfig parsers.
# Second, it helps to raise immediate awareness if a new field type is added (as occurred recently in C#).
@@ -357,7 +315,6 @@ dotnet_naming_rule.sanity_check_uncovered_field_case_rule.symbols = sanity_chec
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.style = internal_error_style
dotnet_naming_rule.sanity_check_uncovered_field_case_rule.severity = error
##########################################
# Other Naming Rules
##########################################
-92
View File
@@ -1,92 +0,0 @@
# Umbraco Code of Conduct
## Preamble
We are the friendly CMS. And our friendliness stems from our values. That's why we have set for ourselves, Umbraco HQ, and the community, five values to guide us in everything we do:
* Trust - We believe in and empower people
* Respect - We treat others as we would like to be treated
* Open - We share our thoughts and knowledge
* Hungry - We want to do things better, best is next
* Friendly - We want to build long-lasting relationships
With these values in mind, we want to offer the Umbraco community a code of conduct that specifies a baseline standard of behavior so that people with different social values and communication styles can work together.
This code of conduct is based on the widely used Contributor Covenant, as described in [https://www.contributor-covenant.org/](https://www.contributor-covenant.org/)
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Enforcement Responsibilities
Community leaders (e.g. Meetup & festival organizers, moderators, maintainers, ...) are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
Specific enforcement steps are listed in the [Code of Conduct Enforcement Guidelines](https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/.github/CODE_OF_CONDUCT_ENFORCEMENT.md) document which is an appendix of this document, updated and maintained by the Code of Conduct Team.
## Scope
This Code of Conduct applies within all community spaces and events supported by Umbraco HQ or using the Umbraco name. It also applies when an individual is officially representing the community in public spaces.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior, may be reported at [conduct@umbraco.com](mailto:conduct@umbraco.com). All complaints will be reviewed and investigated promptly and fairly.
Or alternatively, you can reach out directly to any of the team members behind the address above:
* Sebastiaan Janssen (He, Him - Languages spoken: English, Dutch, Danish(Read)) [sebastiaan@umbraco.com](mailto:sebastiaan@umbraco.com)
* Ilham Boulghallat (She, Her - Languages spoken: English, French, Arabic) [ilham@umbraco.com](mailto:ilham@umbraco.com)
* Arnold Visser (He, Him - Languages spoken: English, Dutch) [arnold@umbraco.com](mailto:arnold@umbraco.com)
The review process is done with full respect for the privacy and security of the reporter of any incident.
People with a conflict of interest should exclude themselves or if necessary be excluded by the other team members.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
**1. Correction**
Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
Consequence: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
**2. Warning**
Community Impact: A violation through a single incident or series of actions.
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
**3. Temporary Ban**
Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
**4. Permanent Ban**
Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
Consequence: A permanent ban from any sort of public interaction within the community.
## Attribution
This Code of Conduct is adapted from the Contributor Covenant, version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html).
This Code of Conduct will be maintained and reviewed by the team listed above.
-57
View File
@@ -1,57 +0,0 @@
# Umbraco Code of Conduct Enforcement guidelines - Consequence Ladder
These are the steps followed by the [Umbraco Code of Conduct Team](https://github.com/umbraco/Umbraco-CMS/blob/v8/contrib/.github/CODE_OF_CONDUCT.md) when we respond to an issue or incident brought to our attention by a community member.
This is an appendix to the Code of Conduct and is updated and maintained by the Code of Conduct Team.
To make sure that all reports will be reviewed and investigated promptly and fairly, as highlighted in the Umbraco Code of Conduct, we are following [Mozillas Consequence Ladder approach](https://github.com/mozilla/inclusion/blob/master/code-of-conduct-enforcement/consequence-ladder.md).
This approach helps the Team enforce the Code of Conduct in a structured manner and can be used as a way of communicating escalation. Each time the Team takes an action (warning, ban) the individual is made aware of future consequences. The Team can either follow the order of the levels in the ladder or decide to jump levels. When needed, the team can go directly to a permanent ban.
**Level 0: No Action**
Recommendations do not indicate a violation of the Code of Conduct.
**Level 1: Simple Warning Issued**
A private, written warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior.
**Level 2: Warning**
A private, written warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
* Communication of next-level consequences if behaviors are repeated (according to this ladder).
**Level 3: Warning + Mandatory Cooling Off Period (Access Retained)**
A private warning from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
* Request to avoid interaction on community messaging platforms (public forums, Our, commenting on issues).
* This includes avoiding any interactions in any Umbraco channels, spaces/offices, as well as external channels like social media (e.g. Twitter, Facebook, LinkedIn). For example, 'following/liking/retweeting' would be considered a violation of these terms, and consequence would escalate according to this ladder.
* Require they do not interact with others in the report, or those who they suspect are involved in the report.
* Suggestions for 'out of office' type of message on platforms, to reduce curiosity, or suspicion among those not involved.
**Level 4: Temporary Ban (Access Revoked)**
Private communication of ban from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
* 3-6 months imposed break.
* All accounts deactivated, or blocked during this time (Our, HQ Slack if applicable).
* Require to avoid interaction on community messaging platforms (public forums, Our, commenting on issues).
* This includes avoiding any interactions in any Umbraco channels, spaces/offices, as well as external channels like social media (e.g. Twitter, Facebook, LinkedIn). For example, 'following/liking/retweeting' would be considered a violation of these terms, and consequence would escalate according to this ladder.
* All community leadership roles (e.g. Community Teams, Meetup/festival organizer, Commit right on Github..) suspended. (onboarding/reapplication required outside of this process)
* No attendance at Umbraco events during the ban period.
* Not allowed to enter Umbraco HQ offices during the ban period.
* Permission to use the MVP title, if applicable, is revoked during this ban period.
* The community leaders running events and other initiatives are informed of the ban.
**Level 5: Permanent Ban**
Private communication of ban from the Code of Conduct Team, with clarity of violation, consequences of continued behavior. Additionally:
* All accounts deactivated permanently.
* No attendance at Umbraco events going forward.
* Not allowed to enter Umbraco HQ offices permanently.
* All community leadership roles (e.g. Community Teams, Meetup/festival organizer, Commit right on Github..) permanently suspended.
* Permission to use the MVP title, if applicable, revoked.
* The community leaders running events and other initiatives are informed of the ban.
Sources:
* [Mozilla Code of Conduct - Enforcement Consequence Ladder](https://github.com/mozilla/inclusion/blob/master/code-of-conduct-enforcement/consequence-ladder.md)
* [Drupal Conflict Resolution Policy and Process](https://www.drupal.org/conflict-resolution)
* [Django Code of Conduct - Enforcement Manual](https://www.djangoproject.com/conduct/enforcement-manual/)
+1 -1
View File
@@ -10,7 +10,7 @@ Remember, we're a friendly bunch and are happy with whatever contribution you mi
**Code of conduct**
This project and everyone participating in it, is governed by the [our Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code. Please report unacceptable behavior to [Sebastiaan Janssen - sj@umbraco.dk](mailto:sj@umbraco.dk).
This project and everyone participating in it, is governed by the [our Code of Conduct](https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md).
**Table of contents**
+2 -2
View File
@@ -1,4 +1,4 @@
# [Umbraco CMS](https://umbraco.com) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md) [![Build status](https://umbraco.visualstudio.com/Umbraco%20Cms/_apis/build/status/Cms%208%20Continuous?branchName=v8/contrib)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Twitter](https://img.shields.io/twitter/follow/umbraco.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=umbraco)
# [Umbraco CMS](https://umbraco.com) &middot; [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](../LICENSE.md) [![Build status](https://umbraco.visualstudio.com/Umbraco%20Cms/_apis/build/status/Cms%208%20Continuous?branchName=v8/contrib)](https://umbraco.visualstudio.com/Umbraco%20Cms/_build?definitionId=75) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md) [![Twitter](https://img.shields.io/twitter/follow/umbraco.svg?style=social&label=Follow)](https://twitter.com/intent/follow?screen_name=umbraco) [![Discord](https://img.shields.io/discord/869656431308189746)](https://discord.gg/umbraco)
Umbraco is the friendliest, most flexible and fastest growing ASP.NET CMS, and used by more than 500,000 websites worldwide. Our mission is to help you deliver delightful digital experiences by making Umbraco friendly, simpler and social.
@@ -15,7 +15,7 @@ See the official [Umbraco website](https://umbraco.com) for an introduction, cor
- [Community](#join-the-umbraco-community)
- [Contributing](#contributing)
Please also see our [Code of Conduct](CODE_OF_CONDUCT.md).
Please also see our [Code of Conduct](https://github.com/umbraco/.github/blob/main/.github/CODE_OF_CONDUCT.md).
## Getting Started
+26
View File
@@ -0,0 +1,26 @@
name: pr-first-response
on:
pull_request:
types: [opened]
jobs:
send-response:
runs-on: ubuntu-latest
steps:
- name: Fetch random comment 🗣️
uses: JamesIves/fetch-api-data-action@v2.1.0
with:
ENDPOINT: https://collaboratorsv2.euwest01.umbraco.io/umbraco/api/comments/PostComment
CONFIGURATION: '{ "method": "POST", "headers": {"Authorization": "Bearer ${{ secrets.OUR_BOT_API_TOKEN }}", "Content-Type": "application/json" }, "body": { "repo": "${{ github.repository }}", "number": "${{ github.event.number }}", "actor": "${{ github.actor }}", "commentType": "opened-pr-first-comment"} }'
- name: Add PR comment
if: "${{ env.fetch-api-data != '' }}"
uses: actions/github-script@v5
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `${{ env.fetch-api-data }}`
})
+6
View File
@@ -85,6 +85,12 @@ src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/lib/*
src/Umbraco.Web.UI/wwwroot/[Uu]mbraco/views/*
src/Umbraco.Web.UI/wwwroot/Media/*
src/Umbraco.Web.UI/Smidge/
src/Umbraco.Web.UI/App_Code/
src/Umbraco.Web.UI/App_Plugins/
src/Umbraco.Web.UI/Views/
!src/Umbraco.Web.UI/Views/Partials/blocklist/
!src/Umbraco.Web.UI/Views/Partials/grid/
!src/Umbraco.Web.UI/Views/_ViewImports.cshtml
# Tests
cypress.env.json
+82
View File
@@ -0,0 +1,82 @@
is_global = true
##########################################
# StyleCopAnalyzers Settings
##########################################
# All constant fields must be PascalCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1303.md
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected, private
dotnet_naming_symbols.stylecop_constant_fields_group.required_modifiers = const
dotnet_naming_symbols.stylecop_constant_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.symbols = stylecop_constant_fields_group
dotnet_naming_rule.stylecop_constant_fields_must_be_pascal_case_rule.style = pascal_case_style
# All static readonly fields must be PascalCase
# Ajusted to ignore private fields.
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1311.md
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
dotnet_naming_symbols.stylecop_static_readonly_fields_group.required_modifiers = static, readonly
dotnet_naming_symbols.stylecop_static_readonly_fields_group.applicable_kinds = field
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.symbols = stylecop_static_readonly_fields_group
dotnet_naming_rule.stylecop_static_readonly_fields_must_be_pascal_case_rule.style = pascal_case_style
# No non-private instance fields are allowed
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1401.md
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_accessibilities = public, internal, protected_internal, protected, private_protected
dotnet_naming_symbols.stylecop_fields_must_be_private_group.applicable_kinds = field
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.symbols = stylecop_fields_must_be_private_group
dotnet_naming_rule.stylecop_instance_fields_must_be_private_rule.style = disallowed_style
# Local variables must be camelCase
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1312.md
dotnet_naming_symbols.stylecop_local_fields_group.applicable_accessibilities = local
dotnet_naming_symbols.stylecop_local_fields_group.applicable_kinds = local
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.symbols = stylecop_local_fields_group
dotnet_naming_rule.stylecop_local_fields_must_be_camel_case_rule.style = camel_case_style
##########################################
# StyleCopAnalyzers rule severity
# https://github.com/DotNetAnalyzers/StyleCopAnalyzers
##########################################
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.DocumentationRules.severity = suggestion
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.ReadabilityRules.severity = suggestion
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.NamingRules.severity = suggestion
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.SpacingRules.severity = suggestion
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.OrderingRules.severity = suggestion
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.MaintainabilityRules.severity = suggestion
dotnet_analyzer_diagnostic.category-StyleCop.CSharp.LayoutRules.severity = suggestion
dotnet_diagnostic.SA1636.severity = none # SA1636: File header copyright text should match
dotnet_diagnostic.SA1101.severity = none # PrefixLocalCallsWithThis - stylecop appears to be ignoring dotnet_style_qualification_for_*
dotnet_diagnostic.SA1503.severity = warning # BracesMustNotBeOmitted
dotnet_diagnostic.SA1117.severity = warning # ParametersMustBeOnSameLineOrSeparateLines
dotnet_diagnostic.SA1116.severity = warning # SplitParametersMustStartOnLineAfterDeclaration
dotnet_diagnostic.SA1122.severity = warning # UseStringEmptyForEmptyStrings
dotnet_diagnostic.SA1028.severity = warning # CodeMustNotContainTrailingWhitespace
dotnet_diagnostic.SA1500.severity = warning # BracesForMultiLineStatementsMustNotShareLine
dotnet_diagnostic.SA1401.severity = warning # FieldsMustBePrivate
dotnet_diagnostic.SA1519.severity = warning # BracesMustNotBeOmittedFromMultiLineChildStatement
dotnet_diagnostic.SA1111.severity = warning # ClosingParenthesisMustBeOnLineOfLastParameter
dotnet_diagnostic.SA1520.severity = warning # UseBracesConsistently
dotnet_diagnostic.SA1407.severity = warning # ArithmeticExpressionsMustDeclarePrecedence
dotnet_diagnostic.SA1400.severity = warning # AccessModifierMustBeDeclared
dotnet_diagnostic.SA1119.severity = warning # StatementMustNotUseUnnecessaryParenthesis
dotnet_diagnostic.SA1649.severity = warning # FileNameMustMatchTypeName
dotnet_diagnostic.SA1121.severity = warning # UseBuiltInTypeAlias
dotnet_diagnostic.SA1132.severity = warning # DoNotCombineFields
dotnet_diagnostic.SA1134.severity = warning # AttributesMustNotShareLine
dotnet_diagnostic.SA1106.severity = warning # CodeMustNotContainEmptyStatements
dotnet_diagnostic.SA1312.severity = warning # VariableNamesMustBeginWithLowerCaseLetter
dotnet_diagnostic.SA1303.severity = warning # ConstFieldNamesMustBeginWithUpperCaseLetter
dotnet_diagnostic.SA1310.severity = warning # FieldNamesMustNotContainUnderscore
dotnet_diagnostic.SA1130.severity = warning # UseLambdaSyntax
dotnet_diagnostic.SA1405.severity = warning # DebugAssertMustProvideMessageText
dotnet_diagnostic.SA1205.severity = warning # PartialElementsMustDeclareAccess
dotnet_diagnostic.SA1306.severity = warning # FieldNamesMustBeginWithLowerCaseLetter
dotnet_diagnostic.SA1209.severity = warning # UsingAliasDirectivesMustBePlacedAfterOtherUsingDirectives
dotnet_diagnostic.SA1216.severity = warning # UsingStaticDirectivesMustBePlacedAtTheCorrectLocation
dotnet_diagnostic.SA1133.severity = warning # DoNotCombineAttributes
dotnet_diagnostic.SA1135.severity = warning # UsingDirectivesMustBeQualified
+1 -7
View File
@@ -2,12 +2,6 @@
<Project>
<!-- Package references and additional files which are consumed by all projects -->
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="all" IsImplicitlyDefined="true" />
<AdditionalFiles Include="$(MSBuildThisFileDirectory)stylecop.json" Link="stylecop.json" />
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.406" PrivateAssets="all" IsImplicitlyDefined="true" />
</ItemGroup>
<!-- Specify rule set for all projects -->
<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)codeanalysis.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
</Project>
@@ -1,7 +1,8 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\is-cache\**;wwwroot\ms-cache\**</DefaultItemExcludes>
</PropertyGroup>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins/**</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/Data/**</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/Logs/**</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot/media/**</DefaultItemExcludes>
</PropertyGroup>
</Project>
@@ -1,4 +1,4 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<ContentFilesPath>$(MSBuildThisFileDirectory)..\content\umbraco\**\*.*</ContentFilesPath>
@@ -6,16 +6,6 @@
<UmbracoWwwrootName Condition="'$(UmbracoWwwrootName)' == ''">umbraco</UmbracoWwwrootName>
</PropertyGroup>
<PropertyGroup>
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins\**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Data\**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\Logs\**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco\mediacache\**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);wwwroot\media\**;</DefaultItemExcludes>
</PropertyGroup>
<Target Name="CopyUmbracoAssets" BeforeTargets="BeforeBuild">
<ItemGroup>
<ContentFiles Include="$(ContentFilesPath)" />
@@ -39,6 +29,7 @@
<ContentWithTargetPath
Include="@(_AppPluginsFiles)"
Exclude="@(ContentWithTargetPath)"
TargetPath="%(Identity)"
CopyToOutputDirectory="PreserveNewest"
CopyToPublishDirectory="PreserveNewest"/>
@@ -65,6 +56,7 @@
<ContentWithTargetPath
Include="@(_UmbracoFolderFiles)"
Exclude="@(ContentWithTargetPath)"
TargetPath="%(Identity)"
CopyToOutputDirectory="PreserveNewest"
CopyToPublishDirectory="PreserveNewest"/>
@@ -92,7 +84,7 @@
<Target Name="IncludeUmbracoRazorFiles" BeforeTargets="ResolveRazorGenerateInputs">
<ItemGroup>
<Content Include="$(MSBuildProjectDirectory)\umbraco\**\*.cshtml" />
<Content Include="$(MSBuildProjectDirectory)\umbraco\**\*.cshtml" Exclude="@(Content)" />
</ItemGroup>
</Target>
+13 -28
View File
@@ -396,42 +396,27 @@ stages:
$ubuild = build/build.ps1 -get -continue
$version = $ubuild.GetUmbracoVersion()
$isRelease = [regex]::matches($env:BUILD_SOURCEBRANCH,"v\d+\/\d+.\d+.*")
if ($isRelease.Count -gt 0){
if ($isRelease.Count -gt 0) {
$continuous = $version.Semver
}
else
{
} else {
$date = (Get-Date).ToString("yyyyMMdd")
$continuous = "$($version.release)-preview$date.$(Build.BuildId)"
$ubuild.SetUmbracoVersion($continuous)
#Update the version in templates also
$templatePath =
'build/templates/UmbracoProject/.template.config/template.json'
$a = Get-Content $templatePath -raw | ConvertFrom-Json
$a.symbols.version.defaultValue = $continuous
$a | ConvertTo-Json -depth 32| set-content $templatePath
$templatePath =
'build/templates/UmbracoPackage/.template.config/template.json'
$a = Get-Content $templatePath -raw | ConvertFrom-Json
$a.symbols.version.defaultValue = $continuous
$a | ConvertTo-Json -depth 32| set-content $templatePath
}
# Update the default Umbraco version in templates
$templatePaths = Get-ChildItem 'templates/**/.template.config/template.json'
foreach ($templatePath in $templatePaths) {
$a = Get-Content $templatePath -Raw | ConvertFrom-Json
if ($a.symbols -and $a.symbols.UmbracoVersion) {
$a.symbols.UmbracoVersion.defaultValue = $continuous
$a | ConvertTo-Json -Depth 32 | Set-Content $templatePath
}
}
}
Write-Host "##vso[build.updatebuildnumber]$continuous.$(Build.BuildId)"
@@ -538,7 +523,7 @@ stages:
inputs:
targetType: inline
script: |
choco install docfx --version=2.58.5 -y
choco install docfx --version=2.59.0 -y
if ($lastexitcode -ne 0){
throw ("Error installing DocFX")
}
+18 -51
View File
@@ -11,7 +11,7 @@
[Alias("loc")]
[switch] $local = $false,
# enable docfx
# enable docfx
[Parameter(Mandatory=$false)]
[Alias("doc")]
[switch] $docfx = $false,
@@ -40,7 +40,7 @@
@{ Continue = $continue })
if ($ubuild.OnError()) { return }
Write-Host "Umbraco Cms Build"
Write-Host "Umbraco CMS Build"
Write-Host "Umbraco.Build v$($ubuild.BuildVersion)"
# ################################################################
@@ -84,7 +84,7 @@
$this.SetEnvVar("NPM_CONFIG_CACHE", $node_npmcache)
$this.SetEnvVar("NPM_CONFIG_PREFIX", $node_npmprefix)
$ignore = $this.ClearEnvVar("NODE_NO_HTTP2")
$this.ClearEnvVar("NODE_NO_HTTP2")
})
$ubuild.DefineMethod("CompileBelle",
@@ -171,11 +171,6 @@
$src = "$($this.SolutionRoot)\src"
$log = "$($this.BuildTemp)\build.umbraco.log"
if ($this.BuildEnv.VisualStudio -eq $null)
{
throw "Build environment does not provide VisualStudio."
}
Write-Host "Compile Umbraco"
Write-Host "Logging to $log"
@@ -195,14 +190,14 @@
# remove extra files
$webAppBin = "$($this.BuildTemp)\WebApp\bin"
$excludeDirs = @("$($webAppBin)\refs","$($webAppBin)\runtimes","$($webAppBin)\Umbraco","$($webAppBin)\wwwroot")
$excludeDirs = @("$($webAppBin)\refs","$($webAppBin)\runtimes","$($webAppBin)\umbraco","$($webAppBin)\wwwroot")
$excludeFiles = @("$($webAppBin)\appsettings.*","$($webAppBin)\*.deps.json","$($webAppBin)\*.exe","$($webAppBin)\*.config","$($webAppBin)\*.runtimeconfig.json")
$this.RemoveDirectory($excludeDirs)
$this.RemoveFile($excludeFiles)
# copy rest of the files into WebApp
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\Umbraco", "*", "$($this.BuildTemp)\WebApp\umbraco")
$excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\lib")
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\umbraco", "*", "$($this.BuildTemp)\WebApp\umbraco")
$excludeUmbracoDirs = @("$($this.BuildTemp)\WebApp\umbraco\lib","$($this.BuildTemp)\WebApp\umbraco\Data","$($this.BuildTemp)\WebApp\umbraco\Logs")
$this.RemoveDirectory($excludeUmbracoDirs)
$this.CopyFiles("$($this.SolutionRoot)\src\Umbraco.Web.UI\Views", "*", "$($this.BuildTemp)\WebApp\Views")
Copy-Item "$($this.SolutionRoot)\src\Umbraco.Web.UI\appsettings.json" "$($this.BuildTemp)\WebApp"
@@ -255,27 +250,21 @@
$buildConfiguration = "Release"
$log = "$($this.BuildTemp)\msbuild.tests.log"
if ($this.BuildEnv.VisualStudio -eq $null)
{
throw "Build environment does not provide VisualStudio."
}
Write-Host "Compile Tests"
Write-Host "Logging to $log"
# beware of the weird double \\ at the end of paths
# see http://edgylogic.com/blog/powershell-and-external-commands-done-right/
&$this.BuildEnv.VisualStudio.MsBuild "$($this.SolutionRoot)\tests\Umbraco.Tests\Umbraco.Tests.csproj" `
/p:WarningLevel=0 `
/p:Configuration=$buildConfiguration `
/p:Platform=AnyCPU `
/p:UseWPP_CopyWebApplication=True `
/p:PipelineDependsOnBuild=False `
/p:OutDir="$($this.BuildTemp)\tests\\" `
/p:Verbosity=minimal `
/t:Build `
/tv:"$($this.BuildEnv.VisualStudio.ToolsVersion)" `
/p:UmbracoBuild=True `
&dotnet msbuild "$($this.SolutionRoot)\tests\Umbraco.Tests\Umbraco.Tests.csproj" `
-target:Build `
-property:WarningLevel=0 `
-property:Configuration=$buildConfiguration `
-property:Platform=AnyCPU `
-property:UseWPP_CopyWebApplication=True `
-property:PipelineDependsOnBuild=False `
-property:OutDir="$($this.BuildTemp)\tests\\" `
-property:Verbosity=minimal `
-property:UmbracoBuild=True `
> $log
# copy Umbraco.Persistence.SqlCe files into WebApp
@@ -292,10 +281,6 @@
$src = "$($this.SolutionRoot)\src"
$tmp = "$($this.BuildTemp)"
$out = "$($this.BuildOutput)"
$templates = "$($this.SolutionRoot)\build\templates"
$buildConfiguration = "Release"
# cleanup build
Write-Host "Clean build"
@@ -309,7 +294,6 @@
# create directories
Write-Host "Create directories"
mkdir "$tmp\WebApp\App_Data" > $null
mkdir "$tmp\Templates" > $null
#mkdir "$tmp\WebApp\Media" > $null
#mkdir "$tmp\WebApp\Views" > $null
@@ -332,10 +316,6 @@
{
$nugetPackages = [System.Environment]::ExpandEnvironmentVariables("%userprofile%\.nuget\packages")
}
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\bin\x86")
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\bin\amd64")
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x86\native", "*.*", "$tmp\WebApp\bin\x86")
#$this.CopyFiles("$nugetPackages\umbraco.sqlserverce\4.0.0.1\runtimes\win-x64\native", "*.*", "$tmp\WebApp\bin\amd64")
# copy Belle
Write-Host "Copy Belle"
@@ -343,19 +323,6 @@
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\js", "*", "$tmp\WebApp\wwwroot\umbraco\js")
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\lib", "*", "$tmp\WebApp\wwwroot\umbraco\lib")
$this.CopyFiles("$src\Umbraco.Web.UI\wwwroot\umbraco\views", "*", "$tmp\WebApp\wwwroot\umbraco\views")
# Prepare templates
Write-Host "Copy template files"
$this.CopyFiles("$templates", "*", "$tmp\Templates")
Write-Host "Copy files for dotnet templates"
$this.CopyFiles("$src\Umbraco.Web.UI", "Program.cs", "$tmp\Templates\UmbracoProject")
$this.CopyFiles("$src\Umbraco.Web.UI", "Startup.cs", "$tmp\Templates\UmbracoProject")
$this.CopyFiles("$src\Umbraco.Web.UI\Views", "*", "$tmp\Templates\UmbracoProject\Views")
$this.RemoveDirectory("$tmp\Templates\UmbracoProject\bin")
})
@@ -389,7 +356,7 @@
{
Write-Host "Restore NuGet"
Write-Host "Logging to $($this.BuildTemp)\nuget.restore.log"
$params = "-Source", $nugetsourceUmbraco
$params = "-Source", $nugetsourceUmbraco
&$this.BuildEnv.NuGet restore "$($this.SolutionRoot)\umbraco-netcore-only.sln" > "$($this.BuildTemp)\nuget.restore.log" @params
if (-not $?) { throw "Failed to restore NuGet packages." }
})
@@ -397,7 +364,7 @@
$ubuild.DefineMethod("PackageNuGet",
{
$nuspecs = "$($this.SolutionRoot)\build\NuSpecs"
$templates = "$($this.BuildTemp)\Templates"
$templates = "$($this.SolutionRoot)\templates"
Write-Host "Create NuGet packages"
-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="4.1.0">
<id>Umbraco.Templates</id>
<version>1.0.0</version>
<authors>Umbraco HQ</authors>
<owners>Umbraco HQ</owners>
<license type="expression">MIT</license>
<projectUrl>https://umbraco.com/</projectUrl>
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Umbraco Cms templates for .NET Core Template Engine available through the dotnet CLI's new command</description>
<language>en-US</language>
<tags>umbraco</tags>
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
<packageTypes>
<packageType name="Template" />
</packageTypes>
</metadata>
</package>
@@ -1,6 +0,0 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
}
}
@@ -1,13 +0,0 @@
{
"$schema": "http://json.schemastore.org/vs-2017.3.host",
"order" : 0,
"icon": "icon.png",
"description": {
"id": "UmbracoPackage",
"text": "Umbraco Package - An empty Umbraco CMS package (Plugin)"
},
"symbolInfo": [
]
}
@@ -1,99 +0,0 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Umbraco HQ",
"description": "An empty Umbraco Package/Plugin ready to get started",
"classifications": [ "Web", "CMS", "Umbraco", "Package", "Plugin"],
"groupIdentity": "Umbraco.Templates.UmbracoPackage",
"identity": "Umbraco.Templates.UmbracoPackage.CSharp",
"name": "Umbraco Package",
"shortName": "umbracopackage",
"defaultName": "UmbracoPackage1",
"preferNameDirectory": true,
"tags": {
"language": "C#",
"type": "project"
},
"primaryOutputs": [
{
"path": "UmbracoPackage.csproj"
}
],
"sourceName": "UmbracoPackage",
"preferNameDirectory": true,
"symbols": {
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.3.0",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"namespaceReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "UmbracoPackage",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": "_"
},
{
"regex": "-",
"replacement": "_"
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": "_"
}
]
}
},
"msbuildReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "UmbracoPackageMsBuild",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": ""
},
{
"regex": "\\.",
"replacement": ""
},
{
"regex": "-",
"replacement": ""
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": ""
}
]
}
},
"Framework": {
"type": "parameter",
"description": "The target framework for the project.",
"datatype": "choice",
"choices": [
{
"choice": "net5.0",
"description": "Target net5.0"
},
{
"choice": "net6.0",
"description": "Target net6.0"
}
],
"replaces": "net5.0",
"defaultValue": "net5.0"
}
}
}
@@ -1,47 +0,0 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"PackageTestSiteName": {
"longName": "PackageTestSiteName",
"shortName": "p"
},
"UseSqlCe": {
"longName": "SqlCe",
"shortName": "ce"
},
"SkipRestore": {
"longName": "no-restore",
"shortName": ""
},
"FriendlyName": {
"longName": "friendly-name",
"shortName": ""
},
"Email": {
"longName": "email",
"shortName": ""
},
"Password": {
"longName": "password",
"shortName": ""
},
"ConnectionString":{
"longName": "connection-string",
"shortName": ""
},
"NoNodesViewPath":{
"longName": "no-nodes-view-path",
"shortName": ""
},
"UseHttpsRedirect": {
"longName": "use-https-redirect",
"shortName": ""
}
},
"usageExamples": [
"dotnet new umbraco -n MyNewProject",
"dotnet new umbraco -n MyNewProjectWithCE -ce",
"dotnet new umbraco -n MyNewProject --no-restore",
"dotnet new umbraco -n MyNewProject --friendly-name \"Friendly User\" --email user@email.com --password password1234 --connection-string \"Server=ConnectionStringHere\""
]
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

@@ -1,74 +0,0 @@
{
"$schema": "http://json.schemastore.org/vs-2017.3.host",
"order" : 0,
"icon": "icon.png",
"description": {
"id": "UmbracoProject",
"text": "Umbraco Web Application - An empty Umbraco CMS web application"
},
"symbolInfo": [
{
"id": "UseSqlCe",
"name": {
"text": "Use Sql Compact Edition (SqlCE)"
},
"isVisible": "true"
},
{
"id": "SkipRestore",
"name": {
"text": "Skips the automatic NuGet restore of the project on create"
},
"isVisible": "true"
},
{
"id": "PackageTestSiteName",
"name": {
"text": "Optional: Specify the name of a package that this should be a test site for"
},
"isVisible": "true"
},
{
"id": "FriendlyName",
"name": {
"text": "Optional: The friendly name of the user for Umbraco login when using Unattended install"
},
"isVisible": "true"
},
{
"id": "Email",
"name": {
"text": "Optional: Email to use for Umbraco login when using Unattended install"
},
"isVisible": "true"
},
{
"id": "Password",
"name": {
"text": "Optional: Password to use for Umbraco login when using Unattended install"
},
"isVisible": "true"
},
{
"id": "ConnectionString",
"name": {
"text": "Optional: Database connection string when using Unattended install"
},
"isVisible": "true"
},
{
"id": "NoNodesViewPath",
"name": {
"text": "Optional: Path to a custom view presented with the Umbraco installation contains no published content"
},
"isVisible": "true"
},
{
"id": "UseHttpsRedirect",
"name": {
"text": "Optional: Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting."
},
"isVisible": "true"
}
]
}
@@ -1,304 +0,0 @@
{
"$schema": "http://json.schemastore.org/template",
"author": "Umbraco HQ",
"description": "An empty Umbraco Project ready to get started",
"classifications": [ "Web", "CMS", "Umbraco"],
"groupIdentity": "Umbraco.Templates.UmbracoProject",
"identity": "Umbraco.Templates.UmbracoProject.CSharp",
"name": "Umbraco Project",
"shortName": "umbraco",
"defaultName": "UmbracoProject1",
"preferNameDirectory": true,
"tags": {
"language": "C#",
"type": "project"
},
"primaryOutputs": [
{
"path": "UmbracoProject.csproj"
}
],
"postActions": [
{
"condition": "(!SkipRestore)",
"description": "Restore NuGet packages required by this project",
"manualInstructions": [{
"text": "Run 'dotnet restore'"
}],
"actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025",
"continueOnError": true
}
],
"sourceName": "UmbracoProject",
"symbols": {
"namespaceReplacer": {
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "Umbraco.Cms.Web.UI",
"parameters": {
"source": "name",
"steps": [
{
"regex": "\\s",
"replacement": "_"
},
{
"regex": "-",
"replacement": "_"
},
{
"regex": "^[^a-zA-Z_]+",
"replacement": "_"
}
]
}
},
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.3.0",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
"PackageTestSiteName": {
"type": "parameter",
"datatype":"text",
"defaultValue": "",
"replaces":"PackageTestSiteName",
"description": "The name of the package this should be a test site for (Default: '')"
},
"UseSqlCe":{
"type": "parameter",
"datatype":"bool",
"defaultValue": "false",
"description": "Adds the required dependencies to use SqlCE (Windows only) (Default: false)"
},
"Framework": {
"type": "parameter",
"description": "The target framework for the project",
"datatype": "choice",
"choices": [
{
"choice": "net5.0",
"description": "Target net5.0"
},
{
"choice": "net6.0",
"description": "Target net6.0"
}
],
"replaces": "net5.0",
"defaultValue": "net5.0"
},
"SkipRestore": {
"type": "parameter",
"datatype": "bool",
"description": "If specified, skips the automatic restore of the project on create",
"defaultValue": "false"
},
"HttpPort": {
"type": "generated",
"generator": "port",
"replaces": "HTTP_PORT_FROM_TEMPLATE",
"parameters": {
"high": 65535,
"low": 1024,
"fallback": 5000
}
},
"HttpsPort": {
"type": "generated",
"generator": "port",
"replaces": "HTTPS_PORT_FROM_TEMPLATE",
"parameters": {
"low": 44300,
"high": 44399,
"fallback": 5001
}
},
"FriendlyName":{
"type": "parameter",
"datatype":"text",
"description": "The friendly name of the user for Umbraco login when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"FriendlyNameReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "FRIENDLY_NAME_FROM_TEMPLATE",
"parameters": {
"source": "FriendlyName",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"Email":{
"type": "parameter",
"datatype":"text",
"description": "Email to use for Umbraco login when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"EmailReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "EMAIL_FROM_TEMPLATE",
"parameters": {
"source": "Email",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"Password":{
"type": "parameter",
"datatype":"text",
"description": "Password to use for Umbraco login when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"PasswordReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "PASSWORD_FROM_TEMPLATE",
"parameters": {
"source": "Password",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"ConnectionString":{
"type": "parameter",
"datatype":"text",
"description": "Database connection string when using Unattended install (Without installer wizard UI)",
"defaultValue": ""
},
"ConnectionStringReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "CONNECTION_FROM_TEMPLATE",
"parameters": {
"source": "ConnectionString",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"NoNodesViewPath":{
"type": "parameter",
"datatype":"text",
"description": "Path to a custom view presented with the Umbraco installation contains no published content",
"defaultValue": ""
},
"NoNodesViewPathReplaced":{
"type": "generated",
"generator": "regex",
"dataType": "string",
"replaces": "NO_NODES_VIEW_PATH_FROM_TEMPLATE",
"parameters": {
"source": "NoNodesViewPath",
"steps": [
{
"regex": "\\\\",
"replacement": "\\\\"
},
{
"regex": "\\\"",
"replacement": "\\\""
},
{
"regex": "\\\n",
"replacement": "\\\n"
},
{
"regex": "\\\t",
"replacement": "\\\t"
}
]
}
},
"HasConnectionString":{
"type": "computed",
"value": "(ConnectionString != \"\")"
},
"HasNoNodesViewPath":{
"type": "computed",
"value": "(NoNodesViewPath != \"\")"
},
"UsingUnattenedInstall":{
"type": "computed",
"value": "(FriendlyName != \"\" && Email != \"\" && Password != \"\" && ConnectionString != \"\")"
},
"UseHttpsRedirect":{
"type": "parameter",
"datatype":"bool",
"defaultValue": "false",
"description": "Adds code to Startup.cs to redirect HTTP to HTTPS and enables the UseHttps setting (Default: false)"
}
}
}
@@ -1,8 +0,0 @@
@using Umbraco.Web.UI
@using Umbraco.Extensions
@using Umbraco.Web.PublishedModels
@using Umbraco.Cms.Core.Models.PublishedContent
@using Microsoft.AspNetCore.Html
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Smidge
@inject Smidge.SmidgeHelper SmidgeHelper
-18
View File
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="CodeAnalysis" ToolsVersion="16.0">
<Rules AnalyzerId="Roslynator.CSharp.Analyzers" RuleNamespace="Roslynator.CSharp">
<Rule Id="RCS1090" Action="None" />
</Rules>
<Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
<Rule Id="SA1101" Action="None" />
<Rule Id="SA1200" Action="None" />
<Rule Id="SA1308" Action="None" />
<Rule Id="SA1309" Action="None" />
<Rule Id="SA1311" Action="None" />
<Rule Id="SA1402" Action="None" />
<Rule Id="SA1413" Action="None" />
<Rule Id="SA1611" Action="None" />
<Rule Id="SA1615" Action="None" />
<Rule Id="SA1629" Action="None" />
</Rules>
</RuleSet>
@@ -15,8 +15,8 @@
<div class="level{{item.level}}"><span class="xref">{{item.name.0.value}}</span></div>
</div>
{{/inheritance.0}}
<h6><strong>{{__global.namespace}}</strong>:{{namespace}}</h6>
<h6><strong>{{__global.assembly}}</strong>:{{assemblies.0}}.dll</h6>
<h6><strong>{{__global.namespace}}</strong>: {{{namespace.specName.0.value}}}</h6>
<h6><strong>{{__global.assembly}}</strong>: {{assemblies.0}}.dll</h6>
<h5 id="{{id}}_syntax">{{__global.syntax}}</h5>
<div class="codewrapper">
<pre><code class="lang-{{_lang}} hljs">{{syntax.content.0.value}}</code></pre>
+5 -5
View File
@@ -1,12 +1,12 @@
<Project>
<Project>
<!-- Enable multi-level merging -->
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<Version>9.3.0</Version>
<AssemblyVersion>9.3.0</AssemblyVersion>
<InformationalVersion>9.3.0</InformationalVersion>
<FileVersion>9.3.0</FileVersion>
<Version>9.5.2</Version>
<AssemblyVersion>9.5.2</AssemblyVersion>
<InformationalVersion>9.5.2</InformationalVersion>
<FileVersion>9.5.2</FileVersion>
<LangVersion Condition="'$(LangVersion)' == ''">9.0</LangVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<Company>Umbraco CMS</Company>
+5
View File
@@ -3,6 +3,7 @@
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Deploy.Core.Configuration.DebugConfiguration;
using Umbraco.Deploy.Core.Configuration.DeployConfiguration;
using Umbraco.Deploy.Core.Configuration.DeployProjectConfiguration;
using Umbraco.Forms.Core.Configuration;
@@ -91,6 +92,8 @@ namespace JsonSchema
public ContentDashboardSettings ContentDashboard { get; set; }
public HelpPageSettings HelpPage { get; set; }
public InstallDefaultDataSettings DefaultDataCreation { get; set; }
}
/// <summary>
@@ -127,6 +130,8 @@ namespace JsonSchema
public DeploySettings Settings { get; set; }
public DeployProjectConfig Project { get; set; }
public DebugSettings Debug { get; set; }
}
}
}
+19 -11
View File
@@ -1,24 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="NJsonSchema" Version="10.5.2" />
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
<PackageReference Include="Umbraco.Deploy.Core" Version="9.2.0" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.2.0" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="NJsonSchema" Version="10.5.2" />
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
<PackageReference Include="Umbraco.Deploy.Core" Version="9.2.0" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.2.0" />
<PackageReference Include="Umbraco.Deploy.Core" Version="9.4.0" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.4.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Umbraco.Core\Umbraco.Core.csproj" />
</ItemGroup>
<!-- Copy forms xml docs-->
<!-- Copy Forms XML docs-->
<PropertyGroup>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
</PropertyGroup>
@@ -46,6 +46,11 @@ namespace Umbraco.Cms.Core.Cache
{
var payloads = Deserialize(json);
Refresh(payloads);
}
public override void Refresh(JsonPayload[] payloads)
{
foreach (var payload in payloads)
{
foreach (var alias in GetCacheKeysForAlias(payload.Alias))
@@ -55,11 +60,13 @@ namespace Umbraco.Cms.Core.Cache
if (macroRepoCache)
{
macroRepoCache.Result.Clear(RepositoryCacheKeys.GetKey<IMacro, int>(payload.Id));
macroRepoCache.Result.Clear(RepositoryCacheKeys.GetKey<IMacro, string>(payload.Alias)); // Repository caching of macro definition by alias
}
}
base.Refresh(json);
base.Refresh(payloads);
}
#endregion
#region Json
+3 -3
View File
@@ -198,7 +198,7 @@ namespace Umbraco.Cms.Core.Composing
IEnumerable<Assembly> assemblies = null,
bool onlyConcreteClasses = true)
{
var assemblyList = (assemblies ?? AssembliesToScan).ToList();
var assemblyList = assemblies ?? AssembliesToScan;
return GetClassesWithBaseType(assignTypeFrom, assemblyList, onlyConcreteClasses,
//the additional filter will ensure that any found types also have the attribute applied.
@@ -214,7 +214,7 @@ namespace Umbraco.Cms.Core.Composing
/// <returns></returns>
public IEnumerable<Type> FindClassesOfType(Type assignTypeFrom, IEnumerable<Assembly> assemblies = null, bool onlyConcreteClasses = true)
{
var assemblyList = (assemblies ?? AssembliesToScan).ToList();
var assemblyList = assemblies ?? AssembliesToScan;
return GetClassesWithBaseType(assignTypeFrom, assemblyList, onlyConcreteClasses);
}
@@ -231,7 +231,7 @@ namespace Umbraco.Cms.Core.Composing
IEnumerable<Assembly> assemblies = null,
bool onlyConcreteClasses = true)
{
var assemblyList = (assemblies ?? AssembliesToScan).ToList();
var assemblyList = assemblies ?? AssembliesToScan;
return GetClassesWithAttribute(attributeType, assemblyList, onlyConcreteClasses);
}
@@ -156,6 +156,9 @@ namespace Umbraco.Cms.Core.Configuration.Models
internal const bool StaticShowDeprecatedPropertyEditors = false;
internal const string StaticLoginBackgroundImage = "assets/img/login.jpg";
internal const string StaticLoginLogoImage = "assets/img/application/umbraco_logo_white.svg";
internal const bool StaticHideBackOfficeLogo = false;
internal const bool StaticDisableDeleteWhenReferenced = false;
internal const bool StaticDisableUnpublishWhenReferenced = false;
/// <summary>
/// Gets or sets a value for the content notification settings.
@@ -219,6 +222,24 @@ namespace Umbraco.Cms.Core.Configuration.Models
[DefaultValue(StaticLoginLogoImage)]
public string LoginLogoImage { get; set; } = StaticLoginLogoImage;
/// <summary>
/// Gets or sets a value indicating whether to hide the backoffice umbraco logo or not.
/// </summary>
[DefaultValue(StaticHideBackOfficeLogo)]
public bool HideBackOfficeLogo { get; set; } = StaticHideBackOfficeLogo;
/// <summary>
/// Gets or sets a value indicating whether to disable the deletion of items referenced by other items.
/// </summary>
[DefaultValue(StaticDisableDeleteWhenReferenced)]
public bool DisableDeleteWhenReferenced { get; set; } = StaticDisableDeleteWhenReferenced;
/// <summary>
/// Gets or sets a value indicating whether to disable the unpublishing of items referenced by other items.
/// </summary>
[DefaultValue(StaticDisableUnpublishWhenReferenced)]
public bool DisableUnpublishWhenReferenced { get; set; } = StaticDisableUnpublishWhenReferenced;
/// <summary>
/// Get or sets the model representing the global content version cleanup policy
/// </summary>
@@ -19,7 +19,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
internal const bool StaticHideTopLevelNodeFromPath = true;
internal const bool StaticUseHttps = false;
internal const int StaticVersionCheckPeriod = 7;
internal const string StaticUmbracoPath = "~/umbraco";
internal const string StaticUmbracoPath = Constants.System.DefaultUmbracoPath;
internal const string StaticIconsPath = "~/umbraco/assets/icons";
internal const string StaticUmbracoCssPath = "~/css";
internal const string StaticUmbracoScriptsPath = "~/scripts";
@@ -29,6 +29,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
internal const string StaticNoNodesViewPath = "~/umbraco/UmbracoWebsite/NoNodes.cshtml";
internal const string StaticSqlWriteLockTimeOut = "00:00:05";
internal const bool StaticSanitizeTinyMce = false;
internal const int StaticMainDomReleaseSignalPollingInterval = 2000;
/// <summary>
/// Gets or sets a value for the reserved URLs (must end with a comma).
@@ -137,6 +138,26 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// </summary>
public string MainDomLock { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value to discriminate MainDom boundaries.
/// <para>
/// Generally the default should suffice but useful for advanced scenarios e.g. azure deployment slot based zero downtime deployments.
/// </para>
/// </summary>
public string MainDomKeyDiscriminator { get; set; } = string.Empty;
/// <summary>
/// Gets or sets the duration (in milliseconds) for which the MainDomLock release signal polling task should sleep.
/// </summary>
/// <remarks>
/// Doesn't apply to MainDomSemaphoreLock.
/// <para>
/// The default value is 2000ms.
/// </para>
/// </remarks>
[DefaultValue(StaticMainDomReleaseSignalPollingInterval)]
public int MainDomReleaseSignalPollingInterval { get; set; } = StaticMainDomReleaseSignalPollingInterval;
/// <summary>
/// Gets or sets the telemetry ID.
/// </summary>
@@ -174,18 +195,18 @@ namespace Umbraco.Cms.Core.Configuration.Models
public bool IsPickupDirectoryLocationConfigured => !string.IsNullOrWhiteSpace(Smtp?.PickupDirectoryLocation);
/// <summary>
/// Gets a value indicating whether TinyMCE scripting sanitization should be applied.
/// Gets or sets a value indicating whether TinyMCE scripting sanitization should be applied.
/// </summary>
[DefaultValue(StaticSanitizeTinyMce)]
public bool SanitizeTinyMce => StaticSanitizeTinyMce;
public bool SanitizeTinyMce { get; set; } = StaticSanitizeTinyMce;
/// <summary>
/// Gets a value representing the time in milliseconds to lock the database for a write operation.
/// An int value representing the time in milliseconds to lock the database for a write operation
/// </summary>
/// <remarks>
/// The default value is 5000 milliseconds.
/// </remarks>
[DefaultValue(StaticSqlWriteLockTimeOut)]
public TimeSpan SqlWriteLockTimeOut { get; } = TimeSpan.Parse(StaticSqlWriteLockTimeOut);
public TimeSpan SqlWriteLockTimeOut { get; set; } = TimeSpan.Parse(StaticSqlWriteLockTimeOut);
}
}
@@ -22,7 +22,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <summary>
/// Gets or sets a value for the location of temporary files.
/// </summary>
[DefaultValue(StaticLocalTempStorageLocation)]
[DefaultValue(StaticLocalTempStorageLocation)]
public LocalTempStorage LocalTempStorageLocation { get; set; } = Enum<LocalTempStorage>.Parse(StaticLocalTempStorageLocation);
/// <summary>
@@ -31,5 +31,10 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// <value><c>true</c> if [debug mode]; otherwise, <c>false</c>.</value>
[DefaultValue(StaticDebug)]
public bool Debug { get; set; } = StaticDebug;
/// <summary>
/// Gets or sets a value specifying the name of the site.
/// </summary>
public string SiteName { get; set; }
}
}
@@ -0,0 +1,73 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System.Collections.Generic;
namespace Umbraco.Cms.Core.Configuration.Models
{
/// <summary>
/// An enumeration of options available for control over installation of default Umbraco data.
/// </summary>
public enum InstallDefaultDataOption
{
/// <summary>
/// Do not install any items of this type (other than Umbraco defined essential ones).
/// </summary>
None,
/// <summary>
/// Only install the default data specified in the <see cref="InstallDefaultDataSettings.Values"/>
/// </summary>
Values,
/// <summary>
/// Install all default data, except that specified in the <see cref="InstallDefaultDataSettings.Values"/>
/// </summary>
ExceptValues,
/// <summary>
/// Install all default data.
/// </summary>
All
}
/// <summary>
/// Typed configuration options for installation of default data.
/// </summary>
public class InstallDefaultDataSettings
{
/// <summary>
/// Gets or sets a value indicating whether to create default data on installation.
/// </summary>
public InstallDefaultDataOption InstallData { get; set; } = InstallDefaultDataOption.All;
/// <summary>
/// Gets or sets a value indicating which default data (languages, data types, etc.) should be created when <see cref="InstallData"/> is
/// set to <see cref="InstallDefaultDataOption.Values"/> or <see cref="InstallDefaultDataOption.ExceptValues"/>.
/// </summary>
/// <remarks>
/// <para>
/// For languages, the values provided should be the ISO codes for the languages to be included or excluded, e.g. "en-US".
/// If removing the single default language, ensure that a different one is created via some other means (such
/// as a restore from Umbraco Deploy schema data).
/// </para>
/// <para>
/// For data types, the values provided should be the Guid values used by Umbraco for the data type, listed at:
/// <see cref="Constants.DataTypes"/>
/// Some data types - such as the string label - cannot be excluded from install as they are required for core Umbraco
/// functionality.
/// Otherwise take care not to remove data types required for default Umbraco media and member types, unless you also
/// choose to exclude them.
/// </para>
/// <para>
/// For media types, the values provided should be the Guid values used by Umbraco for the media type, listed at:
/// https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs.
/// </para>
/// <para>
/// For member types, the values provided should be the Guid values used by Umbraco for the member type, listed at:
/// https://github.com/umbraco/Umbraco-CMS/blob/v9/dev/src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs.
/// </para>
/// </remarks>
public IList<string> Values { get; set; } = new List<string>();
}
}
@@ -12,6 +12,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
public class KeepAliveSettings
{
internal const bool StaticDisableKeepAliveTask = false;
internal const string StaticKeepAlivePingUrl = "~/api/keepalive/ping";
/// <summary>
/// Gets or sets a value indicating whether the keep alive task is disabled.
@@ -20,8 +21,9 @@ namespace Umbraco.Cms.Core.Configuration.Models
public bool DisableKeepAliveTask { get; set; } = StaticDisableKeepAliveTask;
/// <summary>
/// Gets a value for the keep alive ping URL.
/// Gets or sets a value for the keep alive ping URL.
/// </summary>
public string KeepAlivePingUrl => "~/api/keepalive/ping";
[DefaultValue(StaticKeepAlivePingUrl)]
public string KeepAlivePingUrl { get; set; } = StaticKeepAlivePingUrl;
}
}
@@ -42,17 +42,17 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// </remarks>
public bool FlagOutOfDateModels
{
get => _flagOutOfDateModels;
set
get
{
if (!ModelsMode.IsAuto())
if (ModelsMode == ModelsMode.Nothing || ModelsMode.IsAuto())
{
_flagOutOfDateModels = false;
return false;
}
_flagOutOfDateModels = value;
return _flagOutOfDateModels;
}
set => _flagOutOfDateModels = value;
}
/// <summary>
@@ -13,6 +13,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
{
internal const string StaticNuCacheSerializerType = "MessagePack";
internal const int StaticSqlPageSize = 1000;
internal const int StaticKitBatchSize = 1;
/// <summary>
/// Gets or sets a value defining the BTree block size.
@@ -31,6 +32,12 @@ namespace Umbraco.Cms.Core.Configuration.Models
[DefaultValue(StaticSqlPageSize)]
public int SqlPageSize { get; set; } = StaticSqlPageSize;
/// <summary>
/// The size to use for nucache Kit batches. Higher value means more content loaded into memory at a time.
/// </summary>
[DefaultValue(StaticKitBatchSize)]
public int KitBatchSize { get; set; } = StaticKitBatchSize;
public bool UnPublishedContentCompression { get; set; } = false;
}
}
@@ -7,7 +7,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
[UmbracoOptions(Constants.Configuration.ConfigRichTextEditor)]
public class RichTextEditorSettings
{
internal const string StaticValidElements = "+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*]";
internal const string StaticValidElements = "+a[id|style|rel|data-id|data-udi|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|reversed|start|style|type],-ul[class|style],-li[class|style],br[class],img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align|umbracoorgwidth|umbracoorgheight|onresize|onresizestart|onresizeend|rel|data-id],-sub[style|class],-sup[style|class],-blockquote[dir|style|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align|style],address[class|align|style],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|style|dir|class|align|style],hr[class|style],small[class|style],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],object[class|id|width|height|codebase|*],param[name|value|_value|class],embed[type|width|height|src|class|*],map[name|class],area[shape|coords|href|alt|target|class],bdo[class],button[class],iframe[*],figure,figcaption";
internal const string StaticInvalidElements = "font";
private static readonly string[] s_default_plugins = new[]
@@ -56,6 +56,21 @@ namespace Umbraco.Cms.Core
public const string ConfigPackageMigration = ConfigPrefix + "PackageMigration";
public const string ConfigContentDashboard = ConfigPrefix + "ContentDashboard";
public const string ConfigHelpPage = ConfigPrefix + "HelpPage";
public const string ConfigInstallDefaultData = ConfigPrefix + "InstallDefaultData";
public static class NamedOptions
{
public static class InstallDefaultData
{
public const string Languages = "Languages";
public const string DataTypes = "DataTypes";
public const string MediaTypes = "MediaTypes";
public const string MemberTypes = "MemberTypes";
}
}
}
}
}
-1
View File
@@ -211,7 +211,6 @@ namespace Umbraco.Cms.Core
/// </summary>
public static readonly Guid ListViewMembersGuid = new Guid(ListViewMembers);
/// <summary>
/// Guid for Date Picker with time as string
/// </summary>
+19
View File
@@ -0,0 +1,19 @@
namespace Umbraco.Cms.Core
{
/// <summary>
/// Defines constants.
/// </summary>
public static partial class Constants
{
/// <summary>
/// Defines constants for named http clients.
/// </summary>
public static class HttpClients
{
/// <summary>
/// Name for http client which ignores certificate errors.
/// </summary>
public const string IgnoreCertificateErrors = "Umbraco:HttpClients:IgnoreCertificateErrors";
}
}
}
+6 -1
View File
@@ -1,4 +1,4 @@
namespace Umbraco.Cms.Core
namespace Umbraco.Cms.Core
{
public static partial class Constants
{
@@ -9,6 +9,11 @@
/// </summary>
public const string DefaultIcon = Content;
/// <summary>
/// System blueprint icon
/// </summary>
public const string Blueprint = "icon-blueprint";
/// <summary>
/// System content icon
/// </summary>
+3 -1
View File
@@ -59,7 +59,9 @@
public const string RecycleBinMediaPathPrefix = "-1,-21,";
public const int DefaultLabelDataTypeId = -92;
public const string UmbracoConnectionName = "umbracoDbDSN";
public const string UmbracoConnectionName = "umbracoDbDSN";
public const string DefaultUmbracoPath = "~/umbraco";
}
}
}
@@ -1,3 +1,5 @@
using System;
namespace Umbraco.Cms.Core
{
public static partial class Constants
@@ -42,9 +44,11 @@ namespace Umbraco.Cms.Core
public const string Install = "~/install";
public const string AppPlugins = "/App_Plugins";
public static string AppPluginIcons => "/Backoffice/Icons";
public const string CreatedPackages = "/created-packages";
[Obsolete("Use PluginIcons instead")]
public static string AppPluginIcons => "/Backoffice/Icons";
public const string PluginIcons = "/backoffice/icons";
public const string MvcViews = "~/Views";
@@ -54,6 +58,8 @@ namespace Umbraco.Cms.Core
public const string Packages = Data + "/packages";
public const string CreatedPackages = Data + "/CreatedPackages";
public const string Preview = Data + "/preview";
/// <summary>
+32
View File
@@ -0,0 +1,32 @@
namespace Umbraco.Cms.Core
{
public static partial class Constants
{
public static class Telemetry
{
public static string RootCount = "RootCount";
public static string DomainCount = "DomainCount";
public static string ExamineIndexCount = "ExamineIndexCount";
public static string LanguageCount = "LanguageCount";
public static string MacroCount = "MacroCount";
public static string MediaCount = "MediaCount";
public static string MemberCount = "MemberCount";
public static string TemplateCount = "TemplateCount";
public static string ContentCount = "ContentCount";
public static string DocumentTypeCount = "DocumentTypeCount";
public static string Properties = "Properties";
public static string UserCount = "UserCount";
public static string UserGroupCount = "UserGroupCount";
public static string ServerOs = "ServerOs";
public static string ServerFramework = "ServerFramework";
public static string OsLanguage = "OsLanguage";
public static string WebServer = "WebServer";
public static string ModelsBuilderMode = "ModelBuilderMode";
public static string CustomUmbracoPath = "CustomUmbracoPath";
public static string AspEnvironment = "AspEnvironment";
public static string IsDebug = "IsDebug";
public static string DatabaseProvider = "DatabaseProvider";
}
}
}
@@ -0,0 +1,32 @@
using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Models.Membership;
namespace Umbraco.Cms.Core.ContentApps
{
internal class DictionaryContentAppFactory : IContentAppFactory
{
private const int Weight = -100;
private ContentApp _dictionaryApp;
public ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups)
{
switch (source)
{
case IDictionaryItem _:
return _dictionaryApp ??= new ContentApp
{
Alias = "dictionaryContent",
Name = "Content",
Icon = "icon-document",
View = "views/dictionary/views/content/content.html",
Weight = Weight
};
default:
return null;
}
}
}
}
@@ -0,0 +1,15 @@
using System;
namespace Umbraco.Cms.Core.Dashboards
{
public class AnalyticsDashboard : IDashboard
{
public string Alias => "settingsAnalytics";
public string[] Sections => new [] { "settings" };
public string View => "views/dashboard/settings/analytics.html";
public IAccessRule[] AccessRules => Array.Empty<IAccessRule>();
}
}
@@ -46,7 +46,8 @@ namespace Umbraco.Cms.Core.DependencyInjection
.Append<ContentTypeListViewContentAppFactory>()
.Append<ContentTypePermissionsContentAppFactory>()
.Append<ContentTypeTemplatesContentAppFactory>()
.Append<MemberEditorContentAppFactory>();
.Append<MemberEditorContentAppFactory>()
.Append<DictionaryContentAppFactory>();
// all built-in finders in the correct order,
// devs can then modify this list on application startup
@@ -117,7 +118,8 @@ namespace Umbraco.Cms.Core.DependencyInjection
.Append<Soundcloud>()
.Append<Issuu>()
.Append<Hulu>()
.Append<Giphy>();
.Append<Giphy>()
.Append<LottieFiles>();
builder.SearchableTrees().Add(() => builder.TypeLoader.GetTypes<ISearchableTree>());
builder.BackOfficeAssets();
}
@@ -90,6 +90,19 @@ namespace Umbraco.Cms.Core.DependencyInjection
.AddUmbracoOptions<ContentDashboardSettings>()
.AddUmbracoOptions<HelpPageSettings>();
builder.Services.Configure<InstallDefaultDataSettings>(
Constants.Configuration.NamedOptions.InstallDefaultData.Languages,
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.Languages}"));
builder.Services.Configure<InstallDefaultDataSettings>(
Constants.Configuration.NamedOptions.InstallDefaultData.DataTypes,
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.DataTypes}"));
builder.Services.Configure<InstallDefaultDataSettings>(
Constants.Configuration.NamedOptions.InstallDefaultData.MediaTypes,
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.MediaTypes}"));
builder.Services.Configure<InstallDefaultDataSettings>(
Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes,
builder.Config.GetSection($"{Constants.Configuration.ConfigInstallDefaultData}:{Constants.Configuration.NamedOptions.InstallDefaultData.MemberTypes}"));
builder.Services.Configure<RequestHandlerSettings>(options => options.MergeReplacements(builder.Config));
return builder;
@@ -25,7 +25,7 @@ using Umbraco.Cms.Core.Install;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Logging;
using Umbraco.Cms.Core.Mail;
using Umbraco.Cms.Core.Manifest;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.Notifications;
using Umbraco.Cms.Core.PropertyEditors;
@@ -39,7 +39,6 @@ using Umbraco.Cms.Core.Sync;
using Umbraco.Cms.Core.Telemetry;
using Umbraco.Cms.Core.Templates;
using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Web.Common.DependencyInjection;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.DependencyInjection
@@ -182,7 +181,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
Services.AddSingleton<UriUtility>();
Services.AddUnique<IDashboardService, DashboardService>();
Services.AddUnique<IUserDataService, UserDataService>();
Services.AddSingleton<IMetricsConsentService, MetricsConsentService>();
// will be injected in controllers when needed to invoke rest endpoints on Our
Services.AddUnique<IInstallationService, InstallationService>();
@@ -262,6 +261,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
Services.AddSingleton<IValueEditorCache, ValueEditorCache>();
// Register telemetry service used to gather data about installed packages
Services.AddUnique<ISiteIdentifierService, SiteIdentifierService>();
Services.AddUnique<ITelemetryService, TelemetryService>();
// Register a noop IHtmlSanitizer to be replaced
@@ -33,7 +33,8 @@ namespace Umbraco.Cms.Core.Events
Constants.Conventions.RelationTypes.RelateDocumentOnCopyName,
true,
Constants.ObjectTypes.Document,
Constants.ObjectTypes.Document);
Constants.ObjectTypes.Document,
false);
_relationService.Save(relationType);
}
@@ -132,7 +132,7 @@ namespace Umbraco.Extensions
}
}
verifiedIdentity = identity.AuthenticationType == Constants.Security.BackOfficeAuthenticationType ? identity : new ClaimsIdentity(identity.Claims, Constants.Security.BackOfficeAuthenticationType);
verifiedIdentity = identity.AuthenticationType == Constants.Security.BackOfficeAuthenticationType ? identity : new ClaimsIdentity(identity.Claims, Constants.Security.BackOfficeAuthenticationType);
return true;
}
@@ -626,7 +626,6 @@ namespace Umbraco.Extensions
if (type == typeof(sbyte)) return XmlConvert.ToString((sbyte)value);
if (type == typeof(short)) return XmlConvert.ToString((short)value);
if (type == typeof(TimeSpan)) return XmlConvert.ToString((TimeSpan)value);
if (type == typeof(bool)) return XmlConvert.ToString((bool)value);
if (type == typeof(uint)) return XmlConvert.ToString((uint)value);
if (type == typeof(ulong)) return XmlConvert.ToString((ulong)value);
if (type == typeof(ushort)) return XmlConvert.ToString((ushort)value);
@@ -1082,7 +1082,7 @@ namespace Umbraco.Extensions
{
return content.Parent != null
? content.Parent.Children(variationContextAccessor, culture)
: publishedSnapshot.Content.GetAtRoot().WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
: publishedSnapshot.Content.GetAtRoot(culture).WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
}
/// <summary>
@@ -1098,7 +1098,7 @@ namespace Umbraco.Extensions
{
return content.Parent != null
? content.Parent.ChildrenOfType(variationContextAccessor, contentTypeAlias, culture)
: publishedSnapshot.Content.GetAtRoot().OfTypes(contentTypeAlias).WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
: publishedSnapshot.Content.GetAtRoot(culture).OfTypes(contentTypeAlias).WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
}
/// <summary>
@@ -1115,7 +1115,7 @@ namespace Umbraco.Extensions
{
return content.Parent != null
? content.Parent.Children<T>(variationContextAccessor, culture)
: publishedSnapshot.Content.GetAtRoot().OfType<T>().WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
: publishedSnapshot.Content.GetAtRoot(culture).OfType<T>().WhereIsInvariantOrHasCulture(variationContextAccessor, culture);
}
#endregion
@@ -1,10 +1,13 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Install.Models;
using Umbraco.Cms.Core.Telemetry;
using Umbraco.Cms.Web.Common.DependencyInjection;
namespace Umbraco.Cms.Core.Install.InstallSteps
{
@@ -13,31 +16,29 @@ namespace Umbraco.Cms.Core.Install.InstallSteps
PerformsAppRestart = false)]
public class TelemetryIdentifierStep : InstallSetupStep<object>
{
private readonly ILogger<TelemetryIdentifierStep> _logger;
private readonly IOptions<GlobalSettings> _globalSettings;
private readonly IConfigManipulator _configManipulator;
private readonly ISiteIdentifierService _siteIdentifierService;
public TelemetryIdentifierStep(ILogger<TelemetryIdentifierStep> logger, IOptions<GlobalSettings> globalSettings, IConfigManipulator configManipulator)
public TelemetryIdentifierStep(
IOptions<GlobalSettings> globalSettings,
ISiteIdentifierService siteIdentifierService)
{
_logger = logger;
_globalSettings = globalSettings;
_configManipulator = configManipulator;
_siteIdentifierService = siteIdentifierService;
}
[Obsolete("Use constructor that takes GlobalSettings and ISiteIdentifierService")]
public TelemetryIdentifierStep(
ILogger<TelemetryIdentifierStep> logger,
IOptions<GlobalSettings> globalSettings,
IConfigManipulator configManipulator)
: this(globalSettings, StaticServiceProvider.Instance.GetRequiredService<ISiteIdentifierService>())
{
}
public override Task<InstallSetupResult> ExecuteAsync(object model)
{
// Generate GUID
var telemetrySiteIdentifier = Guid.NewGuid();
try
{
_configManipulator.SetGlobalId(telemetrySiteIdentifier.ToString());
}
catch (Exception ex)
{
_logger.LogError(ex, "Couldn't update config files with a telemetry site identifier");
}
_siteIdentifierService.TryCreateSiteIdentifier(out _);
return Task.FromResult<InstallSetupResult>(null);
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
@@ -70,6 +70,10 @@ namespace Umbraco.Cms.Core.Manifest
partA = "contentType";
partB = contentType.Alias;
break;
case IDictionaryItem _:
partA = "dictionary";
partB = "*"; //Not really a different type for dictionary items
break;
default:
return null;
@@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
/// <summary>
/// Embed Provider for lottiefiles.com the popular opensource JSON-based animation format platform.
/// </summary>
public class LottieFiles : OEmbedProviderBase
{
public LottieFiles(IJsonSerializer jsonSerializer) : base(jsonSerializer)
{
}
public override string ApiEndpoint => "https://embed.lottiefiles.com/oembed";
public override string[] UrlSchemeRegex => new string[]
{
@"lottiefiles\.com/*"
};
public override Dictionary<string, string> RequestParams => new Dictionary<string, string>();
public override string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0)
{
var requestUrl = base.GetEmbedProviderUrl(url, maxWidth, maxHeight);
OEmbedResponse oembed = base.GetJsonResponse<OEmbedResponse>(requestUrl);
var html = oembed.GetHtml();
//LottieFiles doesn't seem to support maxwidth and maxheight via oembed
// this is therefore a hack... with regexes.. is that ok? HtmlAgility etc etc
// otherwise it always defaults to 300...
if (maxWidth > 0 && maxHeight > 0)
{
html = Regex.Replace(html, "width=\"([0-9]{1,4})\"", "width=\"" + maxWidth + "\"");
html = Regex.Replace(html, "height=\"([0-9]{1,4})\"", "height=\"" + maxHeight + "\"");
}
else
{
//if set to 0, let's default to 100% as an easter egg
html = Regex.Replace(html, "width=\"([0-9]{1,4})\"", "width=\"100%\"");
html = Regex.Replace(html, "height=\"([0-9]{1,4})\"", "height=\"100%\"");
}
return html;
}
}
}
+1 -1
View File
@@ -237,7 +237,7 @@ namespace Umbraco.Cms.Core.Models
public bool IsCulturePublished(string culture)
// just check _publishInfos
// a non-available culture could not become published anyways
=> _publishInfos != null && _publishInfos.ContainsKey(culture);
=> !culture.IsNullOrWhiteSpace() && _publishInfos != null && _publishInfos.ContainsKey(culture);
/// <inheritdoc />
public bool IsCultureEdited(string culture)
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
@@ -17,6 +17,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
{
Notifications = new List<BackOfficeNotification>();
Translations = new List<DictionaryTranslationDisplay>();
ContentApps = new List<ContentApp>();
}
/// <inheritdoc />
@@ -37,5 +38,11 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
/// </summary>
[DataMember(Name = "translations")]
public List<DictionaryTranslationDisplay> Translations { get; private set; }
/// <summary>
/// Apps for the dictionary item
/// </summary>
[DataMember(Name = "apps")]
public List<ContentApp> ContentApps { get; private set; }
}
}
@@ -1,17 +1,34 @@
using System.Runtime.Serialization;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models.ContentEditing
{
[DataContract(Name = "historyCleanup", Namespace = "")]
public class HistoryCleanup
public class HistoryCleanup : BeingDirtyBase
{
private bool _preventCleanup;
private int? _keepAllVersionsNewerThanDays;
private int? _keepLatestVersionPerDayForDays;
[DataMember(Name = "preventCleanup")]
public bool PreventCleanup { get; set; }
public bool PreventCleanup
{
get => _preventCleanup;
set => SetPropertyValueAndDetectChanges(value, ref _preventCleanup, nameof(PreventCleanup));
}
[DataMember(Name = "keepAllVersionsNewerThanDays")]
public int? KeepAllVersionsNewerThanDays { get; set; }
public int? KeepAllVersionsNewerThanDays
{
get => _keepAllVersionsNewerThanDays;
set => SetPropertyValueAndDetectChanges(value, ref _keepAllVersionsNewerThanDays, nameof(KeepAllVersionsNewerThanDays));
}
[DataMember(Name = "keepLatestVersionPerDayForDays")]
public int? KeepLatestVersionPerDayForDays { get; set; }
public int? KeepLatestVersionPerDayForDays
{
get => _keepLatestVersionPerDayForDays;
set => SetPropertyValueAndDetectChanges(value, ref _keepLatestVersionPerDayForDays, nameof(KeepLatestVersionPerDayForDays));
}
}
}
@@ -55,5 +55,11 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
/// </summary>
[DataMember(Name = "notifications")]
public List<BackOfficeNotification> Notifications { get; private set; }
/// <summary>
/// Gets or sets a boolean indicating whether the RelationType should be returned in "Used by"-queries.
/// </summary>
[DataMember(Name = "isDependency", IsRequired = true)]
public bool IsDependency { get; set; }
}
}
@@ -23,5 +23,11 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
/// </summary>
[DataMember(Name = "childObjectType", IsRequired = false)]
public Guid? ChildObjectType { get; set; }
/// <summary>
/// Gets or sets a boolean indicating whether the RelationType should be returned in "Used by"-queries.
/// </summary>
[DataMember(Name = "isDependency", IsRequired = true)]
public bool IsDependency { get; set; }
}
}
+10 -1
View File
@@ -96,7 +96,13 @@ namespace Umbraco.Cms.Core.Models
}
}
public HistoryCleanup HistoryCleanup { get; set; }
private HistoryCleanup _historyCleanup;
public HistoryCleanup HistoryCleanup
{
get => _historyCleanup;
set => SetPropertyValueAndDetectChanges(value, ref _historyCleanup, nameof(HistoryCleanup));
}
/// <summary>
/// Determines if AllowedTemplates contains templateId
@@ -162,5 +168,8 @@ namespace Umbraco.Cms.Core.Models
/// <inheritdoc />
IContentType IContentType.DeepCloneWithResetIdentities(string newAlias) =>
(IContentType)DeepCloneWithResetIdentities(newAlias);
/// <inheritdoc/>
public override bool IsDirty() => base.IsDirty() || HistoryCleanup.IsDirty();
}
}
+9
View File
@@ -4,6 +4,15 @@ using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models
{
public interface IRelationTypeWithIsDependency : IRelationType
{
/// <summary>
/// Gets or sets a boolean indicating whether the RelationType should be returned in "Used by"-queries.
/// </summary>
[DataMember]
bool IsDependency { get; set; }
}
public interface IRelationType : IEntity, IRememberBeingDirty
{
/// <summary>
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Cms.Core.ContentApps;
@@ -48,6 +48,11 @@ namespace Umbraco.Cms.Core.Models.Mapping
}
public IEnumerable<ContentApp> GetContentApps(IUmbracoEntity source)
{
return GetContentAppsForEntity(source);
}
public IEnumerable<ContentApp> GetContentAppsForEntity(IEntity source)
{
var apps = _contentAppDefinitions.GetContentAppsFor(source).ToArray();
@@ -133,7 +133,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
if (target is IContentTypeWithHistoryCleanup targetWithHistoryCleanup)
{
targetWithHistoryCleanup.HistoryCleanup = source.HistoryCleanup;
MapHistoryCleanup(source, targetWithHistoryCleanup);
}
target.AllowedTemplates = source.AllowedTemplates
@@ -147,6 +147,34 @@ namespace Umbraco.Cms.Core.Models.Mapping
: _fileService.GetTemplate(source.DefaultTemplate));
}
private static void MapHistoryCleanup(DocumentTypeSave source, IContentTypeWithHistoryCleanup target)
{
// If source history cleanup is null we don't have to map all properties
if (source.HistoryCleanup is null)
{
target.HistoryCleanup = null;
return;
}
// We need to reset the dirty properties, because it is otherwise true, just because the json serializer has set properties
target.HistoryCleanup.ResetDirtyProperties(false);
if (target.HistoryCleanup.PreventCleanup != source.HistoryCleanup.PreventCleanup)
{
target.HistoryCleanup.PreventCleanup = source.HistoryCleanup.PreventCleanup;
}
if (target.HistoryCleanup.KeepAllVersionsNewerThanDays != source.HistoryCleanup.KeepAllVersionsNewerThanDays)
{
target.HistoryCleanup.KeepAllVersionsNewerThanDays = source.HistoryCleanup.KeepAllVersionsNewerThanDays;
}
if (target.HistoryCleanup.KeepLatestVersionPerDayForDays !=
source.HistoryCleanup.KeepLatestVersionPerDayForDays)
{
target.HistoryCleanup.KeepLatestVersionPerDayForDays = source.HistoryCleanup.KeepLatestVersionPerDayForDays;
}
}
// no MapAll - take care
private void Map(MediaTypeSave source, IMediaType target, MapperContext context)
{
@@ -196,7 +224,7 @@ namespace Umbraco.Cms.Core.Models.Mapping
target.AllowCultureVariant = source.VariesByCulture();
target.AllowSegmentVariant = source.VariesBySegment();
target.ContentApps = _commonMapper.GetContentApps(source);
target.ContentApps = _commonMapper.GetContentAppsForEntity(source);
//sync templates
target.AllowedTemplates = context.MapEnumerable<ITemplate, EntityBasic>(source.AllowedTemplates);
@@ -328,7 +356,10 @@ namespace Umbraco.Cms.Core.Models.Mapping
if (source.GroupId > 0)
{
target.PropertyGroupId = new Lazy<int>(() => source.GroupId, false);
if (target.PropertyGroupId?.Value != source.GroupId)
{
target.PropertyGroupId = new Lazy<int>(() => source.GroupId, false);
}
}
target.Alias = source.Alias;
@@ -523,7 +554,15 @@ namespace Umbraco.Cms.Core.Models.Mapping
target.Thumbnail = source.Thumbnail;
target.AllowedAsRoot = source.AllowAsRoot;
target.AllowedContentTypes = source.AllowedContentTypes.Select((t, i) => new ContentTypeSort(t, i));
bool allowedContentTypesUnchanged = target.AllowedContentTypes.Select(x => x.Id.Value)
.SequenceEqual(source.AllowedContentTypes);
if (allowedContentTypesUnchanged is false)
{
target.AllowedContentTypes = source.AllowedContentTypes.Select((t, i) => new ContentTypeSort(t, i));
}
if (!(target is IMemberType))
{
@@ -574,13 +613,21 @@ namespace Umbraco.Cms.Core.Models.Mapping
// ensure no duplicate alias, then assign the group properties collection
EnsureUniqueAliases(destProperties);
destGroup.PropertyTypes = new PropertyTypeCollection(isPublishing, destProperties);
if (destGroup.PropertyTypes.SupportsPublishing != isPublishing || destGroup.PropertyTypes.SequenceEqual(destProperties) is false)
{
destGroup.PropertyTypes = new PropertyTypeCollection(isPublishing, destProperties);
}
destGroups.Add(destGroup);
}
// ensure no duplicate name, then assign the groups collection
EnsureUniqueAliases(destGroups);
target.PropertyGroups = new PropertyGroupCollection(destGroups);
if (target.PropertyGroups.SequenceEqual(destGroups) is false)
{
target.PropertyGroups = new PropertyGroupCollection(destGroups);
}
// because the property groups collection was rebuilt, there is no need to remove
// the old groups - they are just gone and will be cleared by the repository
@@ -1,6 +1,7 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Cms.Core.Events;
using Umbraco.Cms.Core.Mapping;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Services;
@@ -14,12 +15,20 @@ namespace Umbraco.Cms.Core.Models.Mapping
public class DictionaryMapDefinition : IMapDefinition
{
private readonly ILocalizationService _localizationService;
private readonly CommonMapper _commonMapper;
[Obsolete("Use the constructor with the CommonMapper")]
public DictionaryMapDefinition(ILocalizationService localizationService)
{
_localizationService = localizationService;
}
public DictionaryMapDefinition(ILocalizationService localizationService, CommonMapper commonMapper)
{
_localizationService = localizationService;
_commonMapper = commonMapper;
}
public void DefineMaps(IUmbracoMapper mapper)
{
mapper.Define<IDictionaryItem, EntityBasic>((source, context) => new EntityBasic(), Map);
@@ -44,6 +53,10 @@ namespace Umbraco.Cms.Core.Models.Mapping
target.Name = source.ItemKey;
target.ParentId = source.ParentId ?? Guid.Empty;
target.Udi = Udi.Create(Constants.UdiEntityType.DictionaryItem, source.Key);
if (_commonMapper != null)
{
target.ContentApps.AddRange(_commonMapper.GetContentAppsForEntity(source));
}
// build up the path to make it possible to set active item in tree
// TODO: check if there is a better way
@@ -30,6 +30,11 @@ namespace Umbraco.Cms.Core.Models.Mapping
target.ChildObjectType = source.ChildObjectType;
target.Id = source.Id;
target.IsBidirectional = source.IsBidirectional;
if (source is IRelationTypeWithIsDependency sourceWithIsDependency)
{
target.IsDependency = sourceWithIsDependency.IsDependency;
}
target.Key = source.Key;
target.Name = source.Name;
target.Alias = source.Alias;
@@ -74,6 +79,11 @@ namespace Umbraco.Cms.Core.Models.Mapping
target.ChildObjectType = source.ChildObjectType;
target.Id = source.Id.TryConvertTo<int>().Result;
target.IsBidirectional = source.IsBidirectional;
if (target is IRelationTypeWithIsDependency targetWithIsDependency)
{
targetWithIsDependency.IsDependency = source.IsDependency;
}
target.Key = source.Key;
target.Name = source.Name;
target.ParentObjectType = source.ParentObjectType;
+1 -1
View File
@@ -161,7 +161,7 @@ namespace Umbraco.Cms.Core.Models
}
else
{
var tuple = new MemberTypePropertyProfileAccess(false, false, true);
var tuple = new MemberTypePropertyProfileAccess(false, false, value);
_memberTypePropertyTypes.Add(propertyTypeAlias, tuple);
}
}
+44
View File
@@ -0,0 +1,44 @@
using System;
using System.Runtime.Serialization;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models
{
[DataContract(Name = "relationItem", Namespace = "")]
public class RelationItem
{
[DataMember(Name = "id")]
public int NodeId { get; set; }
[DataMember(Name = "key")]
public Guid NodeKey { get; set; }
[DataMember(Name = "name")]
public string NodeName { get; set; }
[DataMember(Name = "type")]
public string NodeType { get; set; }
[DataMember(Name = "udi")]
public Udi NodeUdi => NodeType == Constants.UdiEntityType.Unknown ? null : Udi.Create(NodeType, NodeKey);
[DataMember(Name = "icon")]
public string ContentTypeIcon { get; set; }
[DataMember(Name = "alias")]
public string ContentTypeAlias { get; set; }
[DataMember(Name = "contentTypeName")]
public string ContentTypeName { get; set; }
[DataMember(Name = "relationTypeName")]
public string RelationTypeName { get; set; }
[DataMember(Name = "relationTypeIsBidirectional")]
public bool RelationTypeIsBidirectional { get; set; }
[DataMember(Name = "relationTypeIsDependency")]
public bool RelationTypeIsDependency { get; set; }
}
}
+17 -2
View File
@@ -9,20 +9,28 @@ namespace Umbraco.Cms.Core.Models
/// </summary>
[Serializable]
[DataContract(IsReference = true)]
public class RelationType : EntityBase, IRelationType
public class RelationType : EntityBase, IRelationType, IRelationTypeWithIsDependency
{
private string _name;
private string _alias;
private bool _isBidirectional;
private bool _isDependency;
private Guid? _parentObjectType;
private Guid? _childObjectType;
public RelationType(string alias, string name)
: this(name: name, alias: alias, false, null, null)
: this(name: name, alias: alias, false, null, null, false)
{
}
[Obsolete("Use ctor with isDependency parameter")]
public RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType)
:this(name,alias,isBidrectional, parentObjectType, childObjectType, false)
{
}
public RelationType(string name, string alias, bool isBidrectional, Guid? parentObjectType, Guid? childObjectType, bool isDependency)
{
if (name == null) throw new ArgumentNullException(nameof(name));
if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Value can't be empty or consist only of white-space characters.", nameof(name));
@@ -32,6 +40,7 @@ namespace Umbraco.Cms.Core.Models
_name = name;
_alias = alias;
_isBidirectional = isBidrectional;
_isDependency = isDependency;
_parentObjectType = parentObjectType;
_childObjectType = childObjectType;
}
@@ -88,5 +97,11 @@ namespace Umbraco.Cms.Core.Models
set => SetPropertyValueAndDetectChanges(value, ref _childObjectType, nameof(ChildObjectType));
}
public bool IsDependency
{
get => _isDependency;
set => SetPropertyValueAndDetectChanges(value, ref _isDependency, nameof(IsDependency));
}
}
}
+12
View File
@@ -0,0 +1,12 @@
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models
{
[DataContract]
public enum TelemetryLevel
{
Minimal,
Basic,
Detailed,
}
}
@@ -0,0 +1,11 @@
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models
{
[DataContract]
public class TelemetryResource
{
[DataMember]
public TelemetryLevel TelemetryLevel { get; set; }
}
}
@@ -0,0 +1,20 @@
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models
{
[DataContract]
public class UsageInformation
{
[DataMember(Name = "name")]
public string Name { get; }
[DataMember(Name = "data")]
public object Data { get; }
public UsageInformation(string name, object data)
{
Name = name;
Data = data;
}
}
}
@@ -0,0 +1,20 @@
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Models
{
[DataContract]
public class UserTwoFactorProviderModel
{
public UserTwoFactorProviderModel(string providerName, bool isEnabledOnUser)
{
ProviderName = providerName;
IsEnabledOnUser = isEnabledOnUser;
}
[DataMember(Name = "providerName")]
public string ProviderName { get; }
[DataMember(Name = "isEnabledOnUser")]
public bool IsEnabledOnUser { get; }
}
}
@@ -0,0 +1,19 @@
using System.Collections.Generic;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Web;
namespace Umbraco.Cms.Core.Notifications
{
public class SendingAllowedChildrenNotification : INotification
{
public IUmbracoContext UmbracoContext { get; }
public IEnumerable<ContentTypeBasic> Children { get; set; }
public SendingAllowedChildrenNotification(IEnumerable<ContentTypeBasic> children, IUmbracoContext umbracoContext)
{
UmbracoContext = umbracoContext;
Children = children;
}
}
}
@@ -0,0 +1,14 @@
using System;
namespace Umbraco.Cms.Core.Notifications
{
public class UserTwoFactorRequestedNotification : INotification
{
public UserTwoFactorRequestedNotification(Guid userKey)
{
UserKey = userKey;
}
public Guid UserKey { get; }
}
}
@@ -5,7 +5,6 @@ using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
@@ -33,7 +32,7 @@ namespace Umbraco.Cms.Core.Packaging
private readonly IEntityXmlSerializer _serializer;
private readonly IHostingEnvironment _hostingEnvironment;
private readonly string _packageRepositoryFileName;
private readonly string _mediaFolderPath;
private readonly string _createdPackagesFolderPath;
private readonly string _packagesFolderPath;
private readonly string _tempFolderPath;
private readonly PackageDefinitionXmlParser _parser;
@@ -93,7 +92,7 @@ namespace Umbraco.Cms.Core.Packaging
_tempFolderPath = tempFolderPath ?? Constants.SystemDirectories.TempData.EnsureEndsWith('/') + "PackageFiles";
_packagesFolderPath = packagesFolderPath ?? Constants.SystemDirectories.Packages;
_mediaFolderPath = mediaFolderPath ?? Path.Combine(globalSettings.Value.UmbracoMediaPhysicalRootPath, Constants.SystemDirectories.CreatedPackages);
_createdPackagesFolderPath = mediaFolderPath ?? Constants.SystemDirectories.CreatedPackages;
_parser = new PackageDefinitionXmlParser();
_mediaService = mediaService;
@@ -250,15 +249,8 @@ namespace Umbraco.Cms.Core.Packaging
}
}
var directoryName =
_hostingEnvironment.MapPathWebRoot(Path.Combine(_mediaFolderPath, definition.Name.Replace(' ', '_')));
if (Directory.Exists(directoryName) == false)
{
Directory.CreateDirectory(directoryName);
}
var directoryName = _hostingEnvironment.MapPathContentRoot(Path.Combine(_createdPackagesFolderPath, definition.Name.Replace(' ', '_')));
Directory.CreateDirectory(directoryName);
var finalPackagePath = Path.Combine(directoryName, fileName);
@@ -276,14 +268,14 @@ namespace Umbraco.Cms.Core.Packaging
}
finally
{
//Clean up
// Clean up
Directory.Delete(temporaryPath, true);
}
}
private void ValidatePackage(PackageDefinition definition)
{
//ensure it's valid
// ensure it's valid
var context = new ValidationContext(definition, serviceProvider: null, items: null);
var results = new List<ValidationResult>();
var isValid = Validator.TryValidateObject(definition, context, results);
@@ -732,7 +724,6 @@ namespace Umbraco.Cms.Core.Packaging
private XDocument EnsureStorage(out string packagesFile)
{
var packagesFolder = _hostingEnvironment.MapPathContentRoot(_packagesFolderPath);
//ensure it exists
Directory.CreateDirectory(packagesFolder);
packagesFile = _hostingEnvironment.MapPathContentRoot(CreatedPackagesFile);
@@ -740,6 +731,8 @@ namespace Umbraco.Cms.Core.Packaging
{
var xml = new XDocument(new XElement("packages"));
xml.Save(packagesFile);
return xml;
}
var packagesXml = XDocument.Load(packagesFile);
@@ -749,9 +742,16 @@ namespace Umbraco.Cms.Core.Packaging
public void DeleteLocalRepositoryFiles()
{
var packagesFile = _hostingEnvironment.MapPathContentRoot(CreatedPackagesFile);
File.Delete(packagesFile);
if (File.Exists(packagesFile))
{
File.Delete(packagesFile);
}
var packagesFolder = _hostingEnvironment.MapPathContentRoot(_packagesFolderPath);
Directory.Delete(packagesFolder);
if (Directory.Exists(packagesFolder))
{
Directory.Delete(packagesFolder);
}
}
}
}
@@ -65,6 +65,11 @@ namespace Umbraco.Cms.Core
/// All languages.
/// </summary>
public const int Languages = -340;
/// <summary>
/// ScheduledPublishing job.
/// </summary>
public const int ScheduledPublishing = -341;
}
}
}
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Persistence.Repositories
{
[Obsolete("This interface will be merged with IMacroRepository in Umbraco 11")]
public interface IMacroWithAliasRepository : IMacroRepository
{
IMacro GetByAlias(string alias);
IEnumerable<IMacro> GetAllByAlias(string[] aliases);
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -0,0 +1,42 @@
using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Persistence.Repositories
{
public interface ITrackedReferencesRepository
{
/// <summary>
/// Gets a page of items which are in relation with the current item.
/// Basically, shows the items which depend on the current item.
/// </summary>
/// <param name="id">The identifier of the entity to retrieve relations for.</param>
/// <param name="pageIndex">The page index.</param>
/// <param name="pageSize">The page size.</param>
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
/// <param name="totalRecords">The total count of the items with reference to the current item.</param>
/// <returns>An enumerable list of <see cref="RelationItem"/> objects.</returns>
IEnumerable<RelationItem> GetPagedRelationsForItem(int id, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords);
/// <summary>
/// Gets a page of items used in any kind of relation from selected integer ids.
/// </summary>
/// <param name="ids">The identifiers of the entities to check for relations.</param>
/// <param name="pageIndex">The page index.</param>
/// <param name="pageSize">The page size.</param>
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
/// <param name="totalRecords">The total count of the items in any kind of relation.</param>
/// <returns>An enumerable list of <see cref="RelationItem"/> objects.</returns>
IEnumerable<RelationItem> GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords);
/// <summary>
/// Gets a page of the descending items that have any references, given a parent id.
/// </summary>
/// <param name="parentId">The unique identifier of the parent to retrieve descendants for.</param>
/// <param name="pageIndex">The page index.</param>
/// <param name="pageSize">The page size.</param>
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
/// <param name="totalRecords">The total count of descending items.</param>
/// <returns>An enumerable list of <see cref="RelationItem"/> objects.</returns>
IEnumerable<RelationItem> GetPagedDescendantsInReferences(int parentId, long pageIndex, int pageSize, bool filterMustBeIsDependency, out long totalRecords);
}
}
@@ -6,7 +6,6 @@ using System.Linq;
using System.Runtime.Serialization;
using System.Xml.Linq;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Hosting;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Editors;
@@ -158,17 +157,15 @@ namespace Umbraco.Cms.Core.PropertyEditors
/// <exception cref="System.ArgumentOutOfRangeException">ValueType was out of range.</exception>
internal Attempt<object> TryConvertValueToCrlType(object value)
{
// Ensure empty string values are converted to null
if (value is string s && string.IsNullOrWhiteSpace(s))
// Ensure empty string and JSON values are converted to null
if (value is string stringValue && string.IsNullOrWhiteSpace(stringValue))
{
value = null;
}
// Ensure JSON is serialized properly (without indentation or converted to null when empty)
if (value is not null && ValueType.InvariantEquals(ValueTypes.Json))
else if (value is not string && ValueType.InvariantEquals(ValueTypes.Json))
{
// Only serialize value when it's not already a string
var jsonValue = _jsonSerializer.Serialize(value);
if (jsonValue.DetectIsEmptyJson())
{
value = null;
@@ -1,5 +1,5 @@
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Hosting;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Serialization;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
@@ -28,5 +28,17 @@ namespace Umbraco.Cms.Core.PropertyEditors.ParameterEditors
DefaultConfiguration.Add("minNumber",0 );
DefaultConfiguration.Add("maxNumber", 0);
}
protected override IDataValueEditor CreateValueEditor() => DataValueEditorFactory.Create<MultipleContentPickerParameterEditor.MultipleContentPickerParamateterValueEditor>(Attribute);
internal class MultipleContentPickerParamateterValueEditor : MultiplePickerParamateterValueEditorBase
{
public MultipleContentPickerParamateterValueEditor(ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute, IEntityService entityService) : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute, entityService)
{
}
public override string UdiEntityType { get; } = Constants.UdiEntityType.Document;
public override UmbracoObjectTypes UmbracoObjectType { get; } = UmbracoObjectTypes.Document;
}
}
}
@@ -1,5 +1,9 @@
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Hosting;
using System;
using System.Collections.Generic;
using System.Reflection.Metadata;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Editors;
using Umbraco.Cms.Core.Serialization;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
@@ -26,5 +30,17 @@ namespace Umbraco.Cms.Core.PropertyEditors.ParameterEditors
{
DefaultConfiguration.Add("multiPicker", "1");
}
protected override IDataValueEditor CreateValueEditor() => DataValueEditorFactory.Create<MultipleMediaPickerPropertyValueEditor>(Attribute);
internal class MultipleMediaPickerPropertyValueEditor : MultiplePickerParamateterValueEditorBase
{
public MultipleMediaPickerPropertyValueEditor(ILocalizedTextService localizedTextService, IShortStringHelper shortStringHelper, IJsonSerializer jsonSerializer, IIOHelper ioHelper, DataEditorAttribute attribute, IEntityService entityService) : base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute, entityService)
{
}
public override string UdiEntityType { get; } = Constants.UdiEntityType.Media;
public override UmbracoObjectTypes UmbracoObjectType { get; } = UmbracoObjectTypes.Media;
}
}
}
@@ -0,0 +1,61 @@
using System;
using System.Collections.Generic;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Editors;
using Umbraco.Cms.Core.Serialization;
using Umbraco.Cms.Core.Services;
using Umbraco.Cms.Core.Strings;
namespace Umbraco.Cms.Core.PropertyEditors.ParameterEditors
{
internal abstract class MultiplePickerParamateterValueEditorBase : DataValueEditor, IDataValueReference
{
private readonly IEntityService _entityService;
public MultiplePickerParamateterValueEditorBase(
ILocalizedTextService localizedTextService,
IShortStringHelper shortStringHelper,
IJsonSerializer jsonSerializer,
IIOHelper ioHelper,
DataEditorAttribute attribute,
IEntityService entityService)
: base(localizedTextService, shortStringHelper, jsonSerializer, ioHelper, attribute)
{
_entityService = entityService;
}
public abstract string UdiEntityType { get; }
public abstract UmbracoObjectTypes UmbracoObjectType { get; }
public IEnumerable<UmbracoEntityReference> GetReferences(object value)
{
var asString = value is string str ? str : value?.ToString();
if (string.IsNullOrEmpty(asString))
{
yield break;
}
foreach (var udiStr in asString.Split(','))
{
if (UdiParser.TryParse(udiStr, out Udi udi))
{
yield return new UmbracoEntityReference(udi);
}
// this is needed to support the legacy case when the multiple media picker parameter editor stores ints not udis
if (int.TryParse(udiStr, out var id))
{
Attempt<Guid> guidAttempt = _entityService.GetKey(id, UmbracoObjectType);
Guid guid = guidAttempt.Success ? guidAttempt.Result : Guid.Empty;
if (guid != Guid.Empty)
{
yield return new UmbracoEntityReference(new GuidUdi(Constants.UdiEntityType.Media, guid));
}
}
}
}
}
}
@@ -134,8 +134,13 @@ namespace Umbraco.Cms.Core.Routing
return GetUrlFromRoute(route, umbracoContext, content.Id, current, mode, culture);
}
internal UrlInfo GetUrlFromRoute(string route, IUmbracoContext umbracoContext, int id, Uri current,
UrlMode mode, string culture)
internal UrlInfo GetUrlFromRoute(
string route,
IUmbracoContext umbracoContext,
int id,
Uri current,
UrlMode mode,
string culture)
{
if (string.IsNullOrWhiteSpace(route))
{
@@ -149,12 +154,12 @@ namespace Umbraco.Cms.Core.Routing
// route is /<path> or <domainRootId>/<path>
var pos = route.IndexOf('/');
var path = pos == 0 ? route : route.Substring(pos);
var domainUri = pos == 0
DomainAndUri domainUri = pos == 0
? null
: DomainUtilities.DomainForNode(umbracoContext.PublishedSnapshot.Domains, _siteDomainMapper, int.Parse(route.Substring(0, pos), CultureInfo.InvariantCulture), current, culture);
var defaultCulture = _localizationService.GetDefaultLanguageIsoCode();
if (domainUri is not null || culture == defaultCulture || string.IsNullOrEmpty(culture))
if (domainUri is not null || string.IsNullOrEmpty(culture) || culture.Equals(defaultCulture, StringComparison.InvariantCultureIgnoreCase))
{
var url = AssembleUrl(domainUri, path, current, mode).ToString();
return UrlInfo.Url(url, culture);
+5 -5
View File
@@ -111,10 +111,10 @@ namespace Umbraco.Cms.Core.Routing
// this the ONLY place where we deal with default culture - IUrlProvider always receive a culture
// be nice with tests, assume things can be null, ultimately fall back to invariant
// (but only for variant content of course)
if (content.ContentType.VariesByCulture())
// We need to check all ancestors because urls are variant even for invariant content, if an ancestor is variant.
if (culture == null && content.AncestorsOrSelf().Any(x => x.ContentType.VariesByCulture()))
{
if (culture == null)
culture = _variationContextAccessor?.VariationContext?.Culture ?? "";
culture = _variationContextAccessor?.VariationContext?.Culture ?? "";
}
if (current == null)
@@ -122,7 +122,7 @@ namespace Umbraco.Cms.Core.Routing
var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
current = umbracoContext.CleanedUmbracoUrl;
}
var url = _urlProviders.Select(provider => provider.GetUrl(content, mode, culture, current))
.FirstOrDefault(u => u != null);
@@ -230,7 +230,7 @@ namespace Umbraco.Cms.Core.Routing
var umbracoContext = _umbracoContextAccessor.GetRequiredUmbracoContext();
current = umbracoContext.CleanedUmbracoUrl;
}
var url = _mediaUrlProviders.Select(provider =>
provider.GetMediaUrl(content, propertyAlias, mode, culture, current))
@@ -269,16 +269,10 @@ namespace Umbraco.Extensions
if (!pcr.HasPublishedContent())
{
var logMsg = nameof(DetectCollisionAsync) +
const string logMsg = nameof(DetectCollisionAsync) +
" did not resolve a content item for original url: {Url}, translated to {TranslatedUrl} and culture: {Culture}";
if (pcr.IgnorePublishedContentCollisions)
{
logger.LogDebug(logMsg, url, uri, culture);
}
else
{
logger.LogDebug(logMsg, url, uri, culture);
}
logger.LogDebug(logMsg, url, uri, culture);
var urlInfo = UrlInfo.Message(textService.Localize("content", "routeErrorCannotRoute"), culture);
return Attempt.Succeed(urlInfo);
@@ -0,0 +1,13 @@
namespace Umbraco.Cms.Core.Runtime
{
/// <summary>
/// Defines a class which can generate a distinct key for a MainDom boundary.
/// </summary>
public interface IMainDomKeyGenerator
{
/// <summary>
/// Returns a key that signifies a MainDom boundary.
/// </summary>
string GenerateKey();
}
}
+2 -2
View File
@@ -87,7 +87,7 @@ namespace Umbraco.Cms.Core.Runtime
if (_isMainDom.HasValue == false)
{
throw new InvalidOperationException("Register called when MainDom has not been acquired");
throw new InvalidOperationException("Register called before IsMainDom has been established");
}
else if (_isMainDom == false)
{
@@ -225,7 +225,7 @@ namespace Umbraco.Cms.Core.Runtime
{
if (!_isMainDom.HasValue)
{
throw new InvalidOperationException("MainDom has not been acquired yet");
throw new InvalidOperationException("IsMainDom has not been established yet");
}
return _isMainDom.Value;
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.ComponentModel;
using System.Security.Cryptography;
using System.Text;
@@ -8,12 +8,17 @@ namespace Umbraco.Cms.Core.Security
{
/// <summary>
/// Handles password hashing and formatting for legacy hashing algorithms
/// Handles password hashing and formatting for legacy hashing algorithms.
/// </summary>
/// <remarks>
/// Should probably be internal.
/// </remarks>
public class LegacyPasswordSecurity
{
// TODO: Remove v11
// Used for tests
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")]
public string HashPasswordForStorage(string algorithmType, string password)
{
if (string.IsNullOrWhiteSpace(password))
@@ -24,13 +29,15 @@ namespace Umbraco.Cms.Core.Security
return FormatPasswordForStorage(algorithmType, hashed, salt);
}
// TODO: Remove v11
// Used for tests
[EditorBrowsable(EditorBrowsableState.Never)]
[Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")]
public string FormatPasswordForStorage(string algorithmType, string hashedPassword, string salt)
{
if (IsLegacySHA1Algorithm(algorithmType))
if (!SupportHashAlgorithm(algorithmType))
{
return hashedPassword;
throw new InvalidOperationException($"{algorithmType} is not supported");
}
return salt + hashedPassword;
@@ -45,10 +52,15 @@ namespace Umbraco.Cms.Core.Security
/// <returns></returns>
public bool VerifyPassword(string algorithm, string password, string dbPassword)
{
if (string.IsNullOrWhiteSpace(dbPassword)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(dbPassword));
if (string.IsNullOrWhiteSpace(dbPassword))
{
throw new ArgumentException("Value cannot be null or whitespace.", nameof(dbPassword));
}
if (dbPassword.StartsWith(Constants.Security.EmptyPasswordPrefix))
{
return false;
}
try
{
@@ -61,7 +73,6 @@ namespace Umbraco.Cms.Core.Security
//This can happen if the length of the password is wrong and a salt cannot be extracted.
return false;
}
}
/// <summary>
@@ -69,12 +80,13 @@ namespace Umbraco.Cms.Core.Security
/// </summary>
public bool VerifyLegacyHashedPassword(string password, string dbPassword)
{
var hashAlgorith = new HMACSHA1
var hashAlgorithm = new HMACSHA1
{
//the legacy salt was actually the password :(
Key = Encoding.Unicode.GetBytes(password)
};
var hashed = Convert.ToBase64String(hashAlgorith.ComputeHash(Encoding.Unicode.GetBytes(password)));
var hashed = Convert.ToBase64String(hashAlgorithm.ComputeHash(Encoding.Unicode.GetBytes(password)));
return dbPassword == hashed;
}
@@ -87,6 +99,8 @@ namespace Umbraco.Cms.Core.Security
/// <param name="salt"></param>
/// <returns></returns>
// TODO: Do we need this method? We shouldn't be using this class to create new password hashes for storage
// TODO: Remove v11
[Obsolete("We shouldn't be altering our public API to make test code easier, removing v11")]
public string HashNewPassword(string algorithm, string newPassword, out string salt)
{
salt = GenerateSalt();
@@ -102,15 +116,15 @@ namespace Umbraco.Cms.Core.Security
/// <returns></returns>
public string ParseStoredHashPassword(string algorithm, string storedString, out string salt)
{
if (string.IsNullOrWhiteSpace(storedString)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(storedString));
// This is for the <= v4 hashing algorithm for which there was no salt
if (IsLegacySHA1Algorithm(algorithm))
if (string.IsNullOrWhiteSpace(storedString))
{
salt = string.Empty;
return storedString;
throw new ArgumentException("Value cannot be null or whitespace.", nameof(storedString));
}
if (!SupportHashAlgorithm(algorithm))
{
throw new InvalidOperationException($"{algorithm} is not supported");
}
var saltLen = GenerateSalt();
salt = storedString.Substring(0, saltLen.Length);
@@ -133,18 +147,18 @@ namespace Umbraco.Cms.Core.Security
/// <returns></returns>
private string HashPassword(string algorithmType, string pass, string salt)
{
if (IsLegacySHA1Algorithm(algorithmType))
if (!SupportHashAlgorithm(algorithmType))
{
return HashLegacySHA1Password(pass);
throw new InvalidOperationException($"{algorithmType} is not supported");
}
//This is the correct way to implement this (as per the sql membership provider)
// This is the correct way to implement this (as per the sql membership provider)
var bytes = Encoding.Unicode.GetBytes(pass);
var saltBytes = Convert.FromBase64String(salt);
byte[] inArray;
var hashAlgorithm = GetHashAlgorithm(algorithmType);
using var hashAlgorithm = GetHashAlgorithm(algorithmType);
var algorithm = hashAlgorithm as KeyedHashAlgorithm;
if (algorithm != null)
{
@@ -209,42 +223,17 @@ namespace Umbraco.Cms.Core.Security
{
// This is for the v6-v8 hashing algorithm
if (algorithm.InvariantEquals(Constants.Security.AspNetUmbraco8PasswordHashAlgorithmName))
{
return true;
}
// This is for the <= v4 hashing algorithm
if (IsLegacySHA1Algorithm(algorithm))
// Default validation value for old machine keys (switched to HMACSHA256 aspnet 4 https://docs.microsoft.com/en-us/aspnet/whitepapers/aspnet4/breaking-changes)
if (algorithm.InvariantEquals("SHA1"))
{
return true;
}
return false;
}
private bool IsLegacySHA1Algorithm(string algorithm) => algorithm.InvariantEquals(Constants.Security.AspNetUmbraco4PasswordHashAlgorithmName);
/// <summary>
/// Hashes the password with the old v4 algorithm
/// </summary>
/// <param name="password">The password.</param>
/// <returns>The encoded password.</returns>
private string HashLegacySHA1Password(string password)
{
var hashAlgorithm = GetLegacySHA1Algorithm(password);
var hash = Convert.ToBase64String(hashAlgorithm.ComputeHash(Encoding.Unicode.GetBytes(password)));
return hash;
}
/// <summary>
/// Returns the old v4 algorithm and settings
/// </summary>
/// <param name="password"></param>
/// <returns></returns>
private HashAlgorithm GetLegacySHA1Algorithm(string password)
{
return new HMACSHA1
{
//the legacy salt was actually the password :(
Key = Encoding.Unicode.GetBytes(password)
};
}
}
}
@@ -0,0 +1,7 @@
namespace Umbraco.Cms.Core.Services
{
public interface IExamineIndexCountService
{
public int GetCount();
}
}
+1 -8
View File
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
@@ -17,13 +17,6 @@ namespace Umbraco.Cms.Core.Services
/// <returns>An <see cref="IMacro"/> object</returns>
IMacro GetByAlias(string alias);
///// <summary>
///// Gets a list all available <see cref="IMacro"/> objects
///// </summary>
///// <param name="aliases">Optional array of aliases to limit the results</param>
///// <returns>An enumerable list of <see cref="IMacro"/> objects</returns>
//IEnumerable<IMacro> GetAll(params string[] aliases);
IEnumerable<IMacro> GetAll();
IEnumerable<IMacro> GetAll(params int[] ids);
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Services
{
[Obsolete("This interface will be merged with IMacroService in Umbraco 11")]
public interface IMacroWithAliasService : IMacroService
{
/// <summary>
/// Gets a list of available <see cref="IMacro"/> objects by alias.
/// </summary>
/// <param name="aliases">Optional array of aliases to limit the results</param>
/// <returns>An enumerable list of <see cref="IMacro"/> objects</returns>
IEnumerable<IMacro> GetAll(params string[] aliases);
}
}
@@ -0,0 +1,11 @@
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Services
{
public interface IMetricsConsentService
{
TelemetryLevel GetConsentLevel();
void SetConsentLevel(TelemetryLevel telemetryLevel);
}
}
@@ -0,0 +1,10 @@
using System;
namespace Umbraco.Cms.Core.Services
{
public interface INodeCountService
{
int GetNodeCount(Guid nodeType);
int GetMediaCount();
}
}
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.Entities;
@@ -215,7 +215,7 @@ namespace Umbraco.Cms.Core.Services
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="totalChildren"></param>
/// <returns></returns>
/// <returns>An enumerable list of <see cref="IUmbracoEntity"/></returns>
IEnumerable<IUmbracoEntity> GetPagedParentEntitiesByChildId(int id, long pageIndex, int pageSize, out long totalChildren, params UmbracoObjectTypes[] entityTypes);
/// <summary>
@@ -225,7 +225,7 @@ namespace Umbraco.Cms.Core.Services
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="totalChildren"></param>
/// <returns></returns>
/// <returns>An enumerable list of <see cref="IUmbracoEntity"/></returns>
IEnumerable<IUmbracoEntity> GetPagedChildEntitiesByParentId(int id, long pageIndex, int pageSize, out long totalChildren, params UmbracoObjectTypes[] entityTypes);
/// <summary>
@@ -0,0 +1,38 @@
using Umbraco.Cms.Core.Models;
namespace Umbraco.Cms.Core.Services
{
public interface ITrackedReferencesService
{
/// <summary>
/// Gets a paged result of items which are in relation with the current item.
/// Basically, shows the items which depend on the current item.
/// </summary>
/// <param name="id">The identifier of the entity to retrieve relations for.</param>
/// <param name="pageIndex">The page index.</param>
/// <param name="pageSize">The page size.</param>
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
/// <returns>A paged result of <see cref="RelationItem"/> objects.</returns>
PagedResult<RelationItem> GetPagedRelationsForItem(int id, long pageIndex, int pageSize, bool filterMustBeIsDependency);
/// <summary>
/// Gets a paged result of the descending items that have any references, given a parent id.
/// </summary>
/// <param name="parentId">The unique identifier of the parent to retrieve descendants for.</param>
/// <param name="pageIndex">The page index.</param>
/// <param name="pageSize">The page size.</param>
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
/// <returns>A paged result of <see cref="RelationItem"/> objects.</returns>
PagedResult<RelationItem> GetPagedDescendantsInReferences(int parentId, long pageIndex, int pageSize, bool filterMustBeIsDependency);
/// <summary>
/// Gets a paged result of items used in any kind of relation from selected integer ids.
/// </summary>
/// <param name="ids">The identifiers of the entities to check for relations.</param>
/// <param name="pageIndex">The page index.</param>
/// <param name="pageSize">The page size.</param>
/// <param name="filterMustBeIsDependency">A boolean indicating whether to filter only the RelationTypes which are dependencies (isDependency field is set to true).</param>
/// <returns>A paged result of <see cref="RelationItem"/> objects.</returns>
PagedResult<RelationItem> GetPagedItemsWithRelations(int[] ids, long pageIndex, int pageSize, bool filterMustBeIsDependency);
}
}
@@ -58,4 +58,12 @@ namespace Umbraco.Cms.Core.Services
/// </summary>
Task<IEnumerable<string>> GetEnabledTwoFactorProviderNamesAsync(Guid userOrMemberKey);
}
[Obsolete("This will be merged into ITwoFactorLoginService in Umbraco 11")]
public interface ITwoFactorLoginService2 : ITwoFactorLoginService
{
Task<bool> DisableWithCodeAsync(string providerName, Guid userOrMemberKey, string code);
Task<bool> ValidateAndSaveAsync(string providerName, Guid userKey, string secret, string code);
}
}

Some files were not shown because too many files have changed in this diff Show More