Compare commits

...
Author SHA1 Message Date
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
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
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
Mole 4fffb9f7a7 Bump versions to non-rc 2022-03-23 09:48:21 +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 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
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 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
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
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
c7e45ae13a Encode path (#12132)
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2022-03-17 14:53:53 +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
Bjarke Berg 8746d4c13d Small typos fixed.. 2022-03-09 14:59:55 +01: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
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
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
Patrick de MooijandNathan Woulfe 15bedfbc76 11777: Remove sorting because we need the correct order 2022-02-24 07:46:58 +10: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
nikolajlauridsen eea02137ae Bump version to non-rc 2022-02-09 10:26:31 +01:00
Bjarke BergandGitHub 3d28552a77 Add settings to bypass 2fa for external logins (#11959)
* Added settings for bypassing 2fa for external logins

* Fixed issue with saving roles using member ID before the member had an ID.

* Added missing extension method

* Removed test classes from git

* rollback csproj
2022-02-09 10:19:39 +01:00
MoleandGitHub 927ee44efe Merge pull request #11953 from umbraco/v9/feature/migrate-umbraco-logo
Cherry pick Apply the Umbraco logo to BackOffice (#11949) to V9
2022-02-08 11:52:18 +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øandnikolajlauridsen b89cd86d85 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:40:14 +01: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 BergandGitHub 23803a44b7 Fixed minor issues and added xml docs (#11943) 2022-02-07 14:32:58 +01:00
Bjarke BergandGitHub 25c52d507a Merge pull request #11944 from umbraco/v9/hotfix/remove-element-from-blocklist
V9: Fix removing element from BlockList
2022-02-07 14:13:38 +01:00
Mole d7fef7cd0c Check blockObject.content for null 2022-02-07 12:09:13 +01:00
Bjarke BergandGitHub 58b75c58aa Fixes issue with miniprofiler losing the information when doing a redirect, e.g. in a successful surfacecontroller call. (#11939)
Now we store the profiler in a cookie on local redirects and pick it up on next request and add it as a child to that profiler
2022-02-07 09:21:26 +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
Bjarke BergandGitHub 7971f36b78 Add check for PluginControllerAttribute and compare area name (#11911)
* Add check for PluginControllerAttribute and compare area name

* Added null check
2022-01-27 10:32:56 +01:00
Mole c73d0bf6a6 Update logging message in HelpController 2022-01-27 09:53:16 +01:00
MoleandGitHub de6824dfa0 Merge pull request #11909 from umbraco/v9/feature/allowlist-for-help-page
V9: Add allowlist for HelpPage
2022-01-26 13:25: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
Bjarke Berg d4c43b69f7 Updated to use IOptionsMonitor 2022-01-26 12:40:14 +01:00
Ronald BarendseandGitHub 4d4aff4c67 Apply changes from #11805 and #11806 to v9 (#11904)
* Apply changes from #11805 and #11806 to v9

* Update documentation and cleanup code styling
2022-01-26 12:22:05 +01:00
Mole 3261a6f71d Fix up for V9 2022-01-26 12:12:59 +01:00
Mole 2f17d766be Cherry pick Add allowlist for HelpPage 2022-01-26 11:43:59 +01:00
Mole 9dbe2d211c Add allowlist for HelpPage 2022-01-26 10:57:49 +01:00
Mole 72533d29c8 Specify namespace for CharITem 2022-01-26 10:20:12 +01:00
Mole 2ddb3e13e5 Fix breaking changes 2022-01-26 10:05:01 +01:00
Mole 3ade2b6de3 Add RC to version 2022-01-26 08:43:43 +01:00
Mole 6ad08a3b29 Merge branch 'v9/dev' into v9/9.3 2022-01-26 08:33:56 +01:00
Bjarke Berg 930bdac45e Merge remote-tracking branch 'origin/v9/feature/add-html-sanitizer-abstraction' into v9/dev
# Conflicts:
#	src/Umbraco.Core/Security/IHtmlSanitizer.cs
#	src/Umbraco.Core/Security/NoopHtmlSanitizer.cs
2022-01-26 08:02:04 +01:00
Bjarke Berg 160d9fb96b Merge remote-tracking branch 'origin/v8/dev' into v9/dev
# Conflicts:
#	src/Umbraco.Core/Composing/CompositionExtensions/Services.cs
#	src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs
#	src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
2022-01-26 07:58:04 +01:00
MoleandGitHub d70a207d60 V8: Add ability to implement your own HtmlSanitizer (#11897)
* Add IHtmlSanitizer

* Use IHtmlSanitizer in RTE value editor

* Add docstrings to IHtmlSanitizer

* Rename NoOp to Noop

To match the rest of the classes

* Fix tests
2022-01-26 07:51:25 +01:00
Ronald BarendseandBjarke Berg 76593aa7ca Add IsRestarting property to Umbraco application notifications (#11883)
* Add IsRestarting property to Umbraco application notifications

* Add IUmbracoApplicationLifetimeNotification and update constructors

* Only subscribe to events on initial startup

* Cleanup CoreRuntime

* Do not reset StaticApplicationLogging instance after stopping/during restart
2022-01-25 06:39:49 +01:00
Ronald BarendseandGitHub ca56e0971f Add IsRestarting property to Umbraco application notifications (#11883)
* Add IsRestarting property to Umbraco application notifications

* Add IUmbracoApplicationLifetimeNotification and update constructors

* Only subscribe to events on initial startup

* Cleanup CoreRuntime

* Do not reset StaticApplicationLogging instance after stopping/during restart
2022-01-25 06:38:20 +01:00
Mole 39f7102312 Use IHtmlSanitizer in RichTextValueEditor 2022-01-24 09:30:23 +01:00
Mole 249774c815 Rename NoOp to Noop
To match the rest of the classes
2022-01-24 09:24:40 +01:00
Mole 01c1e68cf0 Fix up namespaces 2022-01-24 09:19:06 +01:00
Mole e2d0a0f699 Add docstrings to IHtmlSanitizer 2022-01-24 09:18:31 +01:00
Mole 8b773c90c2 Add IHtmlSanitizer 2022-01-24 08:56:53 +01:00
Bjarke Berg 4b92a47e93 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
2022-01-23 13:44:33 +01:00
Bjarke Berg f49b661c26 Merge remote-tracking branch 'origin/v9/9.2' into v9/9.3
# Conflicts:
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
2022-01-23 13:43:34 +01:00
Bjarke Berg b7d8b7923d Merge remote-tracking branch 'origin/v9/9.2' into v9/dev
# Conflicts:
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
2022-01-23 13:34:39 +01:00
Bjarke Berg 4843b28184 added contains check for acceptance tests 2022-01-21 19:30:38 +01:00
Bjarke BergandGitHub eb126a77b6 Merge pull request #11893 from umbraco/v9/merge-v9-contrib-into-v9-dev
Merge v9 contrib into v9 dev
2022-01-21 13:18:35 +01:00
12abd883a9 Member 2FA (#11889)
* Bugfix - Take ufprt from form data if the request has form content type, otherwise fallback to use the query

* External linking for members

* Changed migration to reuse old table

* removed unnecessary web.config files

* Cleanup

* Extracted class to own file

* Clean up

* Rollback changes to Umbraco.Web.UI.csproj

* Fixed migration for SqlCE

* Added 2fa for members

* Change notification handler to be on deleted

* Update src/Umbraco.Infrastructure/Security/MemberUserStore.cs

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

* updated snippets

* Fixed issue with errors not shown on member linking

* fixed issue with errors

* clean up

* Fix issue where external logins could not be used to upgrade Umbraco, because the externalLogin table was expected to look different. (Like after the migration)

* Fixed issue in Ignore legacy column now using result column.

* Updated 2fa for members + publish notification when 2fa is requested.

* Changed so only Members out of box supports 2fa

* Cleanup

* rollback of csproj file, that should not have been changed

* Removed confirmed flag from db. It was not used.

Handle case where a user is signed up for 2fa, but the provider do not exist anymore. Then it is just ignored until it shows up again

Reintroduced ProviderName on interface, to ensure the class can be renamed safely

* Bugfix

* Registering DeleteTwoFactorLoginsOnMemberDeletedHandler

* Rollback nuget packages added by mistake

* Update src/Umbraco.Infrastructure/Services/Implement/TwoFactorLoginService.cs

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

* Update src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TwoFactorLoginRepository.cs

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

* Added providername to snippet

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-01-21 13:10:34 +01:00
Bjarke Berg 52a3e285a9 Merge remote-tracking branch 'origin/v8/dev' into v9/dev
# Conflicts:
#	src/Umbraco.Core/Composing/CompositionExtensions/Services.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Core/Dashboards/ContentDashboardSettings.cs
#	src/Umbraco.Core/Dashboards/IContentDashboardSettings.cs
#	src/Umbraco.Core/Manifest/ManifestParser.cs
#	src/Umbraco.Core/Manifest/PackageManifest.cs
#	src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs
#	src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Core/Models/PropertyTagsExtensions.cs
#	src/Umbraco.Core/PropertyEditors/ComplexPropertyEditorContentEventHandler.cs
#	src/Umbraco.Core/PropertyEditors/ConfigurationEditor.cs
#	src/Umbraco.Core/PropertyEditors/DataValueEditor.cs
#	src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValue.cs
#	src/Umbraco.Core/Serialization/JsonToStringConverter.cs
#	src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
#	src/Umbraco.Core/Telemetry/ITelemetryService.cs
#	src/Umbraco.Core/Telemetry/Models/PackageTelemetry.cs
#	src/Umbraco.Core/Telemetry/Models/TelemetryReportData.cs
#	src/Umbraco.Core/Telemetry/TelemetryService.cs
#	src/Umbraco.Tests/Manifest/ManifestParserTests.cs
#	src/Umbraco.Tests/PropertyEditors/BlockEditorComponentTests.cs
#	src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs
#	src/Umbraco.Tests/PropertyEditors/NestedContentPropertyComponentTests.cs
#	src/Umbraco.Tests/Web/Controllers/AuthenticationControllerTests.cs
#	src/Umbraco.Tests/Web/Controllers/UsersControllerTests.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/entity.resource.js
#	src/Umbraco.Web.UI/Umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/BatchedDatabaseServerMessenger.cs
#	src/Umbraco.Web/Cache/DistributedCacheBinder.cs
#	src/Umbraco.Web/Compose/BlockEditorComponent.cs
#	src/Umbraco.Web/Compose/NestedContentPropertyComponent.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
#	src/Umbraco.Web/Editors/ContentTypeController.cs
#	src/Umbraco.Web/Editors/DashboardController.cs
#	src/Umbraco.Web/Editors/EntityController.cs
#	src/Umbraco.Web/Editors/UsersController.cs
#	src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/ColorPickerConfigurationEditor.cs
#	src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/ImageCropperPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs
#	src/Umbraco.Web/PropertyEditors/MediaPicker3PropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultiUrlPickerValueEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultipleTextStringPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultipleValueEditor.cs
#	src/Umbraco.Web/PropertyEditors/NestedContentPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/TagsPropertyEditor.cs
#	src/Umbraco.Web/Telemetry/ReportSiteTask.cs
#	src/Umbraco.Web/Telemetry/TelemetryComponent.cs
#	src/Umbraco.Web/Trees/ContentTreeController.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
#	src/Umbraco.Web/WebApi/EnableDetailedErrorsAttribute.cs
2022-01-21 12:40:18 +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
Sebastiaan Janssen ecd32bf033 The marked dev dependency was unused 2022-01-21 10:48:22 +01:00
James Jackson-SouthandSebastiaan Janssen 4136adebc8 Bump ImageSharp.Web version 2022-01-21 10:06:07 +01:00
Sebastiaan Janssen 8eb3ef65f6 Merge branch 'v9/dev' into v9/contrib 2022-01-21 10:02:37 +01:00
Bjarke Berg a8e0690199 moved namespace to match umbraco version 2022-01-21 09:31:09 +01:00
e204c5bab9 Media Previews (#11888)
Co-authored-by: Niels Lyngsø <nsl@umbraco.com>
Co-authored-by: Mads Rasmussen <madsr@hey.com>
Co-authored-by: Paul Johnson <pmj@umbraco.com>
2022-01-20 16:47:00 +01:00
029a261476 Improve functionality for external member logins (#11855)
* Bugfix - Take ufprt from form data if the request has form content type, otherwise fallback to use the query

* External linking for members

* Changed migration to reuse old table

* removed unnecessary web.config files

* Cleanup

* Extracted class to own file

* Clean up

* Rollback changes to Umbraco.Web.UI.csproj

* Fixed migration for SqlCE

* Change notification handler to be on deleted

* Update src/Umbraco.Infrastructure/Security/MemberUserStore.cs

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

* Fixed issue with errors not shown on member linking

* fixed issue with errors

* clean up

* Fix issue where external logins could not be used to upgrade Umbraco, because the externalLogin table was expected to look different. (Like after the migration)

* Fixed issue in Ignore legacy column now using result column.

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-01-19 09:21:50 +01:00
Paul JohnsonandGitHub c60d8c8ab8 Added EntityController.GetUrlsByIds support for int & guid + update MNTP (#11680)
Fixes issue with MNTP (for 8.18) in a partial view macro - GH #11631

Renamed GetUrlsByUdis to match, don't do this in v9 as it would be
breaking there, instead mark it obsolete.

TODO: v9 ensure integration test coverage, more painful here as no 
WebApplicationFactory.
2022-01-19 08:32:33 +01:00
Nikolaj GeisleandGitHub 16fb4f419a Merge pull request #11823 from umbraco/v8/bugfix/dont_show_stacktrace_in_production_mode
Don't show stack trace in production mode
2022-01-18 17:47:14 +01:00
Elitsa MarinovskaandGitHub 24519f6dad Allowlisting remote URLs for displaying content on the content dashboard (#11822)
* Implement allowlisting of urls when fetching data for the content dashboard

* Adding a new setting in the config & removing inexistent one

* Adding description

* Adding description

* Tidy up code
2022-01-18 15:38:03 +01:00
Elitsa MarinovskaandGitHub 229ca989eb V9: Allowlisting remote URLs for displaying content on the content dashboard (#11825)
* Fixing ContentDashboardSettings to work when set in the config

* Moving file in Models folder and adding ContentDashboardUrlAllowlist setting

* Implementing allowlist for content dashboard base url

* Cleanup

* Error msg vs log msg
2022-01-18 15:37:31 +01:00
1b5830a9d7 V9: Visiting a page without a template returns "Page Not Found" (#11852)
* Returns "Page Not Found" when template doesn't exist for a docType

* Fix comment

* Use IsNullOrWhiteSpace instead of IsNullOrEmpty

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-01-18 15:36:25 +01:00
Elitsa Marinovska 72f30eb937 Adding else case 2022-01-18 15:19:05 +01:00
Elitsa Marinovska cce40a0734 Merge branch 'v8/dev' into v8/bugfix/dont_show_stacktrace_in_production_mode 2022-01-18 14:37:14 +01:00
Ronald BarendseandGitHub 364b8f1c72 Add UmbracoApplicationStartedNotification and UmbracoApplicationStoppedNotification (#11857)
* Add UmbracoApplicationStartedNotification and UmbracoApplicationStoppedNotification

* Include cancellation token when publishing unattended install/upgrade notifications
2022-01-18 13:58:14 +01:00
Paul JohnsonandGitHub bf166225de Move Umbraco.Tests to legacy dir. (#11878)
(makes grep easier)
2022-01-18 10:39:22 +00: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
Paul JohnsonandGitHub 576f90ad37 Speedup codeql run (#11877)
* Speedup codeql run

* npm build once, ignore node_modules

* Misc cleanup
2022-01-18 00:35:53 +00:00
Paul Johnson 9a145537aa Fix config file, should be on init 2022-01-17 22:29:42 +00:00
Paul Johnson c410f78986 Restore config file and prevent duplicate run for feature branches 2022-01-17 21:41:24 +00:00
Paul JohnsonandGitHub 2c44d67686 Modify codeql setup. (#11876) 2022-01-17 14:42:41 +00:00
Nikolaj Geisle 0e9525d216 Added null check 2022-01-17 08:32:13 +01:00
Søren KottalandMichael Latouche 8cd0e5a003 Change logmessages 2022-01-16 13:42:57 +01:00
Erik-Jan WestendorpandGitHub ee1153ee56 Localization: Translate history cleanup labels/descriptions to Dutch (#11835)
* Update nl.xml to show labels in dutch in info content app

* Update nl.xml to show labels in dutch in permissions app
2022-01-16 12:33:49 +01:00
Erik-Jan WestendorpandGitHub 294ea7373e Localization: Rename RelatieTypen to RelatieTypes (Dutch) (#11849)
* Change RelatieTypen to RelatieTypes

* Small 't'
2022-01-16 12:13:17 +01:00
Erik-Jan WestendorpandGitHub 73e99b75b2 Add missing read more translation (#11850) 2022-01-16 05:36:45 +01:00
0eed641235 Delete temp document type file if validation fails (#11836)
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-01-13 13:12:44 +01:00
Bjarke BergandGitHub baba7ffed9 Bugfix - Take ufprt from form data if the request has form content type, otherwise fallback to use the query (#11845) 2022-01-12 13:54:14 +01:00
eb4acba081 Set default tree group for core trees (#11801)
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-01-12 12:35:48 +01:00
18a3133536 v9: Fix max allowed content length on iis & kestrel (#11802)
* Update web.config

* Change web.config to align with v8 default values

* Adjust kestrel options to align with v8

* Add better comment

* added web.config to root

* change web.config to 30mb

* delete obsolete comment

* No reason to have web.config to just have it default

* Add back ConfigureIISServerOptions.cs

* Add obsolete comment, can't link to documentation yet as it doesn't exist

* Apply suggestions from code review

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

* Add link to documentation

Co-authored-by: Mole <nikolajlauridsen@protonmail.ch>
2022-01-12 12:32:53 +01:00
Paul JohnsonandGitHub d9bdd8196c Misc/obsolete redundant extension (#11838)
* Mark AddUnique<TImplementing> obsolete.

* Remove all internal usages of AddUnique<TImplementing>.
2022-01-10 17:03:33 +01:00
Paul JohnsonandGitHub a952d17e74 Make using scoped services in notification handlers less painful. (#11733)
* Add failing test to demo issue with handlers + scoped dependencies.

* Make using scoped services in notification handlers less painful.

* Update comments for accuracy.
2022-01-10 15:31:46 +00:00
Ronald BarendseandGitHub 2155062678 Prune/remove indentation from JSON property values (#11806)
* Use Formatting.None for JSON property data in default value editor

* Use Formatting.None for JSON property data in custom value editors

* Use Formatting.None for JSON property data in Nested Content and Block List

* Use Formatting.None for JSON property tags

* Use Formatting.None for JSON configuration data

* Use Formatting.None in custom JSON converter

* Ensure empty tags and complex editor values are not stored

* Fix NestedContentPropertyComponentTests

* Do not store empty property data

* Use Formatting.None and don't store configured crops (without coordinates)

* Fix JSON deserialization of tags value
2022-01-10 09:32:29 +01:00
Nikolaj GeisleandGitHub 187cac469e Add package tests (#11824) 2022-01-07 08:55:40 +01:00
642c216f94 Serve Media and App_Plugins using WebRootFileProvider (and allow changing the physical media path) (#11783)
* Allow changing UmbracoMediaPath to an absolute path. Also ensure Imagesharp are handing requests outside of the wwwroot folder.

* Let UmbracoMediaUrl fallback to UmbracoMediaPath when empty

* Add FileSystemFileProvider to expose an IFileSystem as IFileProvider

* Replace IUmbracoMediaFileProvider with IFileProviderFactory implementation

* Fix issue resolving relative paths when media URL has changed

* Remove FileSystemFileProvider and require explicitly implementing IFileProviderFactory

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

* Update test to use UmbracoMediaUrl

* Add UmbracoMediaPhysicalRootPath global setting

* Remove MediaFileManagerImageProvider and use composited file providers

* Move CreateFileProvider to IFileSystem extension method

* Add rooted path tests

Co-authored-by: Ronald Barendse <ronald@barend.se>
2022-01-06 13:35:24 +01:00
Nikolaj GeisleandGitHub d5ba5be096 Merge pull request #11386 from matthewcare/temp-11381
Request Handler Settings for character replacement
2022-01-05 14:56:11 +01:00
Nikolaj Geisle dfc3e56eb7 Check if we're in debug and set IncludeErrorPolicy accordingly 2022-01-05 13:16:07 +01:00
75bb8051bf Prune Image Cropper and Media Picker (v3) values (#11805)
* Clean up redundant/default Umbraco.ImageCropper data

* Fix ToString() and add HasCrops() method

* Re-use crop/focal point pruning for Umbraco.MediaPicker3

* Fix ImageCropperTest

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2022-01-05 11:11:27 +01:00
MoleandGitHub a54c5bb21d V8: Merge package telemetry from V9 (#11785)
* Merge Telemetry classes from V9

* Use TelemetryService in ReportSiteTask

* Migrate tests
2022-01-04 10:11:34 +01:00
Ronald BarendseandMole 763cb70e67 Move member properties to Member Content App (V9 merge regression) (#11768)
* Fix regression after merging to v9

* Update test to align with removed member properties
2022-01-04 08:21:58 +01:00
MoleandBjarke Berg 65c0d8fcec V9: Use current request for emails (#11778)
* Use request url for email

* Fixed potential null ref exceptions

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2022-01-04 08:18:01 +01:00
Mole bbfa975096 Bump versions to non-rc 2022-01-03 15:36:52 +01:00
Nikolaj GeisleandMole 421faf8d43 Fix assignDomain to handle case sensitive operating systems (#11784) 2022-01-03 15:33:32 +01:00
Nikolaj GeisleandGitHub 84fea8f953 Fix assignDomain to handle case sensitive operating systems (#11784) 2022-01-03 15:07:44 +01:00
Bjarne FyrstenborgandMichael Latouche be8e7b285b Fix incorrect styling of actions in tags editor 2021-12-30 03:11:31 +01:00
Bjarne FyrstenborgandMichael Latouche 025db57b03 Fix issue with missing URLs shown in redirect management 2021-12-30 02:49:03 +01:00
Søren KottalandMichael Latouche fad0c948a1 Makes the width of .login-overlay__logo dynamic 2021-12-28 02:33:57 +01:00
Mole 04d20269ab Merge CharCollection and UserDefinedCharCollection
Otherwise only CharCollection would work, and that's obsolete, now you can use either, but UserDefinedCharCollection takes priority
2021-12-22 13:04:40 +01:00
bc6d8b5ece v9: Throw error on duplicate routes (#11774)
* Add conflicting route service and check

* Added testclass

* Cleanup

* Update src/Umbraco.Web.BackOffice/Services/ConflictingRouteService.cs

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

* Implemented out variable

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2021-12-22 13:03:38 +01:00
Mole 53e5a25df8 Remove ugly CharCollection hack
By adding a new configuration and mapping the old CharCollection to that, we can get around having to return null the first time, by obsoleting the old one and redirecting to the new GetCharReplacements method
2021-12-22 11:29:04 +01:00
Nikolaj GeisleandGitHub 380b70046f Merge pull request #11753 from SpringIT/v9/bugfix/incorrect-import-document-url-casing
Fix incorrect camelcasing for import document type
2021-12-22 10:05:16 +01:00
Andy ButlandandGitHub 1af09c7f13 Updates Forms and adds Deploy JSON schema. (#11739) 2021-12-21 15:19:55 +01:00
Mole c6d28f01a8 Check for null in DefaultShortStringHelperConfig.WithDefault 2021-12-21 15:15:53 +01:00
Mole 040116c004 Remove TODO
With some testing this seems to be a none-issue, since we don't operate on the keys themselves
2021-12-21 14:48:56 +01:00
76cf5037e5 v9: Move local xml package files to database instead (#11654)
* Move package to database

* Added migration and implemented new repository

* Updated migrations to use proper xml convert

* Fixed save function and renamed createDate to update date

* Updated dependencyInjection

* Updated UmbracoPlan.cs

* Apply suggestions from code review

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

* Added File check

* Tried using same context as create table

* Fix DTO

* Fix GetById and local package saving

* Fix images when migrating

* Implement deletion of all local files

* Only delete local repo file, not file snapshots

* Remove static package path and use the one we save

* Update package repo to export package and remove check for ids when exporting

* Minor fixes

* Fix so that you can download package after creating

* Update savePackage method to export package afterwards

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2021-12-21 14:02:49 +01:00
Mole 80cda3364b Make CharCollection return the merged result
Since this is the way it's been previously, we cannot change the behaviour of this. Unfortunately due to how the config binding works, we have to make sure it returns null the very first time it's called by the framework to ensure that overrides actually gets registered.
2021-12-21 13:35:30 +01:00
Bjarke Berg 4abace7e51 Merge remote-tracking branch 'origin/v9/9.2' into v9/dev 2021-12-21 12:54:53 +01:00
Elitsa MarinovskaandBjarke Berg 0ea5f6a02c Adding UmbracoApplicationUrlCheck "Read more" URL 2021-12-21 12:50:44 +01:00
Elitsa MarinovskaandBjarke Berg be53ccf1fd Implement #11776 for v9 2021-12-21 12:50:25 +01:00
72d9f56478 V9: Use current request for emails (#11778)
* Use request url for email

* Fixed potential null ref exceptions

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-12-21 12:48:35 +01:00
Nikolaj GeisleandGitHub 65c0039656 Merge pull request #11779 from umbraco/v9/feature/AB15639-umbracoApplicationUrl-healthcheck
V9: Add a health check for umbraco application url
2021-12-21 12:15:07 +01:00
Mole 6147375a3e Return CharItem instead of IChar from CharCollection
On second thought this is not a breaking change since CharItem implements IChar, so you could still do something lke IEnumerable<IChar> chars = requestHandlerSettings.CharCollection
2021-12-21 11:56:33 +01:00
Nikolaj GeisleandGitHub bd1c392dff Merge pull request #11776 from umbraco/v8/bugfix/AB15639-umbracoApplicationUrl-healthcheck
Add a health check for umbraco application url
2021-12-21 11:35:41 +01:00
Sebastiaan JanssenandGitHub 4240f89534 Adds migration back for v9 for #10450 (#11769) 2021-12-21 11:15:57 +01:00
Mole d77e198d31 Move unit test to the new location 2021-12-21 10:44:36 +01:00
Mole 338bbdd382 Reintroduce IChar interface
Removing a public interface is a breaking change, in case someone is implementing the interface for some reason.
2021-12-21 10:36:25 +01:00
Mole 8a8b1e3247 Rename CharacterReplacement back to CharItem
Since the class is public renaming this would be a breaking change, since if anyone is directly referring to the class it would break
2021-12-21 10:30:19 +01:00
Mole c4f8944add Merge branch 'v9/contrib' into temp-11381 2021-12-21 09:42:39 +01:00
Elitsa Marinovska cc8ea0e8eb Adding UmbracoApplicationUrlCheck "Read more" URL 2021-12-21 08:58:13 +01:00
Elitsa Marinovska 2b2e703e30 Implement #11776 for v9 2021-12-21 08:57:28 +01:00
MoleandGitHub 7a5f72b5eb Use current request for emails (#11775)
* Use current request for emails

* Fix tests
2021-12-21 07:23:08 +01:00
Elitsa Marinovska 68fdf6521e Being more descriptive 2021-12-20 15:21:12 +01:00
Elitsa Marinovska bcabf05995 Adds new translation 2021-12-20 14:37:42 +01:00
Elitsa Marinovska 4e6d09b626 Adds a new Health Check 2021-12-20 14:37:18 +01:00
Andy ButlandandGitHub fd1de8e103 Merge pull request #11757 from umbraco/v8/bugfix/handle-batched-server-messages-on-background-thread
Handled flushing of cache instruction messages when created from handling events in a background thread
2021-12-20 11:43:31 +01:00
Ronald BarendseandGitHub 0ba51f87ea Move member properties to Member Content App (V9 merge regression) (#11768)
* Fix regression after merging to v9

* Update test to align with removed member properties
2021-12-20 08:45:11 +01:00
Sebastiaan Janssen 7006461ba2 Revert "Added notifications toggle to user groups (#10450)"
This reverts commit 4c6d4b9326.
2021-12-16 16:30:18 +01:00
Mole a69499a136 Bump versions 2021-12-16 09:10:55 +01:00
nikolajlauridsen e5deb7fe8c Fix LogViewerController ambiguous constructor 2021-12-15 14:42:18 +01:00
Bjarke Berg 694a636746 Fix breaking change 2021-12-15 11:53:16 +01:00
Bjarke Berg d41fca73a1 Unbreak breaking changes 2021-12-15 11:47:45 +01:00
nikolajlauridsen 908c89f4b3 Fix breaking change in ReportSiteTask 2021-12-15 11:38:17 +01:00
Bjarke Berg 99597734ca Merge remote-tracking branch 'origin/v9/dev' into v9/dev 2021-12-15 08:31:28 +01:00
Bjarke BergandGitHub e991bb79d7 Merge pull request #11762 from umbraco/v9/feature/merge_v8_14-12-2021
Merge v8/dev into v9/dev 14/12/2021
2021-12-14 22:17:25 +01:00
Bjarke Berg 341aac44b5 Fixed tests after merge 2021-12-14 21:24:19 +01:00
Bjarke Berg 69b8b64b54 Merge remote-tracking branch 'origin/v8/dev' into v9/feature/merge_v8_14-12-2021
# Conflicts:
#	src/Umbraco.Core/Constants-Conventions.cs
#	src/Umbraco.Core/Migrations/Install/DatabaseDataCreator.cs
#	src/Umbraco.Core/Migrations/Upgrade/UmbracoPlan.cs
#	src/Umbraco.Core/Models/IContentType.cs
#	src/Umbraco.Core/Packaging/PackageDataInstallation.cs
#	src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeCommonRepository.cs
#	src/Umbraco.Core/Persistence/Repositories/Implement/ContentTypeRepository.cs
#	src/Umbraco.Core/Persistence/Repositories/Implement/MemberTypeRepository.cs
#	src/Umbraco.Core/Services/Implement/EntityXmlSerializer.cs
#	src/Umbraco.Core/Services/Implement/MemberService.cs
#	src/Umbraco.Tests/Packaging/PackageDataInstallationTests.cs
#	src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs
#	src/Umbraco.Tests/Services/Importing/ImportResources.Designer.cs
#	src/Umbraco.Tests/Services/Importing/ImportResources.resx
#	src/Umbraco.Tests/Umbraco.Tests.csproj
#	src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js
#	src/Umbraco.Web.UI.Client/src/common/services/umbdataformatter.service.js
#	src/Umbraco.Web.UI.Client/src/views/content/content.rights.controller.js
#	src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html
#	src/Umbraco.Web.UI.Client/src/views/member/apps/content/content.html
#	src/Umbraco.Web.UI/Umbraco/Views/Default.cshtml
#	src/Umbraco.Web.UI/Umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/fr.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/nl.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/zh.xml
#	src/Umbraco.Web.UI/config/BackOfficeTours/getting-started.json
#	src/Umbraco.Web/HealthCheck/Checks/Security/ExcessiveHeadersCheck.cs
#	src/Umbraco.Web/Models/ContentEditing/MemberDisplay.cs
#	src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs
#	src/Umbraco.Web/Models/Mapping/MemberMapDefinition.cs
#	src/Umbraco.Web/Models/Mapping/MemberTabsAndPropertiesMapper.cs
#	src/Umbraco.Web/Models/Mapping/TabsAndPropertiesMapper.cs
#	src/Umbraco.Web/PropertyEditors/BlockEditorPropertyEditor.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
#	src/Umbraco.Web/Trees/ContentTreeController.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
#	tests/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/Services/Importing/SingleDocType-WithCleanupPolicy.xml
2021-12-14 20:13:42 +01:00
2268b1e187 Package telemetry (#11738)
* Add TelemetryService

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

* Create model class for package telemetry

And move the telemetry report data out of ReportSiteTask

* Add version as an option in package manifest

* Use TelemetryService to generate telemetry data

Instead of doing it directly in the ReportSiteTask

* Seal TelemetryService

This should not be overwritten

* Add option for package creators to opt out

* Add global setting to restrict package telemetry

* Add TelemetryService unit tests

* Add ManifestParser tests for new properties

* Clean

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

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

* Create interface for telemetry service

* Use IOptionsMonitor instead of IOptions

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

* Use is false instead of negation

It's a bit more readable

* Track restrict package telemetry value

* Save RestrictPackageTelemetry in report data

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

* Fix TelemetryService unit tests

* Clean

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

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

* Remove RestrictPackageTelemetry

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-12-14 16:09:31 +01:00
MoleandGitHub cd022af2d7 Merge pull request #11759 from PerplexDaniel/bugfix/11758_umbraco-cshtml-compilation
Ensure Umbraco Razor files are compiled into <project>.Views.dll
2021-12-14 15:47:37 +01: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
Sebastiaan Janssen a3b721bb4c Merge branch 'v8/contrib' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/views/documenttypes/views/permissions/permissions.html
#	src/Umbraco.Web.UI/Umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
2021-12-14 14:19:59 +01:00
Michael LatoucheandGitHub e65baae814 Remove the need of Smtp.Host config when using PickupDirectoryLocation (#11548) 2021-12-14 13:56:10 +01:00
Sebastiaan Janssen bc80892f51 Merge branch 'v9/contrib' into v9/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/directives/components/localization/localize.directive.js
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	tests/Umbraco.Tests.AcceptanceTest/cypress/integration/Languages/languages.ts
2021-12-14 13:32:46 +01:00
Daniël Knippers 95efeeabcf Ensure Umbraco Razor files are compiled into <project>.Views.dll
It worked properly if the Umbraco files are on disk before a build
but when the files are not there yet or a dotnet clean is done first the
files are not compiled. This is often the case on build servers that start
with a clean working directory for each build.

Using this target we simply ensure the files are included as "Content"
which Razor will scan for .cshtml files in their "ResolveRazorGenerateInputs"
target.
2021-12-14 12:25:25 +01:00
Andy Butland d9a4c50a73 Refactored message related methods to allow provision of an HttpContext, and used this in DistributedCacheBinder to ensure messages created are flushed from the same context. 2021-12-14 09:23:55 +01:00
Maarten Mensink bbbfb99a39 update key for importdocumenttype 2021-12-10 11:26:51 +01:00
Maarten Mensink 5580f80035 fix incorrect camelcasing
closes #11752
2021-12-10 10:33:35 +01:00
Elitsa MarinovskaandGitHub a6903d8abe V9: Display configured log levels (#11715)
* Adding ILogLevelLoader to get Serilog level values (global one and umbraco) and the corresponding dependencies

* Obsoleting old methods

* Fix tests

* Front-end changes

* Changes requested in a review
2021-12-06 11:06:55 +01:00
Paul JohnsonandGitHub 1c36af8c7e Map both settings and content data via property editors. (#11722)
For persistence and rendering property editor frontend components.
2021-12-06 10:35:44 +01:00
Jan SkovgaardandGitHub b4059ecfec Listview Datatype: Change from using delete icon to "Remove" text in layouts (#11624)
* Add overlay and texts for overlay

* Change remove icon to remove text
2021-12-06 09:05:08 +10:00
Michael LatoucheandGitHub 6824519cdb Fixes fallback value ignored in Localize directive (#11674)
* addig some French labels

* add intial inner html as fallback value
2021-12-06 08:51:36 +10:00
4c6d4b9326 Added notifications toggle to user groups (#10450)
* Added notifications toggle

* Review: Update DatabaseDataCreator.cs

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

* Added migration

* Fix new file was excluded

* adapt DB  migration

Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Michael <michael@crossingpaths.be>
2021-12-05 13:27:15 +01:00
Bjarke Berg 568dc19929 Merge remote-tracking branch 'origin/v9/9.1' into v9/dev
# Conflicts:
#	build/templates/UmbracoPackage/.template.config/template.json
#	build/templates/UmbracoProject/.template.config/template.json
#	src/Directory.Build.props
2021-12-03 07:20:19 +01:00
Nikolaj GeisleandGitHub dd7805552f v9: Remove install endpoint as valid endpoint (#11710)
* Remove installer endpoint from valid candidates

* Removed unrelevant change
2021-12-02 10:01:23 +01:00
980cf00cba V9: Fix backoffice javascript loading slowly (#11714)
* Update Smidge

* Add SmidgeRequestHelper to override the compression order

By default Smidge will always try and use Brotli (br), this compression is good in the the sense that it compresses the file quite a bit, but sadly it's super super slow, like 10 seconds for backoffice js slow.

* Remove unnecessary new keyword

Co-authored-by: nikolajlauridsen <nel@umbraco.dk>
2021-12-01 19:53:27 +01:00
Erik-Jan WestendorpandGitHub 5d2c950073 Rename AddOEmbedProvider() and Obsolete OEmbedProviders() (#11703)
* Rename AddOEmbedProvider to AddEmbedProvider

* Obsolete  OEmbedProviders()

Obsolete OEmbedProviders() and proxy it to a new EmbedProviders()

* Rename EmbedProviderBase to OEmbedProviderBase

Rename EmbedProviderBase to OEmbedProviderBase
Add an obsoleted  class EmbedProviderBase
Add todo's to all implementations

* remove unintentionally comment

Rem: automatic tests failures not linked to this PR.
2021-11-30 04:10:54 +01:00
Jeavon LeopoldandMichael Latouche b86505d8f2 Change httpsCheckInvalidUrl to healthCheckInvalidUrl 2021-11-28 12:58:02 +01:00
Erik-Jan WestendorpandGitHub 4cd0544c65 Create an extension methods to easily append to CollectionBuilders (#11691)
* Create UmbracoBuilder.ContentApps.cs

Add an extension method to register content apps to make it possible to register content apps in the startup.cs class.

* Create UmbracoBuilder.CollectionsBuilders

* White space

* Rename OEmbedProvider to EmbedProvider

* Rename EmbedProvider to OEmbedProvider
2021-11-26 10:18:45 +01:00
Nikolaj GeisleandGitHub a0695850cb Merge pull request #11587 from umbraco/v8/bugfix/membership-contentapp
Move member properties to Member Content App
2021-11-24 10:45:53 +01:00
Nikolaj GeisleandGitHub b5a895e269 Merge pull request #11349 from umbraco/v9/feature/update-imagesharp-web
Update to SixLabors.ImageSharp.Web 1.0.4 and remove processing order workarounds
2021-11-24 10:24:23 +01:00
Nikolaj GeisleandGitHub 004d3410e9 Merge pull request #11359 from umbraco/v9/feature/imagesharp-cachecontrol-immutable
Change Cache-Control header when cache buster value is present
2021-11-24 09:48:51 +01:00
Nikolaj Geisle c19463b8ae Revert changes in Umbraco.Web.Common.csproj 2021-11-24 09:22:47 +01:00
Nikolaj Geisle e0701ccd48 Merge branch 'v9/dev' into v9/feature/update-imagesharp-web
# Conflicts:
#	src/Umbraco.Tests.AcceptanceTest/cypress/integration/Users/users.ts
#	src/Umbraco.Web.UI/umbraco/config/lang/cy.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/it.xml
#	src/Umbraco.Web.UI/umbraco/config/lang/nl.xml
#	tests/Umbraco.Tests.AcceptanceTest/cypress/integration/DataTypes/dataTypes.ts
2021-11-24 09:11:52 +01:00
inetzoandGitHub 7538f0c4ad Apply pickDate-config setting to hide calendar in datepicker (#11632)
* Apply pickDate-config setting to hide calendar in datepicker 

A time-only picker is only possible if the format is configured like "hh:mm:ss". By using the pickDate config it is possible to determine whether the calendar should be shown or not, instead of depending on a certain time format.

* Changed timeformat to accept both hh:mm:ss and hh:mm

Edited the regex to math times with and without seconds. The calendar should not be shown anymore if the timeformat is (H)H:mm:ss or (H)H:mm.

* Removed unused config property pickDate

config.pickDate is never used and can be removed.

* remove pickDate config from datepickers config
2021-11-24 02:07:35 +01:00
13a51d3267 Support import/export for doc type history cleanup policy (#11660)
* Support import/export for doc type history cleanup policy

* Support unset/null history cleanup value

* Resolve issue when api endpoints called without cleanup policy.
noop isn't good enough as map fails for response.

* null conditional vs null coalesce assignment

* Don't overwrite existing policy if omitted in import XML

* Update history cleanup warning and translations

* Change history cleanup alert to infomational styling

* Remove margin around history cleanup config

Co-authored-by: Ronald Barendse <ronald@barend.se>
2021-11-23 18:53:29 +00:00
Rasmus SöderströmandGitHub f7be5a5dec Add functionality for resetting to the initial state. (#11593)
* Add functionality for resetting to the initial state.

* Refactoing initData
2021-11-23 03:02:32 +01:00
Jan SkovgaardandGitHub 16c1359a90 Focus lock improvements (#11435)
* Call onInit directly and add a timeout of 500ms

* Don't include hidden input types in the selector

* Ensure that the "next" focusable element is selected in case the first element is either the sub-nav or the ellipsis type

* Make sure tab is not selected first
2021-11-23 01:41:51 +01:00
Bjarke Berg 351c37abc0 Merge remote-tracking branch 'remotes/origin/v8/dev' into v9/dev
# Conflicts:
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Models/ContentVersionMeta.cs
#	src/Umbraco.Core/Persistence/Repositories/Implement/DocumentRepository.cs
#	src/Umbraco.Core/Persistence/Repositories/Implement/DocumentVersionRepository.cs
#	src/Umbraco.Core/Services/Implement/ContentService.cs
#	src/Umbraco.Core/Services/Implement/DefaultContentVersionCleanupPolicy.cs
#	src/Umbraco.Tests/Cache/DistributedCacheBinderTests.cs
#	src/Umbraco.Tests/Persistence/Repositories/DocumentVersionRepository_Tests_Integration.cs
#	src/Umbraco.Tests/Services/ContentVersionCleanupService_Tests_UnitTests.cs
#	src/Umbraco.Tests/Services/DefaultContentVersionCleanupPolicy_Tests_UnitTests.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI/Umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/config/umbracoSettings.Release.config
#	src/Umbraco.Web/Cache/DistributedCacheBinder.cs
#	src/Umbraco.Web/Editors/ContentController.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
2021-11-22 18:53:38 +01:00
33f00a508f V9/feature/merge v8 22/11/2021 (#11681)
* Changes to GetReducedEventList (#11444)

* Instead of only using first event, we combine events of same type into a single event with multiple arguments

* Added generic method to DRY up grouping logic.

* Renamed method to better reflect new functionality.

Co-authored-by: Andy Butland <abutland73@gmail.com>

* Merge pull request #11360 from umbraco/v8/bugfix/11057-mandatory-image-not-validating-after-first-time-failure

Fixes 11057: Mandatory Image not validating after first time failure

(cherry picked from commit 5cc70d2160)

* Additional optional sanitization of scripting in TinyMCE (#10653)

(cherry picked from commit f68dba7bcb)

* Bump version to 8.17.1

* Hide localization key while loading

* ContentVersion cleanup backoffice UI (#11637)

* init rollback ui prototype

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

* add localisation

* style current version

* disable rollback button when nothing is selected

* stop click event

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

* Endpoints to "pin" content versions

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

* wire up paging

* wire up pin/unpin

* rename getPagedRollbackVersions to getPagedContentVersions

* prevent selection of current version and current draft

* add current draft and current version to UI

* remove pointer if the row is not selectable

* Improve warning for globally disabled cleanup feature.

* Fix current loses prevent cleanup state on publish.

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

* Match v9 defaults for keepVersions settings

* Fix - losing preventCleanup on save current with content changes

* update pin/unpin button labels

* fix pagination bug

* add missing "

* always send culture when a doc type can vary

Co-authored-by: Mads Rasmussen <madsr@hey.com>

* Bugfix - DocumentVersionRepository.Get should not join culture variation

* Bugfix - Missing write lock

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

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Nikolaj Geisle <70372949+Zeegaan@users.noreply.github.com>
Co-authored-by: Niels Lyngsø <nsl@umbraco.dk>
Co-authored-by: Sebastiaan Janssen <sebastiaan@umbraco.com>
Co-authored-by: Ronald Barendse <ronald@barend.se>
Co-authored-by: Paul Johnson <pmj@umbraco.com>
Co-authored-by: Mads Rasmussen <madsr@hey.com>
2021-11-22 18:50:10 +01:00
Bjarke Berg 579613c83c Revert version 2021-11-22 17:45:49 +01:00
Bjarke Berg 104819084a Merge remote-tracking branch 'origin/v9/9.1' into v9/dev 2021-11-22 17:42:47 +01:00
c2e9ccea9f Member group picker actions (#10096)
* Add remove all property action

* Disable action if no current ids or new ids

* Use vm

* resolve conflict

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2021-11-22 12:38:42 +10:00
e56c1cc208 Fix the introduction tour getting lost if dashboard is not shown (#10597)
* Add conditional step that navigates users to the content section

* tweaked the text in the sections step as it refers to being in the content section, which may not always be the case (hence this PR)

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2021-11-22 10:46:29 +10:00
BatJanandMichael Latouche 1440213ef6 Add missing fallback values and fix en and en_us.xml keys 2021-11-22 01:39:50 +01:00
Jan SkovgaardandGitHub 97071133c7 Documenttypes Permissions view: Add missing fallback texts and fix styling (#11619)
* Add missing fallback texts

* Change styling of "history" info
2021-11-22 01:20:38 +01:00
12004a7854 Fix typo (#11027)
* Fix typo retrive to be retrieve throughout project.

* * Retain uppercase in descriptions.
* Add new directive fixing typo.
* Revert existing directive and template to previous to prevent breaking change.

* * Swap directives.

* * Revert.

* obsoletes public methods with typos. probably should find all refs and update those too

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2021-11-22 10:15:46 +10:00
ccffd264c9 fixes #9894 . Truncate block editor model title to 100 chars. (#10303)
* fixes #9894 . Truncate block editor model title to 100 chars.

* update to move max into controller logic

* null check name, just in case...

Co-authored-by: Mario Lopez <mario@monkii.com>
Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2021-11-22 09:43:43 +10:00
3b0da9be55 #7902 displaying messages on cancelled item creation (#7943)
* #7902 displaying messages on cancelled item creation

* remove debugger

Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2021-11-22 09:12:01 +10:00
BatJanandNathan Woulfe 17f6899f5d Add missing fallback texts 2021-11-22 08:58:20 +10:00
BatJanandNathan Woulfe 77d3e17467 Add missing fallback text 2021-11-22 08:56:25 +10:00
Bjarne FyrstenborgandGitHub a82ee72056 Ensure crop size in shown for slim thumbnails (#11481)
* Ensure there is space enough to render thumbnail size label

* Simplify crop size label

* Add original gray color for min/max icons and adjust margin to compensate for slider handle
2021-11-22 08:55:37 +10:00
BatJanandMichael Latouche a9d2b0307f Add missing fallback text 2021-11-21 03:57:21 +01:00
BatJanandMichael Latouche 2605d7a03b Add missing fallback texts 2021-11-21 03:19:48 +01:00
BatJanandMichael Latouche 2f13bbfc52 Add missing fallback texts 2021-11-21 03:07:06 +01:00
Bjarke Berg 8fd013819d Merge remote-tracking branch 'origin/v9/9.1' into v9/dev 2021-11-19 09:29:45 +01:00
028648786e Fix optional id route param inferred as FromQuery (#11557)
* Fix optional id route param inferred as FromQuery

Closes #11554

* Prevent breaking change, UmbracoJsonModelBinderConvention is public class

* Set missing binding source for complex types

* Update UmbracoApiBehaviorApplicationModelProvider.cs

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com>
2021-11-18 15:20:53 +01:00
082e703863 Migrated / Rewritten ScopedNuCacheTests (#11636)
* Migrated / Rewritten ScopedNuCacheTests

* Cleanup

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2021-11-18 13:34:10 +01:00
bfd17846b7 V9: Fix granular permissions for user groups (#11577)
* Fixes the treepicker for granular permissions to use a select callback instead of submit with the full selection

* Introduced UserGroup2NodeDto table, to allow users to save empty arrays of permissions

* Cleanup

* Fixed null issue in audit logging

* Fixed migration

* Fixed GetDeleteClauses

* Fixes for SqlCE, do not run multiple comments on one sql request

* Align behavior between content>permissions and usergroups>granularPpermissions

- It is now possible to save default values in content>permissions like in usergroups>granularPpermissions
- It is now possible to differentiate between we save an empty collection and we remove the granular permissions in content>permissions

* Fix comments

Co-authored-by: Andy Butland <abutland73@gmail.com>
Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-11-18 11:20:49 +01:00
Michael LatoucheandGitHub 819bc21daa addig some French labels (#11545) 2021-11-18 08:18:22 +10:00
BatJanandNathan Woulfe 43db605c31 Add missing fallback texts 2021-11-18 07:59:14 +10:00
Kevin MeilanderandNathan Woulfe 1125644eb3 in media selection, made folder name clickable to select into a folder. Added not allowed cursor on not allowed items. 2021-11-18 07:57:44 +10:00
SibrenandGitHub ba1518bc5c V8 Changed 'bevestig nieuw password' to 'bevestig nieuw wachtwoord' (#11649)
* V8 Changed 'bevestig nieuw password' to 'bevestig nieuw wachtwoord'

* Added extra missing translation: minimum x character(s) to go
2021-11-17 16:03:24 +01:00
BatJanandMichael Latouche 47da02c5f1 Add missing fallback text 2021-11-17 03:11:48 +01:00
Søren KottalandGitHub 8393fdecfb 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)
2021-11-17 10:38:15 +10:00
Paul Johnson a86baa4798 Bugfix - Policy returns items to delete not items to keep.
Switch to inverse behavior.
2021-11-16 11:53:16 +00:00
Paul Johnson bdbc38e280 Bugfix - Missing write lock 2021-11-16 10:13:20 +00:00
Paul Johnson cf9a6671a9 Bugfix - DocumentVersionRepository.Get should not join culture variation 2021-11-16 08:53:44 +00:00
d89725bd48 ContentVersion cleanup backoffice UI (#11637)
* init rollback ui prototype

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

* add localisation

* style current version

* disable rollback button when nothing is selected

* stop click event

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

* Endpoints to "pin" content versions

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

* wire up paging

* wire up pin/unpin

* rename getPagedRollbackVersions to getPagedContentVersions

* prevent selection of current version and current draft

* add current draft and current version to UI

* remove pointer if the row is not selectable

* Improve warning for globally disabled cleanup feature.

* Fix current loses prevent cleanup state on publish.

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

* Match v9 defaults for keepVersions settings

* Fix - losing preventCleanup on save current with content changes

* update pin/unpin button labels

* fix pagination bug

* add missing "

* always send culture when a doc type can vary

Co-authored-by: Mads Rasmussen <madsr@hey.com>
2021-11-16 08:24:12 +01:00
BatJanandNathan Woulfe b8f20d4548 Add missing fallback value 2021-11-16 13:10:21 +10:00
BatJanandNathan Woulfe e900197907 Wrap texts in umb-box 2021-11-16 13:08:12 +10:00
BatJanandMichael Latouche a9cf12a600 Add "enable js" message changes + removal of the http-equiv meta tag 2021-11-16 02:26:45 +01:00
Matt DarbyandGitHub 0a626c6c2a Replace .first() with localize (#11341)
Replaced usage of first() with localize to target specific action in context menu
2021-11-16 09:25:04 +10:00
Daniel ShuyandNathan Woulfe 284b4b9253 contentpicker: Don't validate minNumber/maxNumber if 0 2021-11-16 07:22:12 +10:00
Paul JohnsonandGitHub 958cd03b00 V9/bugfix/fix lucene immense raw fields prevent indexing (#11599)
* Added failing test to demonstrate issue with large raw_ fields.

* Switched to StoredField to avoid indexing error for immense fields.

StringField indexes all the content as a single token and has a max
length of 32766.

StoredField does not analyze/index the field but enables retrieval with
luceneSearcher.Doc(docId)

Closes GH #11487
2021-11-15 14:24:20 +01:00
Paul JohnsonandGitHub d147d7d412 Make PublishedContentQueryAccessor usable (#11601)
* Make PublishedContentQueryAccessor usable

Closes #11319

* Make xmldocs for IPublishedContentQueryAccessor more helpful.
2021-11-15 14:23:02 +01:00
5d19c663cd v9: Fix tests on Linux (#11586)
* downgraded cypress, updated package

* Fixed language test

* Fix language test

* Fixed routing tests to wait for popup

* Publish test artifacts

* Added better element to wait on

* Fix routing tests for linux

* Fix language tests on linux

* Stablize tabs tests

* Implement waiting for inner tree like in content tests

* Assert that we are in settings section so we dont click an element that doesnt exist

* Fixed rollback by not doing cy.reload()

* Fix language test with correct wait

* Stabilize dataTypes by moving API Call, and stabilize systemInformation.ts test by waiting for success notification

* Fix dataTypes, tabs and template tests

* Update node to newer version in package-lock.json and fix template test

* Implemented cy.wait to test if it is because we are too fast

* Added comments

* Bigger wait

* Try another wait instead of magic numbers

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2021-11-15 14:19:34 +01:00
Bjarke BergandGitHub cabc30341a Merge pull request #11592 from rickbutterfield/feature/temp-11591
v9: Fix for OAuth ExternalLogin
2021-11-15 12:54:44 +01:00
Andy Butland fe396ba0cf Inverted conditional on linking user for clarity. 2021-11-15 11:45:00 +01:00
Andy Butland c6176a0ae7 Added null check for external login invocation when linking users. 2021-11-15 11:42:04 +01:00
Andy Butland 3d43815981 Added suggestions from code review. 2021-11-15 11:17:47 +01:00
BatJanandMichael Latouche e07a2b1abd Add missing text fallback 2021-11-15 03:07:51 +01:00
Enkel MediaandNathan Woulfe c59d799557 Update docs for localize.directive.js
Updated docs to add information about tokens and watch-tokens.
2021-11-15 09:14:35 +10:00
ea9d6919a8 Cy create language (#11546)
* add create language test

* add create language test

* fix bug, move test to new folder and add type definitions

* update to use culture command

Co-authored-by: Jesper <jmh@umbraco.dk>
2021-11-14 02:20:17 +01:00
55de670246 makes the log viewer prettier (#6890)
Co-authored-by: Nathan Woulfe <nathan@nathanw.com.au>
2021-11-12 15:43:09 +10:00
Nikolaj Brask-NielsenandMichael Latouche d9c7640a8d Fixes userpicker filter
#11520
2021-11-11 13:13:21 +01:00
Nikolaj GeisleandMichael Latouche 837cef0b14 Update user test to use constants 2021-11-11 13:06:09 +01:00
Rick ButterfieldandGitHub f92070cee9 v9: Health Check still references web.config instead of appsettings.json (#11600)
* Fix an old reference to web.config instead of appsettings.json

* Match en_us.xml to en.xml

* adding FR translations
2021-11-11 01:00:04 +01:00
fe7b696c7c Add support for media saving messages in dropzone (#11304)
* WIP

Waiting for a response on the issue about how to proceed

* Support messages in dropzone

Update dropzone to allow the showing of messages that may be added in a media saving notification / handler

* Remove test code

Remove code used for testing

* Sort usings

Remove unused using

* Fix ordering

Ordering of files when they were being processed was backwards / out of order

* Add button to "okay" all messages

PR Feedback to add a button to dismiss all of the messages all at once.
Fixing a referencing issue with `currentFile`

Co-authored-by: Michael Latouche <michael@crossingpaths.be>
2021-11-10 02:32:21 +01:00
Lennard FonteijnandMichael Latouche 570841b958 Allow appsettings.json to set SMTP authentication to string.Empty 2021-11-10 01:33:13 +01:00
Sebastiaan Janssen 1fbf02d61e Merge branch 'v8/dev' into v8/contrib 2021-11-09 11:04:38 +01:00
Sebastiaan Janssen e59f855aa9 Merge branch 'v8/contrib' of https://github.com/umbraco/Umbraco-CMS into v8/contrib 2021-11-09 11:04:01 +01:00
Sebastiaan Janssen 2aad2087a5 Merge branch 'v8/8.17' into v8/dev
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/common/services/contenttypehelper.service.js
2021-11-09 11:02:21 +01:00
Ronald BarendseandMichael Latouche 2993c301f3 Hide localization key while loading 2021-11-08 23:42:06 +01:00
Rick Butterfield 709c2498fe Remove unreachable code 2021-11-08 12:46:04 +00:00
Rick Butterfield b00e686936 Fixes #11591 2021-11-08 12:44:01 +00:00
Ronald Barendse 1aeed3173b Do not allow deleting tabs with locked properties 2021-11-08 11:47:12 +01:00
Ronald Barendse 4f6a073f79 Re-bind readonly property state after save 2021-11-08 11:22:35 +01:00
Ronald Barendse 4bf598d9a4 Change IsLockedOut property to readonly when it's true (only allow unlocking members) 2021-11-08 11:22:07 +01:00
Rick Butterfield 1117440a04 Fix for #11591 2021-11-06 11:40:05 +00:00
Ronald Barendse 5bda825fd1 Add Member Content App to display membership properties 2021-11-05 11:05:13 +01:00
ba7db3b842 v9: Use localization keys instead of hardcoded string (#11406)
* Update help.controller.js

* updated with better localization keys

* Added more translations

* Fixed spelling mistakes

* Updated help.controller.js according to review

* Fix localizaMany to include another call

* Cleanup

Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2021-11-04 16:50:33 +01:00
1359eb8f77 v9: Create new 'delete stylesheet' cypress test (#11528)
* Create new cypress test- delete stylesheet

* Cleanup

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
Co-authored-by: Nikolaj Geisle <niko737@edu.ucl.dk>
2021-11-04 16:49:21 +01:00
Ronald Barendse 86fb382f81 Do not explicitly create standard member property group 2021-11-04 15:45:42 +01:00
Nikolaj GeisleandGitHub d4682a9fff Move language test to the 'tests' folder (#11527) 2021-11-04 10:37:00 +01:00
Sebastiaan JanssenandGitHub 6f214fc269 Update 01_bug_report.yml 2021-11-04 08:47:02 +01:00
Sebastiaan Janssen 65a1e5adbe Merge branch 'v8/dev' into v9/contrib 2021-11-03 17:57:44 +01:00
Sebastiaan Janssen 04d0348351 Merge branch 'v9/dev' into v9/contrib 2021-11-03 17:14:46 +01:00
Ronald Barendse cd6d027e51 Mark standard Member group as inherited 2021-11-03 16:47:52 +01:00
Ronald Barendse 0f5f7d24e5 Use standard Member property group name/alias 2021-11-03 16:46:56 +01:00
Sebastiaan Janssen 5123799e32 Bump version to 8.17.1 2021-11-03 14:59:00 +01:00
Niels LyngsøandSebastiaan Janssen 23ce69db2f Additional optional sanitization of scripting in TinyMCE (#10653)
(cherry picked from commit f68dba7bcb)
2021-11-03 08:55:59 +01:00
Nikolaj GeisleandSebastiaan Janssen da48f8435a Merge pull request #11360 from umbraco/v8/bugfix/11057-mandatory-image-not-validating-after-first-time-failure
Fixes 11057: Mandatory Image not validating after first time failure

(cherry picked from commit 5cc70d2160)
2021-11-03 08:52:24 +01:00
Matthew CareandGitHub 1c4cab521d Published Content Query has "skip" applied twice (#11378)
* Fix double skip

Skipping is done as part of the query now, causing `skip` to be applied twice

* More instances of skipping

Fix more areas where skip is applied twice
2021-11-03 08:32:48 +01:00
Michael LatoucheandGitHub 9a64df758b Merge pull request #9 from umbraco/v9/contrib
Revert accidental commit of "Remove need of SMTP.Host config when def…
2021-10-30 00:12:39 +02:00
Michael bd63974d69 Revert accidental commit of "Remove need of SMTP.Host config when defining pickupdirectorylocation"
This reverts commit cb06170818.
2021-10-30 00:09:49 +02:00
Michael cb06170818 Remove need of SMTP.Host config when defining pickupdirectorylocation 2021-10-29 23:26:22 +02:00
JeavonandGitHub acaece6f18 [v9] Fix the basehttpheader health check so that it's checking the root of the domain instead of the /umbraco path (#11535)
* Fix the basehttpheader health check so that it's checking the root of the domain instead of the /umbraco path.

* Remove unused value from security health checks (it was used in v8 for fixing)
2021-10-29 15:42:07 +02:00
Martin BentancourandMichael Latouche dfdb498537 Check for path traversal before uploading file 2021-10-29 14:12:46 +02:00
Sebastiaan Janssen 0db177d1d3 Merge branch 'v9/dev' into v9/contrib 2021-10-29 13:00:00 +02:00
Sebastiaan Janssen 485353b43c Merge branch 'v9/dev' into v9/contrib 2021-10-29 11:09:43 +02:00
Sebastiaan Janssen 687670cc0b Merge v9/dev 2021-10-29 10:25:14 +02:00
Paul JohnsonandGitHub f5fa1eeda2 Merge pull request #11517 from umbraco/v9/feature/nugetconfig
We no longer rely on anything in the umbraconightly feed
2021-10-27 10:01:06 +01:00
Bjarke BergandGitHub af5be82960 Merge pull request #11317 from matthewcare/custom-default-view-content
Ability to register your own content provider for default template content
2021-10-27 07:46:52 +02:00
Søren KottalandGitHub 3ddb2c6bac New design for the default 404 page (#11468)
* New design for the default 404 page

* remove installer reference in link to our
2021-10-27 03:39:42 +02:00
Sebastiaan Janssen e1ea8911be We no longer rely on anything in the umbraconightly feed 2021-10-26 17:53:54 +02:00
Jesper MayntzhusenandGitHub ba73a39558 add delete language test (#11380) 2021-10-26 17:40:37 +02:00
Matthew CareandSebastiaan Janssen 742b8eb1dc Update Examine
Partly fixes #11377
2021-10-26 16:58:53 +02:00
Matthew Care ded1c0b79f Fix DI
Integration tests failing due to multiple ctors. Marking correct one for DI usage
2021-10-26 13:57:53 +01:00
Matthew Care cca526aa58 Use static service provider
Use the static service provider in the obsolete ctor
2021-10-26 10:51:15 +01:00
Matthew Care 576bc1f60b Make requested changes
Prevent breaking change by creating a new ctor

Update obsolete message
2021-10-25 14:30:58 +01:00
Sebastiaan Janssen 27f50e7525 Revert "Content app for dictionary items"
This reverts commit 1d2272f536.
2021-10-24 10:55:38 +02:00
inadaandMichael Latouche 2d346248d3 adding . applying filter 2021-10-24 02:13:48 +02:00
8acf7e147e Changes to GetReducedEventList (#11444)
* Instead of only using first event, we combine events of same type into a single event with multiple arguments

* Added generic method to DRY up grouping logic.

* Renamed method to better reflect new functionality.

Co-authored-by: Andy Butland <abutland73@gmail.com>
2021-10-22 09:58:47 +02:00
Matthew Care 3c1e52f109 Merge branch 'v9/contrib' into temp-11381 2021-10-21 08:34:09 +01:00
Blake IrwinandNathan Woulfe e5549b7533 Fix logger message placeholders being parsed literally instead of substituted 2021-10-21 09:03:15 +10:00
Sebastiaan JanssenandNathan Woulfe e8a6a9279f Further clarification around where configuration goes 2021-10-21 08:58:29 +10:00
Callum WhyteandGitHub 02481f8e14 requireExactSource needs to be disabled in order to properly attach to process and debug Umbraco source in VS Code / Codespaces (#11367) 2021-10-19 10:47:58 +01:00
Matthew Care dac697f9b4 Merge remote-tracking branch 'upstream/v9/contrib' into custom-default-view-content
# Conflicts:
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/DefaultViewContentProviderTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/ViewHelperTests.cs
#	tests/Umbraco.Tests.UnitTests/Umbraco.Core/Templates/ViewHelperTests.cs
2021-10-19 09:18:46 +01:00
Matthew Care aee9bbbb7d Merge remote-tracking branch 'upstream/v9/contrib' into temp-11381 2021-10-19 08:44:05 +01:00
Matthew CareandNathan Woulfe 215ef3d7b6 Update background size
Update background size property to `contain` so that the whole image shows
2021-10-19 17:30:41 +10:00
Matthew CareandMichael Latouche e7f8e692c2 Link insertion with no selected text
TinyMCE requires text to be selected in order to insert links.
Added checks for if there is a text selection, and insert HTML content if there is not.
Link contents consists of the target name, or the target url if not populated
2021-10-19 09:30:07 +02:00
69f8e54cb0 Restore BelleBuild target (for back-office assets) and use npm ci (#11364)
Co-authored-by: Ronald Barendse <ronald@barend.se>
2021-10-19 09:28:39 +02:00
Paul Johnson ad66d61b04 Move new test 2021-10-18 08:32:24 +01:00
Paul Johnson 8be613cad7 Merge branch 'v9/dev' into v9/contrib 2021-10-18 08:31:20 +01:00
Patrick de MooijandNathan Woulfe 1d2272f536 Content app for dictionary items 2021-10-18 16:54:26 +10:00
Chriztian SteinmeierandGitHub e04efe6067 Minor edits to the XPath query help sheet (#11385)
* Clarify the use of placeholders

Since the placeholder is only replaced if it's at the beginning of the query, I've added a note about it.

Also made the spelling of XPath consistent and fixed a nesting error in the HTML.

* Rephrase a couple of sentences
2021-10-17 17:02:59 +01:00
Jacob OvergaardandMichael Latouche 8703d7c929 Rename importdocumenttype to importDocumentType and emptyrecyclebin to emptyRecycleBin to match UI and mocks 2021-10-17 03:35:14 +02:00
Paul SealandGitHub 14fe7d99a8 Added more detailed message when deleting items in the list view (#11375)
* Added more detailed message when deleting items in the list view

* Update FR language file
2021-10-17 01:40:47 +02:00
Matthew Care 98474e1110 Fix broken test
Update tests to disable the default replacements
2021-10-15 23:52:26 +01:00
Matthew Care 25b1c3c078 Add tests
Add new tests for the request handler settings, and fix other tests
2021-10-15 23:24:21 +01:00
Matthew Care 12e89a01ba Update usage
Update string helper to use new method that uses user defined replacements
2021-10-15 23:23:56 +01:00
Matthew Care 1ee4e379e7 Update classes
Update class names, and location
2021-10-15 23:23:07 +01:00
Matthew Care c2ed6a629b Update request handler settings
`CharCollection` didn't map correctly from the config, updated to an array so that it does
Add logic to concatenate user and default replacements, replacing defaults with user defined if present.
Added additional option to disable the default replacements
2021-10-15 23:22:01 +01:00
Matthew CareandSebastiaan Janssen 5c25567599 Return tempFiles
Add the response data to the return. Fixes #11278
2021-10-12 14:51:52 +02:00
patrickdemooij9andGitHub 1605dc10bd 11048: Bugfix for groups and properties that get replaced (#11257) 2021-10-12 14:47:03 +02:00
Sebastiaan Janssen 3f5d9df2a2 Merge branch 'v9/dev' into v9/contrib 2021-10-12 13:24:51 +02:00
Patrick de MooijandSebastiaan Janssen 04f53b7e88 Ability to remove trees in the backoffice 2021-10-12 13:19:17 +02:00
Ronald Barendse 25d3fc90ac Change Cache-Control header when cache buster value is present 2021-10-12 11:13:54 +02:00
Ronald Barendse 83db6f5c5d Ensure crop coordinates are always added before focal point 2021-10-12 11:00:44 +02:00
Erik-Jan WestendorpandGitHub d22297270b Localization add tab text dutch (#11346)
* Update nl.xml add addTab key

* tab to tablad

* Add translation to shortcuts sections
2021-10-12 03:50:17 +02:00
Laura NetoandMichael Latouche 7524b7809c Added missing documentation to Image Cropper Extensions 2021-10-11 12:43:12 +02:00
Ronald Barendse 4dd54a17f2 Update to SixLabors.ImageSharp.Web 1.0.4 and remove processing order workarounds 2021-10-11 12:12:59 +02:00
de12605095 Remove remaining web.config references in translation files (#11344)
* Remove remaining web.config references in translation files so it will fallback to the correct English text

* Remove final reference to web.config in config/lang

ru errorChangingProviderPassword

Co-authored-by: Paul Johnson <pmj@umbraco.com>
2021-10-11 06:59:48 +01:00
Patrick de MooijandNathan Woulfe 49132e2b7f 8258: Added create dictionary item button 2021-10-11 14:46:02 +10:00
Paul SealandNathan Woulfe 3dcfb6aea1 added vm. in front of the enterSubmitFolder method call on ng-keydown 2021-10-11 10:07:57 +10:00
Chriztian SteinmeierandNathan Woulfe 8989c4ad13 Add positioning context
A fallback for browsers that don't support `contain: content`, to make sure the positioning context is correct
2021-10-11 09:58:39 +10:00
Laura NetoandGitHub 15aa713d2a Added missing GetCropUrl overload for MediaWithCrops (#11201)
* Added missing GetCropUrl overload for MediaWithCrops with the extra configuration options

The missing overload would mean that if anyone tried to use the extra options with MediaWithCrops, they would be using the IPublishedContent extension method instead.
This would cause several issues, like not loading the local crops and returning null for a lot of scenarios that should work.

* Added documentation to the added overload

* Use extension method
2021-10-11 01:36:14 +02:00
Brian PopowandNathan Woulfe 10d1d3c30d Update ImageSharp to version 1.0.4 2021-10-11 09:20:02 +10:00
Jesper MayntzhusenandGitHub a2f05850c0 add cypress test for deleting a user (#11282) 2021-10-10 18:50:02 +02:00
Lewis HazellandGitHub 9a5960bf1e Fixes (hides) customize button when connection string is already configured (#11273) 2021-10-10 18:08:41 +02:00
Louis JRandGitHub 9f72b7b710 Change references of Web.config to be appsettings.json (#11244) 2021-10-10 14:32:27 +02:00
Jose MarcenaroandMichael Latouche bea143fa96 Allow local API when using AspNetCore identity 2021-10-10 03:31:57 +02:00
e7da8558e5 Added support for Smtp PickupDirectory (#11253)
* Added support for Smtp PickupDirectory

* Add reference to the implementation outline by MailKit

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

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-10-09 03:30:58 +02:00
Matthew Care 4456bf4a3b Re-add original ctor
Add original ctor in case someone was using it, else this would be a breaking change
2021-10-08 11:33:39 +01:00
Sebastiaan Janssen 79fdb9a876 Merge branch 'v9/dev' into v9/contrib 2021-10-08 08:49:47 +02:00
Matthew Care 8dfec54b2a Remove string
Remove a string that gets appended to the default file content.
2021-10-07 21:09:14 +01:00
Matthew Care 44c25cd016 Update tests
Fix all of the unit / integration tests
Update integration tests to remove references to ViewHelper, to make the tests more focused on what they should be testing
2021-10-07 21:08:35 +01:00
Matthew Care dc536b011b Add Umbraco Builder unique
Follow the convention of having a method on IUmbracoBuilder which allows you to set a custom content provider
2021-10-07 21:06:39 +01:00
Matthew Care 5801ba4b81 Add Default View Content Provider
Add the ability to register your own content provider, so that you can change the content which is injeted into new templates
Obsolete old static method
Register new interfaces / classes (hopefully in the correct buidler)
2021-10-07 21:05:43 +01:00
JesperandNathan Woulfe b74bed380d Add test to update user 2021-10-07 09:34:16 +10:00
Jason ElkinandGitHub 56c97e1c29 Add ModelsBuilder unit tests to cover Inheritance and Composition (#11261)
* Add ModelsBuilder unit tests to cover Inheritance and Composition

* add name to GenerateSimpleType test
2021-10-07 09:10:44 +10:00
Jeavon LeopoldandNathan Woulfe a3744f90de Remove all ImageSharp.Web Processors and the re-add in the correct order 2021-10-06 08:53:04 +10:00
Laura NetoandGitHub 23d2106277 Fixed missing null check in BlockEditorPropertyEditor (#11184)
Thanks @lauraneto - reviewed this and your fix solves the issue. #h5yr
2021-10-05 08:39:56 +01:00
Paul SealandGitHub bdfa54af11 Changed the case of BlockList to blocklist as it breaks on *nix systems (#11219)
Changed the case of `BlockList` to `blocklist` as it breaks on Unix/Linux.
2021-10-05 08:14:50 +01:00
f29bda6455 Cypress test for textbox max length (#11245)
* add test for textbox max length

* remove leftover comment

Co-authored-by: Jesper <jmh@umbraco.dk>
2021-10-05 10:20:51 +10:00
Jeavon LeopoldandNathan Woulfe 9abd071457 Fix for Excessive header checker when excluding Cloudflare 2021-10-05 09:07:18 +10:00
Louis JRandGitHub e416f060c2 Change template helper to use async partials (#11243) 2021-10-04 19:48:52 +02:00
julian-codeandGitHub 465e9545e0 Update CONTRIBUTING.md (#11248) 2021-10-02 15:58:27 +02:00
668 changed files with 17684 additions and 8509 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
##########################################
+2 -1
View File
@@ -57,6 +57,7 @@ Or alternatively, you can reach out directly to any of the team members behind t
* 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)
* Emma Burstow (She, Her - Languages spoken: English) [ema@umbraco.com](mailto:ema@umbraco.com)
The review process is done with full respect for the privacy and security of the reporter of any incident.
@@ -89,4 +90,4 @@ Consequence: A permanent ban from any sort of public interaction within the comm
## 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.
This Code of Conduct will be maintained and reviewed by the team listed above.
+1 -1
View File
@@ -6,7 +6,7 @@ body:
- type: input
id: "version"
attributes:
label: "Which *exact* Umbraco version are you using? For example: 8.13.1 - don't just write v8"
label: "Which *exact* Umbraco version are you using? For example: 9.0.1 - don't just write v9"
description: "Use the help icon in the Umbraco backoffice to find the version you're using"
validations:
required: true
+6 -12
View File
@@ -1,14 +1,8 @@
name: "CodeQL config"
on:
push:
branches: [v8/contrib,v8/dev]
paths-ignore:
- node_modules
- Umbraco.TestData
- Umbraco.Tests
- Umbraco.Tests.AcceptanceTest
- Umbraco.Tests.Benchmarks
- bin
- build.tmp
paths:
- src
- src
paths-ignore:
- '**/node_modules'
- 'src/Umbraco.Web.UI/wwwroot'
+7 -46
View File
@@ -2,67 +2,28 @@ name: "Code scanning - action"
on:
push:
branches: [v8/contrib,v8/dev,v8/bug,v8/feature]
branches: ['*/dev','*/contrib']
pull_request:
# The branches below must be a subset of the branches above
schedule:
- cron: '0 7 * * 2'
branches: ['*/dev','*/contrib']
jobs:
CodeQL-Build:
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2
# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
# ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
- name: configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.2
with:
minimum-size: 8GB
maximum-size: 32GB
- run: |
echo "Run Umbraco-CMS build"
pwsh -command .\build\build.ps1
config-file: ./.github/config/codeql-config.yml
- name: dotnet build
run: dotnet build umbraco-netcore-only.sln
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
with:
config-file: ./.github/config/codeql-config.yml
# This job is to prevent the workflow status from showing as failed when all other jobs are skipped - See https://github.community/t/workflow-is-failing-if-no-job-can-be-ran-due-to-condition/16873
always_job:
name: Always run job
runs-on: ubuntu-latest
steps:
- name: Always run
run: echo "This job is to prevent the workflow status from showing as failed when all other jobs are skipped"
+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>
@@ -90,4 +90,10 @@
<RemoveDir Directories="@(WwwrootUmbracoPackageDir)" />
</Target>
<Target Name="IncludeUmbracoRazorFiles" BeforeTargets="ResolveRazorGenerateInputs">
<ItemGroup>
<Content Include="$(MSBuildProjectDirectory)\umbraco\**\*.cshtml" />
</ItemGroup>
</Target>
</Project>
+1 -1
View File
@@ -538,7 +538,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")
}
@@ -24,7 +24,7 @@
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.1.2",
"defaultValue": "9.4.2",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
+4 -1
View File
@@ -461,6 +461,9 @@ $RECYCLE.BIN/
# Dont commit Umbraco TEMP folder containing Examine Indexes, NuCache etc
**/umbraco/Data/TEMP/
# Umbraco log files
**/umbraco/Logs/
# Dont commit files that are generated and cached from the default ImageSharp location
**/umbraco/mediacache/
@@ -484,4 +487,4 @@ $RECYCLE.BIN/
# Umbraco Static Assets of Backoffice
# Nuget package Umbraco.Cms.StaticAssets will copy them in during dotnet build
**/wwwroot/umbraco/
**/wwwroot/umbraco/
@@ -57,7 +57,7 @@
"version": {
"type": "parameter",
"datatype": "string",
"defaultValue": "9.1.2",
"defaultValue": "9.4.2",
"description": "The version of Umbraco to load using NuGet",
"replaces": "UMBRACO_VERSION_FROM_TEMPLATE"
},
@@ -12,9 +12,13 @@
</ItemGroup>
<!-- Force windows to use ICU. Otherwise Windows 10 2019H1+ will do it, but older windows 10 and most if not all winodws servers will run NLS -->
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
<ItemGroup>
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption
Condition="$(RuntimeIdentifier.StartsWith('linux')) Or $(RuntimeIdentifier.StartsWith('win')) Or ('$(RuntimeIdentifier)' == '' And !$([MSBuild]::IsOSPlatform('osx')))"
Include="System.Globalization.AppLocalIcu"
Value="68.2.0.9" />
</ItemGroup>
<Import Project="..\PackageTestSiteName\build\PackageTestSiteName.targets" Condition="'$(PackageTestSiteName)' != ''" />
-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.1.2</Version>
<AssemblyVersion>9.1.2</AssemblyVersion>
<InformationalVersion>9.1.2</InformationalVersion>
<FileVersion>9.1.2</FileVersion>
<Version>9.4.2</Version>
<AssemblyVersion>9.4.2</AssemblyVersion>
<InformationalVersion>9.4.2</InformationalVersion>
<FileVersion>9.4.2</FileVersion>
<LangVersion Condition="'$(LangVersion)' == ''">9.0</LangVersion>
<NeutralLanguage>en-US</NeutralLanguage>
<Company>Umbraco CMS</Company>
+15 -1
View File
@@ -1,7 +1,11 @@
// Copyright (c) Umbraco.
// Copyright (c) Umbraco.
// See LICENSE for more details.
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;
using SecuritySettings = Umbraco.Cms.Core.Configuration.Models.SecuritySettings;
@@ -82,7 +86,12 @@ namespace JsonSchema
public BasicAuthSettings BasicAuth { get; set; }
public PackageMigrationSettings PackageMigration { get; set; }
public LegacyPasswordMigrationSettings LegacyPasswordMigration { get; set; }
public ContentDashboardSettings ContentDashboard { get; set; }
public HelpPageSettings HelpPage { get; set; }
}
/// <summary>
@@ -116,6 +125,11 @@ namespace JsonSchema
/// </summary>
public class DeployDefinition
{
public DeploySettings Settings { get; set; }
public DeployProjectConfig Project { get; set; }
public DebugSettings Debug { get; set; }
}
}
}
+2 -1
View File
@@ -10,7 +10,8 @@
<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.Forms.Core" Version="9.0.1" />
<PackageReference Include="Umbraco.Deploy.Core" Version="9.3.0" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.3.0" />
</ItemGroup>
<ItemGroup>
@@ -8,7 +8,7 @@
public const char ActionLetter = 'I';
public char Letter => ActionLetter;
public string Alias => "assignDomain";
public string Alias => "assigndomain";
public string Category => Constants.Conventions.PermissionCategories.AdministrationCategory;
public string Icon => "home";
public bool ShowInNotifier => false;
+17
View File
@@ -0,0 +1,17 @@
namespace Umbraco.Cms.Core.Actions
{
public class ActionNotify : IAction
{
public char Letter => 'N';
public bool ShowInNotifier => false;
public bool CanBePermissionAssigned => true;
public string Icon => "megaphone";
public string Alias => "notify";
public string Category => Constants.Conventions.PermissionCategories.ContentCategory;
}
}
@@ -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
@@ -0,0 +1,17 @@
using Umbraco.Cms.Core.Configuration.UmbracoSettings;
namespace Umbraco.Cms.Core.Configuration.Models
{
public class CharItem : IChar
{
/// <summary>
/// The character to replace
/// </summary>
public string Char { get; set; }
/// <summary>
/// The replacement character
/// </summary>
public string Replacement { get; set; }
}
}
@@ -1,6 +1,12 @@

using System.ComponentModel;
using Umbraco.Cms.Core.Configuration.Models;
namespace Umbraco.Cms.Core.Configuration
{
/// <summary>
/// Typed configuration options for content dashboard settings.
/// </summary>
[UmbracoOptions(Constants.Configuration.ConfigContentDashboard)]
public class ContentDashboardSettings
{
private const string DefaultContentDashboardPath = "cms";
@@ -18,6 +24,13 @@ namespace Umbraco.Cms.Core.Configuration
/// Gets the path to use when constructing the URL for retrieving data for the content dashboard.
/// </summary>
/// <value>The URL path.</value>
public string ContentDashboardPath { get; set; } = DefaultContentDashboardPath;
[DefaultValue(DefaultContentDashboardPath)]
public string ContentDashboardPath { get; set; } = DefaultContentDashboardPath;
/// <summary>
/// Gets the allowed addresses to retrieve data for the content dashboard.
/// </summary>
/// <value>The URLs.</value>
public string[] ContentDashboardUrlAllowlist { get; set; }
}
}
@@ -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>
@@ -29,23 +29,22 @@ 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.
/// It must end with a comma
/// Gets or sets a value for the reserved URLs (must end with a comma).
/// </summary>
[DefaultValue(StaticReservedUrls)]
public string ReservedUrls { get; set; } = StaticReservedUrls;
/// <summary>
/// Gets or sets a value for the reserved paths.
/// It must end with a comma
/// Gets or sets a value for the reserved paths (must end with a comma).
/// </summary>
[DefaultValue(StaticReservedPaths)]
public string ReservedPaths { get; set; } = StaticReservedPaths;
/// <summary>
/// Gets or sets a value for the timeout
/// Gets or sets a value for the back-office login timeout.
/// </summary>
[DefaultValue(StaticTimeOut)]
public TimeSpan TimeOut { get; set; } = TimeSpan.Parse(StaticTimeOut);
@@ -104,11 +103,19 @@ namespace Umbraco.Cms.Core.Configuration.Models
public string UmbracoScriptsPath { get; set; } = StaticUmbracoScriptsPath;
/// <summary>
/// Gets or sets a value for the Umbraco media path.
/// Gets or sets a value for the Umbraco media request path.
/// </summary>
[DefaultValue(StaticUmbracoMediaPath)]
public string UmbracoMediaPath { get; set; } = StaticUmbracoMediaPath;
/// <summary>
/// Gets or sets a value for the physical Umbraco media root path (falls back to <see cref="UmbracoMediaPath" /> when empty).
/// </summary>
/// <remarks>
/// If the value is a virtual path, it's resolved relative to the webroot.
/// </remarks>
public string UmbracoMediaPhysicalRootPath { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to install the database when it is missing.
/// </summary>
@@ -130,6 +137,30 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// Gets or sets a value for the main dom lock.
/// </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>
public string Id { get; set; } = string.Empty;
/// <summary>
@@ -159,19 +190,23 @@ namespace Umbraco.Cms.Core.Configuration.Models
public bool IsSmtpServerConfigured => !string.IsNullOrWhiteSpace(Smtp?.Host);
/// <summary>
/// Gets a value indicating whether TinyMCE scripting sanitization should be applied
/// Gets a value indicating whether there is a physical pickup directory configured.
/// </summary>
public bool IsPickupDirectoryLocationConfigured => !string.IsNullOrWhiteSpace(Smtp?.PickupDirectoryLocation);
/// <summary>
/// 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>
/// An int value representing the time in milliseconds to lock the database for a write operation
/// </summary>
/// <remarks>
/// The default value is 5000 milliseconds
/// The default value is 5000 milliseconds.
/// </remarks>
/// <value>The timeout in milliseconds.</value>
[DefaultValue(StaticSqlWriteLockTimeOut)]
public TimeSpan SqlWriteLockTimeOut { get; } = TimeSpan.Parse(StaticSqlWriteLockTimeOut);
public TimeSpan SqlWriteLockTimeOut { get; set; } = TimeSpan.Parse(StaticSqlWriteLockTimeOut);
}
}
@@ -0,0 +1,11 @@
namespace Umbraco.Cms.Core.Configuration.Models
{
[UmbracoOptions(Constants.Configuration.ConfigHelpPage)]
public class HelpPageSettings
{
/// <summary>
/// Gets or sets the allowed addresses to retrieve data for the content dashboard.
/// </summary>
public string[] HelpPageUrlAllowList { get; set; }
}
}
@@ -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; }
}
}
@@ -49,6 +49,7 @@ namespace Umbraco.Cms.Core.Configuration.Models
if (!ModelsMode.IsAuto())
{
_flagOutOfDateModels = false;
return;
}
_flagOutOfDateModels = value;
@@ -1,6 +1,7 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Umbraco.Cms.Core.Configuration.UmbracoSettings;
@@ -16,33 +17,34 @@ namespace Umbraco.Cms.Core.Configuration.Models
{
internal const bool StaticAddTrailingSlash = true;
internal const string StaticConvertUrlsToAscii = "try";
internal const bool StaticEnableDefaultCharReplacements = true;
internal static readonly CharItem[] DefaultCharCollection =
internal static readonly Umbraco.Cms.Core.Configuration.Models.CharItem[] DefaultCharCollection =
{
new CharItem { Char = " ", Replacement = "-" },
new CharItem { Char = "\"", Replacement = string.Empty },
new CharItem { Char = "'", Replacement = string.Empty },
new CharItem { Char = "%", Replacement = string.Empty },
new CharItem { Char = ".", Replacement = string.Empty },
new CharItem { Char = ";", Replacement = string.Empty },
new CharItem { Char = "/", Replacement = string.Empty },
new CharItem { Char = "\\", Replacement = string.Empty },
new CharItem { Char = ":", Replacement = string.Empty },
new CharItem { Char = "#", Replacement = string.Empty },
new CharItem { Char = "+", Replacement = "plus" },
new CharItem { Char = "*", Replacement = "star" },
new CharItem { Char = "&", Replacement = string.Empty },
new CharItem { Char = "?", Replacement = string.Empty },
new CharItem { Char = "æ", Replacement = "ae" },
new CharItem { Char = "ä", Replacement = "ae" },
new CharItem { Char = "ø", Replacement = "oe" },
new CharItem { Char = "ö", Replacement = "oe" },
new CharItem { Char = "å", Replacement = "aa" },
new CharItem { Char = "ü", Replacement = "ue" },
new CharItem { Char = "ß", Replacement = "ss" },
new CharItem { Char = "|", Replacement = "-" },
new CharItem { Char = "<", Replacement = string.Empty },
new CharItem { Char = ">", Replacement = string.Empty }
new () { Char = " ", Replacement = "-" },
new () { Char = "\"", Replacement = string.Empty },
new () { Char = "'", Replacement = string.Empty },
new () { Char = "%", Replacement = string.Empty },
new () { Char = ".", Replacement = string.Empty },
new () { Char = ";", Replacement = string.Empty },
new () { Char = "/", Replacement = string.Empty },
new () { Char = "\\", Replacement = string.Empty },
new () { Char = ":", Replacement = string.Empty },
new () { Char = "#", Replacement = string.Empty },
new () { Char = "+", Replacement = "plus" },
new () { Char = "*", Replacement = "star" },
new () { Char = "&", Replacement = string.Empty },
new () { Char = "?", Replacement = string.Empty },
new () { Char = "æ", Replacement = "ae" },
new () { Char = "ä", Replacement = "ae" },
new () { Char = "ø", Replacement = "oe" },
new () { Char = "ö", Replacement = "oe" },
new () { Char = "å", Replacement = "aa" },
new () { Char = "ü", Replacement = "ue" },
new () { Char = "ß", Replacement = "ss" },
new () { Char = "|", Replacement = "-" },
new () { Char = "<", Replacement = string.Empty },
new () { Char = ">", Replacement = string.Empty }
};
/// <summary>
@@ -67,34 +69,24 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// </summary>
public bool ShouldTryConvertUrlsToAscii => ConvertUrlsToAscii.InvariantEquals("try");
// We need to special handle ":", as this character is special in keys
// TODO: implement from configuration
//// var collection = _configuration.GetSection(Prefix + "CharCollection").GetChildren()
//// .Select(x => new CharItem()
//// {
//// Char = x.GetValue<string>("Char"),
//// Replacement = x.GetValue<string>("Replacement"),
//// }).ToArray();
//// if (collection.Any() || _configuration.GetSection("Prefix").GetChildren().Any(x =>
//// x.Key.Equals("CharCollection", StringComparison.OrdinalIgnoreCase)))
//// {
//// return collection;
//// }
//// return DefaultCharCollection;
/// <summary>
/// Disable all default character replacements
/// </summary>
[DefaultValue(StaticEnableDefaultCharReplacements)]
public bool EnableDefaultCharReplacements { get; set; } = StaticEnableDefaultCharReplacements;
/// <summary>
/// Gets or sets a value for the default character collection for replacements.
/// Add additional character replacements, or override defaults
/// </summary>
/// WB-TODO
[Obsolete("Use the GetCharReplacements extension method in the Umbraco.Extensions namespace instead. Scheduled for removal in V11")]
public IEnumerable<IChar> CharCollection { get; set; } = DefaultCharCollection;
/// <summary>
/// Defines a character replacement.
/// Add additional character replacements, or override defaults
/// </summary>
public IEnumerable<Umbraco.Cms.Core.Configuration.Models.CharItem> UserDefinedCharCollection { get; set; }
[Obsolete("Use CharItem in the Umbraco.Cms.Core.Configuration.Models namespace instead. Scheduled for removal in V10.")]
public class CharItem : IChar
{
/// <inheritdoc/>
@@ -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[]
@@ -11,6 +11,8 @@ namespace Umbraco.Cms.Core.Configuration.Models
[UmbracoOptions(Constants.Configuration.ConfigSecurity)]
public class SecuritySettings
{
internal const bool StaticMemberBypassTwoFactorForExternalLogins = true;
internal const bool StaticUserBypassTwoFactorForExternalLogins = true;
internal const bool StaticKeepUserLoggedIn = false;
internal const bool StaticHideDisabledUsersInBackOffice = false;
internal const bool StaticAllowPasswordReset = true;
@@ -66,5 +68,17 @@ namespace Umbraco.Cms.Core.Configuration.Models
/// Gets or sets a value for the member password settings.
/// </summary>
public MemberPasswordConfigurationSettings MemberPassword { get; set; }
/// <summary>
/// Gets or sets a value indicating whether to bypass the two factor requirement in Umbraco when using external login for members. Thereby rely on the External login and potential 2FA at that provider.
/// </summary>
[DefaultValue(StaticMemberBypassTwoFactorForExternalLogins)]
public bool MemberBypassTwoFactorForExternalLogins { get; set; } = StaticMemberBypassTwoFactorForExternalLogins;
/// <summary>
/// Gets or sets a value indicating whether to bypass the two factor requirement in Umbraco when using external login for users. Thereby rely on the External login and potential 2FA at that provider.
/// </summary>
[DefaultValue(StaticUserBypassTwoFactorForExternalLogins)]
public bool UserBypassTwoFactorForExternalLogins { get; set; } = StaticUserBypassTwoFactorForExternalLogins;
}
}
@@ -0,0 +1,41 @@
using System.Collections.Generic;
using Umbraco.Cms.Core.Configuration.Models;
namespace Umbraco.Cms.Core.Configuration.UmbracoSettings
{
public class CharacterReplacementEqualityComparer : IEqualityComparer<IChar>
{
public bool Equals(IChar x, IChar y)
{
if (ReferenceEquals(x, y))
{
return true;
}
if (x is null)
{
return false;
}
if (y is null)
{
return false;
}
if (x.GetType() != y.GetType())
{
return false;
}
return x.Char == y.Char && x.Replacement == y.Replacement;
}
public int GetHashCode(IChar obj)
{
unchecked
{
return ((obj.Char != null ? obj.Char.GetHashCode() : 0) * 397) ^ (obj.Replacement != null ? obj.Replacement.GetHashCode() : 0);
}
}
}
}
@@ -1,8 +1,9 @@
namespace Umbraco.Cms.Core.Configuration.UmbracoSettings
namespace Umbraco.Cms.Core.Configuration.UmbracoSettings
{
public interface IChar
{
string Char { get; }
string Replacement { get; }
}
}
+3 -1
View File
@@ -1,4 +1,4 @@
namespace Umbraco.Cms.Core
namespace Umbraco.Cms.Core
{
public static partial class Constants
{
@@ -54,6 +54,8 @@
public const string ConfigUserPassword = ConfigPrefix + "Security:UserPassword";
public const string ConfigRichTextEditor = ConfigPrefix + "RichTextEditor";
public const string ConfigPackageMigration = ConfigPrefix + "PackageMigration";
public const string ConfigContentDashboard = ConfigPrefix + "ContentDashboard";
public const string ConfigHelpPage = ConfigPrefix + "HelpPage";
}
}
}
+1 -1
View File
@@ -235,7 +235,7 @@ namespace Umbraco.Cms.Core
/// The standard properties group name for membership properties.
/// </summary>
public const string StandardPropertiesGroupName = "Membership";
}
}
/// <summary>
/// Defines the alias identifiers for Umbraco member types.
+4 -4
View File
@@ -1,4 +1,4 @@
namespace Umbraco.Cms.Core
namespace Umbraco.Cms.Core
{
/// <summary>
/// Defines constants.
@@ -20,15 +20,16 @@
public const string CompilationDebugCheck = "https://umbra.co/healthchecks-compilation-debug";
}
public static class Configuration
{
public const string MacroErrorsCheck = "https://umbra.co/healthchecks-macro-errors";
public const string TrySkipIisCustomErrorsCheck = "https://umbra.co/healthchecks-skip-iis-custom-errors";
public const string NotificationEmailCheck = "https://umbra.co/healthchecks-notification-email";
}
public static class FolderAndFilePermissionsCheck
{
public const string FileWriting = "https://umbra.co/healthchecks-file-writing";
public const string FolderCreation = "https://umbra.co/healthchecks-folder-creation";
public const string FileWritingForPackages = "https://umbra.co/healthchecks-file-writing-for-packages";
@@ -37,7 +38,7 @@
public static class Security
{
public const string UmbracoApplicationUrlCheck = "https://umbra.co/healthchecks-umbraco-application-url";
public const string ClickJackingCheck = "https://umbra.co/healthchecks-click-jacking";
public const string HstsCheck = "https://umbra.co/healthchecks-hsts";
public const string NoSniffCheck = "https://umbra.co/healthchecks-no-sniff";
@@ -46,7 +47,6 @@
public static class HttpsCheck
{
public const string CheckIfCurrentSchemeIsHttps = "https://umbra.co/healthchecks-https-request";
public const string CheckHttpsConfigurationSetting = "https://umbra.co/healthchecks-https-config";
public const string CheckForValidCertificate = "https://umbra.co/healthchecks-valid-certificate";
+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>
+1
View File
@@ -50,6 +50,7 @@ namespace Umbraco.Cms.Core
/// providers need to be setup differently and each auth type for the back office will be prefixed with this value
/// </remarks>
public const string BackOfficeExternalAuthenticationTypePrefix = "Umbraco.";
public const string MemberExternalAuthenticationTypePrefix = "UmbracoMembers.";
public const string StartContentNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startcontentnode";
public const string StartMediaNodeIdClaimType = "http://umbraco.org/2015/02/identity/claims/backoffice/startmedianode";
@@ -1,3 +1,5 @@
using System;
namespace Umbraco.Cms.Core
{
public static partial class Constants
@@ -42,8 +44,16 @@ namespace Umbraco.Cms.Core
public const string Install = "~/install";
public const string AppPlugins = "/App_Plugins";
[Obsolete("Use PluginIcons instead")]
public static string AppPluginIcons => "/Backoffice/Icons";
public const string PluginIcons = "/backoffice/icons";
public const string CreatedPackages = "/created-packages";
public const string MvcViews = "~/Views";
public const string PartialViews = MvcViews + "/Partials/";
@@ -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,34 @@
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 MemberEditorContentAppFactory : IContentAppFactory
{
// see note on ContentApp
internal const int Weight = +50;
private ContentApp _memberApp;
public ContentApp GetContentAppFor(object source, IEnumerable<IReadOnlyUserGroup> userGroups)
{
switch (source)
{
case IMember _:
return _memberApp ??= new ContentApp
{
Alias = "umbMembership",
Name = "Member",
Icon = "icon-user",
View = "views/member/apps/membership/membership.html",
Weight = Weight
};
default:
return null;
}
}
}
}
@@ -24,6 +24,8 @@ namespace Umbraco.Extensions
services.AddUnique<TService2>(factory => (TImplementing)factory.GetRequiredService<TService1>());
}
// TODO(V11): Remove this function.
[Obsolete("This method is functionally equivalent to AddSingleton<TImplementing>() please use that instead.")]
public static void AddUnique<TImplementing>(this IServiceCollection services)
where TImplementing : class
=> services.Replace(ServiceDescriptor.Singleton<TImplementing, TImplementing>());
@@ -0,0 +1,116 @@
using System;
using Umbraco.Cms.Core.Composing;
using Umbraco.Cms.Core.Dashboards;
using Umbraco.Cms.Core.Media;
using Umbraco.Cms.Core.Models.ContentEditing;
using Umbraco.Cms.Core.Routing;
using Umbraco.Cms.Core.Sections;
namespace Umbraco.Cms.Core.DependencyInjection
{
/// <summary>
/// Contains extensions methods for <see cref="IUmbracoBuilder"/> used for registering content apps.
/// </summary>
public static partial class UmbracoBuilderExtensions
{
/// <summary>
/// Register a component.
/// </summary>
/// <typeparam name="T">The type of the component.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddComponent<T>(this IUmbracoBuilder builder)
where T : class, IComponent
{
builder.Components().Append<T>();
return builder;
}
/// <summary>
/// Register a content app.
/// </summary>
/// <typeparam name="T">The type of the content app.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddContentApp<T>(this IUmbracoBuilder builder)
where T : class, IContentAppFactory
{
builder.ContentApps().Append<T>();
return builder;
}
/// <summary>
/// Register a content finder.
/// </summary>
/// <typeparam name="T">The type of the content finder.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddContentFinder<T>(this IUmbracoBuilder builder)
where T : class, IContentFinder
{
builder.ContentFinders().Append<T>();
return builder;
}
/// <summary>
/// Register a dashboard.
/// </summary>
/// <typeparam name="T">The type of the dashboard.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddDashboard<T>(this IUmbracoBuilder builder)
where T : class, IDashboard
{
builder.Dashboards().Add<T>();
return builder;
}
/// <summary>
/// Register a media url provider.
/// </summary>
/// <typeparam name="T">The type of the media url provider.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddMediaUrlProvider<T>(this IUmbracoBuilder builder)
where T : class, IMediaUrlProvider
{
builder.MediaUrlProviders().Append<T>();
return builder;
}
/// <summary>
/// Register a embed provider.
/// </summary>
/// <typeparam name="T">The type of the embed provider.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddEmbedProvider<T>(this IUmbracoBuilder builder)
where T : class, IEmbedProvider
{
builder.EmbedProviders().Append<T>();
return builder;
}
[Obsolete("Use AddEmbedProvider instead. This will be removed in Umbraco 10")]
public static IUmbracoBuilder AddOEmbedProvider<T>(this IUmbracoBuilder builder)
where T : class, IEmbedProvider => AddEmbedProvider<T>(builder);
/// <summary>
/// Register a section.
/// </summary>
/// <typeparam name="T">The type of the section.</typeparam>
/// <param name="builder">The builder.</param>
public static IUmbracoBuilder AddSection<T>(this IUmbracoBuilder builder)
where T : class, ISection
{
builder.Sections().Append<T>();
return builder;
}
/// <summary>
/// Register a url provider.
/// </summary>
/// <typeparam name="T">The type of the url provider.</typeparam>
/// <param name="builder">The Builder.</param>
public static IUmbracoBuilder AddUrlProvider<T>(this IUmbracoBuilder builder)
where T : class, IUrlProvider
{
builder.UrlProviders().Append<T>();
return builder;
}
}
}
@@ -1,3 +1,4 @@
using System;
using Umbraco.Cms.Core.Actions;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Composing;
@@ -34,7 +35,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
{
builder.CacheRefreshers().Add(() => builder.TypeLoader.GetCacheRefreshers());
builder.DataEditors().Add(() => builder.TypeLoader.GetDataEditors());
builder.Actions().Add(() => builder.TypeLoader.GetActions());
builder.Actions().Add(() => builder .TypeLoader.GetActions());
// register known content apps
builder.ContentApps()
@@ -44,7 +45,9 @@ namespace Umbraco.Cms.Core.DependencyInjection
.Append<ContentTypeDesignContentAppFactory>()
.Append<ContentTypeListViewContentAppFactory>()
.Append<ContentTypePermissionsContentAppFactory>()
.Append<ContentTypeTemplatesContentAppFactory>();
.Append<ContentTypeTemplatesContentAppFactory>()
.Append<MemberEditorContentAppFactory>()
.Append<DictionaryContentAppFactory>();
// all built-in finders in the correct order,
// devs can then modify this list on application startup
@@ -102,7 +105,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
builder.ManifestFilters();
builder.MediaUrlGenerators();
// register OEmbed providers - no type scanning - all explicit opt-in of adding types, IEmbedProvider is not IDiscoverable
builder.OEmbedProviders()
builder.EmbedProviders()
.Append<YouTube>()
.Append<Twitter>()
.Append<Vimeo>()
@@ -265,7 +268,15 @@ namespace Umbraco.Cms.Core.DependencyInjection
/// Gets the backoffice OEmbed Providers collection builder.
/// </summary>
/// <param name="builder">The builder.</param>
[Obsolete("Use EmbedProviders() instead")]
public static EmbedProvidersCollectionBuilder OEmbedProviders(this IUmbracoBuilder builder)
=> EmbedProviders(builder);
/// <summary>
/// Gets the backoffice Embed Providers collection builder.
/// </summary>
/// <param name="builder">The builder.</param>
public static EmbedProvidersCollectionBuilder EmbedProviders(this IUmbracoBuilder builder)
=> builder.WithCollectionBuilder<EmbedProvidersCollectionBuilder>();
/// <summary>
@@ -1,9 +1,13 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Configuration.Models.Validation;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.DependencyInjection
{
@@ -13,23 +17,25 @@ namespace Umbraco.Cms.Core.DependencyInjection
public static partial class UmbracoBuilderExtensions
{
private static IUmbracoBuilder AddUmbracoOptions<TOptions>(this IUmbracoBuilder builder)
private static IUmbracoBuilder AddUmbracoOptions<TOptions>(this IUmbracoBuilder builder, Action<OptionsBuilder<TOptions>> configure = null)
where TOptions : class
{
var umbracoOptionsAttribute = typeof(TOptions).GetCustomAttribute<UmbracoOptionsAttribute>();
if (umbracoOptionsAttribute is null)
{
throw new ArgumentException("typeof(TOptions) do not have the UmbracoOptionsAttribute");
throw new ArgumentException($"{typeof(TOptions)} do not have the UmbracoOptionsAttribute.");
}
builder.Services.AddOptions<TOptions>()
.Bind(builder.Config.GetSection(umbracoOptionsAttribute.ConfigurationKey),
o => o.BindNonPublicProperties = umbracoOptionsAttribute.BindNonPublicProperties)
var optionsBuilder = builder.Services.AddOptions<TOptions>()
.Bind(
builder.Config.GetSection(umbracoOptionsAttribute.ConfigurationKey),
o => o.BindNonPublicProperties = umbracoOptionsAttribute.BindNonPublicProperties
)
.ValidateDataAnnotations();
return builder;
configure?.Invoke(optionsBuilder);
return builder;
}
/// <summary>
@@ -52,7 +58,13 @@ namespace Umbraco.Cms.Core.DependencyInjection
.AddUmbracoOptions<ContentSettings>()
.AddUmbracoOptions<CoreDebugSettings>()
.AddUmbracoOptions<ExceptionFilterSettings>()
.AddUmbracoOptions<GlobalSettings>()
.AddUmbracoOptions<GlobalSettings>(optionsBuilder => optionsBuilder.PostConfigure(options =>
{
if (string.IsNullOrEmpty(options.UmbracoMediaPhysicalRootPath))
{
options.UmbracoMediaPhysicalRootPath = options.UmbracoMediaPath;
}
}))
.AddUmbracoOptions<HealthChecksSettings>()
.AddUmbracoOptions<HostingSettings>()
.AddUmbracoOptions<ImagingSettings>()
@@ -74,7 +86,11 @@ namespace Umbraco.Cms.Core.DependencyInjection
.AddUmbracoOptions<BasicAuthSettings>()
.AddUmbracoOptions<RuntimeMinificationSettings>()
.AddUmbracoOptions<LegacyPasswordMigrationSettings>()
.AddUmbracoOptions<PackageMigrationSettings>();
.AddUmbracoOptions<PackageMigrationSettings>()
.AddUmbracoOptions<ContentDashboardSettings>()
.AddUmbracoOptions<HelpPageSettings>();
builder.Services.Configure<RequestHandlerSettings>(options => options.MergeReplacements(builder.Config));
return builder;
}
@@ -36,6 +36,7 @@ using Umbraco.Cms.Core.Runtime;
using Umbraco.Cms.Core.Security;
using Umbraco.Cms.Core.Services;
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;
@@ -170,7 +171,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
Services.AddSingleton<UmbracoRequestPaths>();
Services.AddUnique<InstallStatusTracker>();
Services.AddSingleton<InstallStatusTracker>();
// by default, register a noop factory
Services.AddUnique<IPublishedModelFactory, NoopPublishedModelFactory>();
@@ -178,7 +179,7 @@ namespace Umbraco.Cms.Core.DependencyInjection
Services.AddUnique<ICultureDictionaryFactory, DefaultCultureDictionaryFactory>();
Services.AddSingleton(f => f.GetRequiredService<ICultureDictionaryFactory>().CreateDictionary());
Services.AddUnique<UriUtility>();
Services.AddSingleton<UriUtility>();
Services.AddUnique<IDashboardService, DashboardService>();
Services.AddUnique<IUserDataService, UserDataService>();
@@ -193,14 +194,14 @@ namespace Umbraco.Cms.Core.DependencyInjection
Services.AddUnique<IPublishedUrlProvider, UrlProvider>();
Services.AddUnique<ISiteDomainMapper, SiteDomainMapper>();
Services.AddUnique<HtmlLocalLinkParser>();
Services.AddUnique<HtmlImageSourceParser>();
Services.AddUnique<HtmlUrlParser>();
Services.AddSingleton<HtmlLocalLinkParser>();
Services.AddSingleton<HtmlImageSourceParser>();
Services.AddSingleton<HtmlUrlParser>();
// register properties fallback
Services.AddUnique<IPublishedValueFallback, PublishedValueFallback>();
Services.AddUnique<UmbracoFeatures>();
Services.AddSingleton<UmbracoFeatures>();
// register published router
Services.AddUnique<IPublishedRouter, PublishedRouter>();
@@ -225,13 +226,13 @@ namespace Umbraco.Cms.Core.DependencyInjection
// let's use an hybrid accessor that can fall back to a ThreadStatic context.
Services.AddUnique<IUmbracoContextAccessor, HybridUmbracoContextAccessor>();
Services.AddUnique<LegacyPasswordSecurity>();
Services.AddUnique<UserEditorAuthorizationHelper>();
Services.AddUnique<ContentPermissions>();
Services.AddUnique<MediaPermissions>();
Services.AddSingleton<LegacyPasswordSecurity>();
Services.AddSingleton<UserEditorAuthorizationHelper>();
Services.AddSingleton<ContentPermissions>();
Services.AddSingleton<MediaPermissions>();
Services.AddUnique<PropertyEditorCollection>();
Services.AddUnique<ParameterEditorCollection>();
Services.AddSingleton<PropertyEditorCollection>();
Services.AddSingleton<ParameterEditorCollection>();
// register a server registrar, by default it's the db registrar
Services.AddUnique<IServerRoleAccessor>(f =>
@@ -259,6 +260,13 @@ namespace Umbraco.Cms.Core.DependencyInjection
// Register ValueEditorCache used for validation
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
Services.AddUnique<IHtmlSanitizer, NoopHtmlSanitizer>();
}
}
}
@@ -7,6 +7,8 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Cms.Core.DependencyInjection;
using Umbraco.Cms.Core.Notifications;
namespace Umbraco.Cms.Core.Events
@@ -84,17 +86,56 @@ namespace Umbraco.Cms.Core.Events
internal class NotificationAsyncHandlerWrapperImpl<TNotification> : NotificationAsyncHandlerWrapper
where TNotification : INotification
{
/// <remarks>
/// <para>
/// Background - During v9 build we wanted an in-process message bus to facilitate removal of the old static event handlers. <br/>
/// Instead of taking a dependency on MediatR we (the community) implemented our own using MediatR as inspiration.
/// </para>
///
/// <para>
/// Some things worth knowing about MediatR.
/// <list type="number">
/// <item>All handlers are by default registered with transient lifetime, but can easily depend on services with state.</item>
/// <item>Both the Mediatr instance and its handler resolver are registered transient and as such it is always possible to depend on scoped services in a handler.</item>
/// </list>
/// </para>
///
/// <para>
/// Our EventAggregator started out registered with a transient lifetime but later (before initial release) the registration was changed to singleton, presumably
/// because there are a lot of singleton services in Umbraco which like to publish notifications and it's a pain to use scoped services from a singleton.
/// <br/>
/// The problem with a singleton EventAggregator is it forces handlers to create a service scope and service locate any scoped services
/// they wish to make use of e.g. a unit of work (think entity framework DBContext).
/// </para>
///
/// <para>
/// Moving forwards it probably makes more sense to register EventAggregator transient but doing so now would mean an awful lot of service location to avoid breaking changes.
/// <br/>
/// For now we can do the next best thing which is to create a scope for each published notification, thus enabling the transient handlers to take a dependency on a scoped service.
/// </para>
///
/// <para>
/// Did discuss using HttpContextAccessor/IScopedServiceProvider to enable sharing of scopes when publisher has http context,
/// but decided against because it's inconsistent with what happens in background threads and will just cause confusion.
/// </para>
/// </remarks>
public override Task HandleAsync(
INotification notification,
CancellationToken cancellationToken,
ServiceFactory serviceFactory,
Func<IEnumerable<Func<INotification, CancellationToken, Task>>, INotification, CancellationToken, Task> publish)
{
IEnumerable<Func<INotification, CancellationToken, Task>> handlers = serviceFactory
.GetInstances<INotificationAsyncHandler<TNotification>>()
// Create a new service scope from which to resolve handlers and ensure it's disposed when it goes out of scope.
// TODO: go back to using ServiceFactory to resolve
IServiceScopeFactory scopeFactory = serviceFactory.GetInstance<IServiceScopeFactory>();
using IServiceScope scope = scopeFactory.CreateScope();
IServiceProvider container = scope.ServiceProvider;
IEnumerable<Func<INotification, CancellationToken, Task>> handlers = container
.GetServices<INotificationAsyncHandler<TNotification>>()
.Select(x => new Func<INotification, CancellationToken, Task>(
(theNotification, theToken) =>
x.HandleAsync((TNotification)theNotification, theToken)));
x.HandleAsync((TNotification)theNotification, theToken)));
return publish(handlers, notification, cancellationToken);
}
@@ -103,13 +144,23 @@ namespace Umbraco.Cms.Core.Events
internal class NotificationHandlerWrapperImpl<TNotification> : NotificationHandlerWrapper
where TNotification : INotification
{
/// <remarks>
/// See remarks on <see cref="NotificationAsyncHandlerWrapperImpl{T}.HandleAsync"/> for explanation on
/// what's going on with the IServiceProvider stuff here.
/// </remarks>
public override void Handle(
INotification notification,
ServiceFactory serviceFactory,
Action<IEnumerable<Action<INotification>>, INotification> publish)
{
IEnumerable<Action<INotification>> handlers = serviceFactory
.GetInstances<INotificationHandler<TNotification>>()
// Create a new service scope from which to resolve handlers and ensure it's disposed when it goes out of scope.
// TODO: go back to using ServiceFactory to resolve
IServiceScopeFactory scopeFactory = serviceFactory.GetInstance<IServiceScopeFactory>();
using IServiceScope scope = scopeFactory.CreateScope();
IServiceProvider container = scope.ServiceProvider;
IEnumerable<Action<INotification>> handlers = container
.GetServices<INotificationHandler<TNotification>>()
.Select(x => new Action<INotification>(
(theNotification) =>
x.Handle((TNotification)theNotification)));
@@ -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);
}
@@ -62,6 +62,19 @@ namespace Umbraco.Extensions
return username;
}
public static string GetEmail(this IIdentity identity)
{
if (identity == null) throw new ArgumentNullException(nameof(identity));
string email = null;
if (identity is ClaimsIdentity claimsIdentity)
{
email = claimsIdentity.FindFirstValue(ClaimTypes.Email);
}
return email;
}
/// <summary>
/// Returns the first claim value found in the <see cref="ClaimsIdentity"/> for the given claimType
/// </summary>
@@ -119,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;
}
@@ -367,7 +367,7 @@ namespace Umbraco.Extensions
/// <param name="content"><see cref="IContent"/> to generate xml for</param>
/// <param name="serializer"></param>
/// <returns>Xml representation of the passed in <see cref="IContent"/></returns>
internal static XElement ToDeepXml(this IContent content, IEntityXmlSerializer serializer)
public static XElement ToDeepXml(this IContent content, IEntityXmlSerializer serializer)
{
return serializer.Serialize(content, false, 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);
@@ -0,0 +1,96 @@
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Configuration;
using Umbraco.Cms.Core;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Configuration.UmbracoSettings;
namespace Umbraco.Extensions
{
/// <summary>
/// Get concatenated user and default character replacements
/// taking into account <see cref="RequestHandlerSettings.EnableDefaultCharReplacements"/>
/// </summary>
public static class RequestHandlerSettingsExtension
{
/// <summary>
/// Get concatenated user and default character replacements
/// taking into account <see cref="RequestHandlerSettings.EnableDefaultCharReplacements"/>
/// </summary>
public static IEnumerable<CharItem> GetCharReplacements(this RequestHandlerSettings requestHandlerSettings)
{
if (requestHandlerSettings.EnableDefaultCharReplacements is false)
{
return requestHandlerSettings.UserDefinedCharCollection ?? Enumerable.Empty<CharItem>();
}
if (requestHandlerSettings.UserDefinedCharCollection == null || requestHandlerSettings.UserDefinedCharCollection.Any() is false)
{
return RequestHandlerSettings.DefaultCharCollection;
}
return MergeUnique(requestHandlerSettings.UserDefinedCharCollection, RequestHandlerSettings.DefaultCharCollection);
}
/// <summary>
/// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection
/// </summary>
internal static void MergeReplacements(this RequestHandlerSettings requestHandlerSettings, IConfiguration configuration)
{
string sectionKey = $"{Constants.Configuration.ConfigRequestHandler}:";
IEnumerable<CharItem> charCollection = GetReplacements(
configuration,
$"{sectionKey}{nameof(RequestHandlerSettings.CharCollection)}");
IEnumerable<CharItem> userDefinedCharCollection = GetReplacements(
configuration,
$"{sectionKey}{nameof(requestHandlerSettings.UserDefinedCharCollection)}");
IEnumerable<CharItem> mergedCollection = MergeUnique(userDefinedCharCollection, charCollection);
requestHandlerSettings.UserDefinedCharCollection = mergedCollection;
}
private static IEnumerable<CharItem> GetReplacements(IConfiguration configuration, string key)
{
var replacements = new List<CharItem>();
IEnumerable<IConfigurationSection> config = configuration.GetSection(key).GetChildren();
foreach (IConfigurationSection section in config)
{
var @char = section.GetValue<string>(nameof(CharItem.Char));
var replacement = section.GetValue<string>(nameof(CharItem.Replacement));
replacements.Add(new CharItem { Char = @char, Replacement = replacement });
}
return replacements;
}
/// <summary>
/// Merges two IEnumerable of CharItem without any duplicates, items in priorityReplacements will override those in alternativeReplacements
/// </summary>
private static IEnumerable<CharItem> MergeUnique(
IEnumerable<CharItem> priorityReplacements,
IEnumerable<CharItem> alternativeReplacements)
{
var priorityReplacementsList = priorityReplacements.ToList();
var alternativeReplacementsList = alternativeReplacements.ToList();
foreach (CharItem alternativeReplacement in alternativeReplacementsList)
{
foreach (CharItem priorityReplacement in priorityReplacementsList)
{
if (priorityReplacement.Char == alternativeReplacement.Char)
{
alternativeReplacement.Replacement = priorityReplacement.Replacement;
}
}
}
return priorityReplacementsList.Union<CharItem>(
alternativeReplacementsList,
new CharacterReplacementEqualityComparer());
}
}
}
@@ -430,10 +430,16 @@ namespace Umbraco.Extensions
where T : Attribute
{
if (type == null) return Enumerable.Empty<T>();
return type.GetCustomAttributes(typeof (T), inherited).OfType<T>();
return type.GetCustomAttributes(typeof(T), inherited).OfType<T>();
}
/// <summary>
public static bool HasCustomAttribute<T>(this Type type, bool inherit)
where T : Attribute
{
return type.GetCustomAttribute<T>(inherit) != null;
}
/// <summary>
/// Tries to return a value based on a property name for an object but ignores case sensitivity
/// </summary>
/// <param name="type"></param>
@@ -226,7 +226,7 @@ namespace Umbraco.Cms.Core.Handlers
foreach (var perm in perms)
{
var group = _userService.GetUserGroupById(perm.UserGroupId);
var assigned = string.Join(", ", perm.AssignedPermissions);
var assigned = string.Join(", ", perm?.AssignedPermissions ?? Array.Empty<string>());
var entity = _entityService.Get(perm.EntityId);
_auditService.Write(performingUser.Id, $"User \"{performingUser.Name}\" {FormatEmail(performingUser)}", PerformingIp,
@@ -0,0 +1,68 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Services;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.HealthChecks.Checks.Security
{
[HealthCheck(
"6708CA45-E96E-40B8-A40A-0607C1CA7F28",
"Application URL Configuration",
Description = "Checks if the Umbraco application URL is configured for your site.",
Group = "Security")]
public class UmbracoApplicationUrlCheck : HealthCheck
{
private readonly ILocalizedTextService _textService;
private readonly IOptionsMonitor<WebRoutingSettings> _webRoutingSettings;
public UmbracoApplicationUrlCheck(ILocalizedTextService textService, IOptionsMonitor<WebRoutingSettings> webRoutingSettings)
{
_textService = textService;
_webRoutingSettings = webRoutingSettings;
}
/// <summary>
/// Executes the action and returns its status
/// </summary>
public override HealthCheckStatus ExecuteAction(HealthCheckAction action) => throw new InvalidOperationException("UmbracoApplicationUrlCheck has no executable actions");
/// <summary>
/// Get the status for this health check
/// </summary>
public override Task<IEnumerable<HealthCheckStatus>> GetStatus() =>
Task.FromResult(CheckUmbracoApplicationUrl().Yield());
private HealthCheckStatus CheckUmbracoApplicationUrl()
{
var url = _webRoutingSettings.CurrentValue.UmbracoApplicationUrl;
string resultMessage;
StatusResultType resultType;
var success = false;
if (url.IsNullOrWhiteSpace())
{
resultMessage = _textService.Localize("healthcheck", "umbracoApplicationUrlCheckResultFalse");
resultType = StatusResultType.Warning;
}
else
{
resultMessage = _textService.Localize("healthcheck", "umbracoApplicationUrlCheckResultTrue", new[] { url });
resultType = StatusResultType.Success;
success = true;
}
return new HealthCheckStatus(resultMessage)
{
ResultType = resultType,
ReadMoreLink = success ? null : Constants.HealthChecks.DocumentationLinks.Security.UmbracoApplicationUrlCheck
};
}
}
}
@@ -3,6 +3,7 @@ using System.IO;
using System.Security.Cryptography;
using System.Text;
using System.Threading;
using Microsoft.Extensions.FileProviders;
using Umbraco.Cms.Core.IO;
namespace Umbraco.Extensions
@@ -87,5 +88,24 @@ namespace Umbraco.Extensions
}
fs.DeleteFile(tempFile);
}
/// <summary>
/// Creates a new <see cref="IFileProvider" /> from the file system.
/// </summary>
/// <param name="fileSystem">The file system.</param>
/// <param name="fileProvider">When this method returns, contains an <see cref="IFileProvider"/> created from the file system.</param>
/// <returns>
/// <c>true</c> if the <see cref="IFileProvider" /> was successfully created; otherwise, <c>false</c>.
/// </returns>
public static bool TryCreateFileProvider(this IFileSystem fileSystem, out IFileProvider fileProvider)
{
fileProvider = fileSystem switch
{
IFileProviderFactory fileProviderFactory => fileProviderFactory.Create(),
_ => null
};
return fileProvider != null;
}
}
}
@@ -0,0 +1,18 @@
using Microsoft.Extensions.FileProviders;
namespace Umbraco.Cms.Core.IO
{
/// <summary>
/// Factory for creating <see cref="IFileProvider" /> instances.
/// </summary>
public interface IFileProviderFactory
{
/// <summary>
/// Creates a new <see cref="IFileProvider" /> instance.
/// </summary>
/// <returns>
/// The newly created <see cref="IFileProvider" /> instance (or <c>null</c> if not supported).
/// </returns>
IFileProvider Create();
}
}
+21 -14
View File
@@ -8,7 +8,6 @@ using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Models.PublishedContent;
using Umbraco.Cms.Core.PropertyEditors;
using Umbraco.Cms.Core.Strings;
using Umbraco.Extensions;
@@ -22,13 +21,22 @@ namespace Umbraco.Cms.Core.IO
private readonly IShortStringHelper _shortStringHelper;
private readonly IServiceProvider _serviceProvider;
private MediaUrlGeneratorCollection _mediaUrlGenerators;
private readonly ContentSettings _contentSettings;
/// <summary>
/// Gets the media filesystem.
/// </summary>
public IFileSystem FileSystem { get; }
public MediaFileManager(
IFileSystem fileSystem,
IMediaPathScheme mediaPathScheme,
ILogger<MediaFileManager> logger,
IShortStringHelper shortStringHelper,
IServiceProvider serviceProvider)
{
_mediaPathScheme = mediaPathScheme;
_logger = logger;
_shortStringHelper = shortStringHelper;
_serviceProvider = serviceProvider;
FileSystem = fileSystem;
}
[Obsolete("Use the ctr that doesn't include unused parameters.")]
public MediaFileManager(
IFileSystem fileSystem,
IMediaPathScheme mediaPathScheme,
@@ -36,14 +44,13 @@ namespace Umbraco.Cms.Core.IO
IShortStringHelper shortStringHelper,
IServiceProvider serviceProvider,
IOptions<ContentSettings> contentSettings)
{
_mediaPathScheme = mediaPathScheme;
_logger = logger;
_shortStringHelper = shortStringHelper;
_serviceProvider = serviceProvider;
_contentSettings = contentSettings.Value;
FileSystem = fileSystem;
}
: this(fileSystem, mediaPathScheme, logger, shortStringHelper, serviceProvider)
{ }
/// <summary>
/// Gets the media filesystem.
/// </summary>
public IFileSystem FileSystem { get; }
/// <summary>
/// Delete media files.
+12 -6
View File
@@ -3,14 +3,17 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Hosting;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.IO
{
public interface IPhysicalFileSystem : IFileSystem {}
public class PhysicalFileSystem : IPhysicalFileSystem
public interface IPhysicalFileSystem : IFileSystem
{ }
public class PhysicalFileSystem : IPhysicalFileSystem, IFileProviderFactory
{
private readonly IIOHelper _ioHelper;
private readonly ILogger<PhysicalFileSystem> _logger;
@@ -28,7 +31,7 @@ namespace Umbraco.Cms.Core.IO
// eg "" or "/Views" or "/Media" or "/<vpath>/Media" in case of a virtual path
private readonly string _rootUrl;
public PhysicalFileSystem(IIOHelper ioHelper,IHostingEnvironment hostingEnvironment, ILogger<PhysicalFileSystem> logger, string rootPath, string rootUrl)
public PhysicalFileSystem(IIOHelper ioHelper, IHostingEnvironment hostingEnvironment, ILogger<PhysicalFileSystem> logger, string rootPath, string rootUrl)
{
_ioHelper = ioHelper ?? throw new ArgumentNullException(nameof(ioHelper));
_logger = logger ?? throw new ArgumentNullException(nameof(logger));
@@ -270,7 +273,7 @@ namespace Umbraco.Cms.Core.IO
return path.Substring(_rootUrl.Length).TrimStart(Constants.CharArrays.ForwardSlash);
// unchanged - what else?
return path;
return path.TrimStart(Constants.CharArrays.ForwardSlash);
}
/// <summary>
@@ -285,7 +288,7 @@ namespace Umbraco.Cms.Core.IO
public string GetFullPath(string path)
{
// normalize
var opath = path;
var originalPath = path;
path = EnsureDirectorySeparatorChar(path);
// FIXME: this part should go!
@@ -318,7 +321,7 @@ namespace Umbraco.Cms.Core.IO
// nothing prevents us to reach the file, security-wise, yet it is outside
// this filesystem's root - throw
throw new UnauthorizedAccessException($"File original: [{opath}] full: [{path}] is outside this filesystem's root.");
throw new UnauthorizedAccessException($"File original: [{originalPath}] full: [{path}] is outside this filesystem's root.");
}
/// <summary>
@@ -450,6 +453,9 @@ namespace Umbraco.Cms.Core.IO
}
}
/// <inheritdoc />
public IFileProvider Create() => new PhysicalFileProvider(_rootPath);
#endregion
}
}
+6 -2
View File
@@ -1,14 +1,15 @@
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.Extensions.FileProviders;
using Microsoft.Extensions.Logging;
using Umbraco.Cms.Core.Hosting;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.IO
{
internal class ShadowWrapper : IFileSystem
internal class ShadowWrapper : IFileSystem, IFileProviderFactory
{
private static readonly string ShadowFsPath = Constants.SystemDirectories.TempData.EnsureEndsWith('/') + "ShadowFs";
@@ -220,5 +221,8 @@ namespace Umbraco.Cms.Core.IO
{
FileSystem.AddFile(path, physicalPath, overrideIfExists, copy);
}
/// <inheritdoc />
public IFileProvider Create() => _innerFileSystem.TryCreateFileProvider(out IFileProvider fileProvider) ? fileProvider : null;
}
}
@@ -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;
@@ -48,6 +48,19 @@ namespace Umbraco.Cms.Core.Manifest
/// </remarks>
[IgnoreDataMember]
public string Source { get; set; }
/// <summary>
/// Gets or sets the version of the package
/// </summary>
[DataMember(Name = "version")]
public string Version { get; set; } = string.Empty;
/// <summary>
/// Gets or sets a value indicating whether telemetry is allowed
/// </summary>
[DataMember(Name = "allowPackageTelemetry")]
public bool AllowPackageTelemetry { get; set; } = true;
[DataMember(Name = "bundleOptions")]
public BundleOptions BundleOptions { get; set; }
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO (V10): change base class to OEmbedProviderBase
public class DailyMotion : EmbedProviderBase
{
public override string ApiEndpoint => "https://www.dailymotion.com/services/oembed";
@@ -1,85 +1,14 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Xml;
using System;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
public abstract class EmbedProviderBase : IEmbedProvider
[Obsolete("Use OEmbedProviderBase instead")]
public abstract class EmbedProviderBase : OEmbedProviderBase
{
private readonly IJsonSerializer _jsonSerializer;
protected EmbedProviderBase(IJsonSerializer jsonSerializer)
: base(jsonSerializer)
{
_jsonSerializer = jsonSerializer;
}
private static HttpClient _httpClient;
public abstract string ApiEndpoint { get; }
public abstract string[] UrlSchemeRegex { get; }
public abstract Dictionary<string, string> RequestParams { get; }
public abstract string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0);
public virtual string GetEmbedProviderUrl(string url, int maxWidth, int maxHeight)
{
if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute) == false)
throw new ArgumentException("Not a valid URL.", nameof(url));
var fullUrl = new StringBuilder();
fullUrl.Append(ApiEndpoint);
fullUrl.Append("?url=" + WebUtility.UrlEncode(url));
foreach (var param in RequestParams)
fullUrl.Append($"&{param.Key}={param.Value}");
if (maxWidth > 0)
fullUrl.Append("&maxwidth=" + maxWidth);
if (maxHeight > 0)
fullUrl.Append("&maxheight=" + maxHeight);
return fullUrl.ToString();
}
public virtual string DownloadResponse(string url)
{
if (_httpClient == null)
_httpClient = new HttpClient();
using (var request = new HttpRequestMessage(HttpMethod.Get, url))
{
var response = _httpClient.SendAsync(request).Result;
return response.Content.ReadAsStringAsync().Result;
}
}
public virtual T GetJsonResponse<T>(string url) where T : class
{
var response = DownloadResponse(url);
return _jsonSerializer.Deserialize<T>(response);
}
public virtual XmlDocument GetXmlResponse(string url)
{
var response = DownloadResponse(url);
var doc = new XmlDocument();
doc.LoadXml(response);
return doc;
}
public virtual string GetXmlProperty(XmlDocument doc, string property)
{
var selectSingleNode = doc.SelectSingleNode(property);
return selectSingleNode != null ? selectSingleNode.InnerText : string.Empty;
}
}
};
}
@@ -1,9 +1,10 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Net;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Flickr : EmbedProviderBase
{
public override string ApiEndpoint => "http://www.flickr.com/services/oembed/";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class GettyImages : EmbedProviderBase
{
public override string ApiEndpoint => "http://embed.gettyimages.com/oembed";
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
@@ -6,6 +6,7 @@ namespace Umbraco.Cms.Core.Media.EmbedProviders
/// <summary>
/// Embed Provider for Giphy.com the popular online GIFs and animated sticker provider.
/// </summary>
/// TODO(V10) : change base class to OEmbedProviderBase
public class Giphy : EmbedProviderBase
{
public override string ApiEndpoint => "https://giphy.com/services/oembed?url=";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Hulu : EmbedProviderBase
{
public override string ApiEndpoint => "http://www.hulu.com/api/oembed.json";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Issuu : EmbedProviderBase
{
public override string ApiEndpoint => "https://issuu.com/oembed";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Kickstarter : EmbedProviderBase
{
public override string ApiEndpoint => "http://www.kickstarter.com/services/oembed";
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Xml;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
public abstract class OEmbedProviderBase : IEmbedProvider
{
private readonly IJsonSerializer _jsonSerializer;
protected OEmbedProviderBase(IJsonSerializer jsonSerializer)
{
_jsonSerializer = jsonSerializer;
}
private static HttpClient _httpClient;
public abstract string ApiEndpoint { get; }
public abstract string[] UrlSchemeRegex { get; }
public abstract Dictionary<string, string> RequestParams { get; }
public abstract string GetMarkup(string url, int maxWidth = 0, int maxHeight = 0);
public virtual string GetEmbedProviderUrl(string url, int maxWidth, int maxHeight)
{
if (Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute) == false)
throw new ArgumentException("Not a valid URL.", nameof(url));
var fullUrl = new StringBuilder();
fullUrl.Append(ApiEndpoint);
fullUrl.Append("?url=" + WebUtility.UrlEncode(url));
foreach (var param in RequestParams)
fullUrl.Append($"&{param.Key}={param.Value}");
if (maxWidth > 0)
fullUrl.Append("&maxwidth=" + maxWidth);
if (maxHeight > 0)
fullUrl.Append("&maxheight=" + maxHeight);
return fullUrl.ToString();
}
public virtual string DownloadResponse(string url)
{
if (_httpClient == null)
_httpClient = new HttpClient();
using (var request = new HttpRequestMessage(HttpMethod.Get, url))
{
var response = _httpClient.SendAsync(request).Result;
return response.Content.ReadAsStringAsync().Result;
}
}
public virtual T GetJsonResponse<T>(string url) where T : class
{
var response = DownloadResponse(url);
return _jsonSerializer.Deserialize<T>(response);
}
public virtual XmlDocument GetXmlResponse(string url)
{
var response = DownloadResponse(url);
var doc = new XmlDocument();
doc.LoadXml(response);
return doc;
}
public virtual string GetXmlProperty(XmlDocument doc, string property)
{
var selectSingleNode = doc.SelectSingleNode(property);
return selectSingleNode != null ? selectSingleNode.InnerText : string.Empty;
}
}
};
@@ -1,4 +1,4 @@
using System.Net;
using System.Net;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Slideshare : EmbedProviderBase
{
public override string ApiEndpoint => "http://www.slideshare.net/api/oembed/2";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Soundcloud : EmbedProviderBase
{
public override string ApiEndpoint => "https://soundcloud.com/oembed";
+2 -1
View File
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Ted : EmbedProviderBase
{
public override string ApiEndpoint => "http://www.ted.com/talks/oembed.xml";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Twitter : EmbedProviderBase
{
public override string ApiEndpoint => "http://publish.twitter.com/oembed";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class Vimeo : EmbedProviderBase
{
public override string ApiEndpoint => "https://vimeo.com/api/oembed.xml";
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Cms.Core.Serialization;
namespace Umbraco.Cms.Core.Media.EmbedProviders
{
// TODO(V10) : change base class to OEmbedProviderBase
public class YouTube : EmbedProviderBase
{
public override string ApiEndpoint => "https://www.youtube.com/oembed";
+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));
}
}
}
@@ -37,5 +37,9 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
[DataMember(Name = "apps")]
public IEnumerable<ContentApp> ContentApps { get; set; }
[DataMember(Name = "membershipProperties")]
public IEnumerable<ContentPropertyDisplay> MembershipProperties { get; set; }
}
}
@@ -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; }
}
}
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
@@ -10,7 +11,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
/// Used to assign user group permissions to a content node
/// </summary>
[DataContract(Name = "contentPermission", Namespace = "")]
public class UserGroupPermissionsSave : IValidatableObject
public class UserGroupPermissionsSave
{
public UserGroupPermissionsSave()
{
@@ -29,6 +30,7 @@ namespace Umbraco.Cms.Core.Models.ContentEditing
[DataMember(Name = "permissions")]
public IDictionary<int, IEnumerable<string>> AssignedPermissions { get; set; }
[Obsolete("This is not used and will be removed in Umbraco 10")]
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{
if (AssignedPermissions.SelectMany(x => x.Value).Any(x => x.IsNullOrWhiteSpace()))
+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>
@@ -0,0 +1,12 @@
using System;
using Umbraco.Cms.Core.Models.Entities;
namespace Umbraco.Cms.Core.Models
{
public interface ITwoFactorLogin: IEntity, IRememberBeingDirty
{
string ProviderName { get; }
string Secret { get; }
Guid UserOrMemberKey { get; }
}
}
@@ -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();

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