Compare commits

...

311 Commits

Author SHA1 Message Date
Mads Rasmussen 244ee646b9 Revert "update content when changing variation"
This reverts commit b487436d93.
2016-04-07 12:45:33 +02:00
Mads Rasmussen b487436d93 update content when changing variation 2016-04-07 12:38:05 +02:00
Mads Rasmussen 321b1a3964 disable autocomplete on editor name input 2016-04-07 11:17:05 +02:00
Mads Rasmussen f6b1971243 disable name input for a marketing variation 2016-04-07 11:05:21 +02:00
Simon Busborg ab1e412b4b Active in quickswitcher 2016-04-07 10:51:39 +02:00
Mads Rasmussen 2c866e8326 add spanish 2016-04-07 10:24:52 +02:00
Mads Rasmussen 433563c10b select first variation 2016-04-06 20:03:49 +02:00
Mads Rasmussen 95b91cb55f a bit fine tuning of selected variation and language 2016-04-06 19:29:29 +02:00
Mads Rasmussen d070b869a3 fix error in css 2016-04-06 16:09:26 +02:00
Mads Rasmussen 82bcb8bb8a Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice 2016-04-06 16:07:49 +02:00
Mads Rasmussen 8cbd0281aa set limit on apps 2016-04-06 16:07:12 +02:00
Simon Busborg 148067f119 apps 2016-04-06 16:01:16 +02:00
Mads Rasmussen 9d79577833 add activity app 2016-04-06 15:05:16 +02:00
Simon Busborg c24918aeb7 standard width on apps 2016-04-06 14:15:10 +02:00
Simon Busborg f7a814714c even spacing between apps 2016-04-06 11:36:34 +02:00
Simon Busborg 3200a7fd1a Splitview close 2016-04-06 11:23:38 +02:00
Mads Rasmussen 7983aedf53 make tabs to apps 2016-04-06 11:22:18 +02:00
Mads Rasmussen c31efa3f54 only show variations for active language + add sortable on variations 2016-04-05 15:16:55 +02:00
Simon Busborg c98a98dd71 Tabs 2016-04-05 15:07:35 +02:00
Mads Rasmussen ee3965521d bring back old tabs markup to enable active state 2016-04-05 14:34:57 +02:00
Mads Rasmussen 3d90c0d3d7 add segments to create variation + fix edit variation 2016-04-05 12:31:00 +02:00
Mads Rasmussen bc60aa1688 remove analytics from content plugins 2016-04-05 11:46:08 +02:00
Mads Rasmussen 5c90043298 hide the split view divider when there is no split view open 2016-04-05 11:44:16 +02:00
Mads Rasmussen 0f784151cb close split view on route change 2016-04-05 09:47:58 +02:00
Mads Rasmussen 681512da8c Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice 2016-04-04 19:04:53 +02:00
Mads Rasmussen b17770d6c7 fake split views 2016-04-04 19:04:36 +02:00
Simon Busborg 745b536f63 Fixed divider 2016-04-04 12:55:08 +02:00
Mads Rasmussen 738289cd78 comment out sync switcher and property overlay 2016-04-01 11:19:13 +02:00
Simon Busborg 77d30e8484 fixed colors 2016-03-30 15:02:53 +02:00
Simon Busborg 347fb3a90d demoed version of splitview (not pretty) 2016-03-30 12:24:01 +02:00
Mads Rasmussen 39bdc1bc78 handle 1sites with 1 language 2016-03-30 09:04:26 +02:00
Simon Busborg a3dcdb159b Removed tags, added tags checkboxes, styling in general for variations 2016-03-29 15:38:50 +02:00
Simon Busborg 9656659ecd overview 2016-03-29 13:46:11 +02:00
Mads Rasmussen d679a4e697 make it possible to fake variation content 2016-03-29 12:18:47 +02:00
Mads Rasmussen c81a034c69 only show variations toggle if there are any variations 2016-03-23 14:23:02 +01:00
Mads Rasmussen a519d38b54 Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice 2016-03-23 14:13:10 +01:00
Mads Rasmussen cf4c09f41f When click on item in variation quick switcher - change context in header 2016-03-23 14:12:57 +01:00
Simon Busborg bd3096c3ec changed quick toggler 2016-03-23 13:49:07 +01:00
Simon Busborg 1bbf104b9f variations overview 2016-03-23 13:41:26 +01:00
Mads Rasmussen 4f1e44d42e get variations from helper service so they are in sync 2016-03-23 13:39:26 +01:00
Simon Busborg fa68a9472b quickswitcher update 2016-03-23 11:54:54 +01:00
Mads Rasmussen efb2b744fc Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice 2016-03-23 11:52:26 +01:00
Mads Rasmussen 9018c4ef79 add functionality to create, edit and delete variations - missing styling + segments 2016-03-23 11:52:04 +01:00
Simon Busborg dfce0aa0cb changed width of container 2016-03-23 08:59:52 +01:00
Mads Rasmussen 131c9a6fe1 move description inline 2016-03-22 16:24:18 +01:00
Mads Rasmussen 555589ef3b change colour on tags + bring back create variation link 2016-03-22 15:10:46 +01:00
Mads Rasmussen b099d35981 Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/components/umb-variations.less
#	src/Umbraco.Web.UI.Client/src/views/components/umb-variations.html
2016-03-22 14:24:03 +01:00
Mads Rasmussen e3bc3091f7 add dynamic data to variations overview + clean up UI + add segments to variations overview 2016-03-22 14:17:20 +01:00
Simon Busborg 320ed93b14 active quick switcher 2016-03-22 13:50:39 +01:00
Simon Busborg c71ce7ef2a changed lang options 2016-03-22 10:59:12 +01:00
Mads Rasmussen c0ea46c9f1 split languages and variations in dropdown. Show selected in header 2016-03-22 10:55:33 +01:00
Mads Rasmussen 533443fd25 remove sidebar on variations 2016-03-22 10:47:00 +01:00
Simon Busborg e76658373f Added lang groups for variations 2016-03-22 10:13:05 +01:00
Mads Rasmussen a77330a592 add a bit a variations toggle styling 2016-03-21 10:39:48 +01:00
Mads Rasmussen 2f5e9ee8c4 change sync off label + smaller font size 2016-03-21 10:01:36 +01:00
Mads Rasmussen f252590a1c Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice 2016-03-18 14:40:23 +01:00
Mads Rasmussen fa4bdac78a style editor overlay label 2016-03-18 14:39:18 +01:00
Simon Busborg e268945077 fixed animate bug 2016-03-18 14:38:04 +01:00
Simon Busborg b428fb2211 fixed search / scrollable area 2016-03-18 14:26:24 +01:00
Mads Rasmussen bfc098e5e0 make change variation work work editor view 2016-03-18 14:09:07 +01:00
Simon Busborg d9b58e80fe added search to variations 2016-03-18 12:40:16 +01:00
Simon Busborg a7a860bbcd fixed dropdown 2016-03-18 12:03:05 +01:00
Mads Rasmussen fa277a4a5d fix styling on dropdown 2016-03-18 11:58:57 +01:00
Mads Rasmussen 7e1df76db3 move dropdown logic 2016-03-18 11:26:46 +01:00
Simon Busborg 9c33e292ae moved component to label 2016-03-18 11:13:49 +01:00
Mads Rasmussen 75edd645c6 add basic functionality to edit content and change which variation to sync content from 2016-03-17 21:31:09 +01:00
Mads Rasmussen 6adfdbf7dd clear variations when a new master i set 2016-03-17 20:30:29 +01:00
Mads Rasmussen 5453d86a46 make sidebar title a little smaller 2016-03-17 20:09:58 +01:00
Mads Rasmussen 6d4146b9c6 add wrappers and title to sidebar 2016-03-17 20:07:57 +01:00
Simon Busborg a93d98933f fixed z-index on buttons 2016-03-17 15:20:34 +01:00
Mads Rasmussen cf28c0ca5e change text and icon on sync toggle 2016-03-17 15:12:56 +01:00
Mads Rasmussen 435434b859 position toggle top 0 and right 0 2016-03-17 15:10:07 +01:00
Mads Rasmussen e93b057a5f make sync button a bit smaller 2016-03-17 15:02:38 +01:00
Simon Busborg e8d167faf0 added get content 2016-03-17 14:42:26 +01:00
Mads Rasmussen ab1322f789 started on dropdown 2016-03-17 12:39:40 +01:00
Simon Busborg 36abb83ff2 moved psuedo element to the property editor markup 2016-03-17 11:54:01 +01:00
Simon Busborg 0d62e62fda changed inactive state 2016-03-17 11:41:38 +01:00
Simon Busborg d25a01d9c9 added overlay to variation picker 2016-03-17 11:22:52 +01:00
Simon Busborg 1da55e4dde Fixed subview editor header 2016-03-17 10:46:08 +01:00
Simon Busborg c346ec1282 search width 2016-03-14 11:06:03 +01:00
Simon Busborg 556d4b4c11 search 2016-03-11 14:07:05 +01:00
Mads Rasmussen 7d0d58f7c2 fix notifications width 2016-03-11 13:53:50 +01:00
Mads Rasmussen a0618f401f Merge remote-tracking branch 'origin/temp-maurice' into temp-maurice 2016-03-11 13:19:48 +01:00
Mads Rasmussen 34645460fb Set position relative to contain absolute elements 2016-03-11 13:19:15 +01:00
Simon Busborg 43b534c3b1 tabs activity 2016-03-11 10:57:44 +01:00
Mads Rasmussen bc29b2e235 copy search functionality to top bar 2016-03-11 10:52:45 +01:00
Simon Busborg d6c226d41a Added navigation to sidebars 2016-03-10 15:29:41 +01:00
Simon Busborg 14d8b634b5 Acitvity feed 2016-03-10 12:45:08 +01:00
Mads Rasmussen c4e41c1df6 add a content wrapper to add padding 2016-03-10 12:20:46 +01:00
Mads Rasmussen 788efeb098 remove horizontal scrollbar in media folders 2016-03-10 11:57:00 +01:00
Mads Rasmussen 71916af49c hide generic properties tab content 2016-03-10 11:56:31 +01:00
Mads Rasmussen 55e62c01e4 hide tab instead of removing it.. now we can save again 2016-03-10 11:43:53 +01:00
Mads Rasmussen fa8dc5ace4 remove console.logs 2016-03-10 11:22:08 +01:00
Simon Busborg 671d99f455 changed menu state 2016-03-10 11:09:51 +01:00
Mads Rasmussen d681a84800 Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice 2016-03-10 10:59:07 +01:00
Mads Rasmussen 440e2a7d56 bring back dashboards 2016-03-10 10:58:45 +01:00
Simon Busborg 2f8ec7bd29 Added more and added sidebar navigation status 2016-03-10 10:58:07 +01:00
Simon Busborg 5105cf890d displaying apps center 2016-03-10 10:04:32 +01:00
Mads Rasmussen 88a0f21328 align sub view header content left and right 2016-03-10 09:58:52 +01:00
Mads Rasmussen cd1ea78825 contain absolute positioned elements inside content 2016-03-10 09:33:57 +01:00
Simon Busborg ca4ff98c5f navigation fluf 2016-03-10 09:18:26 +01:00
Mads Rasmussen 339e1dc94e WIP bring in variation ideas + a couple of placeholder subviews 2016-03-10 09:16:37 +01:00
Mads Rasmussen a84c6e9dff remove generic properties tab 2016-03-10 09:15:29 +01:00
Simon Busborg ba927d1962 fixed tree navigation 2016-03-09 20:40:34 +01:00
Simon Busborg ee30f10357 Dropdown 2016-03-09 20:21:14 +01:00
Simon Busborg 478fe51651 Added tree toggler 2016-03-09 15:21:43 +01:00
Mads Rasmussen 5694beafef add subviews to content 2016-03-08 14:49:04 +01:00
Mads Rasmussen 2a1e9e30ae add generic properties icon 2016-03-07 10:01:33 +01:00
Mads Rasmussen ef5bf29b07 remove background color on footer - wireframe style 2016-03-07 09:58:42 +01:00
Mads Rasmussen 7b521e6857 um tree nav - set overflow to auto 2016-03-07 09:51:35 +01:00
Mads Rasmussen 4135e30834 add tabs to media 2016-03-05 14:03:16 +01:00
Mads Rasmussen 2b1bf0b966 add scroll to tree 2016-03-04 18:42:06 +01:00
Mads Rasmussen 6bc2ce19f5 hide search in tree 2016-03-04 18:13:21 +01:00
Mads Rasmussen 67efc1906a add editor toolbar directive - move tabs outside header for content section 2016-03-04 18:12:53 +01:00
Mads Rasmussen 8b62d09e64 remove background from editor header - wireframe look 2016-03-04 18:09:34 +01:00
Mads Rasmussen 5c6bbfb423 remove background + add border to navigation bar - wireframe look 2016-03-04 18:09:04 +01:00
Mads Rasmussen 97ff32245d fix navigation height 2016-03-04 14:43:56 +01:00
Simon Busborg b7549ad644 Fixed second header 🌮 2016-03-04 11:31:56 +01:00
Mads Rasmussen 802fe45614 Merge branch 'temp-maurice' of https://github.com/umbraco/Umbraco-CMS into temp-maurice 2016-03-04 11:05:06 +01:00
Mads Rasmussen 253a4520b0 tighten up tree a bit 2016-03-04 11:04:41 +01:00
Simon Busborg b6877dc4ce fixed header size 2016-03-04 11:03:50 +01:00
Simon Busborg 27a031ea12 Updated recess – fixed content scroll 2016-03-04 10:59:19 +01:00
Mads Rasmussen 0e2212bd40 less padding and smaller font size on top navigation 2016-03-04 10:34:18 +01:00
Simon Busborg 8ee414793f flex - content 2016-03-04 10:26:33 +01:00
Simon Busborg 1dddc06ae7 added tree 🌳 2016-03-03 16:12:07 +01:00
Simon Busborg 3d253b79e4 Added very slick navigation 🔥 2016-03-03 14:26:37 +01:00
Mads Rasmussen e7542bc455 add functionality to top bar navigation - needs styling 2016-03-03 12:56:38 +01:00
Simon Busborg 43ab5a8e2e Nuked interface 2016-03-03 10:38:01 +01:00
Sebastiaan Janssen 05c35b22bd Merge pull request #1148 from umbraco/temp-U4-7040
U4-7040 - Fix bug with permissions cache refresh
2016-03-02 15:03:47 +01:00
Mads Rasmussen f6318fb6f3 Merge pull request #1147 from lars-erik/fix-u4-8082-nested-forms-and-submit-bug
Fixes: U4-8082 New overlays post forms in IE / Edge
2016-02-26 10:08:51 +01:00
Stephan 17b29357d4 U4-7040 - Fix bug with permissions cache refresh 2016-02-25 17:43:38 +01:00
Lars-Erik Aabech 57a766098d Removed nested form and changed buttons to type="button" + action instead of ng-submit on form. 2016-02-25 16:04:37 +01:00
Simon Busborg f78cb8a970 Merge pull request #1119 from jchurchley/dev-v7
Fixes U4-7963 Listview columns not evenly spaced in Chrome
2016-02-25 14:52:17 +01:00
Sebastiaan Janssen def276de01 Merge pull request #1143 from umbraco/temp-U4-8027
U4-8027 - fix ApplicationContext request cache (was null cache)
2016-02-25 10:46:31 +01:00
Stephan 293b170a56 U4-8027 - fix ApplicationContext request cache (was null cache) 2016-02-24 14:16:48 +01:00
Warren Buckley 6ba4efc416 Merge pull request #1142 from umbraco/temp-U4-7570
Temp u4 7570
2016-02-24 11:12:59 +00:00
Simon Busborg 981fb39af6 Fixed crop slider 2016-02-24 09:14:13 +01:00
Sebastiaan Janssen c64f6f894e U4-8024 Unable to use MvcBuildViews since 7.4.0 upgrade because 'umbraco.cms.presentation.create.controls.content' has been removed
Removes files for which the codebehind no longer exists
2016-02-23 17:23:55 +01:00
Simon Busborg 3e73c2da43 Fixed width of cropper 2016-02-23 16:31:10 +01:00
Mads Rasmussen 26a8d23039 Fixes: U4-8063 Content type editor: Keyboard shortcut overview should close on escape 2016-02-23 15:09:27 +01:00
Mads Rasmussen 2632ef740c Fixes: U4-7570 Hide image, focal point and remove link until image has loaded 2016-02-23 13:55:05 +01:00
Sebastiaan Janssen f024dba864 Merge pull request #1139 from umbraco/temp-U4-8017
U4-8017 - fix issues with MySql InitColumnTypeMap
2016-02-22 19:05:41 +01:00
Stephan 9758851a4b Fix SqlCeSyntaxProviderTests 2016-02-22 18:55:49 +01:00
Sebastiaan Janssen 38e56f0fea Might make the build server happy? 2016-02-22 17:57:44 +01:00
Sebastiaan Janssen 462baf91e4 Merge pull request #1137 from umbraco/temp-U4-7914
U4-7914 - add PublishedContentRequest.Preparing event
2016-02-22 17:45:50 +01:00
Stephan f1366c7d29 U4-8017 - fix issues with MySql InitColumnTypeMap 2016-02-19 13:33:11 +01:00
Warren Buckley baaa9340e4 Merge pull request #1131 from umbraco/temp-U4-7918
Fixes U4-7918 Make icon picker for document type and list views consistent
2016-02-19 12:03:27 +00:00
Mads Rasmussen 183a5b5c43 U4-7472: fix macro parameter column width 2016-02-19 09:52:29 +01:00
Mads Rasmussen 1a0c095f40 Merge pull request #932 from engern/MacroParamSortOrder
Fixes U4-7472 - Should be possible to sort macro parameters
2016-02-19 09:27:27 +01:00
Stephan ffada74aa4 Improve RenderModelBinder error msg when same type, different assemblies 2016-02-18 16:04:45 +01:00
Mads Rasmussen f2fc70f731 Merge pull request #982 from abryukhov/patch-4
U4-7616 - Nodes sort dialog - additional date formats
2016-02-18 14:19:06 +01:00
Simon Busborg 866b0113e7 Fixes grunt break 2016-02-18 12:43:09 +01:00
Simon Busborg 06c49daca7 Merge branch 'dev-v7-login-retina-umbraco-logo' of git://github.com/bjarnef/Umbraco-CMS into bjarnef-dev-v7-login-retina-umbraco-logo
# Conflicts:
#	src/Umbraco.Web.UI.Client/src/less/pages/login.less
2016-02-18 12:42:17 +01:00
Stephan 9293008b94 U4-7914 - add PublishedContentRequest.Preparing event 2016-02-18 11:36:48 +01:00
Mads Rasmussen dbb9386d22 Fixes: U4-7660 [7.4 Fix] Added a default value to the Umbaco.TrueFalse datatype. Thanks Jeremy Pyne 2016-02-18 11:20:04 +01:00
Mads Rasmussen 51ed441b85 Merge branch 'u4-5123' of https://github.com/AndyButland/Umbraco-CMS into AndyButland-u4-5123
# Conflicts:
#	src/Umbraco.Web/PropertyEditors/ListViewPropertyEditor.cs
2016-02-18 10:00:22 +01:00
Simon Busborg f566fec665 Merge branch 'Acentrage-U4-6700' into dev-v7 2016-02-17 15:26:51 +01:00
Mads Rasmussen 9d92781a97 Merge pull request #949 from kgiszewski/dev-v7
Fix u4-7534
2016-02-17 15:04:14 +01:00
Simon Busborg 123bfe5afe Fixed merge conflict 2016-02-17 14:31:30 +01:00
Shannon Deminick 3383d2a2ac Merge pull request #1135 from umbraco/temp-U4-7601
U4-7601 - filter published content by composition
2016-02-17 13:31:07 +01:00
Sebastiaan Janssen d9f38a20af Merge remote-tracking branch 'origin/7.3.8' into dev-v7 2016-02-17 13:28:52 +01:00
Sebastiaan Janssen a91669abc0 Fixes unit tests 2016-02-17 13:28:11 +01:00
Stephan cc6dfd0c55 U4-7601 - refactor PR, case insensitive 2016-02-17 12:55:40 +01:00
Stephan d4802fcef6 Merge branch 'feature/is-composed-of' of https://github.com/AndyButland/Umbraco-CMS into temp-U4-7601 2016-02-17 12:44:18 +01:00
Sebastiaan Janssen 35c3208b77 Fixes merge error 2016-02-17 12:30:42 +01:00
Shannon 3b9db8a92f tries fixing test for appveyor 2016-02-17 12:25:40 +01:00
Sebastiaan Janssen 7debe17c58 Merge remote-tracking branch 'origin/7.3.8' into dev-v7
Conflicts:
	src/Umbraco.Web.UI/packages.config
2016-02-17 11:56:24 +01:00
Sebastiaan Janssen 1bfc1229bd Merge pull request #1134 from umbraco/temp-738-U4-7996
Upgrade SQL CE to hopefully fix SQL CE data loss bug
2016-02-17 11:54:25 +01:00
Shannon f941456af6 fixes namespace 2016-02-17 11:48:32 +01:00
Shannon 828e88e6f2 Merge remote-tracking branch 'origin/7.3.8' into dev-v7
Conflicts:
	src/Umbraco.Tests/Web/Mvc/UmbracoViewPageTests.cs
	src/Umbraco.Web/Mvc/UmbracoViewPageOfTModel.cs
2016-02-17 11:46:33 +01:00
Sebastiaan Janssen 3d6fd2d785 Updates to SQL CE 4.0.0.1 2016-02-17 11:44:33 +01:00
Shannon e56881abc6 adds unit tests for new ext methods 2016-02-17 11:21:15 +01:00
Shannon d32991c30a re-organizing some namespaces for tests 2016-02-17 10:59:48 +01:00
Shannon 8758f9649b checks for null before assigning culture 2016-02-17 10:57:20 +01:00
Sebastiaan Janssen 07902e840f Merge pull request #1133 from rodyvansambeek/patch-2
Changed allow upload whitelist to disallow extensions
2016-02-17 10:53:05 +01:00
rodyvansambeek e807ee7d64 Changed allow upload whitelist to disallow extensions
It is not possible to upload files in 7.4.0 with an extension different then the imageTypes in the Umbraco.Sys.ServerVariables.umbracoSettings.imageFileTypes, in the single upload this was changed after beta 7.4.0-beta1 to Umbraco.Sys.ServerVariables.umbracoSettings.disallowedUploadFiles. However the change was not added to the drag-drop-uploader. This fixes that.
2016-02-17 10:30:57 +01:00
Shannon 6f0f1ab2c3 fixes wrong constant used 2016-02-17 10:22:37 +01:00
Shannon cd28240172 Moves strings to constants, adds ControllerContextExtensions to get the UmbracoContext from the hierarchy of ControllerContext's, changes RenderModelBinder to use this method to get the UmbracoContext, changes UmbracoViewPageOfTModel to use this method to get the UmbracoContext, adds RouteDataExtensions to get the UmbracoContext from routedata, adds extension methods on the HttpContext to get the UmbracoContext from it.
Conflicts:
	src/Umbraco.Web/Mvc/RenderModelBinder.cs
2016-02-17 10:22:22 +01:00
Sebastiaan Janssen 85ca85fd42 Merge pull request #1129 from umbraco/temp-U4-7577
U4-7577 Remove dependency on UmbracoContext in CreateServiceContext /…
2016-02-16 17:32:38 +01:00
Sebastiaan Janssen 4a10178697 Merge pull request #1123 from umbraco/temp-U4-8000
U4-8000 NullReferenceException in RenderModelBinder when performing an async controller action
2016-02-16 17:28:49 +01:00
Shannon ccba7f14a0 tries fixing test for appveyor 2016-02-16 16:26:21 +01:00
Sebastiaan Janssen b797e0d0c5 Merge pull request #1127 from umbraco/temp-U4-7953
U4-7953 Creating Templates via new DocType have camelCased aliases, b…
2016-02-16 15:39:35 +01:00
Sebastiaan Janssen 8220b033f3 Merge pull request #1125 from umbraco/temp-U4-7954
U4-7954 Error upgrading database to 7.4.0 - [ FK_cmsPropertyTypeGroup…
2016-02-16 15:20:53 +01:00
Shannon 6fffc8b45e U4-7577 Remove dependency on UmbracoContext in CreateServiceContext / RequestLifespanMessagesFactory 2016-02-16 15:07:42 +01:00
Shannon b550b3dde3 Merge remote-tracking branch 'origin/7.3.8' into dev-v7 2016-02-16 14:52:14 +01:00
Shannon 7002291c41 adds tests for ShouldAuthenticateRequest for app configurations 2016-02-16 14:51:15 +01:00
Shannon 51bbf7ceb5 U4-7494 Installation Fails for 7.3.3 - Intermittent - Value cannot be null. Parameter name: sqlSyntax 2016-02-16 14:22:59 +01:00
Shannon 93d9f09fcc U4-7953 Creating Templates via new DocType have camelCased aliases, but from the Template section have PascalCase aliases 2016-02-16 14:20:29 +01:00
Sebastiaan Janssen 42a68cb770 U4-7494 Installation Fails for 7.3.3 - Intermittent - Value cannot be null. Parameter name: sqlSyntax 2016-02-16 14:00:28 +01:00
Shannon 1c2dec00fc bumps version 2016-02-16 13:32:03 +01:00
Shannon fcea4c7fdd Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-02-16 13:30:21 +01:00
Shannon b6ef4bf6b5 Merge branch '7.3.8' into dev-v7
Conflicts:
	build/UmbracoVersion.txt
	src/SolutionInfo.cs
	src/Umbraco.Core/Configuration/UmbracoVersion.cs
	src/Umbraco.Core/Umbraco.Core.csproj
	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
2016-02-16 13:29:59 +01:00
Shannon 82297a6ff1 U4-7929 Label datatype strips leading zeros 2016-02-16 13:23:37 +01:00
Warren Buckley 3bf79f0a23 Merge pull request #1102 from umbraco/temp-U4-7837
Fixes: U4-7837 Changing document type should refresh the current node
2016-02-16 12:22:56 +00:00
Shannon 3f5aa3aa2b U4-7954 Error upgrading database to 7.4.0 - [ FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id ] doesn't exist 2016-02-16 12:17:21 +01:00
Shannon cc5ac1a84c bumps version 2016-02-16 11:57:10 +01:00
Shannon 6373add383 U4-7922 Preview is not working 2016-02-16 11:53:54 +01:00
Shannon 180099b718 U4-7890 XSLT Macro's not working - "Cannot use this obsoleted overload when the current provider" 2016-02-16 11:52:16 +01:00
Shannon 65f15125e1 U4-7939 - fix routes cache 2016-02-16 11:48:09 +01:00
Shannon f026201c68 fixes wrong constant used 2016-02-16 11:35:38 +01:00
Shannon 640b2c0ee0 Moves strings to constants, adds ControllerContextExtensions to get the UmbracoContext from the hierarchy of ControllerContext's, changes RenderModelBinder to use this method to get the UmbracoContext, changes UmbracoViewPageOfTModel to use this method to get the UmbracoContext, adds RouteDataExtensions to get the UmbracoContext from routedata, adds extension methods on the HttpContext to get the UmbracoContext from it. 2016-02-16 11:17:47 +01:00
Shannon Deminick bef7ad1196 Merge pull request #1120 from lars-erik/fix-silly-long-grid-translation
Grid translations
2016-02-16 10:12:02 +01:00
Shannon Deminick 33c6c8b473 Merge pull request #1121 from umbraco/temp-U4-7950
Fixes another reported bug for U4-7950
2016-02-16 10:05:09 +01:00
Sebastiaan Janssen 0a26e482aa Fixes another reported bug for U4-7950 2016-02-16 09:01:28 +01:00
Lars-Erik Aabech d0de54e2d3 Grid translations:
Fixed a silly long translation of "Add content".
Added missing keys.
Fixed a few spelling mistakes.
2016-02-16 08:50:07 +01:00
Stephan cbdabaa3b1 Merge pull request #1118 from umbraco/temp-U4-7950
Use CultureInfo.CurrentCulture if UmbracoContext.PublishedContentRequ…
2016-02-15 15:21:00 +01:00
John Churchley 65c97040b3 Fix Chrome issue listview columns not evenly spaced
http://issues.umbraco.org/issue/U4-7963#
2016-02-15 12:17:13 +00:00
Simon Busborg a33d7da211 Fixes: U4-7945 Grid's Reorder bar covers content
http://issues.umbraco.org/issue/U4-7945
2016-02-15 12:55:44 +01:00
Sebastiaan Janssen f31b6d9c2c Use CultureInfo.CurrentCulture if UmbracoContext.PublishedContentRequest is not available 2016-02-15 08:27:07 +01:00
Sebastiaan Janssen 367c945b42 Merge pull request #1117 from s-moon/patch-1
Minor text changes.
2016-02-14 11:08:19 +01:00
Stephen Moon b962fcdbc3 Minor text changes. 2016-02-13 21:31:13 +00:00
Simon Busborg 0f8a13d60a 7 in a row instead of 8, bumped font-size on icons to 30 2016-02-12 10:17:42 +01:00
Simon Busborg 5c1502c806 Removes umb-control-group when no icons displayed 2016-02-12 10:13:30 +01:00
Simon Busborg 3cdebf4427 Fixes U4-7918 Make icon picker for document type and list views consistent 2016-02-12 09:38:37 +01:00
Shannon e4e7c18460 Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-02-11 18:07:42 +01:00
Shannon 5f246c533c Fixes issue when there are zero instructions in the db table and we've never synced before, in this case it will always cold boot because it will never saved the last synced, in this scenario also the indexes will not build because we've cleared the collection before they can run. 2016-02-11 18:07:31 +01:00
Sebastiaan Janssen 5323543ec0 Merge pull request #1115 from abryukhov/patch-3
Update UI language ru.xml
2016-02-11 17:36:28 +01:00
Shannon d44542694b Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-02-11 17:31:49 +01:00
Shannon 016a14e5c7 Fixes the image cropper where if you don't have any crops, save an image to a content item, then when you go create a new crop in the data type it wouldn't show up on the front-end or in the back office. 2016-02-11 17:31:37 +01:00
Alexander Bryukhov 52f4dfec80 Update UI language ru.xml
According new keys added to the 7.4.0 nightly build 164 (models builder keys)
2016-02-11 22:29:33 +06:00
Sebastiaan Janssen 4f6e023d77 Make sure that everybody working on the source actually gets these assembly references in web.config 2016-02-11 17:11:02 +01:00
Shannon 5e46750cc4 nuspec and version 2016-02-11 16:34:15 +01:00
Shannon d028b133f5 nuspec updated with MB 2016-02-11 16:27:58 +01:00
Shannon ca6821104b updated to MB 3.0.0 final 2016-02-11 16:26:21 +01:00
Shannon 1ea8c8280c Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-02-11 15:54:10 +01:00
Shannon 17ff952b52 Fixes the URL creating for media in the back office to use an IMedia instead of published media (since it's not published yet at the time) 2016-02-11 15:54:00 +01:00
Sebastiaan Janssen b4f64975a2 Merge pull request #1113 from umbraco/temp-U4-7936
U4-7936 Clicking the Recycle Bin shows "Session expired" login screen
2016-02-11 15:48:24 +01:00
Sebastiaan Janssen 1d8a5cf795 Merge pull request #1114 from umbraco/temp-u4-7729
U4-7729 7.4.0-Beta Cannot drag and Drop PDF on Media Section
2016-02-11 15:34:41 +01:00
Shannon dccee93700 fixes up some null checks and fixes up some string null checks - casting XElement to (string) explicitly avoids null reference exceptions when the XElement isn't actually present. 2016-02-11 15:11:11 +01:00
Per Ploug efeafb4471 U4-7729 7.4.0-Beta Cannot drag and Drop PDF on Media Section 2016-02-11 14:42:47 +01:00
Shannon Deminick 496efde5b3 Merge pull request #1093 from jonrandahl/patch-1
Update PackagingService.cs
2016-02-11 14:18:23 +01:00
Shannon Deminick 2b56854652 Merge pull request #1112 from umbraco/temp-U4-7939
U4-7939 - fix routes cache
2016-02-11 14:15:13 +01:00
Shannon 04e1d8c2bd U4-7936 Clicking the Recycle Bin shows "Session expired" login screen 2016-02-11 14:04:14 +01:00
Simon Busborg c7a7dd6ed5 Fixed disabled buttons 2016-02-11 13:12:13 +01:00
Sebastiaan Janssen 1eedbba97a Merge pull request #920 from darrenferguson/dev-v7
change the text "Reload nodes" to just "Reload" my editors don't know…
2016-02-11 12:04:45 +01:00
Stephan d6b46e7e78 U4-7939 - fix routes cache 2016-02-11 11:53:03 +01:00
Shannon 1b03a8f06c Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7 2016-02-11 11:51:11 +01:00
Shannon 726bef1edf adds notes 2016-02-11 11:50:59 +01:00
Sebastiaan Janssen 33aa04bb2f Updates ImageProcessor.Web 2016-02-11 10:35:52 +01:00
Rune Hem Strand a79333080a Merge pull request #1111 from umbraco/U4-7933
Fixes issue U4-7933
2016-02-11 09:49:09 +01:00
Sebastiaan Janssen d1f513df69 Updates ImageProcessor 2016-02-10 17:09:40 +01:00
Shannon 54ddbc264d Fixes U4-7906 2016-02-10 16:39:05 +01:00
Shannon 89f6089f8e U4-7873 - fix GetCulture issue with languages 2016-02-10 16:22:06 +01:00
Shannon Deminick cf0b72fd77 Merge pull request #1026 from christofur/U4-7763
U4-7763 Fix - added mock and references required for 'dev' Grunt task
2016-02-10 15:54:59 +01:00
Niels Hartvig 2c32530701 Too fast, removed the extra amp 2016-02-10 15:47:52 +01:00
Niels Hartvig d6d945a96e Adds animationprocessmode=false to avoid issues with anim gifs 2016-02-10 15:46:18 +01:00
Shannon Deminick 4b6aee7fd9 Merge pull request #1109 from abryukhov/patch-3
Update UI language ru.xml
2016-02-10 15:44:42 +01:00
Niels Hartvig 8bbeeb2eaf Fixes issue 7933 2016-02-10 15:38:49 +01:00
Shannon Deminick 5648617809 Merge pull request #1098 from umbraco/temp-U4-7891
U4-7891 Image Cropper needs a property value converter to return a strongly typed model, json or a string when requested.
2016-02-10 15:32:55 +01:00
Shannon 0a33b37f2d Fixes issue with U4-7695 and not merging crop values with pre-values properly 2016-02-10 15:31:04 +01:00
Sebastiaan Janssen 157bf0d1eb Include modelsbuilder App_Plugins files in csproj so that the build actually includes them 2016-02-10 14:57:41 +01:00
Shannon 2721c5cb12 adds dynamic caseinsensitive support for the image cropper model 2016-02-10 14:54:00 +01:00
Shannon fd984bd613 Ensures media.Url works properly 2016-02-10 14:53:58 +01:00
Shannon fe0ed2ceea Adds some notes and ensures that the ImageCropperValueConverter shadows the correct one. 2016-02-10 14:53:57 +01:00
Shannon 0829bae5b2 Fixes TextStringValueConverter to include the text box and multi-textbox (since it's like that in the Core one that this overrides), adds new converter for Image cropper including ToString converter & custom type converter to convert from the strongly typed object to JObject, adds test to support this, adds equatable methods for the strongly typed model so it can be easily compared. Ensures that the webboot manager does not include the core value converter for image cropper. 2016-02-10 14:53:56 +01:00
Stephan c3c1567c2e Merge pull request #1100 from umbraco/temp-U4-7881
U4-7881 - fix errors with compositions
2016-02-10 14:53:45 +01:00
Shannon 4a8b59bdfa putting back in ContentTypeId on PropertyTypeDisplay, turns out this IS used when we remove a composition, we need to know which properties are related to which type. have also fixed another potential bug regarding compositions + generic properties, before we were not setting the ContentTypeId correct for a composition property type on the generic properties tab. 2016-02-10 14:34:33 +01:00
Shannon af543c56ec moves model to correct namespace 2016-02-10 13:31:36 +01:00
Claus 4113def0b6 Fixes: U4-7881 version 7.4 beta - cannot add composition doctype to a doctype that has already been saved 2016-02-10 13:08:36 +01:00
Shannon Deminick c346e62176 Merge pull request #1108 from umbraco/temp-U4-7799
Fixes: U4-7799 ModelsBuilder button in Content Type Editor should sav…
2016-02-10 13:05:38 +01:00
Sebastiaan Janssen 94fdbb1983 U4-7669 Update Newtonsoft.Json dependency to v8.0.1 from v6.0.5 2016-02-10 13:04:50 +01:00
Shannon f32e688c1a Fixes the MB re-generate button - this will only be shown when the models are out of date. 2016-02-10 13:04:04 +01:00
Mads Rasmussen 0303196f42 show Ulog error message when models builder fails 2016-02-10 11:47:01 +01:00
Mads Rasmussen c8faf17017 Fixes: U4-7799 ModelsBuilder button in Content Type Editor should save the current content type 2016-02-10 11:47:00 +01:00
Sebastiaan Janssen b2cba310b9 U4-7720 Media grid doesn't display preview for animated gif
In preparation of an updated ImageProcessor build, everything that displays animated gifs in the backoffice can run into this issue, so we show the first frame only everywhere (better than just a broken image)
2016-02-10 11:39:00 +01:00
Sebastiaan Janssen 95522afda8 Merge pull request #1110 from umbraco/temp-U4-7925
U4-7925 Add dependency injection to Umbraco.Web.Trees.TreeController*
2016-02-10 10:57:15 +01:00
Shannon 1b84e33392 reinstall the RC2 version 2016-02-10 10:43:41 +01:00
Shannon 065ed5ed78 updates nuspec 2016-02-10 10:28:57 +01:00
Shannon 9e931b84db U4-7925 Add dependency injection to Umbraco.Web.Trees.TreeController* 2016-02-10 10:26:09 +01:00
Shannon be449a96f7 updates to MB rc2 2016-02-10 10:26:08 +01:00
Alexander Bryukhov a22bfb927a Update UI language ru.xml
According new keys added to the 7.4.0 nightly build 162
2016-02-09 22:18:11 +06:00
Sebastiaan Janssen 5b92b30f64 Don't include the uninstall file in nuspec, it's missing so the package won't build 2016-02-09 17:16:04 +01:00
Sebastiaan Janssen 5e8200ecb2 U4-7909 7.4-rc1 is missing references because it's using portable class libraries now
#U4-7909 Fixed
2016-02-09 17:10:43 +01:00
Sebastiaan Janssen 9b5ea3da21 Can't have an uninstall as it runs during Update-Package, removing configuration settings like umbracoConfigurationStatus triggering the fresh install screen all user settings are also reverted :/ 2016-02-09 17:10:14 +01:00
Sebastiaan Janssen d495b96434 U4-7924 NuGet web.config transform changes targetFramework 2016-02-09 16:29:20 +01:00
Sebastiaan Janssen 79edf81434 Just whitespace, formatting document 2016-02-09 16:00:02 +01:00
Sebastiaan Janssen b3620f1ca4 U4-7924 NuGet web.config transform removes <codedom>
#U4-7924 Fixed
2016-02-09 15:39:48 +01:00
Stephan b6a9734755 Fix ModelsBuilder integration 2016-02-09 11:46:26 +01:00
Shannon c4cedaddd2 Merge remote-tracking branch 'origin/master-v7' into dev-v7 2016-02-09 11:00:57 +01:00
Shannon b5a2b3dbbd U4-7922 Preview is not working 2016-02-09 10:56:15 +01:00
Mads Rasmussen dc4266852f Fixes: U4-7915 7.4 RC1: Cannot change grid background 2016-02-09 09:57:41 +01:00
Simon Busborg 881e8daafd Merge pull request #1104 from abryukhov/patch-3
Update UI language ru.xml
2016-02-08 18:51:20 +01:00
Claus 54c1d25296 Fixes: U4-6407 Change Document Type feature on a node doesn't support compositions 2016-02-08 14:39:16 +01:00
Mads Rasmussen 624d3a9b82 fixes: U4-7905 val-highlight directive not highlighting error fields (red border) in 7.4.0 2016-02-08 13:35:59 +01:00
Mads Rasmussen d46d23b372 Fixes: U4-7732 Grid changes do not trigger Unsaved Changes notification 2016-02-08 12:07:45 +01:00
Mads Rasmussen aeba68782c fixes: U4-7903 Using shortcut for "add property" removes "add property"-field for other tabs in document type editor && U4-7904 Add property using shortcut - submit button text is missing 2016-02-08 10:54:58 +01:00
Mads Rasmussen ac60c63104 Fixes: U4-7900 The new content type editor: If you hit save while it generates an alias, the alias will be generatingAlias 2016-02-08 10:20:09 +01:00
Claus 6e0e48b6e4 Merge pull request #1103 from arknu/U4-7819
U4-7819: Use correct messages when saving Media and Member types
2016-02-08 09:24:42 +01:00
Alexander Bryukhov 0ea15ae22e Update UI language ru.xml
According new / changed keys of 7.4 nightly build 161
2016-02-07 11:37:06 +06:00
Asbjørn Riis-Knudsen 54548ffc68 U4-7819: Use correct messages when saving Media and Member types 2016-02-06 17:34:36 +01:00
Claus fdc50f0635 Merge pull request #1101 from KevinJump/dev-v7-GetContent/MediaContainer-Fix
Fix GetContentTypeContainer and GetMediaTypeContainer
2016-02-05 15:15:56 +01:00
Claus 44f2a9e96f Fixes: U4-7837 Changing document type should refresh the current node 2016-02-05 14:37:01 +01:00
Kevin Jump 11743ea322 Fix GetContentTypeContainer and GetMediaTypeContainer to use correct guid
updated to use DocumentTypeContainerGuid,  MediaTypeContainerGuid
contstants in calls.
2016-02-05 13:20:10 +00:00
Simon Busborg 4d74ec7785 Makes editor types tabs accessible. 2016-02-05 11:49:41 +01:00
Sebastiaan Janssen aa704a2065 Umbraco.ModelsBuilder.AspNet.dll is no longer needed 2016-02-05 11:28:12 +01:00
Mads Rasmussen 08844ea098 close user dialog when clicking on edit, history links and logout 2016-02-05 11:08:34 +01:00
Claus 3449b1efd3 Toggle password fields after successfully changing the password. 2016-02-05 10:43:37 +01:00
Claus 00d012162f Added a bunch of missing translations in user overlay. 2016-02-05 10:38:15 +01:00
Jon R. Humphrey 8b4d34a1e8 Update PackagingService.cs
I've made the changes to the code after running into the "sequence contains no matching element" error in my Starter Kit package install. We knew that there were no calls to .First()., .Last(), or .Single() in our code based on search results and checking for this call, however we were able to deduce that the issue was that we were including a new ImageCropper DataType without values based on Jeavon's [example:] [https://umbraco.com/follow-us/blog-archive/2014/5/30/developing-a-website-with-responsive-images-using-the-umbraco-v714-image-cropper/]

I know it's a simple fix but if it helps anyone else not run into the same thing then that's perfect!

Thank you for all your hard work on Umbraco, maybe someday I can do more!
2016-02-03 13:21:36 +00:00
Chris Perks 698617dc60 Added mock for externalLoginInfo, and dependency references required to run 'dev' Grunt task 2016-01-18 14:41:35 +00:00
Alexander Bryukhov ae85b7bf2b Nodes sort dialog - adding date formats
Adding dates processing for 'dd.MM.yyyy' formats
2015-12-28 23:00:08 +06:00
AndyButland b52c480da3 Added IPublishedContent extension method for filtering nodes based on composition alias
Created unit test for IsComposedOf
2015-12-22 16:27:12 +01:00
kgiszewski dada91f006 Fix u4-7534 2015-12-14 13:35:46 -05:00
engern 348694d9d4 Use same color as the rest 2015-11-29 12:22:22 +01:00
engern 855e3b3dcc Add the possibility to sort the macro parameters 2015-11-29 12:06:19 +01:00
engern 5a8ea4aa41 Merge branch 'dev-v7' of https://github.com/engern/Umbraco-CMS into dev-v7 2015-11-29 09:38:36 +01:00
engern 4bd465f666 Merge remote-tracking branch 'refs/remotes/umbraco/dev-v7' into dev-v7 2015-11-29 09:38:20 +01:00
Tommy Enger ad591c07cf Merge pull request #1 from umbraco/dev-v7
Update from original
2015-11-29 09:37:54 +01:00
Darren Ferguson 1cd00cb6f6 change the text "Reload nodes" to just "Reload" my editors don't know what a node is! 2015-11-20 18:11:13 +00:00
bjarnef cd3aaa47ca Add retina version of Umbraco logo in login screen 2015-11-19 00:25:05 +01:00
AndyButland a05cc03254 Allows position of the list view child items tab to be positioned within the tab list 2015-11-15 21:18:21 +01:00
285 changed files with 8096 additions and 2699 deletions
+5 -5
View File
@@ -15,11 +15,11 @@ If you're interested in making changes to Belle make sure to read the [Belle Rea
**More than 177,000 sites trust Umbraco**
For the first time on the Microsoft platform a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box. It's a developers dream and your users will love it too.
For the first time on the Microsoft platform, there is a free user and developer friendly CMS that makes it quick and easy to create websites - or a breeze to build complex web applications. Umbraco has award-winning integration capabilities and supports ASP.NET MVC or Web Forms, including User and Custom Controls, out of the box. It's a developer's dream and your users will love it too.
Used by more than 177,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)) you can be sure that the technology is proven, stable and scales.
Used by more than 177,000 active websites including [http://daviscup.com](http://daviscup.com), [http://heinz.com](http://heinz.com), [http://peugeot.com](http://peugeot.com), [http://www.hersheys.com/](http://www.hersheys.com/) and **The Official ASP.NET and IIS.NET website from Microsoft** ([http://asp.net](http://asp.net) / [http://iis.net](http://iis.net)), you can be sure that the technology is proven, stable and scales.
To view more examples please visit [http://umbraco.com/why-umbraco/#caseStudies](http://umbraco.com/why-umbraco/#caseStudies)
To view more examples, please visit [http://umbraco.com/why-umbraco/#caseStudies](http://umbraco.com/why-umbraco/#caseStudies)
## Downloading ##
@@ -35,6 +35,6 @@ If you want to contribute back to Umbraco you should check out our [guide to con
## Found a bug? ##
Another way you can contribute to Umbraco is by providing issue reports, for information on how to submit an issue report refer to our [online guide for reporting issues](http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature).
Another way you can contribute to Umbraco is by providing issue reports. For information on how to submit an issue report refer to our [online guide for reporting issues](http://our.umbraco.org/contribute/report-an-issue-or-request-a-feature).
To view existing issues please visit [http://issues.umbraco.org](http://issues.umbraco.org)
To view existing issues, please visit [http://issues.umbraco.org](http://issues.umbraco.org).
+2 -2
View File
@@ -175,8 +175,8 @@
<!-- Copy SQL CE -->
<ItemGroup>
<SQLCE4Files
Include="..\src\packages\SqlServerCE.4.0.0.0\**\*.*"
Exclude="..\src\packages\SqlServerCE.4.0.0.0\lib\**\*;..\src\packages\SqlServerCE.4.0.0.0\**\*.nu*"
Include="..\src\packages\SqlServerCE.4.0.0.1\**\*.*"
Exclude="..\src\packages\SqlServerCE.4.0.0.1\lib\**\*;..\src\packages\SqlServerCE.4.0.0.1\**\*.nu*"
/>
</ItemGroup>
+2 -2
View File
@@ -32,8 +32,8 @@
<dependency id="AutoMapper" version="[3.0.0, 3.1.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 9.0.0)" />
<dependency id="Examine" version="[0.1.68, 1.0.0)" />
<dependency id="ImageProcessor" version="[2.3.2, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.5.1, 5.0.0)" />
<dependency id="ImageProcessor" version="[2.3.3, 3.0.0)" />
<dependency id="ImageProcessor.Web" version="[4.5.3, 5.0.0)" />
<dependency id="semver" version="[1.1.2, 2.0.0)" />
<dependency id="UrlRewritingNet" version="[2.0.7, 3.0.0)" />
<dependency id="Markdown" version="[1.14.4, 2.0.0)" />
+2 -3
View File
@@ -16,8 +16,8 @@
<tags>umbraco</tags>
<dependencies>
<dependency id="UmbracoCms.Core" version="[$version$]" />
<dependency id="Newtonsoft.Json" version="[6.0.5, 7.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.0-RC1, 3.0.0)" />
<dependency id="Newtonsoft.Json" version="[6.0.8, 9.0.0)" />
<dependency id="Umbraco.ModelsBuilder" version="[3.0.0, 4.0.0)" />
</dependencies>
</metadata>
<files>
@@ -37,7 +37,6 @@
<file src="tools\Readme.txt" target="tools\Readme.txt" />
<file src="tools\ReadmeUpgrade.txt" target="tools\ReadmeUpgrade.txt" />
<file src="tools\Web.config.install.xdt" target="Content\Web.config.install.xdt" />
<file src="tools\Web.config.uninstall.xdt" target="Content\Web.config.uninstall.xdt" />
<file src="tools\applications.config.install.xdt" target="Content\config\applications.config.install.xdt" />
<file src="tools\ClientDependency.config.install.xdt" target="Content\config\ClientDependency.config.install.xdt" />
<file src="tools\Dashboard.config.install.xdt" target="Content\config\Dashboard.config.install.xdt" />
+178 -25
View File
@@ -7,8 +7,8 @@
<section name="ExamineLuceneIndexSets" type="Examine.LuceneEngine.Config.IndexSets, Examine" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="SetAttributes(type,requirePermission)" />
<sectionGroup name="applicationSettings" xdt:Locator="Match(name)">
<section name="umbraco.presentation.Properties.Settings" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</sectionGroup>
<section name="umbraco.presentation.Properties.Settings" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</sectionGroup>
<sectionGroup name="system.web.webPages.razor" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<sectionGroup name="umbracoConfiguration" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing">
<section name="settings" type="Umbraco.Core.Configuration.UmbracoSettings.UmbracoSettingsSection, Umbraco.Core" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
@@ -22,7 +22,7 @@
<appSettings>
<add key="owin:appStartup" value="UmbracoDefaultOwinStartup" xdt:Locator="Match(key)" xdt:Transform="InsertIfMissing" />
</appSettings>
<umbracoConfiguration xdt:Transform="InsertIfMissing">
<settings configSource="config\umbracoSettings.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
<BaseRestExtensions configSource="config\BaseRestExtensions.config" xdt:Locator="Match(configSource)" xdt:Transform="InsertIfMissing" />
@@ -37,7 +37,7 @@
<DbProviderFactories xdt:Transform="InsertIfMissing">
<remove invariant="System.Data.SqlServerCe.4.0" xdt:Locator="Match(invariant)" xdt:Transform="InsertIfMissing" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe" xdt:Locator="Match(invariant)" xdt:Transform="SetAttributes(invariant,description,type)" />
<remove invariant="MySql.Data.MySqlClient" xdt:Locator="Match(invariant)" xdt:Transform="InsertIfMissing" />
<remove invariant="MySql.Data.MySqlClient" xdt:Locator="Match(invariant)" xdt:Transform="InsertIfMissing" />
<add invariant="MySql.Data.MySqlClient" xdt:Locator="Match(invariant)" xdt:Transform="Remove" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" xdt:Locator="Match(invariant)" xdt:Transform="InsertIfMissing" />
<add invariant="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data" xdt:Locator="Match(invariant)" xdt:Transform="SetAttributes(type)" />
@@ -48,13 +48,15 @@
<system.web xdt:Transform="InsertIfMissing" />
<system.web>
<siteMap xdt:Transform="Remove" />
<siteMap xdt:Transform="InsertIfMissing">
<siteMap xdt:Transform="InsertIfMissing">
<providers xdt:Transform="InsertIfMissing">
<remove name="MySqlSiteMapProvider" xdt:Transform="InsertIfMissing" />
</providers>
</siteMap>
</siteMap>
<httpRuntime xdt:Transform="InsertIfMissing" />
<httpRuntime targetFramework="4.5" maxRequestLength="51200" fcnMode="Single" xdt:Transform="SetAttributes(targetFramework,fcnMode,maxRequestLength)" />
<httpRuntime maxRequestLength="51200" fcnMode="Single" xdt:Transform="SetAttributes(fcnMode,maxRequestLength)" />
<httpRuntime targetFramework="4.5" xdt:Locator="Condition(count(@targetFramework) != 1)" xdt:Transform="SetAttributes(targetFramework)" />
<membership defaultProvider="DefaultMembershipProvider" xdt:Locator="Match(defaultProvider)" xdt:Transform="Remove" />
<roleManager defaultProvider="DefaultRoleProvider" xdt:Locator="Match(defaultProvider)" xdt:Transform="Remove"/>
<profile defaultProvider="DefaultProfileProvider" xdt:Locator="Match(defaultProvider)" xdt:Transform="Remove"/>>
@@ -63,8 +65,7 @@
<compilation>
<assemblies xdt:Transform="InsertIfMissing" />
<assemblies>
<add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)"
xdt:Transform="InsertIfMissing" />
<add assembly="System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
@@ -78,6 +79,56 @@
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<add assembly="System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<add assembly="System.Web.WebPages, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<add assembly="System.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Collections.Concurrent, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ComponentModel.Annotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ComponentModel.EventBasedAsync, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Diagnostics.Contracts, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Diagnostics.Debug, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Diagnostics.Tools, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Diagnostics.Tracing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Dynamic.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Globalization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.IO, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Linq.Expressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Linq.Parallel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Linq.Queryable, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Net.NetworkInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Net.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Net.Requests, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ObjectModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Reflection.Emit, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Reflection.Emit.ILGeneration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Reflection.Emit.Lightweight, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Reflection.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Reflection.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Resources.ResourceManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime.InteropServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime.InteropServices.WindowsRuntime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime.Numerics, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime.Serialization.Json, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime.Serialization.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Runtime.Serialization.Xml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Security.Principal, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ServiceModel.Duplex, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ServiceModel.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ServiceModel.NetTcp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ServiceModel.Primitives, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.ServiceModel.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Text.Encoding, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Text.Encoding.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Text.RegularExpressions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Threading, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Threading.Tasks.Parallel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Xml.ReaderWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Xml.XDocument, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
<add assembly="System.Xml.XmlSerializer, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" xdt:Locator="Match(assembly)" xdt:Transform="InsertIfMissing" />
</assemblies>
</compilation>
@@ -86,11 +137,113 @@
<remove assembly="System.Web.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Net.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Collections" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Collections.Concurrent" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ComponentModel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ComponentModel.Annotations" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ComponentModel.EventBasedAsync" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Diagnostics.Contracts" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Diagnostics.Debug" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Diagnostics.Tools" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Diagnostics.Tracing" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Dynamic.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Globalization" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.IO" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Linq" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Linq.Expressions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Linq.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Linq.Queryable" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Net.NetworkInformation" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Net.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Net.Requests" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ObjectModel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Reflection" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Reflection.Emit" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Reflection.Emit.ILGeneration" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Reflection.Emit.Lightweight" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Reflection.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Reflection.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Resources.ResourceManager" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime.InteropServices" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime.InteropServices.WindowsRuntime" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime.Numerics" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime.Serialization.Json" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime.Serialization.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Runtime.Serialization.Xml" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Security.Principal" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ServiceModel.Duplex" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ServiceModel.Http" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ServiceModel.NetTcp" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ServiceModel.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.ServiceModel.Security" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Text.Encoding" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Text.Encoding.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Text.RegularExpressions" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Threading" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Threading.Tasks" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Threading.Tasks.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Xml.ReaderWriter" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Xml.XDocument" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
<remove assembly="System.Xml.XmlSerializer" xdt:Locator="Match(assembly)" xdt:Transform="Remove" />
</assemblies>
</compilation>
<compilation>
<assemblies>
<remove assembly="System.Web.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Net.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Collections" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Collections.Concurrent" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ComponentModel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ComponentModel.Annotations" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ComponentModel.EventBasedAsync" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Diagnostics.Contracts" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Diagnostics.Debug" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Diagnostics.Tools" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Diagnostics.Tracing" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Dynamic.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Globalization" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.IO" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Linq" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Linq.Expressions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Linq.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Linq.Queryable" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Net.NetworkInformation" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Net.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Net.Requests" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ObjectModel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Reflection" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Reflection.Emit" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Reflection.Emit.ILGeneration" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Reflection.Emit.Lightweight" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Reflection.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Reflection.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Resources.ResourceManager" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime.InteropServices" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime.InteropServices.WindowsRuntime" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime.Numerics" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime.Serialization.Json" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime.Serialization.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Runtime.Serialization.Xml" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Security.Principal" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ServiceModel.Duplex" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ServiceModel.Http" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ServiceModel.NetTcp" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ServiceModel.Primitives" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.ServiceModel.Security" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Text.Encoding" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Text.Encoding.Extensions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Text.RegularExpressions" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Threading" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Threading.Tasks" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Threading.Tasks.Parallel" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Xml.ReaderWriter" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Xml.XDocument" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
<remove assembly="System.Xml.XmlSerializer" xdt:Locator="Match(assembly)" xdt:Transform="InsertBefore(/configuration/system.web/compilation/assemblies/add)" />
</assemblies>
</compilation>
@@ -125,6 +278,8 @@
<add name="umbracoRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="viewstateMoverModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="umbracoBaseRequestModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<!-- Note, we're removing the one that starts with a space here, don't correct it -->
<!-- This to fix a quirk we for a lot of releases where we added it with the space by default -->
<add name=" UmbracoModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" xdt:Locator="Match(name)" xdt:Transform="InsertIfMissing" />
</modules>
@@ -149,16 +304,14 @@
<requestLimits maxAllowedContentLength="52428800" xdt:Transform="InsertIfMissing" />
</requestFiltering>
</security>
</system.webServer>
<system.codedom xdt:Transform="Remove" />
</system.webServer>
<runtime xdt:Transform="InsertIfMissing" />
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" xdt:Transform="InsertIfMissing" />
</runtime>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='HtmlAgilityPack')" xdt:Transform="Remove" />
@@ -171,7 +324,7 @@
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='Microsoft.Owin.Security.OAuth')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='Microsoft.Owin.Security')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='Microsoft.Owin.Security.Cookies')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Net.Http.Formatting')" xdt:Transform="Remove" />
<dependentAssembly xdt:Locator="Condition(./_defaultNamespace:assemblyIdentity/@name='System.Net.Http.Formatting')" xdt:Transform="Remove" />
</assemblyBinding>
</runtime>
@@ -180,7 +333,7 @@
<dependentAssembly>
<assemblyIdentity name="HtmlAgilityPack" publicKeyToken="bd319b19eaf3b43a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.4.9.0" newVersion="1.4.9.0" />
</dependentAssembly>
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0"/>
@@ -196,7 +349,7 @@
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Web.WebPages.Razor" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Web.Http" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
@@ -208,16 +361,16 @@
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0" />
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
</dependentAssembly>
<dependentAssembly xdt:Transform="Insert">
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
@@ -225,19 +378,19 @@
</runtime>
<system.web.webPages.razor xdt:Transform="Remove" />
<location path="umbraco" xdt:Locator="Match(path)" xdt:Transform="InsertIfMissing" />
<location path="umbraco" xdt:Locator="Match(path)">
<system.webServer xdt:Transform="InsertIfMissing">
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" xdt:Transform="SetAttributes(doStaticCompression,doDynamicCompression,dynamicCompressionBeforeCache)" />
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" xdt:Transform="SetAttributes(doStaticCompression,doDynamicCompression,dynamicCompressionBeforeCache)" />
</system.webServer>
</location>
<location path="App_Plugins" xdt:Locator="Match(path)" xdt:Transform="InsertIfMissing" />
<location path="App_Plugins" xdt:Locator="Match(path)">
<system.webServer xdt:Transform="InsertIfMissing">
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" xdt:Transform="SetAttributes(doStaticCompression,doDynamicCompression,dynamicCompressionBeforeCache)" />
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" xdt:Transform="SetAttributes(doStaticCompression,doDynamicCompression,dynamicCompressionBeforeCache)" />
</system.webServer>
</location>
</configuration>
@@ -1,90 +0,0 @@
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<configSections xdt:Transform="InsertIfMissing" />
<configSections>
<section name="BaseRestExtensions" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<section name="FileSystemProviders" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<section name="ExamineLuceneIndexSets" type="Examine.LuceneEngine.Config.IndexSets, Examine" requirePermission="false" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<sectionGroup name="applicationSettings" xdt:Locator="Match(name)">
<section name="umbraco.presentation.Properties.Settings" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</sectionGroup>
<sectionGroup name="system.web.webPages.razor" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<sectionGroup name="umbracoConfiguration" xdt:Locator="Match(name)" xdt:Transform="Remove"/>
</configSections>
<ExamineLuceneIndexSets xdt:Transform="Remove"/>
<urlrewritingnet xdt:Transform="Remove"/>
<microsoft.scripting xdt:Transform="Remove"/>
<clientDependency xdt:Transform="Remove"/>
<Examine xdt:Transform="Remove"/>
<log4net xdt:Transform="Remove"/>
<appSettings>
<add key="umbracoConfigurationStatus" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoReservedUrls" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoReservedPaths" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoPath" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoHideTopLevelNodeFromPath" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoUseDirectoryUrls" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoTimeOutInMinutes" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoDefaultUILanguage" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="umbracoUseSSL" xdt:Locator="Match(key)" xdt:Transform="Remove"/>
<add key="owin:appStartup" value="UmbracoDefaultOwinStartup" xdt:Locator="Match(key,value)" xdt:Transform="Remove" />
</appSettings>
<umbracoConfiguration xdt:Transform="Remove"/>
<FileSystemProviders xdt:Transform="Remove" />
<BaseRestExtensions xdt:Transform="Remove" />
<connectionStrings>
<remove name="umbracoDbDSN" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="umbracoDbDSN" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</connectionStrings>
<system.web>
<pages>
<controls>
<add tagPrefix="umbraco" xdt:Locator="Match(tagPrefix)" xdt:Transform="Remove" />
</controls>
</pages>
<httpModules>
<add name="UmbracoModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</httpModules>
<httpHandlers>
<add type="umbraco.presentation.channels.api, umbraco" xdt:Locator="Match(type)" xdt:Transform="Remove" />
<add type="umbraco.presentation.channels.wordApi, umbraco" xdt:Locator="Match(type)" xdt:Transform="Remove" />
</httpHandlers>
<compilation>
<buildProviders>
<add type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" xdt:Locator="Match(type)" xdt:Transform="Remove" />
<add type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" xdt:Locator="Match(type)" xdt:Transform="Remove" />
<add type="umbraco.MacroEngines.RazorBuildProvider, umbraco.MacroEngines" xdt:Locator="Match(type)" xdt:Transform="Remove" />
</buildProviders>
</compilation>
<membership>
<providers>
<add name="UmbracoMembershipProvider" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="UsersMembershipProvider" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</providers>
</membership>
<roleManager>
<providers>
<add name="UmbracoRoleProvider" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules>
<remove name="UmbracoModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="UmbracoModule" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</modules>
<handlers>
<remove name="Channels" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<remove name="Channels_Word" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="Channels" xdt:Locator="Match(name)" xdt:Transform="Remove" />
<add name="Channels_Word" xdt:Locator="Match(name)" xdt:Transform="Remove" />
</handlers>
</system.webServer>
<location path="umbraco" xdt:Locator="Match(path)" xdt:Transform="Remove" />/>
<location path="App_Plugins" xdt:Locator="Match(path)" xdt:Transform="Remove" />/>
</configuration>
+1
View File
@@ -49,6 +49,7 @@ if ($project) {
if(Test-Path $umbracoBinFolder\umbraco.editorControls.dll) { Remove-Item $umbracoBinFolder\umbraco.editorControls.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\umbraco.MacroEngines.dll) { Remove-Item $umbracoBinFolder\umbraco.MacroEngines.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\Umbraco.ModelsBuilder.dll) { Remove-Item $umbracoBinFolder\Umbraco.ModelsBuilder.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\Umbraco.ModelsBuilder.AspNet.dll) { Remove-Item $umbracoBinFolder\Umbraco.ModelsBuilder.AspNet.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\umbraco.providers.dll) { Remove-Item $umbracoBinFolder\umbraco.providers.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\Umbraco.Web.UI.dll) { Remove-Item $umbracoBinFolder\Umbraco.Web.UI.dll -Force -Confirm:$false }
if(Test-Path $umbracoBinFolder\UmbracoExamine.dll) { Remove-Item $umbracoBinFolder\UmbracoExamine.dll -Force -Confirm:$false }
+1 -2
View File
@@ -1,3 +1,2 @@
# Usage: on line 2 put the release version, on line 3 put the version comment (example: beta)
7.4.0
RC1
7.4.1
+8 -6
View File
@@ -47,13 +47,15 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.dll</HintPath>
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
<SpecificVersion>False</SpecificVersion>
<Private>False</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net40" />
<package id="SqlServerCE" version="4.0.0.1" targetFramework="net45" />
</packages>
+2 -2
View File
@@ -11,5 +11,5 @@ using System.Resources;
[assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyFileVersion("7.4.0")]
[assembly: AssemblyInformationalVersion("7.4.0-RC1")]
[assembly: AssemblyFileVersion("7.4.1")]
[assembly: AssemblyInformationalVersion("7.4.1")]
@@ -6,7 +6,7 @@ namespace Umbraco.Core.Configuration
{
public class UmbracoVersion
{
private static readonly Version Version = new Version("7.4.0");
private static readonly Version Version = new Version("7.4.1");
/// <summary>
/// Gets the current version of Umbraco.
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration
/// Gets the version comment (like beta or RC).
/// </summary>
/// <value>The version comment.</value>
public static string CurrentComment { get { return "RC1"; } }
public static string CurrentComment { get { return ""; } }
// Get the version of the umbraco.dll by looking at a class in that dll
// Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx
+6
View File
@@ -10,6 +10,12 @@ namespace Umbraco.Core
/// </summary>
public static class Web
{
public const string UmbracoContextDataToken = "umbraco-context";
public const string UmbracoDataToken = "umbraco";
public const string PublishedDocumentRequestDataToken = "umbraco-doc-request";
public const string CustomRouteDataToken = "umbraco-custom-route";
public const string UmbracoRouteDefinitionDataToken = "umbraco-route-def";
/// <summary>
/// The preview cookie name
/// </summary>
@@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Reflection;
namespace Umbraco.Core.Dynamics
{
/// <summary>
/// This will check enable dynamic access to properties and methods in a case insensitive manner
/// </summary>
/// <typeparam name="T"></typeparam>
/// <remarks>
/// This works by using reflection on the type - the reflection lookup is lazy so it will not execute unless a dynamic method needs to be accessed
/// </remarks>
public abstract class CaseInsensitiveDynamicObject<T> : DynamicObject
where T: class
{
/// <summary>
/// Used for dynamic access for case insensitive property access
/// </summary>`
private static readonly Lazy<IDictionary<string, Func<T, object>>> CaseInsensitivePropertyAccess = new Lazy<IDictionary<string, Func<T, object>>>(() =>
{
var props = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public)
.DistinctBy(x => x.Name);
return props.Select(propInfo =>
{
var name = propInfo.Name.ToLowerInvariant();
Func<T, object> getVal = propInfo.GetValue;
return new KeyValuePair<string, Func<T, object>>(name, getVal);
}).ToDictionary(x => x.Key, x => x.Value);
});
/// <summary>
/// Used for dynamic access for case insensitive property access
/// </summary>
private static readonly Lazy<IDictionary<string, Tuple<ParameterInfo[], Func<T, object[], object>>>> CaseInsensitiveMethodAccess
= new Lazy<IDictionary<string, Tuple<ParameterInfo[], Func<T, object[], object>>>>(() =>
{
var props = typeof(T).GetMethods(BindingFlags.Instance | BindingFlags.Public)
.Where(x => x.IsSpecialName == false && x.IsVirtual == false)
.DistinctBy(x => x.Name);
return props.Select(methodInfo =>
{
var name = methodInfo.Name.ToLowerInvariant();
Func<T, object[], object> getVal = methodInfo.Invoke;
var val = new Tuple<ParameterInfo[], Func<T, object[], object>>(methodInfo.GetParameters(), getVal);
return new KeyValuePair<string, Tuple<ParameterInfo[], Func<T, object[], object>>>(name, val);
}).ToDictionary(x => x.Key, x => x.Value);
});
public override bool TryInvokeMember(InvokeMemberBinder binder, object[] args, out object result)
{
var name = binder.Name.ToLowerInvariant();
if (CaseInsensitiveMethodAccess.Value.ContainsKey(name) == false)
return base.TryInvokeMember(binder, args, out result);
var val = CaseInsensitiveMethodAccess.Value[name];
var parameters = val.Item1;
var callback = val.Item2;
var fullArgs = new List<object>(args);
if (args.Length <= parameters.Length)
{
//need to fill them up if they're optional
for (var i = args.Length; i < parameters.Length; i++)
{
if (parameters[i].IsOptional)
{
fullArgs.Add(parameters[i].DefaultValue);
}
}
if (fullArgs.Count == parameters.Length)
{
result = callback((T)(object)this, fullArgs.ToArray());
return true;
}
}
return base.TryInvokeMember(binder, args, out result);
}
public override bool TryGetMember(GetMemberBinder binder, out object result)
{
var name = binder.Name.ToLowerInvariant();
if (CaseInsensitivePropertyAccess.Value.ContainsKey(name) == false)
return base.TryGetMember(binder, out result);
result = CaseInsensitivePropertyAccess.Value[name]((T)(object)this);
return true;
}
}
}
@@ -64,7 +64,7 @@ namespace Umbraco.Core.Dynamics
/// </summary>
public class DynamicXmlConverter : TypeConverter
{
public override bool CanConvertTo(ITypeDescriptorContext context, Type sourceType)
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
var convertableTypes = new[]
{
@@ -78,8 +78,8 @@ namespace Umbraco.Core.Dynamics
typeof(RawXmlDocument)
};
return convertableTypes.Any(x => TypeHelper.IsTypeAssignableFrom(x, sourceType))
|| base.CanConvertFrom(context, sourceType);
return convertableTypes.Any(x => TypeHelper.IsTypeAssignableFrom(x, destinationType))
|| base.CanConvertFrom(context, destinationType);
}
public override object ConvertTo(
@@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors.ValueConverters;
namespace Umbraco.Core.Models
{
internal static class MediaExtensions
{
/// <summary>
/// Hack: we need to put this in a real place, this is currently just used to render the urls for a media item in the back office
/// </summary>
/// <returns></returns>
public static string GetUrl(this IMedia media, string propertyAlias, ILogger logger)
{
var propertyType = media.PropertyTypes.FirstOrDefault(x => x.Alias.InvariantEquals(propertyAlias));
if (propertyType != null)
{
var val = media.Properties[propertyType];
if (val != null)
{
var jsonString = val.Value as string;
if (jsonString != null)
{
if (propertyType.PropertyEditorAlias == Constants.PropertyEditors.ImageCropperAlias)
{
if (jsonString.DetectIsJson())
{
try
{
var json = JsonConvert.DeserializeObject<JObject>(jsonString);
if (json["src"] != null)
{
return json["src"].Value<string>();
}
}
catch (Exception ex)
{
logger.Error<ImageCropperValueConverter>("Could not parse the string " + jsonString + " to a json object", ex);
return string.Empty;
}
}
else
{
return jsonString;
}
}
else if (propertyType.PropertyEditorAlias == Constants.PropertyEditors.UploadFieldAlias)
{
return jsonString;
}
//hrm, without knowing what it is, just adding a string here might not be very nice
}
}
}
return string.Empty;
}
/// <summary>
/// Hack: we need to put this in a real place, this is currently just used to render the urls for a media item in the back office
/// </summary>
/// <returns></returns>
public static string[] GetUrls(this IMedia media, IContentSection contentSection, ILogger logger)
{
var links = new List<string>();
var autoFillProperties = contentSection.ImageAutoFillProperties.ToArray();
if (autoFillProperties.Any())
{
links.AddRange(
autoFillProperties
.Select(field => media.GetUrl(field.Alias, logger))
.Where(link => link.IsNullOrWhiteSpace() == false));
}
return links.ToArray();
}
}
}
@@ -1,9 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Web.Caching;
using System.Web.UI;
using Umbraco.Core.Cache;
namespace Umbraco.Core.Models.PublishedContent
@@ -16,6 +13,7 @@ namespace Umbraco.Core.Models.PublishedContent
public class PublishedContentType
{
private readonly PublishedPropertyType[] _propertyTypes;
private readonly HashSet<string> _compositionAliases;
// fast alias-to-index xref containing both the raw alias and its lowercase version
private readonly Dictionary<string, int> _indexes = new Dictionary<string, int>();
@@ -27,6 +25,7 @@ namespace Umbraco.Core.Models.PublishedContent
{
Id = contentType.Id;
Alias = contentType.Alias;
_compositionAliases = new HashSet<string>(contentType.CompositionAliases(), StringComparer.InvariantCultureIgnoreCase);
_propertyTypes = contentType.CompositionPropertyTypes
.Select(x => new PublishedPropertyType(this, x))
.ToArray();
@@ -34,10 +33,11 @@ namespace Umbraco.Core.Models.PublishedContent
}
// internal so it can be used for unit tests
internal PublishedContentType(int id, string alias, IEnumerable<PublishedPropertyType> propertyTypes)
internal PublishedContentType(int id, string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes)
{
Id = id;
Alias = alias;
_compositionAliases = new HashSet<string>(compositionAliases, StringComparer.InvariantCultureIgnoreCase);
_propertyTypes = propertyTypes.ToArray();
foreach (var propertyType in _propertyTypes)
propertyType.ContentType = this;
@@ -45,8 +45,8 @@ namespace Umbraco.Core.Models.PublishedContent
}
// create detached content type - ie does not match anything in the DB
internal PublishedContentType(string alias, IEnumerable<PublishedPropertyType> propertyTypes)
: this (0, alias, propertyTypes)
internal PublishedContentType(string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes)
: this(0, alias, compositionAliases, propertyTypes)
{ }
private void InitializeIndexes()
@@ -63,6 +63,7 @@ namespace Umbraco.Core.Models.PublishedContent
public int Id { get; private set; }
public string Alias { get; private set; }
public HashSet<string> CompositionAliases { get { return _compositionAliases; } }
#endregion
@@ -164,6 +164,9 @@ namespace Umbraco.Core.Models.PublishedContent
private void InitializeConverters()
{
//TODO: Look at optimizing this method, it gets run for every property type for the document being rendered at startup,
// every precious second counts!
var converters = PropertyValueConvertersResolver.Current.Converters.ToArray();
var defaultConvertersWithAttributes = PropertyValueConvertersResolver.Current.DefaultConverters;
@@ -20,7 +20,17 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer
if (columns.Any(x => x.TableName.InvariantEquals("cmsPropertyTypeGroup") && x.ColumnName.InvariantEquals("parentGroupId")) == false)
return;
Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id").OnTable("cmsPropertyTypeGroup");
//This constraing can be based on old aliases, before removing them, check they exist
var constraints = SqlSyntax.GetConstraintsPerColumn(Context.Database).Distinct().ToArray();
if (constraints.Any(x => x.Item1.InvariantEquals("cmsPropertyTypeGroup") && x.Item3.InvariantEquals("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id")))
{
Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup_id").OnTable("cmsPropertyTypeGroup");
}
if (constraints.Any(x => x.Item1.InvariantEquals("cmsPropertyTypeGroup") && x.Item3.InvariantEquals("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup")))
{
Delete.ForeignKey("FK_cmsPropertyTypeGroup_cmsPropertyTypeGroup").OnTable("cmsPropertyTypeGroup");
}
Delete.Column("parentGroupId").FromTable("cmsPropertyTypeGroup");
}
@@ -28,6 +28,8 @@ namespace Umbraco.Core.Persistence.SqlSyntax
GuidColumnDefinition = "char(36)";
DefaultValueFormat = "DEFAULT {0}";
InitColumnTypeMap();
}
public override IEnumerable<string> GetTablesInSchema(Database db)
@@ -8,6 +8,7 @@ namespace Umbraco.Core.PropertyEditors
/// <summary>
/// Manages the list of IPropertyEditorValueConverter's
/// </summary>
[Obsolete("IPropertyEditorValueConverter is obsolete, but we need to support them until v8, to resolve the correct converter types use: PropertyValueConvertersResolver")]
internal sealed class PropertyEditorValueConvertersResolver : ManyObjectsResolverBase<PropertyEditorValueConvertersResolver, IPropertyEditorValueConverter>
{
/// <summary>
@@ -1,8 +1,11 @@
using System;
using System.Globalization;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Services;
namespace Umbraco.Core.PropertyEditors.ValueConverters
{
@@ -14,11 +17,80 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
public class ImageCropperValueConverter : JsonValueConverter
{
private readonly IDataTypeService _dataTypeService;
public ImageCropperValueConverter()
{
_dataTypeService = ApplicationContext.Current.Services.DataTypeService;
}
public ImageCropperValueConverter(IDataTypeService dataTypeService)
{
if (dataTypeService == null) throw new ArgumentNullException("dataTypeService");
_dataTypeService = dataTypeService;
}
public override bool IsConverter(PublishedPropertyType propertyType)
{
return propertyType.PropertyEditorAlias.InvariantEquals(Constants.PropertyEditors.ImageCropperAlias);
}
internal static void MergePreValues(JObject currentValue, IDataTypeService dataTypeService, int dataTypeId)
{
//need to lookup the pre-values for this data type
//TODO: Change all singleton access to use ctor injection in v8!!!
var dt = dataTypeService.GetPreValuesCollectionByDataTypeId(dataTypeId);
if (dt != null && dt.IsDictionaryBased && dt.PreValuesAsDictionary.ContainsKey("crops"))
{
var cropsString = dt.PreValuesAsDictionary["crops"].Value;
JArray preValueCrops;
try
{
preValueCrops = JsonConvert.DeserializeObject<JArray>(cropsString);
}
catch (Exception ex)
{
LogHelper.Error<ImageCropperValueConverter>("Could not parse the string " + cropsString + " to a json object", ex);
return;
}
//now we need to merge the crop values - the alias + width + height comes from pre-configured pre-values,
// however, each crop can store it's own coordinates
JArray existingCropsArray;
if (currentValue["crops"] != null)
{
existingCropsArray = (JArray)currentValue["crops"];
}
else
{
currentValue["crops"] = existingCropsArray = new JArray();
}
foreach (var preValueCrop in preValueCrops.Where(x => x.HasValues))
{
var found = existingCropsArray.FirstOrDefault(x =>
{
if (x.HasValues && x["alias"] != null)
{
return x["alias"].Value<string>() == preValueCrop["alias"].Value<string>();
}
return false;
});
if (found != null)
{
found["width"] = preValueCrop["width"];
found["height"] = preValueCrop["height"];
}
else
{
existingCropsArray.Add(preValueCrop);
}
}
}
}
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
{
if (source == null) return null;
@@ -29,7 +101,11 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
JObject obj;
try
{
obj = JsonConvert.DeserializeObject<JObject>(sourceString);
obj = JsonConvert.DeserializeObject<JObject>(sourceString, new JsonSerializerSettings
{
Culture = CultureInfo.InvariantCulture,
FloatParseHandling = FloatParseHandling.Decimal
});
}
catch (Exception ex)
{
@@ -37,26 +113,8 @@ namespace Umbraco.Core.PropertyEditors.ValueConverters
return sourceString;
}
//need to lookup the pre-values for this data type
//TODO: Change all singleton access to use ctor injection in v8!!!
var dt = ApplicationContext.Current.Services.DataTypeService.GetPreValuesCollectionByDataTypeId(propertyType.DataTypeId);
MergePreValues(obj, _dataTypeService, propertyType.DataTypeId);
if (dt != null && dt.IsDictionaryBased && dt.PreValuesAsDictionary.ContainsKey("crops"))
{
var cropsString = dt.PreValuesAsDictionary["crops"].Value;
JArray crops;
try
{
crops = JsonConvert.DeserializeObject<JArray>(cropsString);
}
catch (Exception ex)
{
LogHelper.Error<ImageCropperValueConverter>("Could not parse the string " + cropsString + " to a json object", ex);
return sourceString;
}
obj["crops"] = crops;
}
return obj;
}
@@ -0,0 +1,28 @@
using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Core.PropertyEditors.ValueConverters
{
/// <summary>
/// We need this property converter so that we always force the value of a label to be a string
/// </summary>
/// <remarks>
/// Without a property converter defined for the label type, the value will be converted with
/// the `ConvertUsingDarkMagic` method which will try to parse the value into it's correct type, but this
/// can cause issues if the string is detected as a number and then strips leading zeros.
/// Example: http://issues.umbraco.org/issue/U4-7929
/// </remarks>
[DefaultPropertyValueConverter]
[PropertyValueType(typeof (string))]
[PropertyValueCache(PropertyCacheValue.All, PropertyCacheLevel.Content)]
public class LabelValueConverter : PropertyValueConverterBase
{
public override bool IsConverter(PublishedPropertyType propertyType)
{
return Constants.PropertyEditors.NoEditAlias.Equals(propertyType.PropertyEditorAlias);
}
public override object ConvertDataToSource(PublishedPropertyType propertyType, object source, bool preview)
{
return source == null ? string.Empty : source.ToString();
}
}
}
@@ -0,0 +1,52 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace Umbraco.Core.Serialization
{
/// <summary>
/// This is required if we want to force JSON.Net to not use .Net TypeConverters during serialization/deserialization
/// </summary>
/// <typeparam name="T"></typeparam>
/// <remarks>
/// In some cases thsi is required if your model has an explicit type converter, see: http://stackoverflow.com/a/31328131/694494
///
/// NOTE: I was going to use this for the ImageCropDataSetConverter to convert to String, which would have worked by putting this attribute:
/// [JsonConverter(typeof(NoTypeConverterJsonConverter{ImageCropDataSet}))] on top of the ImageCropDataSet class, however it turns out we
/// don't require this because to convert to string, we just override ToString().
/// I'll leave this class here for the future though.
/// </remarks>
internal class NoTypeConverterJsonConverter<T> : JsonConverter
{
static readonly IContractResolver resolver = new NoTypeConverterContractResolver();
private class NoTypeConverterContractResolver : DefaultContractResolver
{
protected override JsonContract CreateContract(Type objectType)
{
if (typeof(T).IsAssignableFrom(objectType))
{
var contract = this.CreateObjectContract(objectType);
contract.Converter = null; // Also null out the converter to prevent infinite recursion.
return contract;
}
return base.CreateContract(objectType);
}
}
public override bool CanConvert(Type objectType)
{
return typeof(T).IsAssignableFrom(objectType);
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
return JsonSerializer.CreateDefault(new JsonSerializerSettings { ContractResolver = resolver }).Deserialize(reader, objectType);
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
JsonSerializer.CreateDefault(new JsonSerializerSettings { ContractResolver = resolver }).Serialize(writer, value);
}
}
}
@@ -229,7 +229,7 @@ namespace Umbraco.Core.Services
public EntityContainer GetContentTypeContainer(Guid containerId)
{
return GetContainer(containerId, Constants.ObjectTypes.DocumentTypeGuid);
return GetContainer(containerId, Constants.ObjectTypes.DocumentTypeContainerGuid);
}
public IEnumerable<EntityContainer> GetContentTypeContainers(int[] containerIds)
@@ -258,7 +258,7 @@ namespace Umbraco.Core.Services
public EntityContainer GetMediaTypeContainer(Guid containerId)
{
return GetContainer(containerId, Constants.ObjectTypes.MediaTypeGuid);
return GetContainer(containerId, Constants.ObjectTypes.MediaTypeContainerGuid);
}
private EntityContainer GetContainer(Guid containerId, Guid containerObjectType)
+6 -1
View File
@@ -255,7 +255,12 @@ namespace Umbraco.Core.Services
/// </returns>
public Attempt<OperationStatus<ITemplate, OperationStatusType>> CreateTemplateForContentType(string contentTypeAlias, string contentTypeName, int userId = 0)
{
var template = new Template(contentTypeName, contentTypeAlias);
var template = new Template(contentTypeName,
//NOTE: We are NOT passing in the content type alias here, we want to use it's name since we don't
// want to save template file names as camelCase, the Template ctor will clean the alias as
// `alias.ToCleanString(CleanStringType.UnderscoreAlias)` which has been the default.
// This fixes: http://issues.umbraco.org/issue/U4-7953
contentTypeName);
var evtMsgs = EventMessagesFactory.Get();
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
+46 -43
View File
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
@@ -365,8 +365,7 @@ namespace Umbraco.Core.Services
var dependencies = new HashSet<string>();
//Add the Master as a dependency
if (infoElement.Element("Master") != null &&
string.IsNullOrEmpty(infoElement.Element("Master").Value) == false)
if (string.IsNullOrEmpty((string)infoElement.Element("Master")) == false)
{
dependencies.Add(infoElement.Element("Master").Value);
}
@@ -627,7 +626,7 @@ namespace Umbraco.Core.Services
contentType.AllowedTemplates = allowedTemplates;
}
if (string.IsNullOrEmpty(defaultTemplateElement.Value) == false)
if (string.IsNullOrEmpty((string)defaultTemplateElement) == false)
{
var defaultTemplate = _fileService.GetTemplate(defaultTemplateElement.Value.ToSafeAlias());
if (defaultTemplate != null)
@@ -698,7 +697,7 @@ namespace Umbraco.Core.Services
: _dataTypeService.GetDataTypeDefinitionByPropertyEditorAlias(propertyEditorAlias);
if (dataTypeDefinitions != null && dataTypeDefinitions.Any())
{
dataTypeDefinition = dataTypeDefinitions.First();
dataTypeDefinition = dataTypeDefinitions.FirstOrDefault();
}
}
else if (legacyPropertyEditorId != Guid.Empty && dataTypeDefinition.ControlId != legacyPropertyEditorId)
@@ -706,7 +705,7 @@ namespace Umbraco.Core.Services
var dataTypeDefinitions = _dataTypeService.GetDataTypeDefinitionByControlId(legacyPropertyEditorId);
if (dataTypeDefinitions != null && dataTypeDefinitions.Any())
{
dataTypeDefinition = dataTypeDefinitions.First();
dataTypeDefinition = dataTypeDefinitions.FirstOrDefault();
}
}
else if (dataTypeDefinition.PropertyEditorAlias != propertyEditorAlias)
@@ -714,7 +713,7 @@ namespace Umbraco.Core.Services
var dataTypeDefinitions = _dataTypeService.GetDataTypeDefinitionByPropertyEditorAlias(propertyEditorAlias);
if (dataTypeDefinitions != null && dataTypeDefinitions.Any())
{
dataTypeDefinition = dataTypeDefinitions.First();
dataTypeDefinition = dataTypeDefinitions.FirstOrDefault();
}
}
@@ -741,13 +740,13 @@ namespace Umbraco.Core.Services
var propertyType = new PropertyType(dataTypeDefinition, property.Element("Alias").Value)
{
Name = property.Element("Name").Value,
Description = property.Element("Description") != null ? property.Element("Description").Value : null,
Description = (string)property.Element("Description"),
Mandatory = property.Element("Mandatory") != null ? property.Element("Mandatory").Value.ToLowerInvariant().Equals("true") : false,
ValidationRegExp = property.Element("Validation") != null ? property.Element("Validation").Value : null,
ValidationRegExp = (string)property.Element("Validation"),
SortOrder = sortOrder
};
var tab = property.Element("Tab").Value;
var tab = (string)property.Element("Tab");
if (string.IsNullOrEmpty(tab))
{
contentType.AddPropertyType(propertyType);
@@ -797,14 +796,14 @@ namespace Umbraco.Core.Services
using (var repository = _repositoryFactory.CreateContentTypeRepository(_uowProvider.GetUnitOfWork()))
{
var query = Query<IContentType>.Builder.Where(x => x.Alias == contentTypeAlias);
var types = repository.GetByQuery(query);
var types = repository.GetByQuery(query).ToArray();
if (!types.Any())
if (types.Any() == false)
throw new Exception(
string.Format("No ContentType matching the passed in Alias: '{0}' was found",
contentTypeAlias));
var contentType = types.First();
var contentType = types.FirstOrDefault();
if (contentType == null)
throw new Exception(string.Format("ContentType matching the passed in Alias: '{0}' was null",
@@ -889,7 +888,7 @@ namespace Umbraco.Core.Services
{
var dataTypeDefinitionName = dataTypeElement.Attribute("Name").Value;
var legacyPropertyEditorId = Guid.Empty;
Guid legacyPropertyEditorId;
Guid.TryParse(dataTypeElement.Attribute("Id").Value, out legacyPropertyEditorId);
var dataTypeDefinitionId = new Guid(dataTypeElement.Attribute("Definition").Value);
@@ -1026,23 +1025,30 @@ namespace Umbraco.Core.Services
if (prevaluesElement == null) continue;
var dataTypeDefinitionName = dataTypeElement.Attribute("Name").Value;
var dataTypeDefinition = dataTypes.First(x => x.Name == dataTypeDefinitionName);
var dataTypeDefinition = dataTypes.FirstOrDefault(x => x.Name == dataTypeDefinitionName);
var valuesWithoutKeys = prevaluesElement.Elements("PreValue")
.Where(x => ((string)x.Attribute("Alias")).IsNullOrWhiteSpace())
.Select(x => x.Attribute("Value").Value);
if (dataTypeDefinition != null)
{
var valuesWithoutKeys = prevaluesElement.Elements("PreValue")
.Where(x => ((string) x.Attribute("Alias")).IsNullOrWhiteSpace())
.Select(x => x.Attribute("Value").Value);
var valuesWithKeys = prevaluesElement.Elements("PreValue")
.Where(x => ((string)x.Attribute("Alias")).IsNullOrWhiteSpace() == false)
.ToDictionary(
key => (string)key.Attribute("Alias"),
val => new PreValue((string)val.Attribute("Value")));
var valuesWithKeys = prevaluesElement.Elements("PreValue")
.Where(x => ((string) x.Attribute("Alias")).IsNullOrWhiteSpace() == false)
.ToDictionary(
key => (string) key.Attribute("Alias"),
val => new PreValue((string) val.Attribute("Value")));
//save the values with keys
_dataTypeService.SavePreValues(dataTypeDefinition, valuesWithKeys);
//save the values with keys
_dataTypeService.SavePreValues(dataTypeDefinition, valuesWithKeys);
//save the values without keys (this is legacy)
_dataTypeService.SavePreValues(dataTypeDefinition.Id, valuesWithoutKeys);
//save the values without keys (this is legacy)
_dataTypeService.SavePreValues(dataTypeDefinition.Id, valuesWithoutKeys);
}
else
{
_logger.Warn<PackagingService>("No data type found with name " + dataTypeDefinitionName + " data type pre-values will not be saved");
}
}
}
@@ -1329,31 +1335,31 @@ namespace Umbraco.Core.Services
//Following xml elements are treated as nullable properties
var useInEditorElement = macroElement.Element("useInEditor");
var useInEditor = false;
if (useInEditorElement != null && string.IsNullOrEmpty(useInEditorElement.Value) == false)
if (useInEditorElement != null && string.IsNullOrEmpty((string)useInEditorElement) == false)
{
useInEditor = bool.Parse(useInEditorElement.Value);
}
var cacheDurationElement = macroElement.Element("refreshRate");
var cacheDuration = 0;
if (cacheDurationElement != null && string.IsNullOrEmpty(cacheDurationElement.Value) == false)
if (cacheDurationElement != null && string.IsNullOrEmpty((string)cacheDurationElement) == false)
{
cacheDuration = int.Parse(cacheDurationElement.Value);
}
var cacheByMemberElement = macroElement.Element("cacheByMember");
var cacheByMember = false;
if (cacheByMemberElement != null && string.IsNullOrEmpty(cacheByMemberElement.Value) == false)
if (cacheByMemberElement != null && string.IsNullOrEmpty((string)cacheByMemberElement) == false)
{
cacheByMember = bool.Parse(cacheByMemberElement.Value);
}
var cacheByPageElement = macroElement.Element("cacheByPage");
var cacheByPage = false;
if (cacheByPageElement != null && string.IsNullOrEmpty(cacheByPageElement.Value) == false)
if (cacheByPageElement != null && string.IsNullOrEmpty((string)cacheByPageElement) == false)
{
cacheByPage = bool.Parse(cacheByPageElement.Value);
}
var dontRenderElement = macroElement.Element("dontRender");
var dontRender = true;
if (dontRenderElement != null && string.IsNullOrEmpty(dontRenderElement.Value) == false)
if (dontRenderElement != null && string.IsNullOrEmpty((string)dontRenderElement) == false)
{
dontRender = bool.Parse(dontRenderElement.Value);
}
@@ -1526,23 +1532,20 @@ namespace Umbraco.Core.Services
var dependencies = new List<string>();
var elementCopy = tempElement;
//Ensure that the Master of the current template is part of the import, otherwise we ignore this dependency as part of the dependency sorting.
if (elementCopy.Element("Master") != null &&
string.IsNullOrEmpty(elementCopy.Element("Master").Value) == false &&
templateElements.Any(x => x.Element("Alias").Value == elementCopy.Element("Master").Value))
if (string.IsNullOrEmpty((string)elementCopy.Element("Master")) == false &&
templateElements.Any(x => (string)x.Element("Alias") == (string)elementCopy.Element("Master")))
{
dependencies.Add(elementCopy.Element("Master").Value);
dependencies.Add((string)elementCopy.Element("Master"));
}
else if (elementCopy.Element("Master") != null &&
string.IsNullOrEmpty(elementCopy.Element("Master").Value) == false &&
templateElements.Any(x => x.Element("Alias").Value == elementCopy.Element("Master").Value) ==
false)
else if (string.IsNullOrEmpty((string)elementCopy.Element("Master")) == false &&
templateElements.Any(x => (string)x.Element("Alias") == (string)elementCopy.Element("Master")) == false)
{
_logger.Info<PackagingService>(string.Format("Template '{0}' has an invalid Master '{1}', so the reference has been ignored.", elementCopy.Element("Alias").Value, elementCopy.Element("Master").Value));
_logger.Info<PackagingService>(string.Format("Template '{0}' has an invalid Master '{1}', so the reference has been ignored.", (string)elementCopy.Element("Alias"), (string)elementCopy.Element("Master")));
}
var field = new TopologicalSorter.DependencyField<XElement>
{
Alias = elementCopy.Element("Alias").Value,
Alias = (string)elementCopy.Element("Alias"),
Item = new Lazy<XElement>(() => elementCopy),
DependsOn = dependencies.ToArray()
};
@@ -1564,7 +1567,7 @@ namespace Umbraco.Core.Services
var existingTemplate = _fileService.GetTemplate(alias) as Template;
var template = existingTemplate ?? new Template(path, templateName, alias);
template.Content = design;
if (masterElement != null && string.IsNullOrEmpty(masterElement.Value) == false)
if (masterElement != null && string.IsNullOrEmpty((string)masterElement) == false)
{
template.MasterTemplateAlias = masterElement.Value;
var masterTemplate = templates.FirstOrDefault(x => x.Alias == masterElement.Value);
@@ -171,9 +171,11 @@ namespace Umbraco.Core.Sync
// go get the last id in the db and store it
// note: do it BEFORE initializing otherwise some instructions might get lost
// when doing it before, some instructions might run twice - not an issue
var lastId = _appContext.DatabaseContext.Database.ExecuteScalar<int>("SELECT MAX(id) FROM umbracoCacheInstruction");
if (lastId > 0)
SaveLastSynced(lastId);
var maxId = _appContext.DatabaseContext.Database.ExecuteScalar<int>("SELECT MAX(id) FROM umbracoCacheInstruction");
//if there is a max currently, or if we've never synced
if (maxId > 0 || _lastId < 0)
SaveLastSynced(maxId);
// execute initializing callbacks
if (_options.InitializingCallbacks != null)
+8 -4
View File
@@ -102,13 +102,13 @@
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Data.Entity" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.dll</HintPath>
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
@@ -309,6 +309,7 @@
<Compile Include="DictionaryExtensions.cs" />
<Compile Include="Dictionary\CultureDictionaryFactoryResolver.cs" />
<Compile Include="Dictionary\ICultureDictionaryFactory.cs" />
<Compile Include="Dynamics\CaseInsensitiveDynamicObject.cs" />
<Compile Include="Dynamics\DynamicInstanceHelper.cs" />
<Compile Include="Dynamics\DynamicXmlConverter.cs" />
<Compile Include="Events\CancellableEventArgs.cs" />
@@ -477,6 +478,7 @@
<Compile Include="PropertyEditors\DecimalValidator.cs" />
<Compile Include="PropertyEditors\ValueConverters\GridValueConverter.cs" />
<Compile Include="PropertyEditors\ValueConverters\DecimalValueConverter.cs" />
<Compile Include="PropertyEditors\ValueConverters\LabelValueConverter.cs" />
<Compile Include="PropertyEditors\ValueConverters\ImageCropperValueConverter.cs" />
<Compile Include="Publishing\UnPublishedStatusType.cs" />
<Compile Include="Publishing\UnPublishStatus.cs" />
@@ -489,6 +491,7 @@
<Compile Include="Security\IBackOfficeUserPasswordChecker.cs" />
<Compile Include="Security\MembershipPasswordHasher.cs" />
<Compile Include="SemVersionExtensions.cs" />
<Compile Include="Serialization\NoTypeConverterJsonConverter.cs" />
<Compile Include="ServiceProviderExtensions.cs" />
<Compile Include="IO\ResizedImage.cs" />
<Compile Include="IO\UmbracoMediaFile.cs" />
@@ -511,6 +514,7 @@
<Compile Include="Services\IServerRegistrationService.cs" />
<Compile Include="Services\ITaskService.cs" />
<Compile Include="Services\LocalizedTextServiceSupplementaryFileSource.cs" />
<Compile Include="Models\MediaExtensions.cs" />
<Compile Include="Services\MigrationEntryService.cs" />
<Compile Include="Services\MoveOperationStatusType.cs" />
<Compile Include="Services\PublicAccessService.cs" />
+1 -1
View File
@@ -15,5 +15,5 @@
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="semver" version="1.1.2" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net4" />
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net4" />
<package id="SqlServerCE" version="4.0.0.1" targetFramework="net45" />
</packages>
+1 -1
View File
@@ -72,7 +72,7 @@
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
@@ -42,7 +42,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
{
for (var i = 1; i < 11; i++)
{
Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
global::Umbraco.Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
}
Assert.AreEqual(10, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).IntIdsRefreshed.Count);
}
@@ -52,7 +52,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
{
for (var i = 0; i < 10; i++)
{
Web.Cache.DistributedCache.Instance.Refresh(
global::Umbraco.Web.Cache.DistributedCache.Instance.Refresh(
Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"),
x => x.Id,
new TestObjectWithId{Id = i});
@@ -65,7 +65,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
{
for (var i = 0; i < 11; i++)
{
Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), Guid.NewGuid());
global::Umbraco.Web.Cache.DistributedCache.Instance.Refresh(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), Guid.NewGuid());
}
Assert.AreEqual(11, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).GuidIdsRefreshed.Count);
}
@@ -75,7 +75,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
{
for (var i = 1; i < 13; i++)
{
Web.Cache.DistributedCache.Instance.Remove(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
global::Umbraco.Web.Cache.DistributedCache.Instance.Remove(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"), i);
}
Assert.AreEqual(12, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).IntIdsRemoved.Count);
}
@@ -85,7 +85,7 @@ namespace Umbraco.Tests.Cache.DistributedCache
{
for (var i = 0; i < 13; i++)
{
Web.Cache.DistributedCache.Instance.RefreshAll(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"));
global::Umbraco.Web.Cache.DistributedCache.Instance.RefreshAll(Guid.Parse("E0F452CB-DCB2-4E84-B5A5-4F01744C5C73"));
}
Assert.AreEqual(13, ((TestServerMessenger)ServerMessengerResolver.Current.Messenger).CountOfFullRefreshes);
}
@@ -56,22 +56,64 @@ namespace Umbraco.Tests.Integration
ServiceContext.DomainService.Save(new UmbracoDomain("*100112") { DomainName = "*100112", RootContentId = c3.Id, LanguageId = l2.Id });
var content = c2;
var culture = Web.Models.ContentExtensions.GetCulture(null,
var culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(null,
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
content.Id, content.Path, new Uri("http://domain1.com/"));
Assert.AreEqual("en-US", culture.Name);
content = c2;
culture = Web.Models.ContentExtensions.GetCulture(null,
culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(null,
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
content.Id, content.Path, new Uri("http://domain1.fr/"));
Assert.AreEqual("fr-FR", culture.Name);
content = c4;
culture = Web.Models.ContentExtensions.GetCulture(null,
culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(null,
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
content.Id, content.Path, new Uri("http://domain1.fr/"));
Assert.AreEqual("de-DE", culture.Name);
}
[Test]
public void GetCultureWithWildcard()
{
var contentTypeService = ServiceContext.ContentTypeService;
var contentType = MockedContentTypes.CreateSimpleContentType("umbBlah", "test Doc Type");
contentTypeService.Save(contentType);
var contentService = ServiceContext.ContentService;
var c1 = contentService.CreateContentWithIdentity("content", -1, "umbBlah");
var c2 = contentService.CreateContentWithIdentity("content", c1, "umbBlah");
var c3 = contentService.CreateContentWithIdentity("content", c1, "umbBlah");
var c4 = contentService.CreateContentWithIdentity("content", c3, "umbBlah");
foreach (var l in ServiceContext.LocalizationService.GetAllLanguages().Where(x => x.CultureName != "en-US").ToArray())
ServiceContext.LocalizationService.Delete(l);
var l0 = ServiceContext.LocalizationService.GetLanguageByIsoCode("en-US");
var l1 = new Core.Models.Language("fr-FR");
var l2 = new Core.Models.Language("de-DE");
ServiceContext.LocalizationService.Save(l1);
ServiceContext.LocalizationService.Save(l2);
foreach (var d in ServiceContext.DomainService.GetAll(true).ToArray())
ServiceContext.DomainService.Delete(d);
ServiceContext.DomainService.Save(new UmbracoDomain("*0000") { DomainName = "*0000", RootContentId = c1.Id, LanguageId = l2.Id });
ServiceContext.DomainService.Save(new UmbracoDomain("*0001") { DomainName = "*0001", RootContentId = c3.Id, LanguageId = l1.Id });
//ServiceContext.DomainService.Save(new UmbracoDomain("*100112") { DomainName = "*100112", RootContentId = c3.Id, LanguageId = l2.Id });
var content = c2;
var culture = Umbraco.Web.Models.ContentExtensions.GetCulture(null,
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
content.Id, content.Path, new Uri("http://domain1.com/"));
Assert.AreEqual("de-DE", culture.Name);
content = c4;
culture = Umbraco.Web.Models.ContentExtensions.GetCulture(null,
ServiceContext.DomainService, ServiceContext.LocalizationService, ServiceContext.ContentService,
content.Id, content.Path, new Uri("http://domain1.fr/"));
Assert.AreEqual("fr-FR", culture.Name);
}
}
}
@@ -1,17 +1,20 @@
using System;
using System.Linq;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Rdbms;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Migrations;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Persistence.SyntaxProvider
{
[NUnit.Framework.Ignore("This doesn't actually test anything")]
//[NUnit.Framework.Ignore("This doesn't actually test anything")]
[TestFixture]
public class MySqlSyntaxProviderTests
public class MySqlSyntaxProviderTests : BaseUsingSqlCeSyntax
{
[SetUp]
public void SetUp()
@@ -20,6 +23,7 @@ namespace Umbraco.Tests.Persistence.SyntaxProvider
}
[Test]
[NUnit.Framework.Ignore]
public void Can_Generate_Create_Table_Statement()
{
var type = typeof(TagRelationshipDto);
@@ -48,5 +52,40 @@ namespace Umbraco.Tests.Persistence.SyntaxProvider
{
SqlSyntaxContext.SqlSyntaxProvider = null;
}
[Test]
public void U4_8017()
{
var logger = Mock.Of<ILogger>();
var migration = new TestMigration(SqlSyntaxContext.SqlSyntaxProvider, logger);
var context = new MigrationContext(DatabaseProviders.MySql, null, logger);
migration.Context = context;
migration.Up();
var x = context.Expressions;
Assert.AreEqual(1, x.Count);
var e = x.First().ToString();
// SQLCE provider *does* use UniqueIdentifier
// MySql using GUID...? because InitColumnTypeMap() missing in provider, fixed
Assert.AreEqual("ALTER TABLE `cmsPropertyTypeGroup` ADD COLUMN `uniqueID` char(36) NOT NULL", e);
}
[Migration("1.0.0", 0, "Test")]
private class TestMigration : MigrationBase
{
public TestMigration(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
{}
public override void Up()
{
Create.Column("uniqueID").OnTable("cmsPropertyTypeGroup").AsGuid().NotNullable().WithDefault(SystemMethods.NewGuid);
}
public override void Down()
{
throw new NotImplementedException();
}
}
}
}
@@ -9,11 +9,12 @@ using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Persistence.Migrations.Syntax.Create.Index;
using Umbraco.Core.Persistence.Migrations.Syntax.Expressions;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Persistence.SyntaxProvider
{
[TestFixture]
public class SqlCeSyntaxProviderTests
public class SqlCeSyntaxProviderTests : BaseUsingSqlCeSyntax
{
[Test]
@@ -1,6 +1,17 @@
using System.Linq;
using System;
using System.Globalization;
using System.Linq;
using Moq;
using Newtonsoft.Json;
using NUnit.Framework;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.ObjectResolution;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Web.Models;
using Umbraco.Web.PropertyEditors;
using Umbraco.Web;
@@ -10,14 +21,155 @@ namespace Umbraco.Tests.PropertyEditors
[TestFixture]
public class ImageCropperTest
{
private const string cropperJson = "{\"focalPoint\": {\"left\": 0.96,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0671.jpg\",\"crops\": [{\"alias\":\"thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.58729977382575338,\"y1\": 0.055768992440203169,\"x2\": 0,\"y2\": 0.32457553600198386}}]}";
private const string cropperJson1 = "{\"focalPoint\": {\"left\": 0.96,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0671.jpg\",\"crops\": [{\"alias\":\"thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.58729977382575338,\"y1\": 0.055768992440203169,\"x2\": 0,\"y2\": 0.32457553600198386}}]}";
private const string cropperJson2 = "{\"focalPoint\": {\"left\": 0.98,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0672.jpg\",\"crops\": [{\"alias\":\"thumb\",\"width\": 100,\"height\": 100,\"coordinates\": {\"x1\": 0.58729977382575338,\"y1\": 0.055768992440203169,\"x2\": 0,\"y2\": 0.32457553600198386}}]}";
private const string cropperJson3 = "{\"focalPoint\": {\"left\": 0.98,\"top\": 0.80827067669172936},\"src\": \"/media/1005/img_0672.jpg\",\"crops\": []}";
private const string mediaPath = "/media/1005/img_0671.jpg";
[Test]
public void ImageCropData_Properties_As_Dynamic()
{
var sourceObj = cropperJson1.SerializeToCropDataSet();
dynamic d = sourceObj;
var index = 0;
foreach (var crop in d.crops)
{
var realObjCrop = sourceObj.Crops.ElementAt(index);
Assert.AreEqual(realObjCrop.Alias, crop.Alias);
Assert.AreEqual(realObjCrop.Alias, crop.alias);
Assert.AreEqual(realObjCrop.Height, crop.Height);
Assert.AreEqual(realObjCrop.Height, crop.height);
Assert.AreEqual(realObjCrop.Coordinates.X1, crop.Coordinates.X1);
Assert.AreEqual(realObjCrop.Coordinates.X1, crop.coordinates.x1);
Assert.AreEqual(realObjCrop.Coordinates.X2, crop.Coordinates.X2);
Assert.AreEqual(realObjCrop.Coordinates.X2, crop.coordinates.x2);
Assert.AreEqual(realObjCrop.Coordinates.Y1, crop.Coordinates.Y1);
Assert.AreEqual(realObjCrop.Coordinates.Y1, crop.coordinates.y1);
Assert.AreEqual(realObjCrop.Coordinates.Y2, crop.Coordinates.Y2);
Assert.AreEqual(realObjCrop.Coordinates.Y2, crop.coordinates.y2);
index++;
}
Assert.AreEqual(index, 1);
}
[Test]
public void ImageCropFocalPoint_Properties_As_Dynamic()
{
var sourceObj = cropperJson1.SerializeToCropDataSet();
dynamic d = sourceObj;
Assert.AreEqual(sourceObj.FocalPoint.Left, d.FocalPoint.Left);
Assert.AreEqual(sourceObj.FocalPoint.Left, d.focalPoint.left);
Assert.AreEqual(sourceObj.FocalPoint.Top, d.FocalPoint.Top);
Assert.AreEqual(sourceObj.FocalPoint.Top, d.focalPoint.top);
}
[Test]
public void ImageCropDataSet_Properties_As_Dynamic()
{
var sourceObj = cropperJson1.SerializeToCropDataSet();
dynamic d = sourceObj;
Assert.AreEqual(sourceObj.Src, d.Src);
Assert.AreEqual(sourceObj.Src, d.src);
Assert.AreEqual(sourceObj.FocalPoint, d.FocalPoint);
Assert.AreEqual(sourceObj.FocalPoint, d.focalPoint);
Assert.AreEqual(sourceObj.Crops, d.Crops);
Assert.AreEqual(sourceObj.Crops, d.crops);
}
[Test]
public void ImageCropDataSet_Methods_As_Dynamic()
{
var sourceObj = cropperJson1.SerializeToCropDataSet();
dynamic d = sourceObj;
Assert.AreEqual(sourceObj.HasCrop("thumb"), d.HasCrop("thumb"));
Assert.AreEqual(sourceObj.HasCrop("thumb"), d.hasCrop("thumb"));
Assert.AreEqual(sourceObj.GetCropUrl("thumb"), d.GetCropUrl("thumb"));
Assert.AreEqual(sourceObj.GetCropUrl("thumb"), d.getCropUrl("thumb"));
Assert.AreEqual(sourceObj.HasFocalPoint(), d.HasFocalPoint());
Assert.AreEqual(sourceObj.HasFocalPoint(), d.hasFocalPoint());
}
[Test]
public void CanConvertImageCropperDataSetSrcToString()
{
//cropperJson3 - has not crops
var sourceObj = cropperJson3.SerializeToCropDataSet();
var destObj = sourceObj.TryConvertTo<string>();
Assert.IsTrue(destObj.Success);
Assert.AreEqual(destObj.Result, "/media/1005/img_0672.jpg");
}
[Test]
public void CanConvertImageCropperDataSetJObject()
{
//cropperJson3 - has not crops
var sourceObj = cropperJson3.SerializeToCropDataSet();
var destObj = sourceObj.TryConvertTo<JObject>();
Assert.IsTrue(destObj.Success);
Assert.AreEqual(sourceObj, destObj.Result.ToObject<ImageCropDataSet>());
}
[Test]
public void CanConvertImageCropperDataSetJsonToString()
{
var sourceObj = cropperJson1.SerializeToCropDataSet();
var destObj = sourceObj.TryConvertTo<string>();
Assert.IsTrue(destObj.Success);
Assert.IsTrue(destObj.Result.DetectIsJson());
var obj = JsonConvert.DeserializeObject<ImageCropDataSet>(cropperJson1, new JsonSerializerSettings {Culture = CultureInfo.InvariantCulture, FloatParseHandling = FloatParseHandling.Decimal});
Assert.AreEqual(sourceObj, obj);
}
[TestCase(cropperJson1, cropperJson1, true)]
[TestCase(cropperJson1, cropperJson2, false)]
public void CanConvertImageCropperPropertyEditor(string val1, string val2, bool expected)
{
try
{
PropertyValueConvertersResolver.Current = new PropertyValueConvertersResolver(new ActivatorServiceProvider(), Mock.Of<ILogger>());
Resolution.Freeze();
var dataTypeService = new Mock<IDataTypeService>();
dataTypeService.Setup(x => x.GetPreValuesCollectionByDataTypeId(It.IsAny<int>())).Returns(new PreValueCollection(Enumerable.Empty<PreValue>()));
var converter = new Umbraco.Web.PropertyEditors.ValueConverters.ImageCropperValueConverter(dataTypeService.Object);
var result = converter.ConvertDataToSource(new PublishedPropertyType("test", 0, "test"), val1, false); // does not use type for conversion
var resultShouldMatch = val2.SerializeToCropDataSet();
if (expected)
{
Assert.AreEqual(resultShouldMatch, result);
}
else
{
Assert.AreNotEqual(resultShouldMatch, result);
}
}
finally
{
PropertyValueConvertersResolver.Reset(true);
}
}
[Test]
public void GetCropUrl_CropAliasTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, cropAlias: "Thumb", useCropDimensions: true);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, cropAlias: "Thumb", useCropDimensions: true);
Assert.AreEqual(mediaPath + "?crop=0.58729977382575338,0.055768992440203169,0,0.32457553600198386&cropmode=percentage&width=100&height=100", urlString);
}
@@ -27,28 +179,28 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void GetCropUrl_CropAliasIgnoreWidthHeightTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, cropAlias: "Thumb", useCropDimensions: true, width: 50, height: 50);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, cropAlias: "Thumb", useCropDimensions: true, width: 50, height: 50);
Assert.AreEqual(mediaPath + "?crop=0.58729977382575338,0.055768992440203169,0,0.32457553600198386&cropmode=percentage&width=100&height=100", urlString);
}
[Test]
public void GetCropUrl_WidthHeightTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, width: 200, height: 300);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, width: 200, height: 300);
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&width=200&height=300", urlString);
}
[Test]
public void GetCropUrl_FocalPointTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, cropAlias: "thumb", preferFocalPoint: true, useCropDimensions: true);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, cropAlias: "thumb", preferFocalPoint: true, useCropDimensions: true);
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&width=100&height=100", urlString);
}
[Test]
public void GetCropUrlFurtherOptionsTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, width: 200, height: 300, furtherOptions: "&filter=comic&roundedcorners=radius-26|bgcolor-fff");
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, width: 200, height: 300, furtherOptions: "&filter=comic&roundedcorners=radius-26|bgcolor-fff");
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&width=200&height=300&filter=comic&roundedcorners=radius-26|bgcolor-fff", urlString);
}
@@ -58,7 +210,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void GetCropUrlNullTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, cropAlias: "Banner", useCropDimensions: true);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, cropAlias: "Banner", useCropDimensions: true);
Assert.AreEqual(null, urlString);
}
@@ -68,7 +220,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void GetBaseCropUrlFromModelTest()
{
var cropDataSet = cropperJson.SerializeToCropDataSet();
var cropDataSet = cropperJson1.SerializeToCropDataSet();
var urlString = cropDataSet.GetCropUrl("thumb");
Assert.AreEqual("?crop=0.58729977382575338,0.055768992440203169,0,0.32457553600198386&cropmode=percentage&width=100&height=100", urlString);
}
@@ -79,7 +231,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void GetCropUrl_CropAliasHeightRatioModeTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, cropAlias: "Thumb", useCropDimensions: true, ratioMode:ImageCropRatioMode.Height);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, cropAlias: "Thumb", useCropDimensions: true, ratioMode:ImageCropRatioMode.Height);
Assert.AreEqual(mediaPath + "?crop=0.58729977382575338,0.055768992440203169,0,0.32457553600198386&cropmode=percentage&width=100&heightratio=1", urlString);
}
@@ -89,7 +241,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void GetCropUrl_WidthHeightRatioModeTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, width: 300, height: 150, ratioMode:ImageCropRatioMode.Height);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, width: 300, height: 150, ratioMode:ImageCropRatioMode.Height);
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&width=300&heightratio=0.5", urlString);
}
@@ -99,7 +251,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void GetCropUrl_HeightWidthRatioModeTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, width: 300, height: 150, ratioMode: ImageCropRatioMode.Width);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, width: 300, height: 150, ratioMode: ImageCropRatioMode.Width);
Assert.AreEqual(mediaPath + "?center=0.80827067669172936,0.96&mode=crop&height=150&widthratio=2", urlString);
}
@@ -109,7 +261,7 @@ namespace Umbraco.Tests.PropertyEditors
[Test]
public void GetCropUrl_SpecifiedCropModeTest()
{
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson, width: 300, height: 150, imageCropMode:ImageCropMode.Max);
var urlString = mediaPath.GetCropUrl(imageCropperValue: cropperJson1, width: 300, height: 150, imageCropMode:ImageCropMode.Max);
Assert.AreEqual(mediaPath + "?mode=max&width=300&height=150", urlString);
}
@@ -234,9 +234,9 @@ namespace Umbraco.Tests.PublishedContent
new PublishedPropertyType("prop1", 1, "?"),
};
var contentType1 = new PublishedContentType(1, "ContentType1", props);
var contentType2 = new PublishedContentType(2, "ContentType2", props);
var contentType2s = new PublishedContentType(3, "ContentType2Sub", props);
var contentType1 = new PublishedContentType(1, "ContentType1", Enumerable.Empty<string>(), props);
var contentType2 = new PublishedContentType(2, "ContentType2", Enumerable.Empty<string>(), props);
var contentType2s = new PublishedContentType(3, "ContentType2Sub", Enumerable.Empty<string>(), props);
cache.Add(new SolidPublishedContent(contentType1)
{
@@ -355,7 +355,11 @@ namespace Umbraco.Tests.PublishedContent
private static readonly PublishedPropertyType Default = new PublishedPropertyType("*", 0, "?");
public AutoPublishedContentType(int id, string alias, IEnumerable<PublishedPropertyType> propertyTypes)
: base(id, alias, propertyTypes)
: base(id, alias, Enumerable.Empty<string>(), propertyTypes)
{ }
public AutoPublishedContentType(int id, string alias, IEnumerable<string> compositionAliases, IEnumerable<PublishedPropertyType> propertyTypes)
: base(id, alias, compositionAliases, propertyTypes)
{ }
public override PublishedPropertyType GetPropertyType(string alias)
@@ -50,7 +50,8 @@ namespace Umbraco.Tests.PublishedContent
new PublishedPropertyType("content", 0, Constants.PropertyEditors.TinyMCEAlias),
new PublishedPropertyType("testRecursive", 0, "?"),
};
var type = new AutoPublishedContentType(0, "anything", propertyTypes);
var compositionAliases = new[] {"MyCompositionAlias"};
var type = new AutoPublishedContentType(0, "anything", compositionAliases, propertyTypes);
PublishedContentType.GetPublishedContentTypeCallback = (alias) => type;
}
@@ -468,6 +469,16 @@ namespace Umbraco.Tests.PublishedContent
Assert.IsNull(doc.FirstChild<IPublishedContent>());
}
[Test]
public void IsComposedOf()
{
var doc = GetNode(1173);
var isComposedOf = doc.IsComposedOf("MyCompositionAlias");
Assert.IsTrue(isComposedOf);
}
[Test]
public void HasProperty()
{
@@ -475,8 +486,7 @@ namespace Umbraco.Tests.PublishedContent
var hasProp = doc.HasProperty(Constants.Conventions.Content.UrlAlias);
Assert.AreEqual(true, (bool)hasProp);
Assert.IsTrue(hasProp);
}
[Test]
@@ -380,7 +380,7 @@ namespace Umbraco.Tests.Routing
var content = umbracoContext.ContentCache.GetById(nodeId);
Assert.IsNotNull(content);
var culture = Web.Models.ContentExtensions.GetCulture(umbracoContext, domainService, ServiceContext.LocalizationService, null, content.Id, content.Path, new Uri(currentUrl));
var culture = global::Umbraco.Web.Models.ContentExtensions.GetCulture(umbracoContext, domainService, ServiceContext.LocalizationService, null, content.Id, content.Path, new Uri(currentUrl));
Assert.AreEqual(expectedCulture, culture.Name);
}
}
@@ -0,0 +1,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web.PublishedCache.XmlPublishedCache;
namespace Umbraco.Tests.Routing
{
[DatabaseTestBehavior(DatabaseBehavior.NewDbFileAndSchemaPerFixture)]
[TestFixture]
public class RoutesCacheTests : BaseRoutingTest
{
[Test]
public void U4_7939()
{
//var routingContext = GetRoutingContext("/test", 1111);
var umbracoContext = GetUmbracoContext("/test", 0);
var cache = umbracoContext.ContentCache.InnerCache as PublishedContentCache;
if (cache == null) throw new Exception("Unsupported IPublishedContentCache, only the Xml one is supported.");
PublishedContentCache.UnitTesting = false; // else does not write to routes cache
Assert.IsFalse(PublishedContentCache.UnitTesting);
var z = cache.GetByRoute(umbracoContext, false, "/home/sub1");
Assert.IsNotNull(z);
Assert.AreEqual(1173, z.Id);
var routes = cache.RoutesCache.GetCachedRoutes();
Assert.AreEqual(1, routes.Count);
// before the fix, the following assert would fail because the route would
// have been stored as { 0, "/home/sub1" } - essentially meaning we were NOT
// storing anything in the route cache!
Assert.AreEqual(1173, routes.Keys.First());
Assert.AreEqual("/home/sub1", routes.Values.First());
}
}
}
@@ -0,0 +1,85 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Web;
using Microsoft.Owin;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Logging;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Profiling;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
using Umbraco.Web.Security.Identity;
namespace Umbraco.Tests.Security
{
[TestFixture]
public class BackOfficeCookieManagerTests
{
[Test]
public void ShouldAuthenticateRequest_When_Not_Configured()
{
//should force app ctx to show not-configured
ConfigurationManager.AppSettings.Set("umbracoConfigurationStatus", "");
var dbCtx = new Mock<DatabaseContext>(Mock.Of<IDatabaseFactory>(), Mock.Of<ILogger>(), Mock.Of<ISqlSyntaxProvider>(), "test");
dbCtx.Setup(x => x.IsDatabaseConfigured).Returns(false);
var appCtx = new ApplicationContext(
dbCtx.Object,
MockHelper.GetMockedServiceContext(),
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
var umbCtx = UmbracoContext.CreateContext(
Mock.Of<HttpContextBase>(),
appCtx,
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
Mock.Of<IUmbracoSettingsSection>(), new List<IUrlProvider>(), false);
var mgr = new BackOfficeCookieManager(Mock.Of<IUmbracoContextAccessor>(accessor => accessor.Value == umbCtx));
var result = mgr.ShouldAuthenticateRequest(Mock.Of<IOwinContext>(), new Uri("http://localhost/umbraco"));
Assert.IsFalse(result);
}
[Test]
public void ShouldAuthenticateRequest_When_Configured()
{
var dbCtx = new Mock<DatabaseContext>(Mock.Of<IDatabaseFactory>(), Mock.Of<ILogger>(), Mock.Of<ISqlSyntaxProvider>(), "test");
dbCtx.Setup(x => x.IsDatabaseConfigured).Returns(true);
var appCtx = new ApplicationContext(
dbCtx.Object,
MockHelper.GetMockedServiceContext(),
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
var umbCtx = UmbracoContext.CreateContext(
Mock.Of<HttpContextBase>(),
appCtx,
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
Mock.Of<IUmbracoSettingsSection>(), new List<IUrlProvider>(), false);
var mgr = new BackOfficeCookieManager(Mock.Of<IUmbracoContextAccessor>(accessor => accessor.Value == umbCtx));
var request = new Mock<OwinRequest>();
request.Setup(owinRequest => owinRequest.Uri).Returns(new Uri("http://localhost/umbraco"));
var result = mgr.ShouldAuthenticateRequest(
Mock.Of<IOwinContext>(context => context.Request == request.Object),
new Uri("http://localhost/umbraco"));
Assert.IsTrue(result);
}
//TODO : Write remaining tests for `ShouldAuthenticateRequest`
}
}
@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Text;
@@ -9,6 +8,7 @@ using Newtonsoft.Json;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Security;
using Umbraco.Core.Services;
namespace Umbraco.Tests.Security
{
+38 -22
View File
@@ -75,6 +75,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Owin, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Owin.3.0.1\lib\net45\Microsoft.Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
@@ -94,6 +98,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Semver">
<HintPath>..\packages\semver.1.1.2\lib\net45\Semver.dll</HintPath>
</Reference>
@@ -102,13 +110,13 @@
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Data.Entity.Design" />
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Reference Include="System.Data.SqlServerCe, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.dll</HintPath>
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.dll</HintPath>
</Reference>
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Reference Include="System.Data.SqlServerCe.Entity, Version=4.0.0.1, Culture=neutral, PublicKeyToken=89845dcd8080cc91, processorArchitecture=MSIL">
<Private>True</Private>
<HintPath>..\packages\SqlServerCE.4.0.0.0\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
<HintPath>..\packages\SqlServerCE.4.0.0.1\lib\System.Data.SqlServerCe.Entity.dll</HintPath>
</Reference>
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
@@ -167,10 +175,10 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AngularIntegration\AngularAntiForgeryTests.cs" />
<Compile Include="AngularIntegration\ContentModelSerializationTests.cs" />
<Compile Include="AngularIntegration\JsInitializationTests.cs" />
<Compile Include="AngularIntegration\ServerVariablesParserTests.cs" />
<Compile Include="Web\AngularIntegration\AngularAntiForgeryTests.cs" />
<Compile Include="Web\AngularIntegration\ContentModelSerializationTests.cs" />
<Compile Include="Web\AngularIntegration\JsInitializationTests.cs" />
<Compile Include="Web\AngularIntegration\ServerVariablesParserTests.cs" />
<Compile Include="ApplicationContextTests.cs" />
<Compile Include="AttemptTests.cs" />
<Compile Include="Cache\CacheRefresherTests.cs" />
@@ -180,12 +188,12 @@
<Compile Include="Cache\FullDataSetCachePolicyTests.cs" />
<Compile Include="Cache\SingleItemsOnlyCachePolicyTests.cs" />
<Compile Include="Collections\DeepCloneableListTests.cs" />
<Compile Include="Controllers\BackOfficeControllerUnitTests.cs" />
<Compile Include="Web\Controllers\BackOfficeControllerUnitTests.cs" />
<Compile Include="DelegateExtensionsTests.cs" />
<Compile Include="Logging\AsyncRollingFileAppenderTest.cs" />
<Compile Include="Logging\DebugAppender.cs" />
<Compile Include="Logging\ParallelForwarderTest.cs" />
<Compile Include="Mvc\RenderIndexActionSelectorAttributeTests.cs" />
<Compile Include="Web\Mvc\RenderIndexActionSelectorAttributeTests.cs" />
<Compile Include="Persistence\Repositories\AuditRepositoryTest.cs" />
<Compile Include="Persistence\Repositories\DomainRepositoryTest.cs" />
<Compile Include="Persistence\Repositories\PartialViewRepositoryTests.cs" />
@@ -193,7 +201,9 @@
<Compile Include="Persistence\Repositories\TaskRepositoryTest.cs" />
<Compile Include="Persistence\Repositories\TaskTypeRepositoryTest.cs" />
<Compile Include="Resolvers\ResolverBaseTest.cs" />
<Compile Include="Routing\RoutesCacheTests.cs" />
<Compile Include="Routing\UrlRoutingTestBase.cs" />
<Compile Include="Security\BackOfficeCookieManagerTests.cs" />
<Compile Include="Security\UmbracoBackOfficeIdentityTests.cs" />
<Compile Include="Services\ContentTypeServiceExtensionsTests.cs" />
<Compile Include="Services\PublicAccessServiceTests.cs" />
@@ -234,8 +244,8 @@
<Compile Include="Models\UmbracoEntityTests.cs" />
<Compile Include="Models\UserTests.cs" />
<Compile Include="Models\UserTypeTests.cs" />
<Compile Include="Mvc\SurfaceControllerTests.cs" />
<Compile Include="Mvc\UmbracoViewPageTests.cs" />
<Compile Include="Web\Mvc\SurfaceControllerTests.cs" />
<Compile Include="Web\Mvc\UmbracoViewPageTests.cs" />
<Compile Include="BootManagers\CoreBootManagerTests.cs" />
<Compile Include="BootManagers\WebBootManagerTests.cs" />
<Compile Include="Cache\ObjectCacheProviderTests.cs" />
@@ -310,9 +320,9 @@
<Compile Include="Configurations\UmbracoSettings\ViewstateMoverModuleElementTests.cs" />
<Compile Include="Configurations\UmbracoSettings\WebRoutingElementDefaultTests.cs" />
<Compile Include="Configurations\UmbracoSettings\WebRoutingElementTests.cs" />
<Compile Include="Controllers\WebApiEditors\ContentControllerUnitTests.cs" />
<Compile Include="Controllers\WebApiEditors\FilterAllowedOutgoingContentAttributeTests.cs" />
<Compile Include="Controllers\WebApiEditors\MediaControllerUnitTests.cs" />
<Compile Include="Web\Controllers\WebApiEditors\ContentControllerUnitTests.cs" />
<Compile Include="Web\Controllers\WebApiEditors\FilterAllowedOutgoingContentAttributeTests.cs" />
<Compile Include="Web\Controllers\WebApiEditors\MediaControllerUnitTests.cs" />
<Compile Include="CoreXml\FrameworkXmlTests.cs" />
<Compile Include="DynamicsAndReflection\QueryableExtensionTests.cs" />
<Compile Include="DynamicsAndReflection\ExtensionMethodFinderTests.cs" />
@@ -322,8 +332,8 @@
<Compile Include="Migrations\Upgrades\ValidateV7UpgradeTest.cs" />
<Compile Include="Models\ContentExtensionsTests.cs" />
<Compile Include="Models\UserExtensionsTests.cs" />
<Compile Include="Mvc\MergeParentContextViewDataAttributeTests.cs" />
<Compile Include="Mvc\ViewDataDictionaryExtensionTests.cs" />
<Compile Include="Web\Mvc\MergeParentContextViewDataAttributeTests.cs" />
<Compile Include="Web\Mvc\ViewDataDictionaryExtensionTests.cs" />
<Compile Include="Persistence\PetaPocoExtensionsTest.cs" />
<Compile Include="Persistence\Querying\ContentTypeSqlMappingTests.cs" />
<Compile Include="Persistence\Repositories\MacroRepositoryTest.cs" />
@@ -420,7 +430,7 @@
<Compile Include="PublishedContent\PublishedContentTests.cs" />
<Compile Include="PublishedContent\PublishedMediaTests.cs" />
<Compile Include="HashCodeCombinerTests.cs" />
<Compile Include="Mvc\HtmlHelperExtensionMethodsTests.cs" />
<Compile Include="Web\Mvc\HtmlHelperExtensionMethodsTests.cs" />
<Compile Include="IO\IOHelperTest.cs" />
<Compile Include="LibraryTests.cs" />
<Compile Include="PropertyEditors\PropertyEditorValueConverterTests.cs" />
@@ -505,7 +515,7 @@
<DependentUpon>ImportResources.resx</DependentUpon>
</Compile>
<Compile Include="Services\ThreadSafetyServiceTest.cs" />
<Compile Include="Controllers\PluginControllerAreaTests.cs" />
<Compile Include="Web\Controllers\PluginControllerAreaTests.cs" />
<Compile Include="Cache\DistributedCache\DistributedCacheTests.cs" />
<Compile Include="Templates\MasterPageHelperTests.cs" />
<Compile Include="TestHelpers\BaseDatabaseFactoryTest.cs" />
@@ -569,6 +579,7 @@
<Compile Include="Plugins\TypeFinderTests.cs" />
<Compile Include="Routing\UmbracoModuleTests.cs" />
<Compile Include="VersionExtensionTests.cs" />
<Compile Include="Web\WebExtensionMethodTests.cs" />
<Compile Include="XmlExtensionsTests.cs" />
<Compile Include="XmlHelperTests.cs" />
</ItemGroup>
@@ -738,11 +749,16 @@
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /D
xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.0\x86\*.* "$(TargetDir)x86\" /Y /F /E /D</PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
<PropertyGroup>
<PreBuildEvent>xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\amd64\*.* "$(TargetDir)amd64\" /Y /F /E /I /C /D
xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\" /Y /F /E /I /C /D</PreBuildEvent>
</PropertyGroup>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
@@ -1,20 +1,11 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.IO;
using System.Net;
using System.Security.Claims;
using System.Security.Principal;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Security;
using NUnit.Framework;
using Umbraco.Core.Security;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Tests.AngularIntegration
namespace Umbraco.Tests.Web.AngularIntegration
{
[TestFixture]
public class AngularAntiForgeryTests
@@ -1,80 +1,77 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Tests.AngularIntegration
{
[TestFixture]
public class ContentModelSerializationTests
{
[Test]
public void Content_Display_To_Json()
{
//create 3 tabs with 3 properties each
var tabs = new List<Tab<ContentPropertyDisplay>>();
for (var tabIndex = 0; tabIndex < 3; tabIndex ++)
{
var props = new List<ContentPropertyDisplay>();
for (var propertyIndex = 0; propertyIndex < 3; propertyIndex ++)
{
props.Add(new ContentPropertyDisplay
{
Alias = "property" + propertyIndex,
Label = "Property " + propertyIndex,
Id = propertyIndex,
Value = "value" + propertyIndex,
Config = new Dictionary<string, object> {{ propertyIndex.ToInvariantString(), "value" }},
Description = "Description " + propertyIndex,
View = "~/Views/View" + propertyIndex,
HideLabel = false
});
}
tabs.Add(new Tab<ContentPropertyDisplay>()
{
Alias = "Tab" + tabIndex,
Label = "Tab" + tabIndex,
Properties = props
});
}
var displayModel = new ContentItemDisplay
{
Id = 1234,
Name = "Test",
Tabs = tabs
};
var json = JsonConvert.SerializeObject(displayModel);
var jObject = JObject.Parse(json);
Assert.AreEqual("1234", jObject["id"].ToString());
Assert.AreEqual("Test", jObject["name"].ToString());
Assert.AreEqual(3, jObject["tabs"].Count());
for (var tab = 0; tab < jObject["tabs"].Count(); tab++)
{
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["alias"].ToString());
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["label"].ToString());
Assert.AreEqual(3, jObject["tabs"][tab]["properties"].Count());
for (var prop = 0; prop < jObject["tabs"][tab]["properties"].Count(); prop++)
{
Assert.AreEqual("property" + prop, jObject["tabs"][tab]["properties"][prop]["alias"].ToString());
Assert.AreEqual("Property " + prop, jObject["tabs"][tab]["properties"][prop]["label"].ToString());
Assert.AreEqual(prop, jObject["tabs"][tab]["properties"][prop]["id"].Value<int>());
Assert.AreEqual("value" + prop, jObject["tabs"][tab]["properties"][prop]["value"].ToString());
Assert.AreEqual("{\"" + prop + "\":\"value\"}", jObject["tabs"][tab]["properties"][prop]["config"].ToString(Formatting.None));
Assert.AreEqual("Description " + prop, jObject["tabs"][tab]["properties"][prop]["description"].ToString());
Assert.AreEqual(false, jObject["tabs"][tab]["properties"][prop]["hideLabel"].Value<bool>());
}
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Tests.Web.AngularIntegration
{
[TestFixture]
public class ContentModelSerializationTests
{
[Test]
public void Content_Display_To_Json()
{
//create 3 tabs with 3 properties each
var tabs = new List<Tab<ContentPropertyDisplay>>();
for (var tabIndex = 0; tabIndex < 3; tabIndex ++)
{
var props = new List<ContentPropertyDisplay>();
for (var propertyIndex = 0; propertyIndex < 3; propertyIndex ++)
{
props.Add(new ContentPropertyDisplay
{
Alias = "property" + propertyIndex,
Label = "Property " + propertyIndex,
Id = propertyIndex,
Value = "value" + propertyIndex,
Config = new Dictionary<string, object> {{ propertyIndex.ToInvariantString(), "value" }},
Description = "Description " + propertyIndex,
View = "~/Views/View" + propertyIndex,
HideLabel = false
});
}
tabs.Add(new Tab<ContentPropertyDisplay>()
{
Alias = "Tab" + tabIndex,
Label = "Tab" + tabIndex,
Properties = props
});
}
var displayModel = new ContentItemDisplay
{
Id = 1234,
Name = "Test",
Tabs = tabs
};
var json = JsonConvert.SerializeObject(displayModel);
var jObject = JObject.Parse(json);
Assert.AreEqual("1234", jObject["id"].ToString());
Assert.AreEqual("Test", jObject["name"].ToString());
Assert.AreEqual(3, jObject["tabs"].Count());
for (var tab = 0; tab < jObject["tabs"].Count(); tab++)
{
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["alias"].ToString());
Assert.AreEqual("Tab" + tab, jObject["tabs"][tab]["label"].ToString());
Assert.AreEqual(3, jObject["tabs"][tab]["properties"].Count());
for (var prop = 0; prop < jObject["tabs"][tab]["properties"].Count(); prop++)
{
Assert.AreEqual("property" + prop, jObject["tabs"][tab]["properties"][prop]["alias"].ToString());
Assert.AreEqual("Property " + prop, jObject["tabs"][tab]["properties"][prop]["label"].ToString());
Assert.AreEqual(prop, jObject["tabs"][tab]["properties"][prop]["id"].Value<int>());
Assert.AreEqual("value" + prop, jObject["tabs"][tab]["properties"][prop]["value"].ToString());
Assert.AreEqual("{\"" + prop + "\":\"value\"}", jObject["tabs"][tab]["properties"][prop]["config"].ToString(Formatting.None));
Assert.AreEqual("Description " + prop, jObject["tabs"][tab]["properties"][prop]["description"].ToString());
Assert.AreEqual(false, jObject["tabs"][tab]["properties"][prop]["hideLabel"].Value<bool>());
}
}
}
}
}
@@ -1,41 +1,36 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Manifest;
using Umbraco.Web.UI.JavaScript;
namespace Umbraco.Tests.AngularIntegration
{
[TestFixture]
public class JsInitializationTests
{
[Test]
public void Get_Default_Init()
{
var init = JsInitialization.GetDefaultInitialization();
Assert.IsTrue(init.Any());
}
[Test]
public void Parse_Main()
{
var result = JsInitialization.ParseMain(new[] {"[World]", "Hello" });
Assert.AreEqual(@"LazyLoad.js([World], function () {
//we need to set the legacy UmbClientMgr path
UmbClientMgr.setUmbracoPath('Hello');
jQuery(document).ready(function () {
angular.bootstrap(document, ['umbraco']);
});
});", result);
}
}
}
using System.Linq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Web.UI.JavaScript;
namespace Umbraco.Tests.Web.AngularIntegration
{
[TestFixture]
public class JsInitializationTests
{
[Test]
public void Get_Default_Init()
{
var init = JsInitialization.GetDefaultInitialization();
Assert.IsTrue(init.Any());
}
[Test]
public void Parse_Main()
{
var result = JsInitialization.ParseMain(new[] {"[World]", "Hello" });
Assert.AreEqual(@"LazyLoad.js([World], function () {
//we need to set the legacy UmbClientMgr path
UmbClientMgr.setUmbracoPath('Hello');
jQuery(document).ready(function () {
angular.bootstrap(document, ['umbraco']);
});
});".StripWhitespace(), result.StripWhitespace());
}
}
}
@@ -1,33 +1,34 @@
using System.Collections.Generic;
using NUnit.Framework;
using Umbraco.Web.UI.JavaScript;
namespace Umbraco.Tests.AngularIntegration
{
[TestFixture]
public class ServerVariablesParserTests
{
[Test]
public void Parse()
{
var d = new Dictionary<string, object>();
d.Add("test1", "Test 1");
d.Add("test2", "Test 2");
d.Add("test3", "Test 3");
d.Add("test4", "Test 4");
d.Add("test5", "Test 5");
var output = ServerVariablesParser.Parse(d);
Assert.IsTrue(output.Contains(@"Umbraco.Sys.ServerVariables = {
""test1"": ""Test 1"",
""test2"": ""Test 2"",
""test3"": ""Test 3"",
""test4"": ""Test 4"",
""test5"": ""Test 5""
} ;"));
}
}
using System.Collections.Generic;
using NUnit.Framework;
using Umbraco.Web.UI.JavaScript;
using Umbraco.Core;
namespace Umbraco.Tests.Web.AngularIntegration
{
[TestFixture]
public class ServerVariablesParserTests
{
[Test]
public void Parse()
{
var d = new Dictionary<string, object>();
d.Add("test1", "Test 1");
d.Add("test2", "Test 2");
d.Add("test3", "Test 3");
d.Add("test4", "Test 4");
d.Add("test5", "Test 5");
var output = ServerVariablesParser.Parse(d).StripWhitespace();
Assert.IsTrue(output.Contains(@"Umbraco.Sys.ServerVariables = {
""test1"": ""Test 1"",
""test2"": ""Test 2"",
""test3"": ""Test 3"",
""test4"": ""Test 4"",
""test5"": ""Test 5""
} ;".StripWhitespace()));
}
}
}
@@ -2,7 +2,7 @@
using NUnit.Framework;
using Umbraco.Web.Editors;
namespace Umbraco.Tests.Controllers
namespace Umbraco.Tests.Web.Controllers
{
[TestFixture]
public class BackOfficeControllerUnitTests
@@ -4,7 +4,7 @@ using Umbraco.Tests.TestHelpers;
using Umbraco.Web;
using Umbraco.Web.Mvc;
namespace Umbraco.Tests.Controllers
namespace Umbraco.Tests.Web.Controllers
{
[TestFixture]
public class PluginControllerAreaTests : BaseWebTest
@@ -1,366 +1,366 @@
using System.Collections.Generic;
using System.Web.Http;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Editors;
namespace Umbraco.Tests.Controllers.WebApiEditors
{
[TestFixture]
public class ContentControllerUnitTests
{
[Test]
public void Access_Allowed_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, contentService, 1234);
//assert
Assert.IsTrue(result);
}
[Test]
public void Throws_Exception_When_No_Content_Found()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(0)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>();
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act/assert
Assert.Throws<HttpResponseException>(() => ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F' }));
}
[Test]
public void No_Access_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(9876);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>();
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
//assert
Assert.IsFalse(result);
}
[Test]
public void No_Access_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A", "B", "C" })
};
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_Allowed_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A", "F", "C" })
};
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
//assert
Assert.IsTrue(result);
}
[Test]
public void Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
//assert
Assert.IsTrue(result);
}
[Test]
public void Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(1234);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
//assert
Assert.IsFalse(result);
}
[Test]
public void No_Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(1234);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Root_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'A'});
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Root_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'B'});
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Recycle_Bin_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'A'});
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Recycle_Bin_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'B'});
//assert
Assert.IsFalse(result);
}
}
//NOTE: The below self hosted stuff does work so need to get some tests written. Some are not possible atm because
// of the legacy SQL calls like checking permissions.
//[TestFixture]
//public class ContentControllerHostedTests : BaseRoutingTest
//{
// protected override DatabaseBehavior DatabaseTestBehavior
// {
// get { return DatabaseBehavior.NoDatabasePerFixture; }
// }
// public override void TearDown()
// {
// base.TearDown();
// UmbracoAuthorizeAttribute.Enable = true;
// UmbracoApplicationAuthorizeAttribute.Enable = true;
// }
// /// <summary>
// /// Tests to ensure that the response filter works so that any items the user
// /// doesn't have access to are removed
// /// </summary>
// [Test]
// public async void Get_By_Ids_Response_Filtered()
// {
// UmbracoAuthorizeAttribute.Enable = false;
// UmbracoApplicationAuthorizeAttribute.Enable = false;
// var baseUrl = string.Format("http://{0}:9876", Environment.MachineName);
// var url = baseUrl + "/api/Content/GetByIds?ids=1&ids=2";
// var routingCtx = GetRoutingContext(url, 1234, null, true);
// var config = new HttpSelfHostConfiguration(baseUrl);
// using (var server = new HttpSelfHostServer(config))
// {
// var route = config.Routes.MapHttpRoute("test", "api/Content/GetByIds",
// new
// {
// controller = "Content",
// action = "GetByIds",
// id = RouteParameter.Optional
// });
// route.DataTokens["Namespaces"] = new string[] { "Umbraco.Web.Editors" };
// var client = new HttpClient(server);
// var request = new HttpRequestMessage
// {
// RequestUri = new Uri(url),
// Method = HttpMethod.Get
// };
// var result = await client.SendAsync(request);
// }
// }
//}
}
using System.Collections.Generic;
using System.Web.Http;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Editors;
namespace Umbraco.Tests.Web.Controllers.WebApiEditors
{
[TestFixture]
public class ContentControllerUnitTests
{
[Test]
public void Access_Allowed_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, contentService, 1234);
//assert
Assert.IsTrue(result);
}
[Test]
public void Throws_Exception_When_No_Content_Found()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(0)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>();
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act/assert
Assert.Throws<HttpResponseException>(() => ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F' }));
}
[Test]
public void No_Access_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(9876);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>();
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
//assert
Assert.IsFalse(result);
}
[Test]
public void No_Access_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A", "B", "C" })
};
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_Allowed_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var contentMock = new Mock<IContent>();
contentMock.Setup(c => c.Path).Returns("-1,1234,5678");
var content = contentMock.Object;
var contentServiceMock = new Mock<IContentService>();
contentServiceMock.Setup(x => x.GetById(1234)).Returns(content);
var contentService = contentServiceMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A", "F", "C" })
};
userServiceMock.Setup(x => x.GetPermissions(user, 1234)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, contentService, 1234, new[] { 'F'});
//assert
Assert.IsTrue(result);
}
[Test]
public void Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
//assert
Assert.IsTrue(result);
}
[Test]
public void Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(1234);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -20);
//assert
Assert.IsFalse(result);
}
[Test]
public void No_Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(1234);
var user = userMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, null, null, -1);
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Root_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'A'});
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Root_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -1)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -1, new[] { 'B'});
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Recycle_Bin_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'A'});
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Recycle_Bin_By_Permission()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1234, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, -20)).Returns(permissions);
var userService = userServiceMock.Object;
//act
var result = ContentController.CheckPermissions(new Dictionary<string, object>(), user, userService, null, -20, new[] { 'B'});
//assert
Assert.IsFalse(result);
}
}
//NOTE: The below self hosted stuff does work so need to get some tests written. Some are not possible atm because
// of the legacy SQL calls like checking permissions.
//[TestFixture]
//public class ContentControllerHostedTests : BaseRoutingTest
//{
// protected override DatabaseBehavior DatabaseTestBehavior
// {
// get { return DatabaseBehavior.NoDatabasePerFixture; }
// }
// public override void TearDown()
// {
// base.TearDown();
// UmbracoAuthorizeAttribute.Enable = true;
// UmbracoApplicationAuthorizeAttribute.Enable = true;
// }
// /// <summary>
// /// Tests to ensure that the response filter works so that any items the user
// /// doesn't have access to are removed
// /// </summary>
// [Test]
// public async void Get_By_Ids_Response_Filtered()
// {
// UmbracoAuthorizeAttribute.Enable = false;
// UmbracoApplicationAuthorizeAttribute.Enable = false;
// var baseUrl = string.Format("http://{0}:9876", Environment.MachineName);
// var url = baseUrl + "/api/Content/GetByIds?ids=1&ids=2";
// var routingCtx = GetRoutingContext(url, 1234, null, true);
// var config = new HttpSelfHostConfiguration(baseUrl);
// using (var server = new HttpSelfHostServer(config))
// {
// var route = config.Routes.MapHttpRoute("test", "api/Content/GetByIds",
// new
// {
// controller = "Content",
// action = "GetByIds",
// id = RouteParameter.Optional
// });
// route.DataTokens["Namespaces"] = new string[] { "Umbraco.Web.Editors" };
// var client = new HttpClient(server);
// var request = new HttpRequestMessage
// {
// RequestUri = new Uri(url),
// Method = HttpMethod.Get
// };
// var result = await client.SendAsync(request);
// }
// }
//}
}
@@ -1,136 +1,136 @@
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Tests.Controllers.WebApiEditors
{
[TestFixture]
public class FilterAllowedOutgoingContentAttributeTests
{
[Test]
public void GetValueFromResponse_Already_EnumerableContent()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
var val = new List<ContentItemBasic>() {new ContentItemBasic()};
var result = att.GetValueFromResponse(
new ObjectContent(typeof (IEnumerable<ContentItemBasic>),
val,
new JsonMediaTypeFormatter(),
new MediaTypeHeaderValue("html/text")));
Assert.AreEqual(val, result);
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
}
[Test]
public void GetValueFromResponse_From_Property()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "MyList");
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
var container = new MyTestClass() {MyList = val};
var result = att.GetValueFromResponse(
new ObjectContent(typeof(MyTestClass),
container,
new JsonMediaTypeFormatter(),
new MediaTypeHeaderValue("html/text")));
Assert.AreEqual(val, result);
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
}
[Test]
public void GetValueFromResponse_Returns_Null_Not_Found_Property()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "DontFind");
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
var container = new MyTestClass() { MyList = val };
var result = att.GetValueFromResponse(
new ObjectContent(typeof(MyTestClass),
container,
new JsonMediaTypeFormatter(),
new MediaTypeHeaderValue("html/text")));
Assert.AreEqual(null, result);
}
[Test]
public void Filter_On_Start_Node()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
var list = new List<dynamic>();
var path = "";
for (var i = 0; i < 10; i++)
{
if (i > 0 && path.EndsWith(",") == false)
{
path += ",";
}
path += i.ToInvariantString();
list.Add(new ContentItemBasic { Id = i, Name = "Test" + i, ParentId = i, Path = path });
}
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(5);
var user = userMock.Object;
att.FilterBasedOnStartNode(list, user);
Assert.AreEqual(5, list.Count);
}
[Test]
public void Filter_On_Permissions()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
var list = new List<dynamic>();
for (var i = 0; i < 10; i++)
{
list.Add(new ContentItemBasic{Id = i, Name = "Test" + i, ParentId = -1});
}
var ids = list.Select(x => (int)x.Id).ToArray();
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
//we're only assigning 3 nodes browse permissions so that is what we expect as a result
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1, new string[]{ "F" }),
new EntityPermission(9, 2, new string[]{ "F" }),
new EntityPermission(9, 3, new string[]{ "F" }),
new EntityPermission(9, 4, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, ids)).Returns(permissions);
var userService = userServiceMock.Object;
att.FilterBasedOnPermissions(list, user, userService);
Assert.AreEqual(3, list.Count);
Assert.AreEqual(1, list.ElementAt(0).Id);
Assert.AreEqual(2, list.ElementAt(1).Id);
Assert.AreEqual(3, list.ElementAt(2).Id);
}
private class MyTestClass
{
public IEnumerable<ContentItemBasic> MyList { get; set; }
}
}
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Tests.Web.Controllers.WebApiEditors
{
[TestFixture]
public class FilterAllowedOutgoingContentAttributeTests
{
[Test]
public void GetValueFromResponse_Already_EnumerableContent()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
var val = new List<ContentItemBasic>() {new ContentItemBasic()};
var result = att.GetValueFromResponse(
new ObjectContent(typeof (IEnumerable<ContentItemBasic>),
val,
new JsonMediaTypeFormatter(),
new MediaTypeHeaderValue("html/text")));
Assert.AreEqual(val, result);
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
}
[Test]
public void GetValueFromResponse_From_Property()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "MyList");
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
var container = new MyTestClass() {MyList = val};
var result = att.GetValueFromResponse(
new ObjectContent(typeof(MyTestClass),
container,
new JsonMediaTypeFormatter(),
new MediaTypeHeaderValue("html/text")));
Assert.AreEqual(val, result);
Assert.AreEqual(1, ((IEnumerable<ContentItemBasic>)result).Count());
}
[Test]
public void GetValueFromResponse_Returns_Null_Not_Found_Property()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>), "DontFind");
var val = new List<ContentItemBasic>() { new ContentItemBasic() };
var container = new MyTestClass() { MyList = val };
var result = att.GetValueFromResponse(
new ObjectContent(typeof(MyTestClass),
container,
new JsonMediaTypeFormatter(),
new MediaTypeHeaderValue("html/text")));
Assert.AreEqual(null, result);
}
[Test]
public void Filter_On_Start_Node()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
var list = new List<dynamic>();
var path = "";
for (var i = 0; i < 10; i++)
{
if (i > 0 && path.EndsWith(",") == false)
{
path += ",";
}
path += i.ToInvariantString();
list.Add(new ContentItemBasic { Id = i, Name = "Test" + i, ParentId = i, Path = path });
}
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(5);
var user = userMock.Object;
att.FilterBasedOnStartNode(list, user);
Assert.AreEqual(5, list.Count);
}
[Test]
public void Filter_On_Permissions()
{
var att = new FilterAllowedOutgoingContentAttribute(typeof(IEnumerable<ContentItemBasic>));
var list = new List<dynamic>();
for (var i = 0; i < 10; i++)
{
list.Add(new ContentItemBasic{Id = i, Name = "Test" + i, ParentId = -1});
}
var ids = list.Select(x => (int)x.Id).ToArray();
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartContentId).Returns(-1);
var user = userMock.Object;
var userServiceMock = new Mock<IUserService>();
//we're only assigning 3 nodes browse permissions so that is what we expect as a result
var permissions = new List<EntityPermission>
{
new EntityPermission(9, 1, new string[]{ "F" }),
new EntityPermission(9, 2, new string[]{ "F" }),
new EntityPermission(9, 3, new string[]{ "F" }),
new EntityPermission(9, 4, new string[]{ "A" })
};
userServiceMock.Setup(x => x.GetPermissions(user, ids)).Returns(permissions);
var userService = userServiceMock.Object;
att.FilterBasedOnPermissions(list, user, userService);
Assert.AreEqual(3, list.Count);
Assert.AreEqual(1, list.ElementAt(0).Id);
Assert.AreEqual(2, list.ElementAt(1).Id);
Assert.AreEqual(3, list.ElementAt(2).Id);
}
private class MyTestClass
{
public IEnumerable<ContentItemBasic> MyList { get; set; }
}
}
}
@@ -1,142 +1,142 @@
using System.Collections.Generic;
using System.Web.Http;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Editors;
namespace Umbraco.Tests.Controllers.WebApiEditors
{
[TestFixture]
public class MediaControllerUnitTests
{
[Test]
public void Access_Allowed_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
var mediaMock = new Mock<IMedia>();
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
var media = mediaMock.Object;
var mediaServiceMock = new Mock<IMediaService>();
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
var mediaService = mediaServiceMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
//assert
Assert.IsTrue(result);
}
[Test]
public void Throws_Exception_When_No_Media_Found()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
var mediaMock = new Mock<IMedia>();
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
var media = mediaMock.Object;
var mediaServiceMock = new Mock<IMediaService>();
mediaServiceMock.Setup(x => x.GetById(0)).Returns(media);
var mediaService = mediaServiceMock.Object;
//act/assert
Assert.Throws<HttpResponseException>(() => MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234));
}
[Test]
public void No_Access_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartMediaId).Returns(9876);
var user = userMock.Object;
var mediaMock = new Mock<IMedia>();
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
var media = mediaMock.Object;
var mediaServiceMock = new Mock<IMediaService>();
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
var mediaService = mediaServiceMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(1234);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(1234);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
//assert
Assert.IsFalse(result);
}
}
using System.Collections.Generic;
using System.Web.Http;
using Moq;
using NUnit.Framework;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Editors;
namespace Umbraco.Tests.Web.Controllers.WebApiEditors
{
[TestFixture]
public class MediaControllerUnitTests
{
[Test]
public void Access_Allowed_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
var mediaMock = new Mock<IMedia>();
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
var media = mediaMock.Object;
var mediaServiceMock = new Mock<IMediaService>();
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
var mediaService = mediaServiceMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
//assert
Assert.IsTrue(result);
}
[Test]
public void Throws_Exception_When_No_Media_Found()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
var mediaMock = new Mock<IMedia>();
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
var media = mediaMock.Object;
var mediaServiceMock = new Mock<IMediaService>();
mediaServiceMock.Setup(x => x.GetById(0)).Returns(media);
var mediaService = mediaServiceMock.Object;
//act/assert
Assert.Throws<HttpResponseException>(() => MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234));
}
[Test]
public void No_Access_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(9);
userMock.Setup(u => u.StartMediaId).Returns(9876);
var user = userMock.Object;
var mediaMock = new Mock<IMedia>();
mediaMock.Setup(m => m.Path).Returns("-1,1234,5678");
var media = mediaMock.Object;
var mediaServiceMock = new Mock<IMediaService>();
mediaServiceMock.Setup(x => x.GetById(1234)).Returns(media);
var mediaService = mediaServiceMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, mediaService, 1234);
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Root_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(1234);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -1);
//assert
Assert.IsFalse(result);
}
[Test]
public void Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(-1);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
//assert
Assert.IsTrue(result);
}
[Test]
public void No_Access_To_Recycle_Bin_By_Path()
{
//arrange
var userMock = new Mock<IUser>();
userMock.Setup(u => u.Id).Returns(0);
userMock.Setup(u => u.StartMediaId).Returns(1234);
var user = userMock.Object;
//act
var result = MediaController.CheckPermissions(new Dictionary<string, object>(), user, null, -21);
//assert
Assert.IsFalse(result);
}
}
}
@@ -2,7 +2,7 @@ using System.Web.Mvc;
using NUnit.Framework;
using Umbraco.Web;
namespace Umbraco.Tests.Mvc
namespace Umbraco.Tests.Web.Mvc
{
[TestFixture]
public class HtmlHelperExtensionMethodsTests
@@ -1,86 +1,86 @@
using System.Web.Mvc;
using System.Web.Routing;
using NUnit.Framework;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web.Mvc;
namespace Umbraco.Tests.Mvc
{
[TestFixture]
public class MergeParentContextViewDataAttributeTests
{
[Test]
public void Ensure_All_Ancestor_ViewData_Is_Merged()
{
var http = new FakeHttpContextFactory("http://localhost");
//setup an heirarchy
var rootViewCtx = new ViewContext {Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary()};
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) {RouteData = new RouteData()};
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
//set up the view data
controllerCtx.Controller.ViewData["Test1"] = "Test1";
controllerCtx.Controller.ViewData["Test2"] = "Test2";
controllerCtx.Controller.ViewData["Test3"] = "Test3";
parentViewCtx.ViewData["Test4"] = "Test4";
parentViewCtx.ViewData["Test5"] = "Test5";
parentViewCtx.ViewData["Test6"] = "Test6";
rootViewCtx.ViewData["Test7"] = "Test7";
rootViewCtx.ViewData["Test8"] = "Test8";
rootViewCtx.ViewData["Test9"] = "Test9";
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) {RouteData = controllerCtx.RouteData};
var att = new MergeParentContextViewDataAttribute();
Assert.IsTrue(filter.IsChildAction);
att.OnResultExecuting(filter);
Assert.AreEqual(9, controllerCtx.Controller.ViewData.Count);
}
[Test]
public void Ensure_All_Ancestor_ViewData_Is_Merged_Without_Data_Loss()
{
var http = new FakeHttpContextFactory("http://localhost");
//setup an heirarchy
var rootViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary() };
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) { RouteData = new RouteData() };
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
//set up the view data with overlapping keys
controllerCtx.Controller.ViewData["Test1"] = "Test1";
controllerCtx.Controller.ViewData["Test2"] = "Test2";
controllerCtx.Controller.ViewData["Test3"] = "Test3";
parentViewCtx.ViewData["Test2"] = "Test4";
parentViewCtx.ViewData["Test3"] = "Test5";
parentViewCtx.ViewData["Test4"] = "Test6";
rootViewCtx.ViewData["Test3"] = "Test7";
rootViewCtx.ViewData["Test4"] = "Test8";
rootViewCtx.ViewData["Test5"] = "Test9";
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) { RouteData = controllerCtx.RouteData };
var att = new MergeParentContextViewDataAttribute();
Assert.IsTrue(filter.IsChildAction);
att.OnResultExecuting(filter);
Assert.AreEqual(5, controllerCtx.Controller.ViewData.Count);
Assert.AreEqual("Test1", controllerCtx.Controller.ViewData["Test1"]);
Assert.AreEqual("Test2", controllerCtx.Controller.ViewData["Test2"]);
Assert.AreEqual("Test3", controllerCtx.Controller.ViewData["Test3"]);
Assert.AreEqual("Test6", controllerCtx.Controller.ViewData["Test4"]);
Assert.AreEqual("Test9", controllerCtx.Controller.ViewData["Test5"]);
}
internal class MyController : Controller
{
}
}
using System.Web.Mvc;
using System.Web.Routing;
using NUnit.Framework;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web.Mvc;
namespace Umbraco.Tests.Web.Mvc
{
[TestFixture]
public class MergeParentContextViewDataAttributeTests
{
[Test]
public void Ensure_All_Ancestor_ViewData_Is_Merged()
{
var http = new FakeHttpContextFactory("http://localhost");
//setup an heirarchy
var rootViewCtx = new ViewContext {Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary()};
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) {RouteData = new RouteData()};
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
//set up the view data
controllerCtx.Controller.ViewData["Test1"] = "Test1";
controllerCtx.Controller.ViewData["Test2"] = "Test2";
controllerCtx.Controller.ViewData["Test3"] = "Test3";
parentViewCtx.ViewData["Test4"] = "Test4";
parentViewCtx.ViewData["Test5"] = "Test5";
parentViewCtx.ViewData["Test6"] = "Test6";
rootViewCtx.ViewData["Test7"] = "Test7";
rootViewCtx.ViewData["Test8"] = "Test8";
rootViewCtx.ViewData["Test9"] = "Test9";
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) {RouteData = controllerCtx.RouteData};
var att = new MergeParentContextViewDataAttribute();
Assert.IsTrue(filter.IsChildAction);
att.OnResultExecuting(filter);
Assert.AreEqual(9, controllerCtx.Controller.ViewData.Count);
}
[Test]
public void Ensure_All_Ancestor_ViewData_Is_Merged_Without_Data_Loss()
{
var http = new FakeHttpContextFactory("http://localhost");
//setup an heirarchy
var rootViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, ViewData = new ViewDataDictionary() };
var parentViewCtx = new ViewContext { Controller = new MyController(), RequestContext = http.RequestContext, RouteData = new RouteData(), ViewData = new ViewDataDictionary() };
parentViewCtx.RouteData.DataTokens.Add("ParentActionViewContext", rootViewCtx);
var controllerCtx = new ControllerContext(http.RequestContext, new MyController()) { RouteData = new RouteData() };
controllerCtx.RouteData.DataTokens.Add("ParentActionViewContext", parentViewCtx);
//set up the view data with overlapping keys
controllerCtx.Controller.ViewData["Test1"] = "Test1";
controllerCtx.Controller.ViewData["Test2"] = "Test2";
controllerCtx.Controller.ViewData["Test3"] = "Test3";
parentViewCtx.ViewData["Test2"] = "Test4";
parentViewCtx.ViewData["Test3"] = "Test5";
parentViewCtx.ViewData["Test4"] = "Test6";
rootViewCtx.ViewData["Test3"] = "Test7";
rootViewCtx.ViewData["Test4"] = "Test8";
rootViewCtx.ViewData["Test5"] = "Test9";
var filter = new ResultExecutingContext(controllerCtx, new ContentResult()) { RouteData = controllerCtx.RouteData };
var att = new MergeParentContextViewDataAttribute();
Assert.IsTrue(filter.IsChildAction);
att.OnResultExecuting(filter);
Assert.AreEqual(5, controllerCtx.Controller.ViewData.Count);
Assert.AreEqual("Test1", controllerCtx.Controller.ViewData["Test1"]);
Assert.AreEqual("Test2", controllerCtx.Controller.ViewData["Test2"]);
Assert.AreEqual("Test3", controllerCtx.Controller.ViewData["Test3"]);
Assert.AreEqual("Test6", controllerCtx.Controller.ViewData["Test4"]);
Assert.AreEqual("Test9", controllerCtx.Controller.ViewData["Test5"]);
}
internal class MyController : Controller
{
}
}
}
@@ -17,7 +17,7 @@ using Umbraco.Web.Mvc;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
namespace Umbraco.Tests.Mvc
namespace Umbraco.Tests.Web.Mvc
{
[TestFixture]
public class RenderIndexActionSelectorAttributeTests
@@ -1,5 +1,4 @@
using System;
using System.CodeDom;
using System.Linq;
using System.Web;
using System.Web.Mvc;
@@ -12,7 +11,6 @@ using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Dictionary;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.ObjectResolution;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Profiling;
@@ -20,11 +18,10 @@ using Umbraco.Core.Services;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web;
using Umbraco.Web.Mvc;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
namespace Umbraco.Tests.Mvc
namespace Umbraco.Tests.Web.Mvc
{
[TestFixture]
public class SurfaceControllerTests
@@ -165,7 +162,7 @@ namespace Umbraco.Tests.Mvc
};
var routeData = new RouteData();
routeData.DataTokens.Add("umbraco-route-def", routeDefinition);
routeData.DataTokens.Add(Umbraco.Core.Constants.Web.UmbracoRouteDefinitionDataToken, routeDefinition);
var ctrl = new TestSurfaceController(umbCtx, new UmbracoHelper());
ctrl.ControllerContext = new ControllerContext(contextBase, routeData, ctrl);
@@ -1,27 +1,22 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Web.Routing;
using System.Xml;
using Moq;
using NUnit.Framework;
using umbraco.BusinessLogic;
using Umbraco.Core;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Events;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.Persistence.UnitOfWork;
using Umbraco.Core.Profiling;
using Umbraco.Core.Services;
using Umbraco.Web.Security;
using umbraco.BusinessLogic;
using Umbraco.Core;
using Umbraco.Core.Events;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Tests.PublishedContent;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.TestHelpers.Stubs;
using Umbraco.Web;
@@ -30,8 +25,9 @@ using Umbraco.Web.Mvc;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.PublishedCache.XmlPublishedCache;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
namespace Umbraco.Tests.Mvc
namespace Umbraco.Tests.Web.Mvc
{
[TestFixture]
public class UmbracoViewPageTests
@@ -445,7 +441,7 @@ namespace Umbraco.Tests.Mvc
var context = new ViewContext();
context.RouteData = new RouteData();
context.RouteData.DataTokens.Add("umbraco-context", umbracoContext);
context.RouteData.DataTokens.Add(Umbraco.Core.Constants.Web.UmbracoContextDataToken, umbracoContext);
return context;
}
@@ -1,42 +1,40 @@
using System.Collections.Generic;
using System.Text;
using System.Web.Mvc;
using NUnit.Framework;
using Umbraco.Web.Mvc;
namespace Umbraco.Tests.Mvc
{
[TestFixture]
public class ViewDataDictionaryExtensionTests
{
[Test]
public void Merge_View_Data()
{
var source = new ViewDataDictionary();
var dest = new ViewDataDictionary();
source.Add("Test1", "Test1");
dest.Add("Test2", "Test2");
dest.MergeViewDataFrom(source);
Assert.AreEqual(2, dest.Count);
}
[Test]
public void Merge_View_Data_Retains_Destination_Values()
{
var source = new ViewDataDictionary();
var dest = new ViewDataDictionary();
source.Add("Test1", "Test1");
dest.Add("Test1", "MyValue");
dest.Add("Test2", "Test2");
dest.MergeViewDataFrom(source);
Assert.AreEqual(2, dest.Count);
Assert.AreEqual("MyValue", dest["Test1"]);
Assert.AreEqual("Test2", dest["Test2"]);
}
}
}
using System.Web.Mvc;
using NUnit.Framework;
using Umbraco.Web.Mvc;
namespace Umbraco.Tests.Web.Mvc
{
[TestFixture]
public class ViewDataDictionaryExtensionTests
{
[Test]
public void Merge_View_Data()
{
var source = new ViewDataDictionary();
var dest = new ViewDataDictionary();
source.Add("Test1", "Test1");
dest.Add("Test2", "Test2");
dest.MergeViewDataFrom(source);
Assert.AreEqual(2, dest.Count);
}
[Test]
public void Merge_View_Data_Retains_Destination_Values()
{
var source = new ViewDataDictionary();
var dest = new ViewDataDictionary();
source.Add("Test1", "Test1");
dest.Add("Test1", "MyValue");
dest.Add("Test2", "Test2");
dest.MergeViewDataFrom(source);
Assert.AreEqual(2, dest.Count);
Assert.AreEqual("MyValue", dest["Test1"]);
Assert.AreEqual("Test2", dest["Test2"]);
}
}
}
@@ -0,0 +1,170 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.Logging;
using Umbraco.Core.Profiling;
using Umbraco.Web;
using Umbraco.Web.Mvc;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
namespace Umbraco.Tests.Web
{
[TestFixture]
public class WebExtensionMethodTests
{
[Test]
public void UmbracoContextExtensions_GetUmbracoContext()
{
var appCtx = new ApplicationContext(
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
var umbCtx = UmbracoContext.CreateContext(
Mock.Of<HttpContextBase>(),
appCtx,
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
Mock.Of<IUmbracoSettingsSection>(),
new List<IUrlProvider>(),
false);
var items = new Dictionary<object, object>()
{
{UmbracoContext.HttpContextItemName, umbCtx}
};
var http = new Mock<HttpContextBase>();
http.Setup(x => x.Items).Returns(items);
var result = http.Object.GetUmbracoContext();
Assert.IsNotNull(result);
Assert.AreSame(umbCtx, result);
}
[Test]
public void RouteDataExtensions_GetUmbracoContext()
{
var appCtx = new ApplicationContext(
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
var umbCtx = UmbracoContext.CreateContext(
Mock.Of<HttpContextBase>(),
appCtx,
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
Mock.Of<IUmbracoSettingsSection>(),
new List<IUrlProvider>(),
false);
var r1 = new RouteData();
r1.DataTokens.Add(Core.Constants.Web.UmbracoContextDataToken, umbCtx);
var result = r1.GetUmbracoContext();
Assert.IsNotNull(result);
Assert.AreSame(umbCtx, result);
}
[Test]
public void ControllerContextExtensions_GetUmbracoContext_From_RouteValues()
{
var appCtx = new ApplicationContext(
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
var umbCtx = UmbracoContext.CreateContext(
Mock.Of<HttpContextBase>(),
appCtx,
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
Mock.Of<IUmbracoSettingsSection>(),
new List<IUrlProvider>(),
false);
var r1 = new RouteData();
r1.DataTokens.Add(Core.Constants.Web.UmbracoContextDataToken, umbCtx);
var ctx1 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r1, new MyController()));
var r2 = new RouteData();
r2.DataTokens.Add("ParentActionViewContext", ctx1);
var ctx2 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r2, new MyController()));
var r3 = new RouteData();
r3.DataTokens.Add("ParentActionViewContext", ctx2);
var ctx3 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r3, new MyController()));
var result = ctx3.GetUmbracoContext();
Assert.IsNotNull(result);
Assert.AreSame(umbCtx, result);
}
[Test]
public void ControllerContextExtensions_GetUmbracoContext_From_HttpContext()
{
var appCtx = new ApplicationContext(
CacheHelper.CreateDisabledCacheHelper(),
new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
var umbCtx = UmbracoContext.CreateContext(
Mock.Of<HttpContextBase>(),
appCtx,
new WebSecurity(Mock.Of<HttpContextBase>(), appCtx),
Mock.Of<IUmbracoSettingsSection>(),
new List<IUrlProvider>(),
false);
var items = new Dictionary<object, object>()
{
{UmbracoContext.HttpContextItemName, umbCtx}
};
var http = new Mock<HttpContextBase>();
http.Setup(x => x.Items).Returns(items);
var r1 = new RouteData();
var ctx1 = CreateViewContext(new ControllerContext(http.Object, r1, new MyController()));
var r2 = new RouteData();
r2.DataTokens.Add("ParentActionViewContext", ctx1);
var ctx2 = CreateViewContext(new ControllerContext(http.Object, r2, new MyController()));
var r3 = new RouteData();
r3.DataTokens.Add("ParentActionViewContext", ctx2);
var ctx3 = CreateViewContext(new ControllerContext(http.Object, r3, new MyController()));
var result = ctx3.GetUmbracoContext();
Assert.IsNotNull(result);
Assert.AreSame(umbCtx, result);
}
[Test]
public void ControllerContextExtensions_GetDataTokenInViewContextHierarchy()
{
var r1 = new RouteData();
r1.DataTokens.Add("hello", "world");
var ctx1 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r1, new MyController()));
var r2 = new RouteData();
r2.DataTokens.Add("ParentActionViewContext", ctx1);
var ctx2 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r2, new MyController()));
var r3 = new RouteData();
r3.DataTokens.Add("ParentActionViewContext", ctx2);
var ctx3 = CreateViewContext(new ControllerContext(Mock.Of<HttpContextBase>(), r3, new MyController()));
var result = ctx3.GetDataTokenInViewContextHierarchy("hello");
Assert.IsNotNull(result as string);
Assert.AreEqual((string)result, "world");
}
private ViewContext CreateViewContext(ControllerContext ctx)
{
return new ViewContext(ctx, Mock.Of<IView>(),
new ViewDataDictionary(), new TempDataDictionary(), new StringWriter());
}
private class MyController : Controller
{
}
}
}
+3 -1
View File
@@ -13,13 +13,15 @@
<package id="Microsoft.AspNet.WebApi.SelfHost" version="4.0.30506.0" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net45" />
<package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Owin" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="MiniProfiler" version="2.1.0" targetFramework="net45" />
<package id="Moq" version="4.1.1309.0919" targetFramework="net45" />
<package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" />
<package id="NUnit" version="2.6.2" targetFramework="net45" />
<package id="Owin" version="1.0" targetFramework="net45" />
<package id="Selenium.WebDriver" version="2.32.0" targetFramework="net45" />
<package id="semver" version="1.1.2" targetFramework="net45" />
<package id="SharpZipLib" version="0.86.0" targetFramework="net45" />
<package id="SqlServerCE" version="4.0.0.0" targetFramework="net45" />
<package id="SqlServerCE" version="4.0.0.1" targetFramework="net45" />
</packages>
+7 -7
View File
@@ -1,5 +1,5 @@
{
"env": {
"env": {
"browser": true
},
@@ -8,7 +8,7 @@
],
"rules": {
"eqeqeq": 2,
"eqeqeq": 2,
"curly": 2,
"no-unused-vars": 1,
@@ -18,8 +18,8 @@
"dot-notation": 1,
"no-use-before-define": 0,
"angular/ng_controller_as": 1,
"angular/ng_controller_as_vm": 1,
"angular/ng_controller_as": 1,
"angular/ng_controller_as_vm": 1,
"strict": 0,
@@ -32,8 +32,8 @@
"comma-spacing": 0,
"no-trailing-spaces": 0,
"eol-last": 0,
"no-underscore-dangle": 0,
"camelcase": 0
"no-underscore-dangle": 0,
"camelcase": 0
},
"globals": {
@@ -50,4 +50,4 @@
"Bloodhound", false
}
}
}
@@ -361,6 +361,12 @@ Umbraco.Sys.registerNamespace("Umbraco.Application");
rootScope : function(){
return getRootScope();
},
reloadLocation: function() {
var injector = getRootInjector();
var $route = injector.get("$route");
$route.reload();
},
closeModalWindow: function(rVal) {
+1 -1
View File
@@ -37,7 +37,7 @@
"grunt-ngdocs": "~0.1.2",
"grunt-open": "~0.2.0",
"grunt-postcss": "~0.6.0",
"grunt-recess": "~0.3",
"grunt-recess": "~1.0.1",
"karma": "~0.9",
"karma-chrome-launcher": "0.0.2",
"karma-coffee-preprocessor": "0.0.1",
@@ -3,11 +3,93 @@
* @name umbraco.directives.directive:umbNavigation
* @restrict E
**/
function umbNavigationDirective() {
function umbNavigationDirective(appState, $location) {
return {
restrict: "E", // restrict to an element
replace: true, // replace the html element with the template
templateUrl: 'views/components/application/umb-navigation.html'
templateUrl: 'views/components/application/umb-navigation.html',
link: function (scope, element, attr, ctrl) {
scope.showTreeNavigation = appState.getGlobalState("showNavigation");
scope.searchClick = function() {
scope.searchOverlay = {
view: "search",
show: true,
submit: function(model) {
$location.path(model.selectedItem.editorPath);
scope.searchOverlay.show = false;
scope.searchOverlay = null;
},
close: function(oldModel) {
scope.searchOverlay.show = false;
scope.searchOverlay = null;
}
};
};
scope.avatarClick = function(){
if(scope.helpDialog) {
closeHelpDialog();
}
if(!scope.userDialog) {
scope.userDialog = {
view: "user",
show: true,
close: function(oldModel) {
closeUserDialog();
}
};
} else {
closeUserDialog();
}
};
function closeUserDialog() {
scope.userDialog.show = false;
scope.userDialog = null;
}
scope.helpClick = function(){
if(scope.userDialog) {
closeUserDialog();
}
if(!scope.helpDialog) {
scope.helpDialog = {
view: "help",
show: true,
close: function(oldModel) {
closeHelpDialog();
}
};
} else {
closeHelpDialog();
}
};
function closeHelpDialog() {
scope.helpDialog.show = false;
scope.helpDialog = null;
}
scope.showTree = function () {
scope.showTreeNavigation = appState.getGlobalState("showNavigation");
if(scope.showTreeNavigation === true) {
appState.setGlobalState("showNavigation", false);
} else {
appState.setGlobalState("showNavigation", true);
}
};
}
};
}
@@ -11,7 +11,7 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
link: function (scope, element, attr, ctrl) {
//setup scope vars
scope.maxSections = 7;
scope.maxSections = 5;
scope.overflowingSections = 0;
scope.sections = [];
scope.currentSection = appState.getSectionState("currentSection");
@@ -34,16 +34,25 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
sectionResource.getSections()
.then(function (result) {
scope.sections = result;
calculateHeight();
// hide overflowing sections
scope.totalSections = scope.sections.length;
if(scope.totalSections > scope.maxSections){
scope.needTray = true;
scope.overflowingSections = scope.maxSections - scope.totalSections;
}
// calculateHeight();
});
}
function calculateHeight(){
$timeout(function(){
//total height minus room for avatar and help icon
var height = $(window).height()-200;
var height = $(window).width();
scope.totalSections = scope.sections.length;
scope.maxSections = Math.floor(height / 70);
scope.maxSections = Math.floor(width / 70);
scope.needTray = false;
if(scope.totalSections > scope.maxSections){
@@ -84,57 +93,7 @@ function sectionsDirective($timeout, $window, navigationService, treeService, se
});
//on page resize
window.onresize = calculateHeight;
scope.avatarClick = function(){
if(scope.helpDialog) {
closeHelpDialog();
}
if(!scope.userDialog) {
scope.userDialog = {
view: "user",
show: true,
close: function(oldModel) {
closeUserDialog();
}
};
} else {
closeUserDialog();
}
};
function closeUserDialog() {
scope.userDialog.show = false;
scope.userDialog = null;
}
scope.helpClick = function(){
if(scope.userDialog) {
closeUserDialog();
}
if(!scope.helpDialog) {
scope.helpDialog = {
view: "help",
show: true,
close: function(oldModel) {
closeHelpDialog();
}
};
} else {
closeHelpDialog();
}
};
function closeHelpDialog() {
scope.helpDialog.show = false;
scope.helpDialog = null;
}
// window.onresize = calculateHeight;
scope.sectionClick = function (event, section) {
@@ -0,0 +1,30 @@
(function() {
'use strict';
function TreeNavigation(appState) {
function link(scope, el, attr, ctrl) {
scope.showTreeNavigation = false;
scope.currentSection = appState.getSectionState("currentSection");
scope.$watch(function(){
return appState.getGlobalState("showNavigation");
}, function (newValue) {
scope.showTreeNavigation = newValue;
});
}
var directive = {
restrict: 'E',
replace: true,
templateUrl: 'views/components/application/umb-tree-navigation.html',
link: link
};
return directive;
}
angular.module('umbraco.directives').directive('umbTreeNavigation', TreeNavigation);
})();
@@ -0,0 +1,18 @@
(function() {
'use strict';
function EditorSubView() {
var directive = {
transclude: true,
restrict: 'E',
replace: true,
templateUrl: 'views/components/editor/subview/umb-editor-sub-view.html'
};
return directive;
}
angular.module('umbraco.directives').directive('umbEditorSubView', EditorSubView);
})();
@@ -0,0 +1,18 @@
(function() {
'use strict';
function EditorSubViewContainer() {
var directive = {
transclude: true,
restrict: 'E',
replace: true,
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-container.html'
};
return directive;
}
angular.module('umbraco.directives').directive('umbEditorSubViewContainer', EditorSubViewContainer);
})();
@@ -0,0 +1,18 @@
(function() {
'use strict';
function EditorSubViewContent() {
var directive = {
transclude: true,
restrict: 'E',
replace: true,
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-content.html'
};
return directive;
}
angular.module('umbraco.directives').directive('umbEditorSubViewContent', EditorSubViewContent);
})();
@@ -0,0 +1,18 @@
(function() {
'use strict';
function EditorSubViewHeader() {
var directive = {
transclude: true,
restrict: 'E',
replace: true,
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-header.html'
};
return directive;
}
angular.module('umbraco.directives').directive('umbEditorSubViewHeader', EditorSubViewHeader);
})();
@@ -0,0 +1,18 @@
(function() {
'use strict';
function EditorSubViewSidebar() {
var directive = {
transclude: true,
restrict: 'E',
replace: true,
templateUrl: 'views/components/editor/subview/umb-editor-sub-view-sidebar.html'
};
return directive;
}
angular.module('umbraco.directives').directive('umbEditorSubViewSidebar', EditorSubViewSidebar);
})();
@@ -1,10 +1,25 @@
(function() {
'use strict';
function EditorHeaderDirective(iconHelper) {
function EditorHeaderDirective(iconHelper, variationsHelper) {
function link(scope, el, attr, ctrl) {
scope.showVariationsQuickSwitchToggle = false;
scope.showVariationsQuickSwitch = false;
function activate() {
showVariationsQuickSwitch(scope.variations);
}
function showVariationsQuickSwitch(variations) {
if(variations && variations.length > 1 || variations && variations.length === 1 && variations[0].variations && variations[0].variations.length > 0) {
scope.showVariationsQuickSwitchToggle = true;
} else {
scope.showVariationsQuickSwitchToggle = false;
}
}
scope.openIconPicker = function() {
scope.dialogModel = {
view: "iconpicker",
@@ -24,6 +39,62 @@
}
};
};
scope.toggleVariationsQuickSwitch = function() {
scope.showVariationsQuickSwitch = !scope.showVariationsQuickSwitch;
};
scope.hideVariationsQuickSwitch = function() {
scope.showVariationsQuickSwitch = false;
};
scope.toggleSubItems = function(item, $event) {
item.showSubItems = !item.showSubItems;
$event.preventDefault();
$event.stopPropagation();
};
scope.selectItem = function(item) {
if(scope.onSelectItem) {
for(var i = 0; i < scope.variations.length; i++) {
var language = scope.variations[i];
language.active = false;
if(language.variations && language.variations.length > 0) {
for(var variationIndex = 0; variationIndex < language.variations.length; variationIndex++) {
var variation = language.variations[variationIndex];
variation.active = false;
}
}
}
// set selected item to active
item.active = true;
scope.onSelectItem(item);
scope.showVariationsQuickSwitch = false;
}
};
scope.openInSplitView = function(item, $event) {
if(scope.onOpenInSplitView) {
scope.onOpenInSplitView(item);
scope.showVariationsQuickSwitch = false;
$event.preventDefault();
$event.stopPropagation();
}
};
scope.$watch('variations', function(newValue, oldValue){
showVariationsQuickSwitch(newValue);
}, true);
activate();
}
var directive = {
@@ -37,6 +108,11 @@
actions: "=",
name: "=",
nameLocked: "=",
variation: "=",
language: "=",
variations: "=",
onSelectItem: "=",
onOpenInSplitView: "=",
menu: "=",
icon: "=",
hideIcon: "@",
@@ -6,10 +6,21 @@
function link(scope, el, attr, ctrl) {
scope.showNavigation = true;
scope.showDropdown = false;
scope.maxNavigationItems = 5;
scope.overflowingNavigationsItems = 0;
scope.needDropdown = false;
scope.clickNavigationItem = function(selectedItem) {
setItemToActive(selectedItem);
runItemAction(selectedItem);
if(scope.showDropdown) {
scope.closeDropdown();
}
};
function runItemAction(selectedItem) {
@@ -40,8 +51,29 @@
scope.showNavigation = false;
}
hideOverflowingNavigationItems();
}
function hideOverflowingNavigationItems() {
scope.totalNavigationItems = scope.navigation.length;
if(scope.totalNavigationItems > scope.maxNavigationItems){
scope.needDropdown = true;
scope.overflowingNavigationsItems = scope.maxNavigationItems - scope.totalNavigationItems;
}
}
scope.toggleDropdown = function() {
scope.showDropdown = !scope.showDropdown;
};
scope.closeDropdown = function() {
scope.showDropdown = false;
};
activate();
}
@@ -3,32 +3,6 @@
function EditorSubViewsDirective() {
function link(scope, el, attr, ctrl) {
scope.activeView = {};
// set toolbar from selected navigation item
function setActiveView(items) {
for (var index = 0; index < items.length; index++) {
var item = items[index];
if (item.active && item.view) {
scope.activeView = item;
}
}
}
// watch for navigation changes
scope.$watch('subViews', function(newValue, oldValue) {
if (newValue) {
setActiveView(newValue);
}
}, true);
}
var directive = {
restrict: 'E',
replace: true,
@@ -36,8 +10,7 @@
scope: {
subViews: "=",
model: "="
},
link: link
}
};
return directive;
@@ -0,0 +1,19 @@
(function() {
'use strict';
function EditorToolbar() {
var directive = {
restrict: 'E',
replace: true,
transclude: true,
templateUrl: 'views/components/editor/umb-editor-toolbar.html'
};
return directive;
}
angular.module('umbraco.directives').directive('umbEditorToolbar', EditorToolbar);
})();
@@ -15,45 +15,55 @@ angular.module("umbraco.directives")
keyCombo = scope.$eval(attrs["hotkey"]);
}
// disable shortcuts in input fields if keycombo is 1 character
if (keyCombo) {
function activate() {
if (keyCombo.length === 1) {
options = {
inputDisabled: true
};
}
if (keyCombo) {
keyboardService.bind(keyCombo, function() {
var element = $(el);
var activeElementType = document.activeElement.tagName;
var clickableElements = ["A", "BUTTON"];
if (element.is("a,div,button,input[type='button'],input[type='submit'],input[type='checkbox']") && !element.is(':disabled')) {
if (element.is(':visible') || attrs.hotkeyWhenHidden) {
// when keycombo is enter and a link or button has focus - click the link or button instead of using the hotkey
if (keyCombo === "enter" && clickableElements.indexOf(activeElementType) === 0) {
document.activeElement.click();
} else {
element.click();
}
}
} else {
element.focus();
// disable shortcuts in input fields if keycombo is 1 character
if (keyCombo.length === 1) {
options = {
inputDisabled: true
};
}
}, options);
keyboardService.bind(keyCombo, function() {
el.on('$destroy', function() {
keyboardService.unbind(keyCombo);
});
var element = $(el);
var activeElementType = document.activeElement.tagName;
var clickableElements = ["A", "BUTTON"];
if (element.is("a,div,button,input[type='button'],input[type='submit'],input[type='checkbox']") && !element.is(':disabled')) {
if (element.is(':visible') || attrs.hotkeyWhenHidden) {
if (attrs.hotkeyWhen && attrs.hotkeyWhen === "false") {
return;
}
// when keycombo is enter and a link or button has focus - click the link or button instead of using the hotkey
if (keyCombo === "enter" && clickableElements.indexOf(activeElementType) === 0) {
document.activeElement.click();
} else {
element.click();
}
}
} else {
element.focus();
}
}, options);
el.on('$destroy', function() {
keyboardService.unbind(keyCombo);
});
}
}
activate();
};
});
@@ -14,7 +14,8 @@ angular.module("umbraco.directives")
templateUrl: 'views/components/imaging/umb-image-gravity.html',
scope: {
src: '=',
center: "="
center: "=",
onImageLoaded: "="
},
link: function(scope, element, attrs) {
@@ -26,6 +27,8 @@ angular.module("umbraco.directives")
top: 0
};
scope.loaded = false;
//elements
var $viewport = element.find(".viewport");
var $image = element.find("img");
@@ -42,6 +45,19 @@ angular.module("umbraco.directives")
};
};
scope.setFocalPoint = function(event) {
scope.$emit("imageFocalPointStart");
var offsetX = event.offsetX - 10;
var offsetY = event.offsetY - 10;
calculateGravity(offsetX, offsetY);
lazyEndEvent();
};
var setDimensions = function(){
scope.dimensions.width = $image.width();
scope.dimensions.height = $image.height();
@@ -54,9 +70,9 @@ angular.module("umbraco.directives")
}
};
var calculateGravity = function(){
scope.dimensions.left = $overlay[0].offsetLeft;
scope.dimensions.top = $overlay[0].offsetTop;
var calculateGravity = function(offsetX, offsetY){
scope.dimensions.left = offsetX;
scope.dimensions.top = offsetY;
scope.center.left = (scope.dimensions.left+10) / scope.dimensions.width;
scope.center.top = (scope.dimensions.top+10) / scope.dimensions.height;
@@ -80,7 +96,9 @@ angular.module("umbraco.directives")
},
stop: function() {
scope.$apply(function(){
calculateGravity();
var offsetX = $overlay[0].offsetLeft;
var offsetY = $overlay[0].offsetTop;
calculateGravity(offsetX, offsetY);
});
lazyEndEvent();
@@ -91,8 +109,26 @@ angular.module("umbraco.directives")
$image.load(function(){
$timeout(function(){
setDimensions();
scope.loaded = true;
scope.onImageLoaded();
});
});
$(window).on('resize.umbImageGravity', function(){
scope.$apply(function(){
$timeout(function(){
setDimensions();
});
var offsetX = $overlay[0].offsetLeft;
var offsetY = $overlay[0].offsetTop;
calculateGravity(offsetX, offsetY);
});
});
scope.$on('$destroy', function() {
$(window).off('.umbImageGravity');
});
}
};
});
@@ -26,6 +26,7 @@ angular.module("umbraco.directives")
link: function(scope, element, attrs) {
//// INIT /////
var $image = element.find("img");
scope.loaded = false;
$image.load(function(){
$timeout(function(){
@@ -52,6 +53,7 @@ angular.module("umbraco.directives")
}
setPreviewStyle();
scope.loaded = true;
});
});
@@ -11,22 +11,88 @@ angular.module("umbraco.directives")
},
transclude: true,
restrict: 'E',
replace: true,
replace: true,
templateUrl: 'views/components/property/umb-property.html',
link: function(scope) {
scope.propertyAlias = Umbraco.Sys.ServerVariables.isDebuggingEnabled === true ? scope.property.alias : null;
scope.showDropdown = false;
scope.selectedVariation = {};
scope.variations = [
{
name: "Danish",
master: true,
selected: true
},
{
name: "German"
},
{
name: "Spanish"
},
{
name: "Finnish"
},
{
name: "Albanian"
},
{
name: "Russian"
},
{
name: "Norwegian"
},
{
name: "Swedish"
}
];
function activate() {
for(var i = 0; i < scope.variations.length; i++ ) {
var variation = scope.variations[i];
if(variation.selected) {
scope.property.variation = variation;
}
}
}
scope.toggleDropdown = function() {
scope.showDropdown = !scope.showDropdown;
};
scope.closeDropdown = function() {
scope.showDropdown = false;
};
scope.editContent = function() {
scope.property.variation = null;
scope.showDropdown = false;
};
scope.syncContent = function(selectedVariation) {
for(var i = 0; i < scope.variations.length; i++ ) {
var variation = scope.variations[i];
variation.selected = false;
}
selectedVariation.selected = true;
scope.property.variation = selectedVariation;
scope.showDropdown = false;
};
activate();
},
//Define a controller for this directive to expose APIs to other directives
controller: function ($scope, $timeout) {
var self = this;
//set the API properties/methods
self.property = $scope.property;
self.setPropertyError = function(errorMsg) {
$scope.property.propertyErrorMessage = errorMsg;
};
}
};
});
});
@@ -1,7 +1,7 @@
/**
* @ngdoc directive
* @function
* @name umbraco.directives.directive:umbPropertyEditor
* @name umbraco.directives.directive:umbPropertyEditor
* @requires formController
* @restrict E
**/
@@ -14,10 +14,10 @@ var _umbPropertyEditor = function (umbPropEditorHelper) {
isPreValue: "@",
preview: "@"
},
require: "^form",
restrict: 'E',
replace: true,
replace: true,
templateUrl: 'views/components/property/umb-property-editor.html',
link: function (scope, element, attrs, ctrl) {
@@ -33,6 +33,7 @@ var _umbPropertyEditor = function (umbPropEditorHelper) {
scope.$watch("model.view", function(val){
scope.propertyEditorView = umbPropEditorHelper.getViewPath(scope.model.view, scope.isPreValue);
});
}
};
};
@@ -13,7 +13,7 @@
el.find("a:first").tab('show');
//enable the tab drop
el.tabdrop();
//el.tabdrop();
});
@@ -29,7 +29,7 @@
scope.$on('$destroy', function () {
//ensure to destroy tabdrop (unbinds window resize listeners)
el.tabdrop("destroy");
//el.tabdrop("destroy");
unbindModelWatch();
@@ -28,7 +28,8 @@ angular.module("umbraco.directives")
if( value !== undefined && value !== "" && value !== null) {
scope.alias = "Generating Alias...";
scope.alias = "";
scope.placeholderText = "Generating Alias...";
generateAliasTimeout = $timeout(function () {
updateAlias = true;
@@ -28,6 +28,8 @@
// add init tab
addInitGroup(scope.model.groups);
activateFirstGroup(scope.model.groups);
// localize texts
localizationService.localize("validation_validation").then(function(value) {
validationTranslated = value;
@@ -153,14 +155,14 @@
return resourceLookup(scope.model.id, selectedContentTypeAliases, propAliasesExisting).then(function (filteredAvailableCompositeTypes) {
_.each(scope.compositionsDialogModel.availableCompositeContentTypes, function (current) {
//reset first
//reset first
current.allowed = true;
//see if this list item is found in the response (allowed) list
var found = _.find(filteredAvailableCompositeTypes, function (f) {
return current.contentType.alias === f.contentType.alias;
});
//allow if the item was found in the response (allowed) list -
//allow if the item was found in the response (allowed) list -
// and ensure its set to allowed if it is currently checked,
// DO not allow if it's a locked content type.
current.allowed = scope.model.lockedCompositeContentTypes.indexOf(current.contentType.alias) === -1 &&
@@ -181,7 +183,7 @@
}
function setupAvailableContentTypesModel(result) {
scope.compositionsDialogModel.availableCompositeContentTypes = result;
scope.compositionsDialogModel.availableCompositeContentTypes = result;
//iterate each one and set it up
_.each(scope.compositionsDialogModel.availableCompositeContentTypes, function (c) {
//enable it if it's part of the selected model
@@ -276,7 +278,7 @@
// submit overlay if no compositions has been removed
// or the action has been confirmed
} else {
// make sure that all tabs has an init property
if (scope.model.groups.length !== 0) {
angular.forEach(scope.model.groups, function(group) {
@@ -454,6 +456,15 @@
return groups;
}
function activateFirstGroup(groups) {
if (groups && groups.length > 0) {
var firstGroup = groups[0];
if(!firstGroup.tabState || firstGroup.tabState === "inActive") {
firstGroup.tabState = "active";
}
}
}
/* ---------- PROPERTIES ---------- */
scope.addProperty = function(property, group) {
@@ -0,0 +1,112 @@
(function() {
'use strict';
function Variations(iconHelper) {
function link(scope, el, attr, ctrl) {
scope.newVariation = {};
scope.segments = [
{
name: "Mobile",
id: 1
},
{
name: "Tablet",
id: 2
},
{
name: "Email Subscriber",
id: 3
},
{
name: "Email Campagin March 2016",
id: 4
},
{
name: "Codegarden Attendees",
id: 5
},
{
name: "Codegarden Attendees from abroad",
id: 6
}
];
scope.variationsSortableOptions = {
distance: 10,
tolerance: "pointer",
opacity: 0.7,
scroll: true,
cursor: "move",
zIndex: 6000
};
scope.showNewVariation = function(language) {
language.showNewVariation = true;
};
scope.hideNewVariation = function(language) {
language.showNewVariation = false;
};
scope.toggleEditVariation = function(selectedVariation) {
selectedVariation.editVariation = !selectedVariation.editVariation;
};
scope.createNewVariation = function(newVariation, language) {
var variation = angular.copy(language);
variation.variationName = newVariation.name;
variation.variationDescription = newVariation.description;
variation.segments = newVariation.segments;
variation.active = false;
language.variations.unshift(variation);
language.showNewVariation = false;
scope.newVariation = {
name: "",
description: "",
segments: []
};
};
scope.saveVariation = function(variation, language) {
variation.editVariation = false;
};
scope.deleteVariation = function(variation, language) {
var index = language.variations.indexOf(variation);
language.variations.splice(index, 1);
};
scope.hideEditVariation = function(variation) {
variation.editVariation = false;
};
}
var directive = {
restrict: 'E',
replace: true,
templateUrl: 'views/components/umb-variations.html',
scope: {
variations: "=",
onClickVariation: "=",
onSaveVariation: "=",
onCloneVariation: "=",
onDeleteVariation: "="
},
link: link
};
return directive;
}
angular.module('umbraco.directives').directive('umbVariations', Variations);
})();
@@ -0,0 +1,29 @@
(function() {
'use strict';
function SetDirtyOnChange() {
function link(scope, el, attr, ctrl) {
var initValue = attr.umbSetDirtyOnChange;
attr.$observe("umbSetDirtyOnChange", function (newValue) {
if(newValue !== initValue) {
ctrl.$setDirty();
}
});
}
var directive = {
require: "^form",
restrict: 'A',
link: link
};
return directive;
}
angular.module('umbraco.directives').directive('umbSetDirtyOnChange', SetDirtyOnChange);
})();
@@ -8,9 +8,9 @@ function valHighlight($timeout) {
return {
restrict: "A",
link: function (scope, element, attrs, ctrl) {
attrs.$observe("valHighlight", function (newVal) {
if (newVal === true) {
if (newVal === "true") {
element.addClass("highlight-error");
$timeout(function () {
//set the bound scope property to false
@@ -25,4 +25,4 @@ function valHighlight($timeout) {
}
};
}
angular.module('umbraco.directives.validation').directive("valHighlight", valHighlight);
angular.module('umbraco.directives.validation').directive("valHighlight", valHighlight);
@@ -0,0 +1,8 @@
angular.module("umbraco.mocks").factory('externalLoginInfo',
function () {
return {
errors: [],
providers: []
};
}
);
@@ -716,7 +716,7 @@ angular.module('umbraco.mocks').
"user_administrators": "Administrator",
"user_categoryField": "Category field",
"user_changePassword": "Change Your Password",
"user_newPassword": "Change Your Password",
"user_newPassword": "New password",
"user_confirmNewPassword": "Confirm new password",
"user_changePasswordDescription": "You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button",
"user_contentChannel": "Content Channel",
@@ -730,6 +730,7 @@ angular.module('umbraco.mocks').
"user_mediastartnode": "Start Node in Media Library",
"user_modules": "Sections",
"user_noConsole": "Disable Umbraco Access",
"user_oldPassword": "Old password",
"user_password": "Password",
"user_resetPassword": "Reset password",
"user_passwordChanged": "Your password has been changed!",
@@ -42,6 +42,15 @@ function contentResource($q, $http, umbDataFormatter, umbRequestHelper) {
return {
getRecycleBin: function() {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"contentApiBaseUrl",
"GetRecycleBin")),
'Failed to retrieve data for content recycle bin');
},
/**
* @ngdoc method
* @name umbraco.resources.contentResource#sort
@@ -24,29 +24,18 @@ function contentTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
filterPropertyTypes = [];
}
var query = "";
_.each(filterContentTypes, function (item) {
query += "filterContentTypes=" + item + "&";
});
// if filterContentTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterContentTypes.length === 0) {
query += "filterContentTypes=&";
}
_.each(filterPropertyTypes, function (item) {
query += "filterPropertyTypes=" + item + "&";
});
// if filterPropertyTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterPropertyTypes.length === 0) {
query += "filterPropertyTypes=&";
}
query += "contentTypeId=" + contentTypeId;
var query = {
contentTypeId: contentTypeId,
filterContentTypes: filterContentTypes,
filterPropertyTypes: filterPropertyTypes
};
return umbRequestHelper.resourcePromise(
$http.get(
$http.post(
umbRequestHelper.getApiUrl(
"contentTypeApiBaseUrl",
"GetAvailableCompositeContentTypes",
query)),
"GetAvailableCompositeContentTypes"),
query),
'Failed to retrieve data for content type id ' + contentTypeId);
},
@@ -22,6 +22,15 @@ function mediaResource($q, $http, umbDataFormatter, umbRequestHelper) {
return {
getRecycleBin: function () {
return umbRequestHelper.resourcePromise(
$http.get(
umbRequestHelper.getApiUrl(
"mediaApiBaseUrl",
"GetRecycleBin")),
'Failed to retrieve data for media recycle bin');
},
/**
* @ngdoc method
* @name umbraco.resources.mediaResource#sort
@@ -24,29 +24,18 @@ function mediaTypeResource($q, $http, umbRequestHelper, umbDataFormatter) {
filterPropertyTypes = [];
}
var query = "";
_.each(filterContentTypes, function (item) {
query += "filterContentTypes=" + item + "&";
});
// if filterContentTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterContentTypes.length === 0) {
query += "filterContentTypes=&";
}
_.each(filterPropertyTypes, function (item) {
query += "filterPropertyTypes=" + item + "&";
});
// if filterPropertyTypes array is empty we need a empty variable in the querystring otherwise the service returns a error
if (filterPropertyTypes.length === 0) {
query += "filterPropertyTypes=&";
}
query += "contentTypeId=" + contentTypeId;
var query = {
contentTypeId: contentTypeId,
filterContentTypes: filterContentTypes,
filterPropertyTypes: filterPropertyTypes
};
return umbRequestHelper.resourcePromise(
$http.get(
$http.post(
umbRequestHelper.getApiUrl(
"mediaTypeApiBaseUrl",
"GetAvailableCompositeMediaTypes",
query)),
"GetAvailableCompositeMediaTypes"),
query),
'Failed to retrieve data for content type id ' + contentTypeId);
},
@@ -55,7 +55,7 @@ function contentEditingHelper(fileManager, $q, $location, $routeParams, notifica
var deferred = $q.defer();
if (!args.scope.busy && formHelper.submitForm({ scope: args.scope, statusMessage: args.statusMessage })) {
if (!args.scope.busy && formHelper.submitForm({ scope: args.scope, statusMessage: args.statusMessage, action: args.action })) {
args.scope.busy = true;
@@ -53,8 +53,8 @@ function contentTypeHelper(contentTypeResource, dataTypeResource, $filter, $inje
if (modelsBuilderEnabled && modelsResource) {
modelsResource.getModelsOutOfDateStatus().then(function(result) {
//Generate models buttons should be enabled if its not 100
deferred.resolve(result.status !== 100);
//Generate models buttons should be enabled if it is 0
deferred.resolve(result.status === 0);
});
}
else {
@@ -50,7 +50,7 @@ function formHelper(angularHelper, serverValidationManager, $timeout, notificati
}
//the first thing any form must do is broadcast the formSubmitting event
args.scope.$broadcast("formSubmitting", { scope: args.scope });
args.scope.$broadcast("formSubmitting", { scope: args.scope, action: args.action });
//then check if the form is valid
if (!args.skipValidation) {
@@ -0,0 +1,154 @@
(function() {
'use strict';
function variationsHelper() {
var variations = [];
/*
var variations = [
{
language: "Danish",
master: true,
published: true,
variations: [
{
name: "Mobile",
description: "Danish content for mobile",
published: true,
segments: [
{
name: "Mobile"
}
]
}
]
},
{
language: "Dutch",
published: true,
variations: [
{
name: "Mobile",
description: "Dutch content for mobile",
segments: [
{
name: "Mobile"
}
]
}
]
},
{
language: "English (United States)",
published: true,
variations: [
{
name: "Mobile",
description: "English content for mobile",
published: true,
segments: [
{
name: "Mobile"
}
]
},
{
name: "Job campaign: Front-end developer",
description: "Landing page for job thing 1",
published: true,
segments: [
{
name: "Front-end developer"
}
]
},
{
name: "Job campaign: Back-end developer",
description: "Landing page for job thing 2",
published: true,
segments: [
{
name: "Back-end developer"
}
]
}
]
},
{
language: "German",
published: true
},
{
language: "Italian",
published: true
},
{
language: "Spanish",
published: false
},
{
language: "Swedish",
published: false
}
];
*/
function setMaster(master) {
variations = [];
master.master = true;
variations.push(master);
}
function getVariations() {
return variations;
}
function createVariation(variation) {
var newVariation = angular.copy(variation);
newVariation.master = false;
variations.push(newVariation);
}
function saveVariation(updatedVariation) {
for(var i = 0; i < variations.length; i++) {
var variation = variations[i];
if(variation.id === updatedVariation) {
variation.name = updatedVariation.name;
variation.description = updatedVariation.description;
}
}
}
function cloneVariation(variation) {
var variationClone = angular.copy(variation);
variationClone.master = false;
variationClone.published = false;
variations.push(variationClone);
}
function deleteVariation(variation, event, index) {
variations.splice(index, 1);
}
var service = {
setMaster: setMaster,
getVariations: getVariations,
createVariation: createVariation,
saveVariation: saveVariation,
cloneVariation: cloneVariation,
deleteVariation: deleteVariation
};
return service;
}
angular.module('umbraco.services').factory('variationsHelper', variationsHelper);
})();
@@ -8,7 +8,7 @@
* The main application controller
*
*/
function MainController($scope, $rootScope, $location, $routeParams, $timeout, $http, $log, appState, treeService, notificationsService, userService, navigationService, historyService, updateChecker, assetsService, eventsService, umbRequestHelper, tmhDynamicLocale) {
function MainController($scope, $rootScope, $location, $routeParams, $timeout, $http, $log, appState, treeService, notificationsService, userService, navigationService, historyService, updateChecker, assetsService, eventsService, umbRequestHelper, tmhDynamicLocale, $templateCache) {
//the null is important because we do an explicit bool check on this in the view
//the avatar is by default the umbraco logo
@@ -19,7 +19,7 @@ function MainController($scope, $rootScope, $location, $routeParams, $timeout, $
{ value: "assets/img/application/logo@3x.png" }
];
$scope.touchDevice = appState.getGlobalState("touchDevice");
$scope.splitView = {};
$scope.removeNotification = function (index) {
notificationsService.remove(index);
@@ -126,6 +126,28 @@ function MainController($scope, $rootScope, $location, $routeParams, $timeout, $
};
}));
evts.push(eventsService.on("splitView.open", function(name, view) {
var updateTime = Date.now();
$scope.splitView = {
id: view.id,
view: view.view + "?updated=" + updateTime,
show: true
};
}));
$rootScope.$on('$routeChangeSuccess', function(event, current, previous) {
$scope.closeSplitView();
});
$scope.closeSplitView = function() {
$scope.splitView.show = false;
$scope.splitView.id = null;
$scope.splitView.view = null;
};
//ensure to unregister from all events!
$scope.$on('$destroy', function () {
for (var e in evts) {
@@ -141,4 +163,4 @@ angular.module('umbraco').controller("Umbraco.MainController", MainController).
config(function (tmhDynamicLocaleProvider) {
//Set url for locale files
tmhDynamicLocaleProvider.localeLocationPattern('lib/angular/1.1.5/i18n/angular-locale_{{locale}}.js');
});
});
@@ -41,14 +41,10 @@ body {
}
#contentwrapper, #contentcolumn {
position: absolute;
top: 0px; bottom: 0px; right: 0px; left: 80px;
z-index: 10;
margin: 0
}
#umb-notifications-wrapper {
left: 80px;
// position: absolute;
// top: 0px; bottom: 0px; right: 0px; left: 80px;
// z-index: 10;
// margin: 0
}
#contentcolumn {
@@ -63,24 +59,6 @@ body {
border: none;
}
#leftcolumn {
height: 100%;
z-index: 20;
width: 80px;
float: left;
position: absolute;
}
#applications {
z-index: 1000;
height: 100%;
left: 0px;
top: 0;
bottom: 0;
position: absolute;
text-align: center
}
#applications-tray {
z-index: 900;
left: 80px;
@@ -91,6 +69,7 @@ body {
text-align: center;
}
/*
#search-form {
display: block;
margin: 0;
@@ -102,21 +81,37 @@ body {
overflow: hidden;
.form-search {
display: -ms-flexbox;
display: -webkit-box;
display: -webkit-flex;
display: flex;
margin-top: 17px;
.umb-search-field {
width: auto;
min-width: 160px;
-webkit-flex: 1;
-ms-flex: 1;
flex: 1;
border-left: none;
border-right: none;
border-top: none;
}
}
}
*/
.form-search {
display: flex;
//margin-top: 17px;
.umb-search-field {
width: auto;
min-width: 160px;
flex: 1;
border-left: none;
border-right: none;
border-top: none;
height: 60px;
box-sizing: border-box;
padding-left: 40px !important;
}
}
#navigation {
left: 80px;
@@ -199,10 +194,10 @@ body {
z-index:9999 !important;
}
@media (min-width: 1101px) {
#contentwrapper, #umb-notifications-wrapper {left: 440px;}
#speechbubble {left: 360px;}
}
// @media (min-width: 1101px) {
// #contentwrapper, #umb-notifications-wrapper {left: 440px;}
// #speechbubble {left: 360px;}
// }
//empty section modification
.emptySection #contentwrapper, .emptySection #umb-notifications-wrapper {left: 80px;}

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