From 227e7a9c70d7c2e3521c0bc55f83c673898b5566 Mon Sep 17 00:00:00 2001 From: Simone Chiaretta Date: Tue, 8 Mar 2016 11:21:21 +0100 Subject: [PATCH 001/168] [U4-8128] Always rejecting promise even with server error Updated postSaveContent and resourcePromise to always reject the promise (thus always calling callers error handler) even when the error is 500 server error --- .../services/umbrequesthelper.service.js | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js index ccdd283ea6..a3d1e5b0c6 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/umbrequesthelper.service.js @@ -170,16 +170,14 @@ function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogServ } } - else { - //return an error object including the error message for UI - deferred.reject({ - errorMsg: result.errorMsg, - data: result.data, - status: result.status - }); + //return an error object including the error message for UI + deferred.reject({ + errorMsg: result.errorMsg, + data: result.data, + status: result.status + }); - } }); @@ -266,15 +264,14 @@ function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogServ } } - else { - - //return an error object including the error message for UI - deferred.reject({ - errorMsg: 'An error occurred', - data: data, - status: status - }); - } + + //return an error object including the error message for UI + deferred.reject({ + errorMsg: 'An error occurred', + data: data, + status: status + }); + }); @@ -337,4 +334,4 @@ function umbRequestHelper($http, $q, umbDataFormatter, angularHelper, dialogServ } }; } -angular.module('umbraco.services').factory('umbRequestHelper', umbRequestHelper); \ No newline at end of file +angular.module('umbraco.services').factory('umbRequestHelper', umbRequestHelper); From b607ba52f41c472b3f06b9ad239271730911b79e Mon Sep 17 00:00:00 2001 From: Dynacy Date: Fri, 22 Apr 2016 12:26:26 +0300 Subject: [PATCH 002/168] Create tr.xml Turkish Language --- src/Umbraco.Web.UI/umbraco/config/lang/tr.xml | 1073 +++++++++++++++++ 1 file changed, 1073 insertions(+) create mode 100644 src/Umbraco.Web.UI/umbraco/config/lang/tr.xml diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml new file mode 100644 index 0000000000..8adcb89801 --- /dev/null +++ b/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml @@ -0,0 +1,1073 @@ + + + + Umbraco + http://our.umbraco.org/documentation/Extending-Umbraco/Language-Files + + + Kültür ve Alanadları + Denetim + Nodları Görüntüle + Döküman Tipini Değiştir + Kopyala + Oluştur + Paket Oluştur + Sil + Devredışı Bırak + Çöp Kutusunu Boşalt + Döküman Tipini Dışarı Çıkar + Döküman Tipini İçeri Aktar + İçeri Paket Aktar + Kanvasda Düzenle + Çıkış + Taşı + Bildiri + Herkes Ulaşsın + Yayınla + Yayınlama + Nodları Yenile + Bütün Siteyi Tekrar Yayınla + Onar + İzinler + Geri Al + Yayınlamak İçin Gönder + Çeviri İçin Gönder + Sırala + Yayına Gönder + Çeviri + Güncelleme + Varsayılan Değer + + + İzin Reddedildi + Yeni Alanadı Ekle + Kaldır + Hatalı Nod + Hatalı Alanadı + Alanadı önceden atanmış. + Dil + Alanadı + Yeni alanadı '%0%' oluşturuldu + Alanadı '%0%' silindi + Alanadı '%0%' önceden atanmış + Alanadı '%0%' güncellendi + Geçerli Alanadlarını Düzenle + + Miras Al + Dil Değiştir + or inherit culture from parent nodes. Will also apply
+ to the current node, unless a domain below applies too.]]>
+ Alanadları + + + Görüntüleniyor + + + Seç + Geçerli dosyaları seç + Başka Birşey Yapın + Kalın + Paragraf İşaretini Kaldır + Insert form field + Insert graphic headline + Edit Html + Indent Paragraph + Italic + Center + Justify Left + Justify Right + Insert Link + Insert local link (anchor) + Bullet List + Numeric List + Insert macro + Insert picture + Edit relations + Return to list + Save + Save and publish + Save and send for approval + Preview + Preview is disabled because there's no template assigned + Choose style + Show styles + Insert table + + + To change the document type for the selected content, first select from the list of valid types for this location. + Then confirm and/or amend the mapping of properties from the current type to the new, and click Save. + The content has been re-published. + Current Property + Current type + The document type cannot be changed, as there are no alternatives valid for this location. An alternative will be valid if it is allowed under the parent of the selected content item and that all existing child content items are allowed to be created under it. + Document Type Changed + Map Properties + Map to Property + New Template + New Type + none + Content + Select New Document Type + The document type of the selected content has been successfully changed to [new type] and the following properties mapped: + to + Could not complete property mapping as one or more properties have more than one mapping defined. + Only alternate types valid for the current location are displayed. + + + Is Published + About this page + Alias + (how would you describe the picture over the phone) + Alternative Links + Click to edit this item + Created by + Original author + Updated by + Created + Date/time this document was created + Document Type + Editing + Remove at + This item has been changed after publication + This item is not published + Last published + There are no items to show in the list. + Media Type + Link to media item(s) + Member Group + Role + Member Type + No date chosen + Page Title + Properties + This document is published but is not visible because the parent '%0%' is unpublished + Oops: this document is published but is not in the cache (internal error) + Publish + Publication Status + Publish at + Unpublish at + Clear Date + Sortorder is updated + To sort the nodes, simply drag the nodes or click one of the column headers. You can select multiple nodes by holding the "shift" or "control" key while selecting + Statistics + Title (optional) + Alternative text (optional) + Type + Unpublish + Last edited + Date/time this document was edited + Remove file(s) + Link to document + Member of group(s) + Not a member of group(s) + Child items + Target + + + Click to upload + Drop your files here... + Link to media + + + Create a new member + All Members + + + Where do you want to create the new %0% + Create an item under + Choose a type and a title + "document types".]]> + "media types".]]> + + + Browse your website + - Hide + If Umbraco isn't opening, you might need to allow popups from this site + has opened in a new window + Restart + Visit + Welcome + + + Name + Manage hostnames + Close this window + Are you sure you want to delete + Are you sure you want to disable + Please check this box to confirm deletion of %0% item(s) + Are you sure? + Are you sure? + Cut + Edit Dictionary Item + Edit Language + Insert local link + Insert character + Insert graphic headline + Insert picture + Insert link + Click to add a Macro + Insert table + Last Edited + Link + Internal link: + When using local links, insert "#" in front of link + Open in new window? + Macro Settings + This macro does not contain any properties you can edit + Paste + Edit Permissions for + The items in the recycle bin are now being deleted. Please do not close this window while this operation takes place + The recycle bin is now empty + When items are deleted from the recycle bin, they will be gone forever + regexlib.com's webservice is currently experiencing some problems, which we have no control over. We are very sorry for this inconvenience.]]> + Search for a regular expression to add validation to a form field. Example: 'email, 'zip-code' 'url' + Remove Macro + Required Field + Site is reindexed + The website cache has been refreshed. All publish content is now up to date. While all unpublished content is still unpublished + The website cache will be refreshed. All published content will be updated, while unpublished content will stay unpublished. + Number of columns + Number of rows + Set a placeholder id by setting an ID on your placeholder you can inject content into this template from child templates, + by referring this ID using a <asp:content /> element.]]> + Select a placeholder id from the list below. You can only + choose Id's from the current template's master.]]> + Click on the image to see full size + Pick item + View Cache Item + + + %0%' below
You can add additional languages under the 'languages' in the menu on the left + ]]>
+ Culture Name + + + Enter your username + Enter your password + Name the %0%... + Enter a name... + Type to search... + Type to filter... + Type to add tags (press enter after each tag)... + + + + Allow at root + Only Content Types with this checked can be created at the root level of Content and Media trees + Allowed child node types + Document Type Compositions + Create + Delete tab + Description + New tab + Tab + Thumbnail + Enable list view + Configures the content item to show a sortable & searchable list of its children, the children will not be shown in the tree + Current list view + The active list view data type + Create custom list view + Remove custom list view + + + Add prevalue + Database datatype + Property editor GUID + Property editor + Buttons + Enable advanced settings for + Enable context menu + Maximum default size of inserted images + Related stylesheets + Show label + Width and height + + + Your data has been saved, but before you can publish this page there are some errors you need to fix first: + The current membership provider does not support changing password (EnablePasswordRetrieval need to be true) + %0% already exists + There were errors: + There were errors: + The password should be a minimum of %0% characters long and contain at least %1% non-alpha numeric character(s) + %0% must be an integer + The %0% field in the %1% tab is mandatory + %0% is a mandatory field + %0% at %1% is not in a correct format + %0% is not in a correct format + + + The specified file type has been disallowed by the administrator + NOTE! Even though CodeMirror is enabled by configuration, it is disabled in Internet Explorer because it's not stable enough. + Please fill both alias and name on the new property type! + There is a problem with read/write access to a specific file or folder + Error loading Partial View script (file: %0%) + Error loading userControl '%0%' + Error loading customControl (Assembly: %0%, Type: '%1%') + Error loading MacroEngine script (file: %0%) + "Error parsing XSLT file: %0% + "Error reading XSLT file: %0% + Please enter a title + Please choose a type + You're about to make the picture larger than the original size. Are you sure that you want to proceed? + Error in python script + The python script has not been saved, because it contained error(s) + Startnode deleted, please contact your administrator + Please mark content before changing style + No active styles available + Please place cursor at the left of the two cells you wish to merge + You cannot split a cell that hasn't been merged. + Error in XSLT source + The XSLT has not been saved, because it contained error(s) + There is a configuration error with the data type used for this property, please check the data type + + + About + Action + Actions + Add + Alias + Are you sure? + Border + by + Cancel + Cell margin + Choose + Close + Close Window + Comment + Confirm + Constrain proportions + Continue + Copy + Create + Database + Date + Default + Delete + Deleted + Deleting... + Design + Dimensions + Down + Download + Edit + Edited + Elements + Email + Error + Find + Height + Help + Icon + Import + Inner margin + Insert + Install + Justify + Language + Layout + Loading + Locked + Login + Log off + Logout + Macro + Move + More + Name + New + Next + No + of + OK + Open + or + Password + Path + Placeholder ID + One moment please... + Previous + Properties + Email to receive form data + Recycle Bin + Remaining + Rename + Renew + Required + Retry + Permissions + Search + Server + Show + Show page on Send + Size + Sort + Type + Type to search... + Up + Update + Upgrade + Upload + Url + User + Username + Value + View + Welcome... + Width + Yes + Folder + Search results + + + Background color + Bold + Text color + Font + Text + + + Page + + + The installer cannot connect to the database. + Could not save the web.config file. Please modify the connection string manually. + Your database has been found and is identified as + Database configuration + install button to install the Umbraco %0% database + ]]> + Next to proceed.]]> + Database not found! Please check that the information in the "connection string" of the "web.config" file is correct.

+

To proceed, please edit the "web.config" file (using Visual Studio or your favourite text editor), scroll to the bottom, add the connection string for your database in the key named "UmbracoDbDSN" and save the file.

+

+ Click the retry button when + done.
+ More information on editing web.config here.

]]>
+ + Please contact your ISP if necessary. + If you're installing on a local machine or server you might need information from your system administrator.]]> + + Press the upgrade button to upgrade your database to Umbraco %0%

+

+ Don't worry - no content will be deleted and everything will continue working afterwards! +

+ ]]>
+ Press Next to + proceed. ]]> + next to continue the configuration wizard]]> + The Default users' password needs to be changed!]]> + The Default user has been disabled or has no access to Umbraco!

No further actions needs to be taken. Click Next to proceed.]]> + The Default user's password has been successfully changed since the installation!

No further actions needs to be taken. Click Next to proceed.]]> + The password is changed! + + Umbraco creates a default user with a login ('admin') and password ('default'). It's important that the password is + changed to something unique. +

+

+ This step will check the default user's password and suggest if it needs to be changed. +

+ ]]>
+ Get a great start, watch our introduction videos + By clicking the next button (or modifying the umbracoConfigurationStatus in web.config), you accept the license for this software as specified in the box below. Notice that this Umbraco distribution consists of two different licenses, the open source MIT license for the framework and the Umbraco freeware license that covers the UI. + Not installed yet. + Affected files and folders + More information on setting up permissions for Umbraco here + You need to grant ASP.NET modify permissions to the following files/folders + Your permission settings are almost perfect!

+ You can run Umbraco without problems, but you will not be able to install packages which are recommended to take full advantage of Umbraco.]]>
+ How to Resolve + Click here to read the text version + video tutorial on setting up folder permissions for Umbraco or read the text version.]]> + Your permission settings might be an issue! +

+ You can run Umbraco without problems, but you will not be able to create folders or install packages which are recommended to take full advantage of Umbraco.]]>
+ Your permission settings are not ready for Umbraco! +

+ In order to run Umbraco, you'll need to update your permission settings.]]>
+ Your permission settings are perfect!

+ You are ready to run Umbraco and install packages!]]>
+ Resolving folder issue + Follow this link for more information on problems with ASP.NET and creating folders + Setting up folder permissions + + I want to start from scratch + learn how) + You can still choose to install Runway later on. Please go to the Developer section and choose Packages. + ]]> + You've just set up a clean Umbraco platform. What do you want to do next? + Runway is installed + + This is our list of recommended modules, check off the ones you would like to install, or view the full list of modules + ]]> + Only recommended for experienced users + I want to start with a simple website + + "Runway" is a simple website providing some basic document types and templates. The installer can set up Runway for you automatically, + but you can easily edit, extend or remove it. It's not necessary and you can perfectly use Umbraco without it. However, + Runway offers an easy foundation based on best practices to get you started faster than ever. + If you choose to install Runway, you can optionally select basic building blocks called Runway Modules to enhance your Runway pages. +

+ + Included with Runway: Home page, Getting Started page, Installing Modules page.
+ Optional Modules: Top Navigation, Sitemap, Contact, Gallery. +
+ ]]>
+ What is Runway + Step 1/5 Accept license + Step 2/5: Database configuration + Step 3/5: Validating File Permissions + Step 4/5: Check Umbraco security + Step 5/5: Umbraco is ready to get you started + Thank you for choosing Umbraco + Browse your new site +You installed Runway, so why not see how your new website looks.]]> + Further help and information +Get help from our award winning community, browse the documentation or watch some free videos on how to build a simple site, how to use packages and a quick guide to the Umbraco terminology]]> + Umbraco %0% is installed and ready for use + /web.config file and update the AppSetting key UmbracoConfigurationStatus in the bottom to the value of '%0%'.]]> + started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco, +you can find plenty of resources on our getting started pages.]]>
+ Launch Umbraco +To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> + Connection to database failed. + Umbraco Version 3 + Umbraco Version 4 + Watch + Umbraco %0% for a fresh install or upgrading from version 3.0. +

+ Press "next" to start the wizard.]]>
+ + + Culture Code + Culture Name + + + You've been idle and logout will automatically occur in + Renew now to save your work + + + Happy super Sunday + Happy manic Monday + Happy tubular Tuesday + Happy wonderful Wednesday + Happy thunderous Thursday + Happy funky Friday + Happy Caturday + Log in below + Session timed out + © 2001 - %0%
Umbraco.com

]]>
+ + + Dashboard + Sections + Content + + + Choose page above... + %0% has been copied to %1% + Select where the document %0% should be copied to below + %0% has been moved to %1% + Select where the document %0% should be moved to below + has been selected as the root of your new content, click 'ok' below. + No node selected yet, please select a node in the list above before clicking 'ok' + The current node is not allowed under the chosen node because of its type + The current node cannot be moved to one of its subpages + The current node cannot exist at the root + The action isn't allowed since you have insufficient permissions on 1 or more child documents. + Relate copied items to original + + + Edit your notification for %0% + + Hi %0%

+ +

This is an automated mail to inform you that the task '%1%' + has been performed on the page '%2%' + by the user '%3%' +

+
+
+      EDIT        +
+
+

+

Update summary:

+ + %6% +
+

+ +
+
+      EDIT        +
+
+ +

Have a nice day!

+ Cheers from the Umbraco robot +

]]>
+ [%0%] Notification about %1% performed on %2% + Notifications + + + + button and locating the package. Umbraco packages usually have a ".umb" or ".zip" extension. + ]]> + Author + Demonstration + Documentation + Package meta data + Package name + Package doesn't contain any items +
+ You can safely remove this from the system by clicking "uninstall package" below.]]>
+ No upgrades available + Package options + Package readme + Package repository + Confirm uninstall + Package was uninstalled + The package was successfully uninstalled + Uninstall package + + Notice: any documents, media etc depending on the items you remove, will stop working, and could lead to system instability, + so uninstall with caution. If in doubt, contact the package author.]]> + Download update from the repository + Upgrade package + Upgrade instructions + There's an upgrade available for this package. You can download it directly from the Umbraco package repository. + Package version + Package version history + View package website + + + Paste with full formatting (Not recommended) + The text you're trying to paste contains special characters or formatting. This could be caused by copying text from Microsoft Word. Umbraco can remove special characters or formatting automatically, so the pasted content will be more suitable for the web. + Paste as raw text without any formatting at all + Paste, but remove formatting (Recommended) + + + Role based protection + using Umbraco's member groups.]]> + role-based authentication.]]> + Error Page + Used when people are logged on, but do not have access + Choose how to restrict access to this page + %0% is now protected + Protection removed from %0% + Login Page + Choose the page that contains the login form + Remove Protection + Select the pages that contain login form and error messages + Pick the roles who have access to this page + Set the login and password for this page + Single user protection + If you just want to setup simple protection using a single login and password + + + + + + + + + + Include unpublished child pages + Publishing in progress - please wait... + %0% out of %1% pages have been published... + %0% has been published + %0% and subpages have been published + Publish %0% and all its subpages + ok to publish %0% and thereby making its content publicly available.

+ You can publish this page and all it's sub-pages by checking publish all children below. + ]]>
+ + + You have not configured any approved colors + + + enter external link + choose internal page + Caption + Link + Open in new window + enter the display caption + Enter the link + + + Reset + + + Current version + Red text will not be shown in the selected version. , green means added]]> + Document has been rolled back + This displays the selected version as HTML, if you wish to see the difference between 2 versions at the same time, use the diff view + Rollback to + Select version + View + + + Edit script file + + + Concierge + Content + Courier + Developer + Umbraco Configuration Wizard + Media + Members + Newsletters + Settings + Statistics + Translation + Users + Help + Forms + Analytics + + + go to + Help topics for + Video chapters for + The best Umbraco video tutorials + + + Default template + Dictionary Key + To import a document type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen) + New Tab Title + Node type + Type + Stylesheet + Script + Stylesheet property + Tab + Tab Title + Tabs + Master Content Type enabled + This Content Type uses + as a Master Content Type. Tabs from Master Content Types are not shown and can only be edited on the Master Content Type itself + No properties defined on this tab. Click on the "add a new property" link at the top to create a new property. + Master Document Type + Create matching template + + + Sorting complete. + Drag the different items up or down below to set how they should be arranged. Or click the column headers to sort the entire collection of items +
Do not close this window during sorting]]>
+ + + Failed + Insufficient user permissions, could not complete the operation + Cancelled + Operation was cancelled by a 3rd party add-in + Publishing was cancelled by a 3rd party add-in + Property type already exists + Property type created + DataType: %1%]]> + Propertytype deleted + Document Type saved + Tab created + Tab deleted + Tab with id: %0% deleted + Stylesheet not saved + Stylesheet saved + Stylesheet saved without any errors + Datatype saved + Dictionary item saved + Publishing failed because the parent page isn't published + Content published + and visible at the website + Content saved + Remember to publish to make changes visible + Sent For Approval + Changes have been sent for approval + Media saved + Media saved without any errors + Member saved + Stylesheet Property Saved + Stylesheet saved + Template saved + Error saving user (check log) + User Saved + User type saved + File not saved + file could not be saved. Please check file permissions + File saved + File saved without any errors + Language saved + Python script not saved + Python script could not be saved due to error + Python script saved + No errors in python script + Template not saved + Please make sure that you do not have 2 templates with the same alias + Template saved + Template saved without any errors! + XSLT not saved + XSLT contained an error + XSLT could not be saved, check file permissions + XSLT saved + No errors in XSLT + Content unpublished + Partial view saved + Partial view saved without any errors! + Partial view not saved + An error occurred saving the file. + Script view saved + Script view saved without any errors! + Script view not saved + An error occurred saving the file. + An error occurred saving the file. + + + Uses CSS syntax ex: h1, .redHeader, .blueTex + Edit stylesheet + Edit stylesheet property + Name to identify the style property in the rich text editor + Preview + Styles + + + Edit template + Insert content area + Insert content area placeholder + Insert dictionary item + Insert Macro + Insert Umbraco page field + Master template + Quick Guide to Umbraco template tags + Template + + + Insert control + Choose a layout for this section + below and add your first element]]> + + Click to embed + Click to insert image + Image caption... + Write here... + Grid layouts + Layouts are the overall work area for the grid editor, usually you only need one or two different layouts + Add grid layout + Adjust the layout by setting column widths and adding additional sections + + Row configurations + Rows are predefined cells arranged horizontally + Add row configuration + Adjust the row by setting cell widths and adding additional cells + + Columns + Total combined number of columns in the grid layout + + Settings + Configure what settings editors can change + + + Styles + Configure what styling editors can change + + Settings will only save if the entered json configuration is valid + + Allow all editors + Allow all row configurations + + + Alternative field + Alternative Text + Casing + Encoding + Choose field + Convert line breaks + Replaces line breaks with html-tag &lt;br&gt; + Custom Fields + Yes, Date only + Format as date + HTML encode + Will replace special characters by their HTML equivalent. + Will be inserted after the field value + Will be inserted before the field value + Lowercase + None + Insert after field + Insert before field + Recursive + Remove Paragraph tags + Will remove any &lt;P&gt; in the beginning and end of the text + Standard Fields + Uppercase + URL encode + Will format special characters in URLs + Will only be used when the field values above are empty + This field will only be used if the primary field is empty + Yes, with time. Separator: + + + Tasks assigned to you + assigned to you. To see a detailed view including comments, click on "Details" or just the page name. + You can also download the page as XML directly by clicking the "Download Xml" link.
+ To close a translation task, please go to the Details view and click the "Close" button. + ]]>
+ close task + Translation details + Download all translation tasks as XML + Download XML + Download XML DTD + Fields + Include subpages + + [%0%] Translation task for %1% + No translator users found. Please create a translator user before you start sending content to translation + Tasks created by you + created by you. To see a detailed view including comments, + click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link. + To close a translation task, please go to the Details view and click the "Close" button. + ]]> + The page '%0%' has been send to translation + Send the page '%0%' to translation + Assigned by + Task opened + Total words + Translate to + Translation completed. + You can preview the pages, you've just translated, by clicking below. If the original page is found, you will get a comparison of the 2 pages. + Translation failed, the XML file might be corrupt + Translation options + Translator + Upload translation XML + + + Cache Browser + Recycle Bin + Created packages + Data Types + Dictionary + Installed packages + Install skin + Install starter kit + Languages + Install local package + Macros + Media Types + Members + Member Groups + Roles + Member Types + Document Types + Packages + Packages + Python Files + Install from repository + Install Runway + Runway modules + Scripting Files + Scripts + Stylesheets + Templates + XSLT Files + Analytics + + + New update ready + %0% is ready, click here for download + No connection to server + Error checking for update. Please review trace-stack for further information + + + Administrator + Category field + Change Your Password + Change Your Password + Confirm new password + You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button + Content Channel + Description field + Disable User + Document Type + Editor + Excerpt field + Language + Login + Start Node in Media Library + Sections + Disable Umbraco Access + Password + Reset password + Your password has been changed! + Please confirm the new password + Enter your new password + Your new password cannot be blank! + Current password + Invalid current password + There was a difference between the new password and the confirmed password. Please try again! + The confirmed password doesn't match the new password! + Replace child node permissions + You are currently modifying permissions for the pages: + Select pages to modify their permissions + Search all children + Start Node in Content + Name + User permissions + User type + User types + Writer + Translator + Change + Your profile + Your recent history + Session expires in + +
From ff5714196c91874d869a19b51a15648b098b7f8b Mon Sep 17 00:00:00 2001 From: Dynacy Date: Fri, 22 Apr 2016 12:34:03 +0300 Subject: [PATCH 003/168] Update tr.xml --- src/Umbraco.Web.UI/umbraco/config/lang/tr.xml | 1149 +++++++++-------- 1 file changed, 609 insertions(+), 540 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml b/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml index 8adcb89801..6452af023b 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/tr.xml @@ -1,470 +1,489 @@ - + Umbraco - http://our.umbraco.org/documentation/Extending-Umbraco/Language-Files + http://kayadata.com - Kültür ve Alanadları - Denetim - Nodları Görüntüle - Döküman Tipini Değiştir - Kopyala + Kültür ve Hostnames + Denetim Trail + Düğüm Araçtır + Belge Türü Değiştir + Kopya Oluştur Paket Oluştur Sil - Devredışı Bırak - Çöp Kutusunu Boşalt - Döküman Tipini Dışarı Çıkar - Döküman Tipini İçeri Aktar - İçeri Paket Aktar - Kanvasda Düzenle + Devre Dışı Bırak + Geri Dönüşümü Boşat + Belge Türü Çıkart + Belge Türü Al + Paket Ekle + Tuval Düzele Çıkış Taşı - Bildiri - Herkes Ulaşsın - Yayınla - Yayınlama - Nodları Yenile - Bütün Siteyi Tekrar Yayınla - Onar + Bildirimler + Genel Erişim + Yayımla + Yayından Kaldır + Yeniden Yükle + Siteleri Yeniden Yayınla + Düzelt İzinler - Geri Al - Yayınlamak İçin Gönder - Çeviri İçin Gönder + Rollback + Yayın için Gönder + Çeviri Gönder Sırala Yayına Gönder - Çeviri - Güncelleme + Çevir + Güncelle Varsayılan Değer - İzin Reddedildi - Yeni Alanadı Ekle - Kaldır - Hatalı Nod - Hatalı Alanadı - Alanadı önceden atanmış. + İzin reddedildi. + Yeni Domain ekle + kaldır + Geçersiz node. + Geçersiz domain biçimi. + Domain zaten eklenmiş. Dil - Alanadı - Yeni alanadı '%0%' oluşturuldu - Alanadı '%0%' silindi - Alanadı '%0%' önceden atanmış - Alanadı '%0%' güncellendi - Geçerli Alanadlarını Düzenle - + Domain + Yeni domain '%0%' oluşturuldu + Domain '%0%' silindi + Domain '%0%' zaten atanmış + Domain '%0%' güncellendi + Geçerli domain düzenle + + etki /> bir düzey yollar desteklenir
+
Miras Al - Dil Değiştir - or inherit culture from parent nodes. Will also apply
- to the current node, unless a domain below applies too.]]>
- Alanadları + Kültür + + veya üst düğümleri kültürünü devralır. Ayrıca
geçerli olacaktır + Geçerli düğümün , bir etki altında çok uygulanmadığı sürece .]]> +
+ Domainler Görüntüleniyor Seç - Geçerli dosyaları seç - Başka Birşey Yapın + Geçerli klasörü seçin + Başka birşey yapın Kalın - Paragraf İşaretini Kaldır - Insert form field - Insert graphic headline - Edit Html - Indent Paragraph - Italic - Center - Justify Left - Justify Right - Insert Link - Insert local link (anchor) - Bullet List - Numeric List - Insert macro - Insert picture - Edit relations - Return to list - Save - Save and publish - Save and send for approval - Preview - Preview is disabled because there's no template assigned - Choose style - Show styles - Insert table + Paragraf girinti iptal + Form alanı ekle + Grafik başlık ekle + Html Düzenle + Paragraf girintisi + Yatık + Ortalı + Sola Yasla + Sağa Yasla + Link ekle + Yerel bağlantı ekle + Bulet listesi + Sayısal Liste + Macro ekle + Resim ekle + Düzenleme ilişkileri + Listeye Dön + Kaydet + Kaydet ve Yayınla + Kaydet ve Onay için gönder + Önizle + Önizleme kapalı, Atanmış şablon yok + Stili seçin + Stilleri Göster + Tablo Ekle - To change the document type for the selected content, first select from the list of valid types for this location. - Then confirm and/or amend the mapping of properties from the current type to the new, and click Save. - The content has been re-published. - Current Property - Current type - The document type cannot be changed, as there are no alternatives valid for this location. An alternative will be valid if it is allowed under the parent of the selected content item and that all existing child content items are allowed to be created under it. - Document Type Changed - Map Properties - Map to Property - New Template - New Type - none - Content - Select New Document Type - The document type of the selected content has been successfully changed to [new type] and the following properties mapped: - to - Could not complete property mapping as one or more properties have more than one mapping defined. - Only alternate types valid for the current location are displayed. + Seçilen içerik için belge türünü değiştirmek için , öncelikle bu konum için geçerli türleri listesinden seçim yapın. + Ardından onaylamak ve / veya yeni akım tip özellikleri haritalama değişiklik ve Kaydet'i tıklatın . + İçerik yeniden yayımlanmıştır . + Güncel Mülkiyet + Güncel tip + Bu konum için geçerli hiçbir alternatifi olduğu gibi belge türü , değiştirilemez . Seçilen içerik öğesinin ebeveyn altında izin verilir ve mevcut tüm alt içerik öğeleri altında oluşturulacak izin eğer bir alternatif geçerli olacaktır . + Belge Türü değiştirildi + harita Özellikleri + Mülkiyet Harita + Yeni Şablon + Yeni Tip + Hiçbiri + İçerik + Yeni Belge Tipi Seçiniz + Seçilen içeriğin belge türü başarıyla [ yeni tip ] değişti ve aşağıdaki özellikleri eşleştirilmiş edilmiştir : + için + Bir veya daha fazla özellikleri olarak mülkiyet haritalama tamamlayamadı birden fazla eşleme tanımlanmış var. + Bulunduğunuz yerin için geçerli Sadece alternatif türleri görüntülenir. - Is Published - About this page - Alias - (how would you describe the picture over the phone) - Alternative Links - Click to edit this item - Created by - Original author - Updated by - Created - Date/time this document was created - Document Type - Editing - Remove at - This item has been changed after publication - This item is not published - Last published - There are no items to show in the list. - Media Type - Link to media item(s) - Member Group - Role - Member Type - No date chosen - Page Title - Properties - This document is published but is not visible because the parent '%0%' is unpublished - Oops: this document is published but is not in the cache (internal error) - Publish - Publication Status - Publish at - Unpublish at - Clear Date - Sortorder is updated - To sort the nodes, simply drag the nodes or click one of the column headers. You can select multiple nodes by holding the "shift" or "control" key while selecting - Statistics - Title (optional) - Alternative text (optional) - Type - Unpublish - Last edited - Date/time this document was edited - Remove file(s) - Link to document - Member of group(s) - Not a member of group(s) - Child items - Target + Yayımlandı + Bu sayfa hakkında + takma ad + ( nasıl telefon üzerinden resim anlatırsınız ) + Alternatif Linkler + Bu öğeyi düzenlemek için tıklayın + Tarafından yaratıldı + orijinal yazar + tarafından güncellendi + oluşturuldu + Bu belgenin oluşturulduğu tarih / zaman + Belge Türü + kurgu + en kaldır + Bu madde yayınlanmasından sonra değiştirildi + Bu öğe yayınlanmadı + Son yayınlanan + Listede gösterilecek öğe yok. + Medya Türü + Medya öğesinin bağlantı ( lar) + Üye Grubu + rol + Üye Türü + Hiçbir tarih seçildi + Sayfa başlığı + Özellikler + Ebeveyn ' %0% ' yayımlanmamış olduğu için bu belge yayınladı ama görünür değildir + Hata : Bu ​​belge yayınlandı ancak önbellek ( iç hata ) değil + yayınlamak + Yayın Durum + en Yayınla + en yayından + temizle tarihi + Sıralama güncellenir + Düğümlerini sıralamak için, sadece düğümleri sürükleyin veya sütun başlıkları birini tıklatın . Seçerken " shift " veya " kontrol " tuşunu basılı tutarak birden fazla düğüm seçebilirsiniz + istatistik + Başlık (isteğe bağlı) + Alternatif metin (isteğe bağlı) + tip + Yayından + Son düzenleme + Bu belgenin düzenlendiği tarih / zaman + Dosya(ları) kaldırın + Belgeye Bağlantı + Grubun Üyesi(leri) + Grubun bir üyesi değil + Çocuk öğeleri + hedef - Click to upload - Drop your files here... - Link to media - - - Create a new member - All Members + Yüklemek için tıklayın + Burada açılan dosyaları ... + Medya Linki - Where do you want to create the new %0% - Create an item under - Choose a type and a title - "document types".]]> - "media types".]]> + Nerede yeni %0% yaratmak istiyorsun + Altında bir öğe oluşturun + Bir tür ve bir başlık seçin + "belge türleri".]]> + "ortam türleri".]]> - Browse your website - - Hide - If Umbraco isn't opening, you might need to allow popups from this site - has opened in a new window - Restart - Visit - Welcome + Web sitenizi tarayın + - gizle + CMS açılış değilse , bu siteden pop-up izin gerekebilir + Yeni bir pencere açtı + Tekrar başlat + ziyaret + hoşgeldiniz - Name - Manage hostnames - Close this window - Are you sure you want to delete - Are you sure you want to disable - Please check this box to confirm deletion of %0% item(s) - Are you sure? - Are you sure? - Cut - Edit Dictionary Item - Edit Language - Insert local link - Insert character - Insert graphic headline - Insert picture - Insert link - Click to add a Macro - Insert table - Last Edited - Link - Internal link: - When using local links, insert "#" in front of link - Open in new window? - Macro Settings - This macro does not contain any properties you can edit - Paste - Edit Permissions for - The items in the recycle bin are now being deleted. Please do not close this window while this operation takes place - The recycle bin is now empty - When items are deleted from the recycle bin, they will be gone forever - regexlib.com's webservice is currently experiencing some problems, which we have no control over. We are very sorry for this inconvenience.]]> - Search for a regular expression to add validation to a form field. Example: 'email, 'zip-code' 'url' - Remove Macro - Required Field - Site is reindexed - The website cache has been refreshed. All publish content is now up to date. While all unpublished content is still unpublished - The website cache will be refreshed. All published content will be updated, while unpublished content will stay unpublished. - Number of columns - Number of rows - Set a placeholder id by setting an ID on your placeholder you can inject content into this template from child templates, - by referring this ID using a <asp:content /> element.]]> - Select a placeholder id from the list below. You can only - choose Id's from the current template's master.]]> - Click on the image to see full size - Pick item - View Cache Item + isim + konak yönetin + Bu pencereyi kapatın + Silmek istediğine emin misin + Eğer devre dışı bırakmak istediğinizden emin misiniz + %0% öğe(lerin) silinmesi onaylamak için bu kutuyu kontrol edin + Emin misiniz? + Emin misiniz? + Kes + Düzenleme Sözlük Öğe + Dil Düzenleme + Yerel bağlantı ekleme + Karakter Ekle + Grafik başlığı ekleyin + Resim ekle + Link Ekle + Bir makro eklemek için tıklayın + Tablo Ekle + Son DÜzenleme + Bağlantı + İç Bağlantı: + Yerel bağlantıları kullanırken, bağlantının önündeki "# " insert + Yeni pencerede aç + Makro ayarları + Düzenleyebileceğiniz Bu makro herhangi bir özellikleri içermiyor + Yapıştır + İzinleri düzenle + Geri dönüşüm kutusu öğeleri şimdi siliniyor. Bu işlem gerçekleşirken bu pencereyi kapatın etmeyiniz + Geri dönüşüm kutusu artık boş + Öğeleri geri dönüşüm kutusu silindiğinde, onlar sonsuza kadar gitmiş olacak + regexlib.com's webcoder şu anda üzerinde hiçbir kontrole sahip bazı sorunları, yaşanıyor. Bu rahatsızlıktan dolayı çok üzgünüz.]]> + Bir düzenli ifade arama form alanına doğrulama ekleyin. Örnek: 'E-posta', zip code 'url' + Makro kaldır + Gerekli alan + Site yeniden indekslendi + Web sitesi yenilendi önbelleği olmuştur. Tüm içerik güncel artık yayımlamak. Tüm yayınlanmamış içeriği hala yayınlanmamış olmakla birlikte + Web sitesi önbelleği yenilenir olacaktır. Yayınlanmamış içerik yayınlanmamış kalacak ise tüm yayınlanan içerik, güncellenecektir. + Sütün sayısı + Satır sayısı + + Yer tutucu kimliği ayarla senin tutucu bir kimlik ayarlayarak Çocuğunuz şablonları bu şablon içine içerik enjekte edebilir, + Bir kullanarak bu kimliği bakarak <asp:content /> element.]]> + + + Yer tutucu kimliği seçin Aşağıdaki listeden. You can sadece +       Geçerli şablonun ustadan kimliği sitesinin seçin.]]> + + Tam boyutta görmek için resmin üzerine tıklayın + öğeyi seçin + Görünüm Önbellek Öğe - %0%' below
You can add additional languages under the 'languages' in the menu on the left - ]]>
- Culture Name + + %0%' aşağıda
Sol taraftaki menüden 'diller' başlığı altında ek dil ekleyebilirsiniz + ]]> +
+ Kültür adı - Enter your username - Enter your password - Name the %0%... - Enter a name... - Type to search... - Type to filter... - Type to add tags (press enter after each tag)... + Kullanıcı adınızı giriniz + Parolanızı giriniz + Ad %0%... + Adınızı girin... + Aramak için yazın... + Filtrelemek için yazın... + (Basın, her etiketinden sonra girin) etiket eklemek için yazın ... - - Allow at root - Only Content Types with this checked can be created at the root level of Content and Media trees - Allowed child node types - Document Type Compositions - Create - Delete tab - Description - New tab - Tab - Thumbnail - Enable list view - Configures the content item to show a sortable & searchable list of its children, the children will not be shown in the tree - Current list view - The active list view data type - Create custom list view - Remove custom list view + Root'a izin ver + Bu Sadece İçerik Türleri İçerik ve Medya ağaçların kök düzeyinde oluşturulabilir kontrol + İzin alt düğüm çeşitleri + Belge Türü kompozisyonlar + Oluştur + Sekmesini sil + Tanım + Yeni sekme + Sekme + Küçük resim + Lüste görünümü etkinleştir + Bir sıralanabilir & göstermek için içerik öğesini yapılandırır; kendi çocuklarının aranabilir liste, çocuk ağacında gösterilen olmayacak + Liste görünümü + Etkin liste görünümü veri türü + Özel liste görünüm oluşturun + Özel liste görünümü kaldır - Add prevalue - Database datatype - Property editor GUID - Property editor - Buttons - Enable advanced settings for - Enable context menu - Maximum default size of inserted images - Related stylesheets - Show label - Width and height + Ön değer ekle + Veritabanı veritürü + Mülkiyet editörü GUID + Mülkiyet editörü + Düğmeler + Gelişmiş ayarları etkinleştir... + Bağlam menüsünü etkinleştir + Eklenen görüntülerin maksimum varsayılan boyutu + İlgili stil + Etiketi göster + Yükseklik ve Genişlik - Your data has been saved, but before you can publish this page there are some errors you need to fix first: - The current membership provider does not support changing password (EnablePasswordRetrieval need to be true) - %0% already exists - There were errors: - There were errors: - The password should be a minimum of %0% characters long and contain at least %1% non-alpha numeric character(s) - %0% must be an integer - The %0% field in the %1% tab is mandatory - %0% is a mandatory field - %0% at %1% is not in a correct format - %0% is not in a correct format + Verileriniz kaydedildi, ancak bu sayfayı yayınlamak için önce ilk düzeltmek için gereken bazı hatalar vardır: + Geçerli üyelik sağlayıcısı değişen şifreyi desteklemiyor (EnablePasswordRetrieval doğru olması gerekir) + %0% zaten var + Hatalar vardı: + Hatalar vardı: + Şifre %0% karakter uzunluğunda en az olması ve en az %1% non-alfa sayısal karakter (ler) içermelidir + %0% bir tamsayı olmalıdır + %1% sekmesinde %0% alan zorunludur + %0% zorunlu bir alandır + %0% - %1% bir doğru biçimde değil + %0% Bir doğru biçimde değil - The specified file type has been disallowed by the administrator - NOTE! Even though CodeMirror is enabled by configuration, it is disabled in Internet Explorer because it's not stable enough. - Please fill both alias and name on the new property type! - There is a problem with read/write access to a specific file or folder - Error loading Partial View script (file: %0%) + Belirtilen dosya türü yönetici tarafından izin verilmeyen olmuştur + NOT! CodeMirror yapılandırma tarafından etkin olsa bile yeterince kararlı değil, çünkü Internet Explorer'da devre dışı bırakılır. + Yeni özellik tipine takma adını ve hem de doldurunuz! + Belirli bir dosya veya klasör için okuma / yazma erişimi olan bir sorun var + Error loading Partial View script (Dosya: %0%) Error loading userControl '%0%' Error loading customControl (Assembly: %0%, Type: '%1%') - Error loading MacroEngine script (file: %0%) + Error loading MacroEngine script (Dosya: %0%) "Error parsing XSLT file: %0% - "Error reading XSLT file: %0% - Please enter a title - Please choose a type - You're about to make the picture larger than the original size. Are you sure that you want to proceed? - Error in python script - The python script has not been saved, because it contained error(s) - Startnode deleted, please contact your administrator - Please mark content before changing style - No active styles available - Please place cursor at the left of the two cells you wish to merge - You cannot split a cell that hasn't been merged. - Error in XSLT source - The XSLT has not been saved, because it contained error(s) - There is a configuration error with the data type used for this property, please check the data type + "Error reading XSLT file: %0% + Lütfen bir başlık girin + Lütfen bir tür seçin + Orijinal boyutundan daha resmi büyütmek üzereyiz. Devam etmek istediğinizden emin misiniz? + Python komut dosyası hatası + O hatayı içerdiği için python komut dosyası, kaydedilmemiş (ler) + Silinen düğüm başlatın, lütfen yöneticinize başvurun + Tarzı değiştirmeden önce içerik işaretleyiniz + Henüz aktif stilleri + Birleştirmek istediğiniz iki hücre solundaki imleci Lütfen + Sen birleştirilmiş henüz bir hücreyi bölemezsiniz. + XSLT kaynak hatae + O hatayı içerdiği XSLT, kaydedilmemiş (ler)) + Bu özellik için kullanılan veri türüne sahip bir yapılandırma hatası var, veri türünü kontrol edin - About - Action - Actions - Add - Alias - Are you sure? - Border - by - Cancel - Cell margin - Choose - Close - Close Window - Comment - Confirm - Constrain proportions - Continue - Copy - Create - Database - Date - Default - Delete - Deleted - Deleting... - Design - Dimensions - Down - Download - Edit - Edited - Elements - Email - Error - Find - Height - Help - Icon - Import - Inner margin - Insert - Install - Justify - Language - Layout - Loading - Locked - Login - Log off - Logout - Macro - Move - More - Name - New - Next - No - of - OK - Open - or - Password - Path - Placeholder ID - One moment please... - Previous - Properties - Email to receive form data - Recycle Bin - Remaining - Rename - Renew - Required - Retry - Permissions - Search - Server - Show - Show page on Send - Size - Sort - Type - Type to search... - Up - Update - Upgrade - Upload - Url - User - Username - Value - View - Welcome... - Width - Yes - Folder - Search results + Hakkında + Eylem + Eylemler + Ekle + Takma ad + Emin misiniz? + Sınır + tarafında + İptal + hücre marjı + Seçim + Kapat + Pencereyi kapat + Açıklama + Onayla + oranları sınırlamak + Devam et + Kopyala + Oluştur + Veritabanı + Tarih + Standart + Sil + Silindi + Siliniyor... + Dizayn + Boyutlar + Aşağı + İndir + Düzenle + Düzenlendi + Elemanları + E-Posta + Hata + Bul + Yükseklik + Yardım + İkon + İthalat + İç Marj + Ekle + Kur + Satır Uzunluğu + Dil + Düzen + Yükleniyor + Kilitli + Giriş yap + Oturum Kapat + Çıkış yap + Makro + Taşı + Daha + Ad + Yeni + Sonraki + Hayır + arasında + TAMAM + + veya + Parola + Yol + Yer tutucu ID + Bir dakika lütfen... + Önceki + Özellikler + Form verilerini almak için e-posta + Geridönüşüm kutusu + Kalan + Adını Değiştir + Yenile + Gerekli + Tekrar dene + İzinler + Arama + Sunucu + Göster + Gönder sayfasını göster + Boyut + Sırala + Tip + Aramak için yazın... + Yukarı + Güncelle + Yükselt + Yükle + URL + Kullanıcı + Kullanıcı adı + Değer + Görünüm + Hoşgeldiniz... + Genişlik + Evet + Klasör + Arama Sonuçları - Background color - Bold - Text color - Font - Text + Arka plan rengi + Kalın + Metin Rengi + Yazı + Metin - Page + Sayfa - The installer cannot connect to the database. - Could not save the web.config file. Please modify the connection string manually. - Your database has been found and is identified as - Database configuration - install button to install the Umbraco %0% database - ]]> - Next to proceed.]]> - Database not found! Please check that the information in the "connection string" of the "web.config" file is correct.

-

To proceed, please edit the "web.config" file (using Visual Studio or your favourite text editor), scroll to the bottom, add the connection string for your database in the key named "UmbracoDbDSN" and save the file.

+ Yükleyici veritabanına bağlanamıyor. + Web.config dosyasını kaydedilemedi. El bağlantı dizesini değiştirin lütfen. + Web.config dosyasını kaydedilemedi. El bağlantı dizesini değiştirin lütfen.... + Veritabanı yapılandırması + + Kurulum için dğümeye basın %0% veritabanı + ]]> + + Sonraki Devam için.]]> + + Veritabanı bulunamadı! "Web.config" nin "bağlantı dizesinde" bilgi dosyası doğru olup olmadığını kontrol edin.

+

Devam etmek için, (Visual Studio veya sevdiğiniz metin editörü kullanarak) "web.config" dosyasını düzenlemek lütfen, altına gidin "UmbracoDbDSN" adlı anahtarı veritabanınız için bağlantı dizesini eklemek ve dosyayı kaydedin.

- Click the retry button when - done.
- More information on editing web.config here.

]]>
- - Please contact your ISP if necessary. - If you're installing on a local machine or server you might need information from your system administrator.]]> - Tekrar dene. +
+ + Burada düzenleme web.config Hakkında Daha Fazla Bilgi.

]]> +
+ + + Gerekirse ISS'nize irtibata geçiniz. + Eğer yerel makine veya sunucu üzerinde yükleme ediyorsanız, sistem yöneticinizden bilgi gerekebilir.]]> + + + - Press the upgrade button to upgrade your database to Umbraco %0%

+ CMS %0% için veritabanını yükseltme için yükseltme düğmesine basın +

- Don't worry - no content will be deleted and everything will continue working afterwards! + Merak etmeyin - hiçbir içerik silinmeyecek ve her şey sonradan çalışmaya devam edecektir!

- ]]>
- Press Next to - proceed. ]]> + ]]> +
+ + Sonraki işlem. ]]> + next to continue the configuration wizard]]> The Default users' password needs to be changed!]]> The Default user has been disabled or has no access to Umbraco!

No further actions needs to be taken. Click Next to proceed.]]> The Default user's password has been successfully changed since the installation!

No further actions needs to be taken. Click Next to proceed.]]> The password is changed! - + Umbraco creates a default user with a login ('admin') and password ('default'). It's important that the password is changed to something unique. @@ -472,48 +491,64 @@

This step will check the default user's password and suggest if it needs to be changed.

- ]]>
+ ]]> + Get a great start, watch our introduction videos By clicking the next button (or modifying the umbracoConfigurationStatus in web.config), you accept the license for this software as specified in the box below. Notice that this Umbraco distribution consists of two different licenses, the open source MIT license for the framework and the Umbraco freeware license that covers the UI. Not installed yet. Affected files and folders More information on setting up permissions for Umbraco here You need to grant ASP.NET modify permissions to the following files/folders - Your permission settings are almost perfect!

- You can run Umbraco without problems, but you will not be able to install packages which are recommended to take full advantage of Umbraco.]]>
+ + Your permission settings are almost perfect!

+ You can run Umbraco without problems, but you will not be able to install packages which are recommended to take full advantage of Umbraco.]]> +
How to Resolve Click here to read the text version video tutorial on setting up folder permissions for Umbraco or read the text version.]]> - Your permission settings might be an issue! + + Your permission settings might be an issue!

- You can run Umbraco without problems, but you will not be able to create folders or install packages which are recommended to take full advantage of Umbraco.]]>
- Your permission settings are not ready for Umbraco! + You can run Umbraco without problems, but you will not be able to create folders or install packages which are recommended to take full advantage of Umbraco.]]> + + + Your permission settings are not ready for Umbraco!

- In order to run Umbraco, you'll need to update your permission settings.]]>
- Your permission settings are perfect!

- You are ready to run Umbraco and install packages!]]>
+ In order to run Umbraco, you'll need to update your permission settings.]]> +
+ + Your permission settings are perfect!

+ You are ready to run Umbraco and install packages!]]> +
Resolving folder issue Follow this link for more information on problems with ASP.NET and creating folders Setting up folder permissions - + - I want to start from scratch - + + Baştan başlamak istiyorum + + learn how) You can still choose to install Runway later on. Please go to the Developer section and choose Packages. - ]]> + ]]> + You've just set up a clean Umbraco platform. What do you want to do next? Runway is installed - + This is our list of recommended modules, check off the ones you would like to install, or view the full list of modules - ]]> + ]]> + Only recommended for experienced users I want to start with a simple website - + "Runway" is a simple website providing some basic document types and templates. The installer can set up Runway for you automatically, but you can easily edit, extend or remove it. It's not necessary and you can perfectly use Umbraco without it. However, @@ -524,7 +559,8 @@ Included with Runway: Home page, Getting Started page, Installing Modules page.
Optional Modules: Top Navigation, Sitemap, Contact, Gallery. - ]]>
+ ]]> + What is Runway Step 1/5 Accept license Step 2/5: Database configuration @@ -532,49 +568,61 @@ Step 4/5: Check Umbraco security Step 5/5: Umbraco is ready to get you started Thank you for choosing Umbraco - Browse your new site -You installed Runway, so why not see how your new website looks.]]> - Further help and information -Get help from our award winning community, browse the documentation or watch some free videos on how to build a simple site, how to use packages and a quick guide to the Umbraco terminology]]> + + Browse your new site +You installed Runway, so why not see how your new website looks.]]> + + + Further help and information +Get help from our award winning community, browse the documentation or watch some free videos on how to build a simple site, how to use packages and a quick guide to the Umbraco terminology]]> + Umbraco %0% is installed and ready for use - /web.config file and update the AppSetting key UmbracoConfigurationStatus in the bottom to the value of '%0%'.]]> - started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco, -you can find plenty of resources on our getting started pages.]]>
- Launch Umbraco -To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> + + /web.config file and update the AppSetting key UmbracoConfigurationStatus in the bottom to the value of '%0%'.]]> + + + started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco, +you can find plenty of resources on our getting started pages.]]> +
+ + Launch Umbraco +To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]> + Connection to database failed. Umbraco Version 3 Umbraco Version 4 Watch - Umbraco %0% for a fresh install or upgrading from version 3.0. + + Umbraco %0% for a fresh install or upgrading from version 3.0.

- Press "next" to start the wizard.]]>
+ Press "next" to start the wizard.]]> +
- Culture Code - Culture Name + Kültür Kodu + Kültür Adı - You've been idle and logout will automatically occur in - Renew now to save your work + Sen boşta oldum ve çıkış otomatik olarak gerçekleşecek + İşinizi kaydetmek için şimdi Yenile - Happy super Sunday - Happy manic Monday - Happy tubular Tuesday - Happy wonderful Wednesday - Happy thunderous Thursday - Happy funky Friday - Happy Caturday - Log in below - Session timed out - © 2001 - %0%
Umbraco.com

]]>
+ Pazar + Pazartesi + Salı + Çarşamba + Perşembe + Cuma + İçerik Yönetim Sistemi + Giriş Yapın + Oturum zaman aşımına uğradı + © 2015 - %0%
kayadata.com

]]>
- Dashboard - Sections - Content + Gösterge Paneli + Bölümler + İçerik Choose page above... @@ -592,7 +640,8 @@ To manage your website, simply open the Umbraco back office and start adding con Edit your notification for %0% - + - Hi %0%

+ ]]> +
+ + Hi %0%

This is an automated mail to inform you that the task '%1%' has been performed on the page '%2%' @@ -631,23 +682,28 @@ To manage your website, simply open the Umbraco back office and start adding con

Have a nice day!

Cheers from the Umbraco robot -

]]>
+

]]> + [%0%] Notification about %1% performed on %2% Notifications - + button and locating the package. Umbraco packages usually have a ".umb" or ".zip" extension. - ]]> + ]]> + Author Demonstration Documentation Package meta data Package name Package doesn't contain any items -
- You can safely remove this from the system by clicking "uninstall package" below.]]>
+ +
+ You can safely remove this from the system by clicking "uninstall package" below.]]> +
No upgrades available Package options Package readme @@ -656,9 +712,11 @@ To manage your website, simply open the Umbraco back office and start adding con Package was uninstalled The package was successfully uninstalled Uninstall package - + + Notice: any documents, media etc depending on the items you remove, will stop working, and could lead to system instability, - so uninstall with caution. If in doubt, contact the package author.]]> + so uninstall with caution. If in doubt, contact the package author.]]> + Download update from the repository Upgrade package Upgrade instructions @@ -697,38 +755,43 @@ To manage your website, simply open the Umbraco back office and start adding con %0% could not be published because the item is scheduled for release. ]]> - - + - + + + - + + + + ]]> + Include unpublished child pages Publishing in progress - please wait... %0% out of %1% pages have been published... %0% has been published %0% and subpages have been published Publish %0% and all its subpages - ok to publish %0% and thereby making its content publicly available.

+ + ok to publish %0% and thereby making its content publicly available.

You can publish this page and all it's sub-pages by checking publish all children below. - ]]>
+ ]]> +
- You have not configured any approved colors + You have not configured any approved colours enter external link choose internal page Caption Link - Open in new window - enter the display caption + New window + Enter a new caption Enter the link @@ -744,34 +807,34 @@ To manage your website, simply open the Umbraco back office and start adding con View - Edit script file + Düzenleme komut dosyası - Concierge - Content - Courier - Developer - Umbraco Configuration Wizard - Media - Members - Newsletters - Settings - Statistics - Translation - Users - Help - Forms + Kapıcı + İçerik + Kurya + Geliştirici + CMS Yapılandırma Sihirbazı + Medya + Üyeler + Haber Bültenleri + Ayarlar + İstatistik + Çeviri + Kullanıcılar + Yardım + Formlar Analytics - go to + git Help topics for Video chapters for - The best Umbraco video tutorials + Kayadata - Default template - Dictionary Key + Varsayılan şablonu + Sözlük Key To import a document type, find the ".udt" file on your computer by clicking the "Browse" button and click "Import" (you'll be asked for confirmation on the next screen) New Tab Title Node type @@ -795,11 +858,11 @@ To manage your website, simply open the Umbraco back office and start adding con
Do not close this window during sorting]]>
- Failed - Insufficient user permissions, could not complete the operation - Cancelled - Operation was cancelled by a 3rd party add-in - Publishing was cancelled by a 3rd party add-in + Hata + Kullanıcı izniniz yeterli olmadığı için, işleminiz gerçekleştirilmedi. + İptal Edildi + İşleminiz 3.Parti yazılım tarafından iptal edildi. + Sayfa yayınlama 3.Parti yazılım tarafından iptal edildi. Property type already exists Property type created DataType: %1%]]> @@ -879,7 +942,7 @@ To manage your website, simply open the Umbraco back office and start adding con Insert control - Choose a layout for this section + Choose a layout for the page below and add your first element]]> Click to embed @@ -943,10 +1006,12 @@ To manage your website, simply open the Umbraco back office and start adding con Tasks assigned to you - assigned to you. To see a detailed view including comments, click on "Details" or just the page name. + + assigned to you. To see a detailed view including comments, click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link.
To close a translation task, please go to the Details view and click the "Close" button. - ]]>
+ ]]> +
close task Translation details Download all translation tasks as XML @@ -954,7 +1019,8 @@ To manage your website, simply open the Umbraco back office and start adding con Download XML DTD Fields Include subpages - + + ]]> + [%0%] Translation task for %1% No translator users found. Please create a translator user before you start sending content to translation Tasks created by you - created by you. To see a detailed view including comments, + + created by you. To see a detailed view including comments, click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link. To close a translation task, please go to the Details view and click the "Close" button. - ]]> + ]]> + The page '%0%' has been send to translation Send the page '%0%' to translation Assigned by @@ -1027,47 +1096,47 @@ To manage your website, simply open the Umbraco back office and start adding con Error checking for update. Please review trace-stack for further information - Administrator - Category field - Change Your Password - Change Your Password - Confirm new password - You can change your password for accessing the Umbraco Back Office by filling out the form below and click the 'Change Password' button - Content Channel - Description field - Disable User - Document Type - Editor - Excerpt field - Language - Login - Start Node in Media Library - Sections - Disable Umbraco Access - Password - Reset password - Your password has been changed! - Please confirm the new password - Enter your new password - Your new password cannot be blank! - Current password - Invalid current password - There was a difference between the new password and the confirmed password. Please try again! - The confirmed password doesn't match the new password! - Replace child node permissions - You are currently modifying permissions for the pages: - Select pages to modify their permissions - Search all children - Start Node in Content - Name - User permissions - User type - User types - Writer + Yönetici + Kategori alanı + Şifreni değiştir + Şifreni değiştir + Yeni şifreyi onaylad + Aşağıdaki formu doldurarak CMS Geri Office'i erişmek için parolanızı değiştirmeniz ve ' Şifre Değiştir ' düğmesine tıklayabilirsiniz + İçerik Kanal + Açıklama alanı + Kullanıcıyı Devre Dışı Bırak + Belge Türü + editör + Alıntı alan + Dil + Kullanıcı adı + Medya Kütüphane düğüm başlatın + Bölümler + CMS Erişim devre dışı bırakma + Parola + Şifre sıfırlamak + Şifreniz değiştirildi! + Yeni parolayı onaylayın Lütfen + Yeni şifrenizi girin + Yeni şifre boş olamaz ! + Mevcut Şifre + Geçersiz Geçerli şifre + Yeni şifre ile teyit şifre arasında bir fark yoktu. Lütfen tekrar deneyin! + Teyit şifre yeni bir şifre eşleşmiyor ! + Alt düğümü izinlerini değiştirin + Şu anda sayfaları için izinleri değiştiriyorsunuz: + Onların izinlerini değiştirmek için sayfaları seçin + Tüm çocukların ara + içerikte Düğüm başlat + İsim + Kullanıcı izinleri + Kullanıcı türü + Kullanıcı tipleri + Yazar Translator Change - Your profile - Your recent history - Session expires in + Profiliniz + Son tarih + Oturum sona eriyor
From b69580967e8b247893782541107305e28d071c63 Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 24 May 2016 16:12:54 +0200 Subject: [PATCH 004/168] Updates interceptor files with correct module usage - creates new request interceptor to append a custom Time-Offset header --- .../src/common/security/_module.js | 8 +- .../src/common/security/requestinterceptor.js | 26 +++ .../src/common/security/retryqueue.js | 1 + ...{interceptor.js => securityinterceptor.js} | 188 +++++++++--------- 4 files changed, 125 insertions(+), 98 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js rename src/Umbraco.Web.UI.Client/src/common/security/{interceptor.js => securityinterceptor.js} (96%) diff --git a/src/Umbraco.Web.UI.Client/src/common/security/_module.js b/src/Umbraco.Web.UI.Client/src/common/security/_module.js index 15a7663d9b..c8289c754e 100644 --- a/src/Umbraco.Web.UI.Client/src/common/security/_module.js +++ b/src/Umbraco.Web.UI.Client/src/common/security/_module.js @@ -1,4 +1,4 @@ -// Based loosely around work by Witold Szczerba - https://github.com/witoldsz/angular-http-auth -angular.module('umbraco.security', [ - 'umbraco.security.retryQueue', - 'umbraco.security.interceptor']); \ No newline at end of file +//TODO: This is silly and unecessary to have a separate module for this +angular.module('umbraco.security.retryQueue', []); +angular.module('umbraco.security.interceptor', ['umbraco.security.retryQueue']); +angular.module('umbraco.security', ['umbraco.security.retryQueue', 'umbraco.security.interceptor']); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js b/src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js new file mode 100644 index 0000000000..8557ce1435 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js @@ -0,0 +1,26 @@ +angular.module('umbraco.security.interceptor').factory("requestInterceptor", + ['$q', 'requestInterceptorFilter', function ($q, requestInterceptorFilter) { + var requestInterceptor = { + request: function (config) { + + var filtered = _.find(requestInterceptorFilter(), function (val) { + return config.url.indexOf(val) > 0; + }); + if (filtered) { + return config; + } + + config.headers["Time-Offset"] = (new Date().getTimezoneOffset()); + return config; + } + }; + + return requestInterceptor; + } + ]) + // We have to add the interceptor to the queue as a string because the interceptor depends upon service instances that are not available in the config block. + .config([ + '$httpProvider', function($httpProvider) { + $httpProvider.interceptors.push('requestInterceptor'); + } + ]); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/security/retryqueue.js b/src/Umbraco.Web.UI.Client/src/common/security/retryqueue.js index e971719398..28d91dd610 100644 --- a/src/Umbraco.Web.UI.Client/src/common/security/retryqueue.js +++ b/src/Umbraco.Web.UI.Client/src/common/security/retryqueue.js @@ -1,3 +1,4 @@ +//TODO: This is silly and unecessary to have a separate module for this angular.module('umbraco.security.retryQueue', []) // This is a generic retry queue for security failures. Each item is expected to expose two functions: retry and cancel. diff --git a/src/Umbraco.Web.UI.Client/src/common/security/interceptor.js b/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js similarity index 96% rename from src/Umbraco.Web.UI.Client/src/common/security/interceptor.js rename to src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js index 2b757707ba..b80754ef67 100644 --- a/src/Umbraco.Web.UI.Client/src/common/security/interceptor.js +++ b/src/Umbraco.Web.UI.Client/src/common/security/securityinterceptor.js @@ -1,95 +1,95 @@ -angular.module('umbraco.security.interceptor', ['umbraco.security.retryQueue']) - // This http interceptor listens for authentication successes and failures - .factory('securityInterceptor', ['$injector', 'securityRetryQueue', 'notificationsService', 'requestInterceptorFilter', function ($injector, queue, notifications, requestInterceptorFilter) { - return function(promise) { - - return promise.then( - function(originalResponse) { - // Intercept successful requests - - //Here we'll check if our custom header is in the response which indicates how many seconds the user's session has before it - //expires. Then we'll update the user in the user service accordingly. - var headers = originalResponse.headers(); - if (headers["x-umb-user-seconds"]) { - // We must use $injector to get the $http service to prevent circular dependency - var userService = $injector.get('userService'); - userService.setUserTimeout(headers["x-umb-user-seconds"]); - } - - return promise; - }, function(originalResponse) { - // Intercept failed requests - - //Here we'll check if we should ignore the error, this will be based on an original header set - var headers = originalResponse.config ? originalResponse.config.headers : {}; - if (headers["x-umb-ignore-error"] === "ignore") { - //exit/ignore - return promise; - } - var filtered = _.find(requestInterceptorFilter(), function(val) { - return originalResponse.config.url.indexOf(val) > 0; - }); - if (filtered) { - return promise; - } - - //A 401 means that the user is not logged in - if (originalResponse.status === 401) { - - // The request bounced because it was not authorized - add a new request to the retry queue - promise = queue.pushRetryFn('unauthorized-server', function retryRequest() { - // We must use $injector to get the $http service to prevent circular dependency - return $injector.get('$http')(originalResponse.config); - }); - } - else if (originalResponse.status === 404) { - - //a 404 indicates that the request was not found - this could be due to a non existing url, or it could - //be due to accessing a url with a parameter that doesn't exist, either way we should notifiy the user about it - - var errMsg = "The URL returned a 404 (not found):
" + originalResponse.config.url.split('?')[0] + ""; - if (originalResponse.data && originalResponse.data.ExceptionMessage) { - errMsg += "
with error:
" + originalResponse.data.ExceptionMessage + ""; - } - if (originalResponse.config.data) { - errMsg += "
with data:
" + angular.toJson(originalResponse.config.data) + "
Contact your administrator for information."; - } - - notifications.error( - "Request error", - errMsg); - - } - else if (originalResponse.status === 403) { - //if the status was a 403 it means the user didn't have permission to do what the request was trying to do. - //How do we deal with this now, need to tell the user somehow that they don't have permission to do the thing that was - //requested. We can either deal with this globally here, or we can deal with it globally for individual requests on the umbRequestHelper, - // or completely custom for services calling resources. - - //http://issues.umbraco.org/issue/U4-2749 - - //It was decided to just put these messages into the normal status messages. - - var msg = "Unauthorized access to URL:
" + originalResponse.config.url.split('?')[0] + ""; - if (originalResponse.config.data) { - msg += "
with data:
" + angular.toJson(originalResponse.config.data) + "
Contact your administrator for information."; - } - - notifications.error( - "Authorization error", - msg); - } - - return promise; - }); - }; - }]) - - .value('requestInterceptorFilter', function() { - return ["www.gravatar.com"]; - }) - - // We have to add the interceptor to the queue as a string because the interceptor depends upon service instances that are not available in the config block. - .config(['$httpProvider', function ($httpProvider) { - $httpProvider.responseInterceptors.push('securityInterceptor'); +angular.module('umbraco.security.interceptor') + // This http interceptor listens for authentication successes and failures + .factory('securityInterceptor', ['$injector', 'securityRetryQueue', 'notificationsService', 'requestInterceptorFilter', function ($injector, queue, notifications, requestInterceptorFilter) { + return function(promise) { + + return promise.then( + function(originalResponse) { + // Intercept successful requests + + //Here we'll check if our custom header is in the response which indicates how many seconds the user's session has before it + //expires. Then we'll update the user in the user service accordingly. + var headers = originalResponse.headers(); + if (headers["x-umb-user-seconds"]) { + // We must use $injector to get the $http service to prevent circular dependency + var userService = $injector.get('userService'); + userService.setUserTimeout(headers["x-umb-user-seconds"]); + } + + return promise; + }, function(originalResponse) { + // Intercept failed requests + + //Here we'll check if we should ignore the error, this will be based on an original header set + var headers = originalResponse.config ? originalResponse.config.headers : {}; + if (headers["x-umb-ignore-error"] === "ignore") { + //exit/ignore + return promise; + } + var filtered = _.find(requestInterceptorFilter(), function(val) { + return originalResponse.config.url.indexOf(val) > 0; + }); + if (filtered) { + return promise; + } + + //A 401 means that the user is not logged in + if (originalResponse.status === 401) { + + // The request bounced because it was not authorized - add a new request to the retry queue + promise = queue.pushRetryFn('unauthorized-server', function retryRequest() { + // We must use $injector to get the $http service to prevent circular dependency + return $injector.get('$http')(originalResponse.config); + }); + } + else if (originalResponse.status === 404) { + + //a 404 indicates that the request was not found - this could be due to a non existing url, or it could + //be due to accessing a url with a parameter that doesn't exist, either way we should notifiy the user about it + + var errMsg = "The URL returned a 404 (not found):
" + originalResponse.config.url.split('?')[0] + ""; + if (originalResponse.data && originalResponse.data.ExceptionMessage) { + errMsg += "
with error:
" + originalResponse.data.ExceptionMessage + ""; + } + if (originalResponse.config.data) { + errMsg += "
with data:
" + angular.toJson(originalResponse.config.data) + "
Contact your administrator for information."; + } + + notifications.error( + "Request error", + errMsg); + + } + else if (originalResponse.status === 403) { + //if the status was a 403 it means the user didn't have permission to do what the request was trying to do. + //How do we deal with this now, need to tell the user somehow that they don't have permission to do the thing that was + //requested. We can either deal with this globally here, or we can deal with it globally for individual requests on the umbRequestHelper, + // or completely custom for services calling resources. + + //http://issues.umbraco.org/issue/U4-2749 + + //It was decided to just put these messages into the normal status messages. + + var msg = "Unauthorized access to URL:
" + originalResponse.config.url.split('?')[0] + ""; + if (originalResponse.config.data) { + msg += "
with data:
" + angular.toJson(originalResponse.config.data) + "
Contact your administrator for information."; + } + + notifications.error( + "Authorization error", + msg); + } + + return promise; + }); + }; + }]) + + .value('requestInterceptorFilter', function() { + return ["www.gravatar.com"]; + }) + + // We have to add the interceptor to the queue as a string because the interceptor depends upon service instances that are not available in the config block. + .config(['$httpProvider', function ($httpProvider) { + $httpProvider.responseInterceptors.push('securityInterceptor'); }]); \ No newline at end of file From 2504586c267c114815f478a9fcf287f2eda65047 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 May 2016 09:43:31 +0200 Subject: [PATCH 005/168] removes initial idea of performing conversion on the server since this would be a breaking change, instead we can easily do this on the client side - and this works much better. Have added pre-values to the date/time picker to be able to enable offset times. This is enabled for the publish-at pickers since those must be offset. When the datetime is offset, it shows the server time in small text underneath the picker. Have added js unit tests for the date conversions. Have updated the datepicker controller to set the model date in a single place/method so it's consistent. --- .../src/common/security/requestinterceptor.js | 26 ------- .../src/common/services/util.service.js | 38 ++++++++++ .../datepicker/datepicker.controller.js | 76 ++++++++++++------- .../datepicker/datepicker.html | 3 + .../test/config/karma.conf.js | 1 + .../unit/common/services/date-helper.spec.js | 53 +++++++++++++ .../Editors/BackOfficeController.cs | 4 + .../Editors/ContentControllerBase.cs | 5 +- .../Models/Mapping/ContentModelMapper.cs | 12 ++- .../PropertyEditors/DateTimePreValueEditor.cs | 10 +++ .../PropertyEditors/DateTimePropertyEditor.cs | 13 +++- src/Umbraco.Web/Umbraco.Web.csproj | 1 + .../WebApi/Binders/ContentItemBaseBinder.cs | 12 ++- 13 files changed, 190 insertions(+), 64 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js create mode 100644 src/Umbraco.Web.UI.Client/test/unit/common/services/date-helper.spec.js create mode 100644 src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs diff --git a/src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js b/src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js deleted file mode 100644 index 8557ce1435..0000000000 --- a/src/Umbraco.Web.UI.Client/src/common/security/requestinterceptor.js +++ /dev/null @@ -1,26 +0,0 @@ -angular.module('umbraco.security.interceptor').factory("requestInterceptor", - ['$q', 'requestInterceptorFilter', function ($q, requestInterceptorFilter) { - var requestInterceptor = { - request: function (config) { - - var filtered = _.find(requestInterceptorFilter(), function (val) { - return config.url.indexOf(val) > 0; - }); - if (filtered) { - return config; - } - - config.headers["Time-Offset"] = (new Date().getTimezoneOffset()); - return config; - } - }; - - return requestInterceptor; - } - ]) - // We have to add the interceptor to the queue as a string because the interceptor depends upon service instances that are not available in the config block. - .config([ - '$httpProvider', function($httpProvider) { - $httpProvider.interceptors.push('requestInterceptor'); - } - ]); \ No newline at end of file diff --git a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js index 9fbf2947af..2f06d4c393 100644 --- a/src/Umbraco.Web.UI.Client/src/common/services/util.service.js +++ b/src/Umbraco.Web.UI.Client/src/common/services/util.service.js @@ -1,5 +1,43 @@ /*Contains multiple services for various helper tasks */ +function dateHelper() { + + return { + + convertToServerStringTime: function(momentLocal, serverOffsetMinutes, format) { + + //get the formatted offset time in HH:mm (server time offset is in minutes) + var formattedOffset = (serverOffsetMinutes > 0 ? "+" : "-") + + moment() + .startOf('day') + .minutes(Math.abs(serverOffsetMinutes)) + .format('HH:mm'); + + var server = moment.utc(momentLocal).zone(formattedOffset); + return server.format(format ? format : "YYYY-MM-DD HH:mm:ss"); + }, + + convertToLocalMomentTime: function (strVal, serverOffsetMinutes) { + + //get the formatted offset time in HH:mm (server time offset is in minutes) + var formattedOffset = (serverOffsetMinutes > 0 ? "+" : "-") + + moment() + .startOf('day') + .minutes(Math.abs(serverOffsetMinutes)) + .format('HH:mm'); + + //convert to the iso string format + var isoFormat = moment(strVal).format("YYYY-MM-DDTHH:mm:ss") + formattedOffset; + + //create a moment with the iso format which will include the offset with the correct time + // then convert it to local time + return moment.parseZone(isoFormat).local(); + } + + }; +} +angular.module('umbraco.services').factory('dateHelper', dateHelper); + function packageHelper(assetsService, treeService, eventsService, $templateCache) { return { diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js index 693bd49ec6..95d0a1bdf6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js @@ -1,4 +1,4 @@ -function dateTimePickerController($scope, notificationsService, assetsService, angularHelper, userService, $element) { +function dateTimePickerController($scope, notificationsService, assetsService, angularHelper, userService, $element, dateHelper) { //setup the default config var config = { @@ -22,6 +22,8 @@ function dateTimePickerController($scope, notificationsService, assetsService, a $scope.model.config.format = $scope.model.config.pickTime ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD"; } + + $scope.hasDatetimePickerValue = $scope.model.value ? true : false; $scope.datetimePickerValue = null; @@ -43,20 +45,46 @@ function dateTimePickerController($scope, notificationsService, assetsService, a if (e.date && e.date.isValid()) { $scope.datePickerForm.datepicker.$setValidity("pickerError", true); $scope.hasDatetimePickerValue = true; - $scope.datetimePickerValue = e.date.format($scope.model.config.format); - $scope.model.value = $scope.datetimePickerValue; + $scope.datetimePickerValue = e.date.format($scope.model.config.format); } else { $scope.hasDatetimePickerValue = false; $scope.datetimePickerValue = null; } - + + setModelValue(); + if (!$scope.model.config.pickTime) { $element.find("div:first").datetimepicker("hide", 0); } }); } + //sets the scope model value accordingly - this is the value to be sent up to the server and depends on + // if the picker is configured to offset time. We always format the date/time in a specific format for sending + // to the server, this is different from the format used to display the date/time. + function setModelValue() { + if ($scope.hasDatetimePickerValue) { + var elementData = $element.find("div:first").data().DateTimePicker; + if ($scope.model.config.pickTime) { + //check if we are supposed to offset the time + if ($scope.model.value && $scope.model.config.offsetTime === "1" && Umbraco.Sys.ServerVariables.application.serverTimeOffset) { + $scope.model.value = dateHelper.convertToServerStringTime(elementData.getDate(), Umbraco.Sys.ServerVariables.application.serverTimeOffset); + $scope.serverTime = dateHelper.convertToServerStringTime(elementData.getDate(), Umbraco.Sys.ServerVariables.application.serverTimeOffset, "YYYY-MM-DD HH:mm:ss Z"); + } + else { + $scope.model.value = elementData.getDate().format("YYYY-MM-DD HH:mm:ss"); + } + } + else { + $scope.model.value = elementData.getDate().format("YYYY-MM-DD"); + } + } + else { + $scope.model.value = null; + } + } + var picker = null; $scope.clearDate = function() { @@ -66,6 +94,8 @@ function dateTimePickerController($scope, notificationsService, assetsService, a $scope.datePickerForm.datepicker.$setValidity("pickerError", true); } + $scope.serverTime = null; + //get the current user to see if we can localize this picker userService.getCurrentUser().then(function (user) { @@ -97,8 +127,17 @@ function dateTimePickerController($scope, notificationsService, assetsService, a }); if ($scope.hasDatetimePickerValue) { - //assign value to plugin/picker - var dateVal = $scope.model.value ? moment($scope.model.value, "YYYY-MM-DD HH:mm:ss") : moment(); + var dateVal; + //check if we are supposed to offset the time + if ($scope.model.value && $scope.model.config.offsetTime === "1" && Umbraco.Sys.ServerVariables.application.serverTimeOffset) { + //get the local time offset from the server + dateVal = dateHelper.convertToLocalMomentTime($scope.model.value, Umbraco.Sys.ServerVariables.application.serverTimeOffset); + $scope.serverTime = dateHelper.convertToServerStringTime(dateVal, Umbraco.Sys.ServerVariables.application.serverTimeOffset, "YYYY-MM-DD HH:mm:ss Z"); + } + else { + //create a normal moment , no offset required + var dateVal = $scope.model.value ? moment($scope.model.value, "YYYY-MM-DD HH:mm:ss") : moment(); + } element.datetimepicker("setValue", dateVal); $scope.datetimePickerValue = dateVal.format($scope.model.config.format); @@ -117,18 +156,7 @@ function dateTimePickerController($scope, notificationsService, assetsService, a var unsubscribe = $scope.$on("formSubmitting", function (ev, args) { - if ($scope.hasDatetimePickerValue) { - var elementData = $element.find("div:first").data().DateTimePicker; - if ($scope.model.config.pickTime) { - $scope.model.value = elementData.getDate().format("YYYY-MM-DD HH:mm:ss"); - } - else { - $scope.model.value = elementData.getDate().format("YYYY-MM-DD"); - } - } - else { - $scope.model.value = null; - } + setModelValue(); }); //unbind doc click event! $scope.$on('$destroy', function () { @@ -142,17 +170,7 @@ function dateTimePickerController($scope, notificationsService, assetsService, a }); var unsubscribe = $scope.$on("formSubmitting", function (ev, args) { - if ($scope.hasDatetimePickerValue) { - if ($scope.model.config.pickTime) { - $scope.model.value = $element.find("div:first").data().DateTimePicker.getDate().format("YYYY-MM-DD HH:mm:ss"); - } - else { - $scope.model.value = $element.find("div:first").data().DateTimePicker.getDate().format("YYYY-MM-DD"); - } - } - else { - $scope.model.value = null; - } + setModelValue(); }); //unbind doc click event! diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html index e6d49e5c6c..c9b83cc8ed 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.html @@ -18,6 +18,9 @@ {{datePickerForm.datepicker.errorMsg}} Invalid date +

+ Server time: {{serverTime}} +

Clear date

diff --git a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js index 0f323f03aa..ede7c20538 100644 --- a/src/Umbraco.Web.UI.Client/test/config/karma.conf.js +++ b/src/Umbraco.Web.UI.Client/test/config/karma.conf.js @@ -24,6 +24,7 @@ module.exports = function(karma) { 'lib/../build/belle/lib/underscore/underscore-min.js', + 'lib/../build/belle/lib/moment/moment-with-locales.js', 'lib/umbraco/Extensions.js', 'lib/../build/belle/lib/rgrove-lazyload/lazyload.js', 'lib/../build/belle/lib/angular-local-storage/angular-local-storage.min.js', diff --git a/src/Umbraco.Web.UI.Client/test/unit/common/services/date-helper.spec.js b/src/Umbraco.Web.UI.Client/test/unit/common/services/date-helper.spec.js new file mode 100644 index 0000000000..74d2b38cfa --- /dev/null +++ b/src/Umbraco.Web.UI.Client/test/unit/common/services/date-helper.spec.js @@ -0,0 +1,53 @@ +describe('date helper tests', function () { + var dateHelper; + + beforeEach(module('umbraco.services')); + + beforeEach(inject(function ($injector) { + dateHelper = $injector.get('dateHelper'); + })); + + describe('converting to local moments', function () { + + it('converts from a positive offset', function () { + var offsetMin = 600; //+10 + var strDate = "2016-01-01 10:00:00"; + + var result = dateHelper.convertToLocalMomentTime(strDate, offsetMin); + + expect(result.format("YYYY-MM-DD HH:mm:ss Z")).toBe("2016-01-01 01:00:00 +01:00"); + }); + + it('converts from a negataive offset', function () { + var offsetMin = -420; //-7 + var strDate = "2016-01-01 10:00:00"; + + var result = dateHelper.convertToLocalMomentTime(strDate, offsetMin); + + expect(result.format("YYYY-MM-DD HH:mm:ss Z")).toBe("2016-01-01 18:00:00 +01:00"); + }); + + }); + + describe('converting to server strings', function () { + + it('converts to a positive offset', function () { + var offsetMin = 600; //+10 + var localDate = moment("2016-01-01 10:00:00"); + + var result = dateHelper.convertToServerStringTime(localDate, offsetMin, "YYYY-MM-DD HH:mm:ss Z"); + + expect(result).toBe("2016-01-01 19:00:00 +10:00"); + }); + + it('converts from a negataive offset', function () { + var offsetMin = -420; //-7 + var localDate = moment("2016-01-01 10:00:00"); + + var result = dateHelper.convertToServerStringTime(localDate, offsetMin, "YYYY-MM-DD HH:mm:ss Z"); + + expect(result).toBe("2016-01-01 02:00:00 -07:00"); + }); + + }); +}); \ No newline at end of file diff --git a/src/Umbraco.Web/Editors/BackOfficeController.cs b/src/Umbraco.Web/Editors/BackOfficeController.cs index b5cea7a945..6ee6f260f3 100644 --- a/src/Umbraco.Web/Editors/BackOfficeController.cs +++ b/src/Umbraco.Web/Editors/BackOfficeController.cs @@ -677,6 +677,10 @@ namespace Umbraco.Web.Editors app.Add("cdf", ClientDependencySettings.Instance.Version); //useful for dealing with virtual paths on the client side when hosted in virtual directories especially app.Add("applicationPath", HttpContext.Request.ApplicationPath.EnsureEndsWith('/')); + + //add the server's GMT time offset in minutes + app.Add("serverTimeOffset", Convert.ToInt32(DateTimeOffset.Now.Offset.TotalMinutes)); + return app; } diff --git a/src/Umbraco.Web/Editors/ContentControllerBase.cs b/src/Umbraco.Web/Editors/ContentControllerBase.cs index bf9f2056b3..495217cec2 100644 --- a/src/Umbraco.Web/Editors/ContentControllerBase.cs +++ b/src/Umbraco.Web/Editors/ContentControllerBase.cs @@ -97,10 +97,11 @@ namespace Umbraco.Web.Editors var d = new Dictionary(); //add the files if any var files = contentItem.UploadedFiles.Where(x => x.PropertyAlias == p.Alias).ToArray(); - if (files.Any()) + if (files.Length > 0) { d.Add("files", files); } + var data = new ContentPropertyData(p.Value, p.PreValues, d); //get the deserialized value from the property editor @@ -113,7 +114,7 @@ namespace Umbraco.Web.Editors var valueEditor = p.PropertyEditor.ValueEditor; //don't persist any bound value if the editor is readonly if (valueEditor.IsReadOnly == false) - { + { var propVal = p.PropertyEditor.ValueEditor.ConvertEditorToDb(data, dboProperty.Value); var supportTagsAttribute = TagExtractor.GetAttribute(p.PropertyEditor); if (supportTagsAttribute != null) diff --git a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs index ede1dfc78d..e44fc056da 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs @@ -179,7 +179,11 @@ namespace Umbraco.Web.Models.Mapping Label = localizedText.Localize("content/releaseDate"), Value = display.ReleaseDate.HasValue ? display.ReleaseDate.Value.ToIsoString() : null, //Not editible for people without publish permission (U4-287) - View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View + View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View, + Config = new Dictionary + { + {"offsetTime", "1"} + } //TODO: Fix up hard coded datepicker } , new ContentPropertyDisplay @@ -188,7 +192,11 @@ namespace Umbraco.Web.Models.Mapping Label = localizedText.Localize("content/unpublishDate"), Value = display.ExpireDate.HasValue ? display.ExpireDate.Value.ToIsoString() : null, //Not editible for people without publish permission (U4-287) - View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View + View = display.AllowedActions.Contains('P') ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View, + Config = new Dictionary + { + {"offsetTime", "1"} + } //TODO: Fix up hard coded datepicker }, new ContentPropertyDisplay diff --git a/src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs b/src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs new file mode 100644 index 0000000000..242893cbca --- /dev/null +++ b/src/Umbraco.Web/PropertyEditors/DateTimePreValueEditor.cs @@ -0,0 +1,10 @@ +using Umbraco.Core.PropertyEditors; + +namespace Umbraco.Web.PropertyEditors +{ + internal class DateTimePreValueEditor : DatePreValueEditor + { + [PreValueField("offsetTime", "Offset time", "boolean", Description = "When enabled the time displayed will be offset with the server's timezone, this is useful for scenarios like scheduled publishing when an editor is in a different timezone than the hosted server")] + public bool OffsetTime { get; set; } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs index 38674de14e..2a76c0d50a 100644 --- a/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/DateTimePropertyEditor.cs @@ -1,7 +1,10 @@ using System; using System.Collections.Generic; using Umbraco.Core; +using Umbraco.Core.Models; +using Umbraco.Core.Models.Editors; using Umbraco.Core.PropertyEditors; +using Umbraco.Core.Services; namespace Umbraco.Web.PropertyEditors { @@ -14,7 +17,11 @@ namespace Umbraco.Web.PropertyEditors { //NOTE: This is very important that we do not use .Net format's there, this format // is the correct format for the JS picker we are using so you cannot capitalize the HH, they need to be 'hh' - {"format", "YYYY-MM-DD HH:mm:ss"} + {"format", "YYYY-MM-DD HH:mm:ss"}, + //a pre-value indicating if the client/server time should be offset, when set to true the date/time seen + // by the client will be offset with the server time. + // For example, this is forced to true for scheduled publishing date/time pickers + {"offsetTime", "0"} }; } @@ -40,7 +47,9 @@ namespace Umbraco.Web.PropertyEditors protected override PreValueEditor CreatePreValueEditor() { - return new DatePreValueEditor(); + return new DateTimePreValueEditor(); } } + + } \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 48005b1209..a1968d5e3f 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -354,6 +354,7 @@ + diff --git a/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs b/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs index dda19f9ff9..195c488b1e 100644 --- a/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs +++ b/src/Umbraco.Web/WebApi/Binders/ContentItemBaseBinder.cs @@ -166,7 +166,7 @@ namespace Umbraco.Web.WebApi.Binders //create the dto from the persisted model if (model.PersistedContent != null) { - model.ContentDto = MapFromPersisted(model); + model.ContentDto = MapFromPersisted(model); } if (model.ContentDto != null) { @@ -186,9 +186,15 @@ namespace Umbraco.Web.WebApi.Binders /// private static void MapPropertyValuesFromSaved(TModelSave saveModel, ContentItemDto dto) { - foreach (var p in saveModel.Properties.Where(p => dto.Properties.Any(x => x.Alias == p.Alias))) + //NOTE: Don't convert this to linq, this is much quicker + foreach (var p in saveModel.Properties) { - dto.Properties.Single(x => x.Alias == p.Alias).Value = p.Value; + foreach (var propertyDto in dto.Properties) + { + if (propertyDto.Alias != p.Alias) continue; + propertyDto.Value = p.Value; + break; + } } } From bab693f2baac2d4898c8fdb1ea555b253d32ba52 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 25 May 2016 10:56:41 +0200 Subject: [PATCH 006/168] fix build --- src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs index 97d81539d2..34cd64c265 100644 --- a/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs +++ b/src/Umbraco.Web/Models/Mapping/ContentModelMapper.cs @@ -179,7 +179,7 @@ namespace Umbraco.Web.Models.Mapping Label = localizedText.Localize("content/releaseDate"), Value = display.ReleaseDate.HasValue ? display.ReleaseDate.Value.ToIsoString() : null, //Not editible for people without publish permission (U4-287) - View = display.AllowedActions.Contains(ActionPublish.Instance.Letter) ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View + View = display.AllowedActions.Contains(ActionPublish.Instance.Letter) ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View, Config = new Dictionary { {"offsetTime", "1"} @@ -192,7 +192,7 @@ namespace Umbraco.Web.Models.Mapping Label = localizedText.Localize("content/unpublishDate"), Value = display.ExpireDate.HasValue ? display.ExpireDate.Value.ToIsoString() : null, //Not editible for people without publish permission (U4-287) - View = display.AllowedActions.Contains(ActionPublish.Instance.Letter) ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View + View = display.AllowedActions.Contains(ActionPublish.Instance.Letter) ? "datepicker" : PropertyEditorResolver.Current.GetByAlias(Constants.PropertyEditors.NoEditAlias).ValueEditor.View, Config = new Dictionary { {"offsetTime", "1"} From 30ac4e94be2acd6f49c2072fd3a69447485ed2eb Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 26 May 2016 13:12:05 +0200 Subject: [PATCH 007/168] hacked new packages tree --- .../Trees/NewPackagesTreeController.cs | 48 +++++++++++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 1 + 2 files changed, 49 insertions(+) create mode 100644 src/Umbraco.Web/Trees/NewPackagesTreeController.cs diff --git a/src/Umbraco.Web/Trees/NewPackagesTreeController.cs b/src/Umbraco.Web/Trees/NewPackagesTreeController.cs new file mode 100644 index 0000000000..c6c4e67841 --- /dev/null +++ b/src/Umbraco.Web/Trees/NewPackagesTreeController.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Net.Http.Formatting; +using System.Web.Http; +using Umbraco.Core; +using Umbraco.Core.Models; +using Umbraco.Web.Models.Trees; +using Umbraco.Web.Mvc; +using Umbraco.Web.WebApi.Filters; +using umbraco; +using umbraco.BusinessLogic.Actions; +using Umbraco.Core.Models.EntityBase; +using Umbraco.Core.Services; +using Constants = Umbraco.Core.Constants; + +namespace Umbraco.Web.Trees +{ + [UmbracoTreeAuthorize(Constants.Trees.DataTypes)] + [Tree(Constants.Applications.Developer, "packagesNew")] + [PluginController("UmbracoTrees")] + [CoreTree] + public class NewPackagesTreeController : TreeController + { + protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) + { + var nodes = new TreeNodeCollection(); + + var node = CreateTreeNode("1", id, queryStrings, "Name", "icon-folder", false, ""); + node.Path = "path"; + //node.NodeType = "container"; + //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. + //node.AdditionalData["jsClickCallback"] = "javascript:void(0);"; + + nodes.Add(node); + + return nodes; + } + + protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings) + { + var menu = new MenuItemCollection(); + return menu; + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index de4b49bc77..5102416548 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -376,6 +376,7 @@ + From 05746c7b7c7e4be08b78365e937d9e6e35868f48 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 26 May 2016 13:12:41 +0200 Subject: [PATCH 008/168] added editor scaffold --- .../src/views/packagesNew/edit.controller.js | 16 +++++++++++ .../src/views/packagesNew/edit.html | 27 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js new file mode 100644 index 0000000000..345846fdb9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js @@ -0,0 +1,16 @@ +(function () { + "use strict"; + + function PackagesEditController($scope) { + + var vm = this; + + vm.page = {}; + vm.page.name = "Packages"; + + + } + + angular.module("umbraco").controller("Umbraco.Editors.Packages.EditController", PackagesEditController); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html new file mode 100644 index 0000000000..9af94dc739 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -0,0 +1,27 @@ +
+ + + +
+ + + + + + + + This is my new package repository + + + + +
+ +
From f876b6b7280cdc41507d54111fac8253264752dd Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Thu, 26 May 2016 13:39:01 +0200 Subject: [PATCH 009/168] added umb-packages.less, added repeater for packages + minimal styling --- src/Umbraco.Web.UI.Client/src/less/belle.less | 1 + .../src/less/components/umb-packages.less | 42 +++++++++++ .../src/views/packagesNew/edit.controller.js | 33 ++++++++- .../src/views/packagesNew/edit.html | 69 ++++++++++++++----- 4 files changed, 127 insertions(+), 18 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less diff --git a/src/Umbraco.Web.UI.Client/src/less/belle.less b/src/Umbraco.Web.UI.Client/src/less/belle.less index 9d01cae4b9..d00bc6021e 100644 --- a/src/Umbraco.Web.UI.Client/src/less/belle.less +++ b/src/Umbraco.Web.UI.Client/src/less/belle.less @@ -108,6 +108,7 @@ @import "components/umb-empty-state.less"; @import "components/umb-property-editor.less"; @import "components/umb-iconpicker.less"; +@import "components/umb-packages.less"; @import "components/buttons/umb-button.less"; @import "components/buttons/umb-button-group.less"; diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less new file mode 100644 index 0000000000..581b6da16d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -0,0 +1,42 @@ +.umb-packages { + display: flex; + flex-wrap: wrap; +} + +.umb-package { + flex: 0 0 25%; + + padding-left: 20px; + padding-right: 20px; + + box-sizing: border-box; +} + +.umb-package-link { + display: flex; + flex-wrap: wrap; + flex-direction: column; + + padding: 20px; + + background: whitesmoke; + border: 2px solid #ececec; + border-radius: 3px; + + text-decoration: none !important; +} + + +.umb-package-icon { + padding: 20px; + text-align: center; +} + +.umb-package-name { + font-weight: bold; +} + +.umb-package-numbers { + display: flex; + flex-wrap: wrap; +} diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js index 345846fdb9..9279d1916e 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js @@ -7,7 +7,38 @@ vm.page = {}; vm.page.name = "Packages"; - + + vm.packages = [ + { + "name": "Test App", + "description": "lorem flaxis slk asjasd ks", + "karma": "1", + "downloads": "2", + "icon": "flax" + }, + { + "name": "Tessti flaxi", + "description": "loremlaksjd lkajs dasjasd ks", + "karma": "10", + "downloads": "22", + "icon": "flaxo" + }, + { + "name": "Walla", + "description": "lorem flaxis slk asjasd ks", + "karma": "1", + "downloads": "2", + "icon": "flax" + }, + { + "name": "Walla", + "description": "lorem flaxis slk asjasd ks", + "karma": "1", + "downloads": "2", + "icon": "flax" + } + ]; + } diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index 9af94dc739..f0c54febaa 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -1,27 +1,62 @@
- + -
+ - + - - + + - - This is my new package repository - + - + + +
+ +
+ + + + + +
+ +
From 259ccd653e6444bad5110b5401b8b4c1f5e149bd Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Thu, 26 May 2016 14:13:55 +0200 Subject: [PATCH 010/168] Added dummy data to packages --- .../src/less/components/umb-packages.less | 121 +++++++++++++++++- .../src/views/packagesNew/edit.controller.js | 28 ++++ .../src/views/packagesNew/edit.html | 20 +-- src/Umbraco.Web.UI/config/trees.config | 1 + 4 files changed, 158 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 581b6da16d..fd9880f016 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -4,12 +4,33 @@ } .umb-package { - flex: 0 0 25%; + flex: 0 0 100%; padding-left: 20px; padding-right: 20px; + padding-bottom: 20px; box-sizing: border-box; + + @media (min-width: 768px) { + flex: 0 0 50%; + } + + @media (min-width: 1024px) { + flex: 0 0 33.33%; + } + + @media (min-width: 1260px) { + flex: 0 0 25%; + } + + @media (min-width: 1600px) { + flex: 0 0 20%; + } + + @media (min-width: 2000px) { + flex: 0 0 16.66%; + } } .umb-package-link { @@ -17,8 +38,6 @@ flex-wrap: wrap; flex-direction: column; - padding: 20px; - background: whitesmoke; border: 2px solid #ececec; border-radius: 3px; @@ -28,15 +47,109 @@ .umb-package-icon { - padding: 20px; + display: flex; + + justify-content: center; + align-items: center; + + padding: 10px; text-align: center; + border-bottom: 2px solid #ececec; + background-color: white; + + min-height: 120px; } +.umb-package-icon img { + opacity: .1; +} + +.umb-package-info { + padding-top: 10px; + padding-right: 20px; + padding-bottom: 20px; + padding-left: 20px; +} + + .umb-package-name { font-weight: bold; + margin-bottom: 10px; } .umb-package-numbers { display: flex; flex-wrap: wrap; + + margin-bottom: 20px; + + opacity: .6; +} + +.umb-package-link:hover .umb-package-numbers { + opacity: 1; +} + +.umb-package-link:hover .umb-era-button { + background: #2e8aea; + color: white; + + &:hover { + background-color: #287dd6; + } +} + +/* umb-buttons-era */ +.umb-era-button { + display: flex; + justify-content: center; + align-items: center; + + font-size: 14px; + font-weight: bold; + text-transform: capitalize; + + height: 38px; + line-height: 38px; + + + max-width: 100%; + padding: 0 18px; + + color: #484848; + background-color: #e0e0e0; + + text-decoration: none !important; + user-select: none; + + white-space: nowrap; + overflow: hidden; + + border-radius: 3px; + border: 0 none; + + transition: background-color 80ms ease, color 80ms ease; +} + + +.umb-era-button:hover, +.umb-era-button:active { + color: #484848; + background-color: #d3d3d3; + outline: none; + text-decoration: none; +} + + +.umb-era-button:focus { + outline: none; +} + +.umb-era-button.-blue { + background: #2e8aea; + color: white; +} + +.umb-era-button.-blue:hover { + background-color: #287dd6; } diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js index 9279d1916e..9c41d98d3a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js @@ -9,6 +9,34 @@ vm.page.name = "Packages"; vm.packages = [ + { + "name": "Test App", + "description": "lorem flaxis slk asjasd ks", + "karma": "1", + "downloads": "2", + "icon": "flax" + }, + { + "name": "Tessti flaxi", + "description": "loremlaksjd lkajs dasjasd ks", + "karma": "10", + "downloads": "22", + "icon": "flaxo" + }, + { + "name": "Walla", + "description": "lorem flaxis slk asjasd ks", + "karma": "1", + "downloads": "2", + "icon": "flax" + }, + { + "name": "Walla", + "description": "lorem flaxis slk asjasd ks", + "karma": "1", + "downloads": "2", + "icon": "flax" + }, { "name": "Test App", "description": "lorem flaxis slk asjasd ks", diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index f0c54febaa..e01fe89161 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -26,30 +26,34 @@ diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config index 91c216c727..6c9fb153b6 100644 --- a/src/Umbraco.Web.UI/config/trees.config +++ b/src/Umbraco.Web.UI/config/trees.config @@ -42,4 +42,5 @@ + \ No newline at end of file From 7bb8430022b0a539d7315f603809acee622ecc82 Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Thu, 26 May 2016 14:50:11 +0200 Subject: [PATCH 011/168] =?UTF-8?q?Packages=20=F0=9F=93=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/less/components/umb-packages.less | 14 ++++++++++---- .../src/views/packagesNew/edit.html | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index fd9880f016..6840376703 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -43,6 +43,12 @@ border-radius: 3px; text-decoration: none !important; + + transition: border-color 100ms ease; + + &:hover { + border-color: @blue; + } } @@ -91,11 +97,11 @@ } .umb-package-link:hover .umb-era-button { - background: #2e8aea; + background: @blue; color: white; &:hover { - background-color: #287dd6; + background-color: @blueDark; } } @@ -146,10 +152,10 @@ } .umb-era-button.-blue { - background: #2e8aea; + background: @blue; color: white; } .umb-era-button.-blue:hover { - background-color: #287dd6; + background-color: @blueDark; } diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index e01fe89161..e7e46528a8 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -31,7 +31,7 @@
- +
From 098eb32ef61fbe3ec6994e5dd1243541c6bd38ed Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 26 May 2016 14:57:38 +0200 Subject: [PATCH 012/168] added categories --- .../src/less/components/umb-packages.less | 39 +++++++++++++++++++ .../src/views/packagesNew/edit.controller.js | 27 +++++++++++++ .../src/views/packagesNew/edit.html | 5 ++- 3 files changed, 70 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 6840376703..4d4d443b09 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -159,3 +159,42 @@ .umb-era-button.-blue:hover { background-color: @blueDark; } + + + +/* CATEGORIES */ + +.umb-packages-categories { + display: flex; + user-select: center; + flex-wrap: wrap; + margin-bottom: 30px; +} + +.umb-packages-category { + display: flex; + align-items: center; + flex: 1 0 auto; + max-width: 25%; + background-color: @blue; + padding: 10px; + font-size: 12px; + border-radius: 3px; + color: @white; + font-weight: bold; + box-sizing: border-box; + flex: 1 0 auto; + margin: 5px; + justify-content: center; +} + +.umb-packages-category:hover, +.umb-packages-category:focus { + text-decoration: none; + color: @white; +} + +.umb-packages-category-icon { + font-size: 20px; + margin-right: 5px; +} diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js index 9c41d98d3a..4ce5597429 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js @@ -8,6 +8,33 @@ vm.page = {}; vm.page.name = "Packages"; + vm.categories = [ + { + "icon": "icon-male-and-female", + "name": "Collaboration" + }, + { + "icon": "icon-molecular-network", + "name": "Backoffice extensions" + }, + { + "icon": "icon-brackets", + "name": "Developer tools" + }, + { + "icon": "icon-wand", + "name": "Starter kits" + }, + { + "icon": "icon-medal", + "name": "Umbraco Pro" + }, + { + "icon": "icon-wrench", + "name": "Website utilities" + } + ]; + vm.packages = [ { "name": "Test App", diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index e7e46528a8..8f98ba8712 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -21,7 +21,10 @@
From 8a744b52fe42097d2031cd8dd18f76af0f7f7121 Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Thu, 26 May 2016 15:21:12 +0200 Subject: [PATCH 013/168] Removed install button, better spacing --- .../src/less/components/umb-packages.less | 25 +++++++++++-------- .../src/views/packagesNew/edit.html | 12 +++------ 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 4d4d443b09..bca3d7cbd7 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -1,13 +1,17 @@ .umb-packages { display: flex; flex-wrap: wrap; + + margin: 0 -5px; } + +// List .umb-package { flex: 0 0 100%; - padding-left: 20px; - padding-right: 20px; + padding-left: 10px; + padding-right: 10px; padding-bottom: 20px; box-sizing: border-box; @@ -33,6 +37,8 @@ } } + +// Link (Wrapper) .umb-package-link { display: flex; flex-wrap: wrap; @@ -52,6 +58,8 @@ } + +// Icon .umb-package-icon { display: flex; @@ -70,6 +78,8 @@ opacity: .1; } + +// Info .umb-package-info { padding-top: 10px; padding-right: 20px; @@ -78,17 +88,17 @@ } +// Name .umb-package-name { font-weight: bold; margin-bottom: 10px; } +// Numbers .umb-package-numbers { display: flex; flex-wrap: wrap; - margin-bottom: 20px; - opacity: .6; } @@ -96,14 +106,7 @@ opacity: 1; } -.umb-package-link:hover .umb-era-button { - background: @blue; - color: white; - &:hover { - background-color: @blueDark; - } -} /* umb-buttons-era */ .umb-era-button { diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index 8f98ba8712..c34c9487f2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -43,16 +43,12 @@
-
+ Downloads {{ package.downloads }} -
-
+ + Karma {{ package.karma }} -
-
- -
- Install +
From 628ce5ea1fb9e7405a90ea593983a68951397c3f Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 26 May 2016 15:30:40 +0200 Subject: [PATCH 014/168] Backports some changes from v8 so that we can perform a nice strongly typed query with paging - this is then used for the content indexer to index content via the db for published content instead of the xml cache system. This was already done in v8 but have no backported the logic and fixed up the unit tests. When merging with v8 we will most likely just keep all v8 stuff and discard these changes, but we'll need to compare just in case. All tests pass and re-indexing is working as expected. Also updated the paging count from 1000 to 5000 for reindexing. --- .../Repositories/ContentRepository.cs | 20 +++--- .../Interfaces/IContentRepository.cs | 4 +- .../Repositories/VersionableRepositoryBase.cs | 22 ++++++- src/Umbraco.Core/Services/ContentService.cs | 46 +++++++++++++- src/Umbraco.Core/Services/IContentService.cs | 16 +++++ .../Repositories/ContentRepositoryTest.cs | 8 ++- .../LegacyExamineBackedMediaTests.cs | 20 +++--- .../UmbracoExamine/EventsTest.cs | 28 +++++---- .../UmbracoExamine/ExamineBaseTest.cs | 28 +++++---- .../UmbracoExamine/IndexInitializer.cs | 45 +++++++++++++- src/Umbraco.Tests/UmbracoExamine/IndexTest.cs | 31 +++++----- src/UmbracoExamine/BaseUmbracoIndexer.cs | 30 +++------ src/UmbracoExamine/UmbracoContentIndexer.cs | 62 ++++++++++--------- 13 files changed, 239 insertions(+), 121 deletions(-) diff --git a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs index 5f96cad114..1a1a7b00bf 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ContentRepository.cs @@ -771,22 +771,22 @@ namespace Umbraco.Core.Persistence.Repositories /// Search text filter /// An Enumerable list of objects public IEnumerable GetPagedResultsByQuery(IQuery query, long pageIndex, int pageSize, out long totalRecords, - string orderBy, Direction orderDirection, bool orderBySystemField, string filter = "") + string orderBy, Direction orderDirection, bool orderBySystemField, IQuery filter = null) { //NOTE: This uses the GetBaseQuery method but that does not take into account the required 'newest' field which is // what we always require for a paged result, so we'll ensure it's included in the filter - - var args = new List(); - var sbWhere = new StringBuilder("AND (cmsDocument.newest = 1)"); - - if (filter.IsNullOrWhiteSpace() == false) + + var filterSql = new Sql().Append("AND (cmsDocument.newest = 1)"); + if (filter != null) { - sbWhere.Append(" AND (cmsDocument." + SqlSyntax.GetQuotedColumnName("text") + " LIKE @" + args.Count + ")"); - args.Add("%" + filter + "%"); + foreach (var filterClaus in filter.GetWhereClauses()) + { + filterSql.Append(string.Format("AND ({0})", filterClaus.Item1), filterClaus.Item2); + } } - - Func> filterCallback = () => new Tuple(sbWhere.ToString(), args.ToArray()); + + Func> filterCallback = () => new Tuple(filterSql.SQL, filterSql.Arguments); return GetPagedResultsByQuery(query, pageIndex, pageSize, out totalRecords, new Tuple("cmsDocument", "nodeId"), diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs index ab176df6d0..c18765239b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IContentRepository.cs @@ -85,9 +85,9 @@ namespace Umbraco.Core.Persistence.Repositories /// Field to order by /// Direction to order by /// Flag to indicate when ordering by system field - /// Search text filter + /// /// An Enumerable list of objects IEnumerable GetPagedResultsByQuery(IQuery query, long pageIndex, int pageSize, out long totalRecords, - string orderBy, Direction orderDirection, bool orderBySystemField, string filter = ""); + string orderBy, Direction orderDirection, bool orderBySystemField, IQuery filter = null); } } \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs b/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs index 4b2befb3e3..e062f49235 100644 --- a/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs +++ b/src/Umbraco.Core/Persistence/Repositories/VersionableRepositoryBase.cs @@ -235,13 +235,29 @@ namespace Umbraco.Core.Persistence.Repositories private Sql GetFilteredSqlForPagedResults(Sql sql, Func> defaultFilter = null) { - //copy to var so that the original isn't changed - var filteredSql = new Sql(sql.SQL, sql.Arguments); + Sql filteredSql; + // Apply filter if (defaultFilter != null) { var filterResult = defaultFilter(); - filteredSql.Append(filterResult.Item1, filterResult.Item2); + + //NOTE: this is certainly strange - NPoco handles this much better but we need to re-create the sql + // instance a couple of times to get the parameter order correct, for some reason the first + // time the arguments don't show up correctly but the SQL argument parameter names are actually updated + // accordingly - so we re-create it again. In v8 we don't need to do this and it's already taken care of. + + filteredSql = new Sql(sql.SQL, sql.Arguments); + var args = filteredSql.Arguments.Concat(filterResult.Item2).ToArray(); + filteredSql = new Sql( + string.Format("{0} {1}", filteredSql.SQL, filterResult.Item1), + args); + filteredSql = new Sql(filteredSql.SQL, args); + } + else + { + //copy to var so that the original isn't changed + filteredSql = new Sql(sql.SQL, sql.Arguments); } return filteredSql; } diff --git a/src/Umbraco.Core/Services/ContentService.cs b/src/Umbraco.Core/Services/ContentService.cs index bbae07eb6a..7fcb915b30 100644 --- a/src/Umbraco.Core/Services/ContentService.cs +++ b/src/Umbraco.Core/Services/ContentService.cs @@ -536,7 +536,12 @@ namespace Umbraco.Core.Services { query.Where(x => x.ParentId == id); } - var contents = repository.GetPagedResultsByQuery(query, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, orderBySystemField, filter); + IQuery filterQuery = null; + if (filter.IsNullOrWhiteSpace() == false) + { + filterQuery = Query.Builder.Where(x => x.Name.Contains(filter)); + } + var contents = repository.GetPagedResultsByQuery(query, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, orderBySystemField, filterQuery); return contents; } @@ -593,12 +598,49 @@ namespace Umbraco.Core.Services { query.Where(x => x.Path.SqlContains(string.Format(",{0},", id), TextColumnType.NVarchar)); } - var contents = repository.GetPagedResultsByQuery(query, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, orderBySystemField, filter); + IQuery filterQuery = null; + if (filter.IsNullOrWhiteSpace() == false) + { + filterQuery = Query.Builder.Where(x => x.Name.Contains(filter)); + } + var contents = repository.GetPagedResultsByQuery(query, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, orderBySystemField, filterQuery); return contents; } } + /// + /// Gets a collection of objects by Parent Id + /// + /// Id of the Parent to retrieve Descendants from + /// Page number + /// Page size + /// Total records query would return without paging + /// Field to order by + /// Direction to order by + /// Flag to indicate when ordering by system field + /// Search filter + /// An Enumerable list of objects + public IEnumerable GetPagedDescendants(int id, long pageIndex, int pageSize, out long totalChildren, string orderBy, Direction orderDirection, bool orderBySystemField, IQuery filter) + { + Mandate.ParameterCondition(pageIndex >= 0, "pageIndex"); + Mandate.ParameterCondition(pageSize > 0, "pageSize"); + + using (var repository = RepositoryFactory.CreateContentRepository(UowProvider.GetUnitOfWork())) + { + var query = Query.Builder; + + //if the id is System Root, then just get all + if (id != Constants.System.Root) + { + query.Where(x => x.Path.SqlContains(string.Format(",{0},", id), TextColumnType.NVarchar)); + } + var contents = repository.GetPagedResultsByQuery(query, pageIndex, pageSize, out totalChildren, orderBy, orderDirection, orderBySystemField, filter); + + return contents; + } + } + /// /// Gets a collection of objects by its name or partial name /// diff --git a/src/Umbraco.Core/Services/IContentService.cs b/src/Umbraco.Core/Services/IContentService.cs index df70fa8094..5e90559233 100644 --- a/src/Umbraco.Core/Services/IContentService.cs +++ b/src/Umbraco.Core/Services/IContentService.cs @@ -4,6 +4,7 @@ using System.ComponentModel; using Umbraco.Core.Models; using Umbraco.Core.Models.Membership; using Umbraco.Core.Persistence.DatabaseModelDefinitions; +using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Publishing; namespace Umbraco.Core.Services @@ -268,6 +269,21 @@ namespace Umbraco.Core.Services IEnumerable GetPagedDescendants(int id, long pageIndex, int pageSize, out long totalRecords, string orderBy, Direction orderDirection, bool orderBySystemField, string filter); + /// + /// Gets a collection of objects by Parent Id + /// + /// Id of the Parent to retrieve Descendants from + /// Page number + /// Page size + /// Total records query would return without paging + /// Field to order by + /// Direction to order by + /// Flag to indicate when ordering by system field + /// + /// An Enumerable list of objects + IEnumerable GetPagedDescendants(int id, long pageIndex, int pageSize, out long totalRecords, + string orderBy, Direction orderDirection, bool orderBySystemField, IQuery filter); + /// /// Gets a collection of an objects versions by its Id /// diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs index d29b073df7..2d036bb620 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs @@ -685,8 +685,10 @@ namespace Umbraco.Tests.Persistence.Repositories { // Act var query = Query.Builder.Where(x => x.Level == 2); + var filterQuery = Query.Builder.Where(x => x.Name.Contains("Page 2")); + long totalRecords; - var result = repository.GetPagedResultsByQuery(query, 0, 1, out totalRecords, "Name", Direction.Ascending, true, "Page 2"); + var result = repository.GetPagedResultsByQuery(query, 0, 1, out totalRecords, "Name", Direction.Ascending, true, filterQuery); // Assert Assert.That(totalRecords, Is.EqualTo(1)); @@ -706,8 +708,10 @@ namespace Umbraco.Tests.Persistence.Repositories { // Act var query = Query.Builder.Where(x => x.Level == 2); + var filterQuery = Query.Builder.Where(x => x.Name.Contains("Page")); + long totalRecords; - var result = repository.GetPagedResultsByQuery(query, 0, 1, out totalRecords, "Name", Direction.Ascending, true, "Page"); + var result = repository.GetPagedResultsByQuery(query, 0, 1, out totalRecords, "Name", Direction.Ascending, true, filterQuery); // Assert Assert.That(totalRecords, Is.EqualTo(2)); diff --git a/src/Umbraco.Tests/PublishedContent/LegacyExamineBackedMediaTests.cs b/src/Umbraco.Tests/PublishedContent/LegacyExamineBackedMediaTests.cs index 7b0ffb41d7..8a83bea75a 100644 --- a/src/Umbraco.Tests/PublishedContent/LegacyExamineBackedMediaTests.cs +++ b/src/Umbraco.Tests/PublishedContent/LegacyExamineBackedMediaTests.cs @@ -7,14 +7,17 @@ using NUnit.Framework; using Umbraco.Tests.TestHelpers; using Umbraco.Tests.UmbracoExamine; using umbraco.MacroEngines; +using Umbraco.Core; +using Umbraco.Core.Logging; +using Umbraco.Core.Persistence.Mappers; namespace Umbraco.Tests.PublishedContent { public class LegacyExamineBackedMediaTests : ExamineBaseTest { - public override void TestSetup() + public override void Initialize() { - base.TestSetup(); + base.Initialize(); var settings = SettingsForTests.GenerateMockSettings(); var contentMock = Mock.Get(settings.Content); @@ -22,13 +25,8 @@ namespace Umbraco.Tests.PublishedContent contentMock.Setup(x => x.UmbracoLibraryCacheDuration).Returns(1800); SettingsForTests.ConfigureSettings(settings); } - - public override void TestTearDown() - { - SettingsForTests.Reset(); - base.TestTearDown(); - } - + + [Test] public void Ensure_Children_Are_Sorted() { @@ -47,7 +45,9 @@ namespace Umbraco.Tests.PublishedContent var children = backedMedia.ChildrenAsList.Value; var currSort = 0; - for (var i = 0; i < children.Count(); i++) + Assert.Greater(children.Count, 0); + + for (var i = 0; i < children.Count; i++) { Assert.GreaterOrEqual(children[i].SortOrder, currSort); currSort = children[i].SortOrder; diff --git a/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs b/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs index d01b298bb4..6bd01c7f1c 100644 --- a/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/EventsTest.cs @@ -45,19 +45,21 @@ namespace Umbraco.Tests.UmbracoExamine private static UmbracoContentIndexer _indexer; private Lucene.Net.Store.Directory _luceneDir; - public override void TestSetup() - { - base.TestSetup(); - _luceneDir = new RAMDirectory(); - _indexer = IndexInitializer.GetUmbracoIndexer(_luceneDir); - _indexer.RebuildIndex(); - _searcher = IndexInitializer.GetUmbracoSearcher(_luceneDir); - } + public override void Initialize() + { + base.Initialize(); - public override void TestTearDown() - { - base.TestTearDown(); - _luceneDir.Dispose(); - } + _luceneDir = new RAMDirectory(); + _indexer = IndexInitializer.GetUmbracoIndexer(_luceneDir); + _indexer.RebuildIndex(); + _searcher = IndexInitializer.GetUmbracoSearcher(_luceneDir); + } + + public override void TearDown() + { + base.TearDown(); + _luceneDir.Dispose(); + } + } } \ No newline at end of file diff --git a/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs b/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs index 5fed998194..ec3babc7ab 100644 --- a/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/ExamineBaseTest.cs @@ -1,5 +1,9 @@ -using NUnit.Framework; +using Moq; +using NUnit.Framework; +using Umbraco.Core; +using Umbraco.Core.Logging; using Umbraco.Core.ObjectResolution; +using Umbraco.Core.Persistence.Mappers; using Umbraco.Core.Strings; using Umbraco.Tests.TestHelpers; using UmbracoExamine; @@ -7,29 +11,27 @@ using UmbracoExamine; namespace Umbraco.Tests.UmbracoExamine { [TestFixture] - public abstract class ExamineBaseTest : BaseUmbracoConfigurationTest + public abstract class ExamineBaseTest : BaseDatabaseFactoryTest { - - [SetUp] - public virtual void TestSetup() + /// + /// sets up resolvers before resolution is frozen + /// + protected override void FreezeResolution() { UmbracoExamineSearcher.DisableInitializationCheck = true; BaseUmbracoIndexer.DisableInitializationCheck = true; ShortStringHelperResolver.Current = new ShortStringHelperResolver(new DefaultShortStringHelper(SettingsForTests.GetDefault())); - Resolution.Freeze(); + base.FreezeResolution(); } - [TearDown] - public virtual void TestTearDown() + public override void TearDown() { + base.TearDown(); + UmbracoExamineSearcher.DisableInitializationCheck = null; BaseUmbracoIndexer.DisableInitializationCheck = null; - - //reset all resolvers - ResolverCollection.ResetAll(); - //reset resolution itself (though this should be taken care of by resetting any of the resolvers above) - Resolution.Reset(); } + } } \ No newline at end of file diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs index 9990c58a43..b303eed997 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexInitializer.cs @@ -10,6 +10,7 @@ using Moq; using Umbraco.Core.Models; using Umbraco.Core.Models.Membership; using Umbraco.Core.Persistence.DatabaseModelDefinitions; +using Umbraco.Core.Persistence.Querying; using Umbraco.Core.Services; using UmbracoExamine; using UmbracoExamine.Config; @@ -41,7 +42,48 @@ namespace Umbraco.Tests.UmbracoExamine } if (contentService == null) { - contentService = Mock.Of(); + long longTotalRecs; + int intTotalRecs; + + var allRecs = dataService.ContentService.GetLatestContentByXPath("//*[@isDoc]") + .Root + .Elements() + .Select(x => Mock.Of( + m => + m.Id == (int)x.Attribute("id") && + m.ParentId == (int)x.Attribute("parentID") && + m.Level == (int)x.Attribute("level") && + m.CreatorId == 0 && + m.SortOrder == (int)x.Attribute("sortOrder") && + m.CreateDate == (DateTime)x.Attribute("createDate") && + m.UpdateDate == (DateTime)x.Attribute("updateDate") && + m.Name == (string)x.Attribute("nodeName") && + m.Path == (string)x.Attribute("path") && + m.Properties == new PropertyCollection() && + m.ContentType == Mock.Of(mt => + mt.Alias == x.Name.LocalName && + mt.Id == (int)x.Attribute("nodeType") && + mt.Icon == "test"))) + .ToArray(); + + + contentService = Mock.Of( + x => x.GetPagedDescendants( + It.IsAny(), It.IsAny(), It.IsAny(), out longTotalRecs, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny()) + == + allRecs + && x.GetPagedDescendants( + It.IsAny(), It.IsAny(), It.IsAny(), out longTotalRecs, It.IsAny(), It.IsAny(), It.IsAny()) + == + allRecs + && x.GetPagedDescendants( + It.IsAny(), It.IsAny(), It.IsAny(), out intTotalRecs, It.IsAny(), It.IsAny(), It.IsAny()) + == + allRecs + && x.GetPagedDescendants( + It.IsAny(), It.IsAny(), It.IsAny(), out longTotalRecs, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny>()) + == + allRecs); } if (userService == null) { @@ -86,7 +128,6 @@ namespace Umbraco.Tests.UmbracoExamine It.IsAny(), It.IsAny(), It.IsAny(), out intTotalRecs, It.IsAny(), It.IsAny(), It.IsAny()) == allRecs); - } if (dataTypeService == null) { diff --git a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs index a5418649fe..6cef19af9e 100644 --- a/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs +++ b/src/Umbraco.Tests/UmbracoExamine/IndexTest.cs @@ -142,8 +142,6 @@ namespace Umbraco.Tests.UmbracoExamine { var s = (IndexSearcher)_searcher.GetSearcher(); - - //first delete all 'Content' (not media). This is done by directly manipulating the index with the Lucene API, not examine! var contentTerm = new Term(LuceneIndexer.IndexTypeFieldName, IndexTypes.Content); @@ -207,23 +205,24 @@ namespace Umbraco.Tests.UmbracoExamine private Lucene.Net.Store.Directory _luceneDir; - public override void TestTearDown() - { - base.TestTearDown(); - _luceneDir.Dispose(); + public override void TearDown() + { + base.TearDown(); + _luceneDir.Dispose(); UmbracoExamineSearcher.DisableInitializationCheck = null; BaseUmbracoIndexer.DisableInitializationCheck = null; - } - - public override void TestSetup() - { - base.TestSetup(); - _luceneDir = new RAMDirectory(); - _indexer = IndexInitializer.GetUmbracoIndexer(_luceneDir); - _indexer.RebuildIndex(); - _searcher = IndexInitializer.GetUmbracoSearcher(_luceneDir); - } + } + + public override void Initialize() + { + base.Initialize(); + _luceneDir = new RAMDirectory(); + _indexer = IndexInitializer.GetUmbracoIndexer(_luceneDir); + _indexer.RebuildIndex(); + _searcher = IndexInitializer.GetUmbracoSearcher(_luceneDir); + } + #endregion } diff --git a/src/UmbracoExamine/BaseUmbracoIndexer.cs b/src/UmbracoExamine/BaseUmbracoIndexer.cs index ee77f5d05c..26763bd7cd 100644 --- a/src/UmbracoExamine/BaseUmbracoIndexer.cs +++ b/src/UmbracoExamine/BaseUmbracoIndexer.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using System.Net; using System.Security; @@ -361,10 +362,11 @@ namespace UmbracoExamine /// protected override void PerformIndexAll(string type) { - //NOTE: the logic below is ONLY used for published content, for media and members and non-published content, this method is overridden + //NOTE: the logic below is NOT used, this method is overridden // and we query directly against the umbraco service layer. + // This is here for backwards compat only. - if (!SupportedTypes.Contains(type)) + if (SupportedTypes.Contains(type) == false) return; var xPath = "//*[(number(@id) > 0 and (@isDoc or @nodeTypeAlias)){0}]"; //we'll add more filters to this below if needed @@ -417,16 +419,11 @@ namespace UmbracoExamine AddNodesToIndex(xPath, type); } - /// - /// Returns an XDocument for the entire tree stored for the IndexType specified. - /// - /// The xpath to the node. - /// The type of data to request from the data service. - /// Either the Content or Media xml. If the type is not of those specified null is returned + [Obsolete("This method is not be used, it will be removed in future versions")] + [EditorBrowsable(EditorBrowsableState.Never)] protected virtual XDocument GetXDocument(string xPath, string type) { - //TODO: We need to get rid of this! it will now only ever be called for published content - but we're keeping the other - // logic here for backwards compatibility in case inheritors are calling this for some reason. + //TODO: We need to get rid of this! This does not get called by our code if (type == IndexTypes.Content) { @@ -447,12 +444,9 @@ namespace UmbracoExamine } #endregion - #region Private - /// - /// Adds all nodes with the given xPath root. - /// - /// The x path. - /// The type. + + [Obsolete("This method is not be used, it will be removed in future versions")] + [EditorBrowsable(EditorBrowsableState.Never)] private void AddNodesToIndex(string xPath, string type) { // Get all the nodes of nodeTypeAlias == nodeTypeAlias @@ -476,9 +470,5 @@ namespace UmbracoExamine } } - - - - #endregion } } diff --git a/src/UmbracoExamine/UmbracoContentIndexer.cs b/src/UmbracoExamine/UmbracoContentIndexer.cs index 613304c4ff..92a1fb776e 100644 --- a/src/UmbracoExamine/UmbracoContentIndexer.cs +++ b/src/UmbracoExamine/UmbracoContentIndexer.cs @@ -25,6 +25,7 @@ using UmbracoExamine.Config; using Examine.LuceneEngine.Providers; using Lucene.Net.Analysis; using umbraco.BasePages; +using Umbraco.Core.Persistence.Querying; using IContentService = Umbraco.Core.Services.IContentService; using UmbracoExamine.LocalStorage; using IMediaService = Umbraco.Core.Services.IMediaService; @@ -348,50 +349,55 @@ namespace UmbracoExamine protected override void PerformIndexAll(string type) { - - const int pageSize = 1000; + const int pageSize = 5000; var pageIndex = 0; switch (type) { case IndexTypes.Content: - if (this.SupportUnpublishedContent == false) + + + var contentParentId = -1; + if (IndexerData.ParentNodeId.HasValue && IndexerData.ParentNodeId.Value > 0) { - //use the base implementation which will use the published XML cache to perform the lookups - base.PerformIndexAll(type); + contentParentId = IndexerData.ParentNodeId.Value; } - else + IContent[] content; + + do { - var contentParentId = -1; - if (IndexerData.ParentNodeId.HasValue && IndexerData.ParentNodeId.Value > 0) + long total; + + IEnumerable descendants; + if (SupportUnpublishedContent) { - contentParentId = IndexerData.ParentNodeId.Value; + descendants = _contentService.GetPagedDescendants(contentParentId, pageIndex, pageSize, out total); } - IContent[] content; - - do + else { - long total; - var descendants = _contentService.GetPagedDescendants(contentParentId, pageIndex, pageSize, out total); + //add the published filter + var qry = Query.Builder.Where(x => x.Published == true); - //if specific types are declared we need to post filter them - //TODO: Update the service layer to join the cmsContentType table so we can query by content type too - if (IndexerData.IncludeNodeTypes.Any()) - { - content = descendants.Where(x => IndexerData.IncludeNodeTypes.Contains(x.ContentType.Alias)).ToArray(); - } - else - { - content = descendants.ToArray(); - } + descendants = _contentService.GetPagedDescendants(contentParentId, pageIndex, pageSize, out total, "Path", Direction.Ascending, true, qry); + } - AddNodesToIndex(GetSerializedContent(content), type); - pageIndex++; + //if specific types are declared we need to post filter them + //TODO: Update the service layer to join the cmsContentType table so we can query by content type too + if (IndexerData.IncludeNodeTypes.Any()) + { + content = descendants.Where(x => IndexerData.IncludeNodeTypes.Contains(x.ContentType.Alias)).ToArray(); + } + else + { + content = descendants.ToArray(); + } + + AddNodesToIndex(GetSerializedContent(content), type); + pageIndex++; - } while (content.Length == pageSize); + } while (content.Length == pageSize); - } break; case IndexTypes.Media: From 3cc8a71a60fa12158ffb28c70e7ea0ed5fdac306 Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Thu, 26 May 2016 16:31:56 +0200 Subject: [PATCH 015/168] added button back --- .../src/less/components/umb-packages.less | 103 ++++++++++++------ .../src/views/packagesNew/edit.controller.js | 82 ++++++-------- .../src/views/packagesNew/edit.html | 45 +++++++- 3 files changed, 143 insertions(+), 87 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index bca3d7cbd7..b226517bbf 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -1,3 +1,25 @@ +.umb-packages-search { + width: 100%; + + margin-top: 40px; + margin-bottom: 30px; +} + +.umb-packages-search input { + border-width: 2px; + border-radius: 3px; + min-height: 44px; + + padding: 4px 10px; + font-size: 16px; + border-color: #ececec; + + &:hover, &:focus { + border-color: @grayLight; + } +} + + .umb-packages { display: flex; flex-wrap: wrap; @@ -8,33 +30,10 @@ // List .umb-package { - flex: 0 0 100%; + height: 260px; + width: 200px; - padding-left: 10px; - padding-right: 10px; - padding-bottom: 20px; - - box-sizing: border-box; - - @media (min-width: 768px) { - flex: 0 0 50%; - } - - @media (min-width: 1024px) { - flex: 0 0 33.33%; - } - - @media (min-width: 1260px) { - flex: 0 0 25%; - } - - @media (min-width: 1600px) { - flex: 0 0 20%; - } - - @media (min-width: 2000px) { - flex: 0 0 16.66%; - } + padding: 20px; } @@ -43,8 +42,11 @@ display: flex; flex-wrap: wrap; flex-direction: column; + justify-content: center; + + height: 100%; + width: 100%; - background: whitesmoke; border: 2px solid #ececec; border-radius: 3px; @@ -66,40 +68,62 @@ justify-content: center; align-items: center; - padding: 10px; + padding-top: 10px; + padding-right: 10px; + padding-left: 10px; + text-align: center; - border-bottom: 2px solid #ececec; background-color: white; - min-height: 120px; + min-height: 80px; } .umb-package-icon img { - opacity: .1; + max-width: 70px; + height: auto; } // Info .umb-package-info { - padding-top: 10px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; + + text-align: center; } // Name .umb-package-name { + max-width: 250px; + font-weight: bold; + margin-bottom: 10px; + + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + + line-height: normal; } // Numbers .umb-package-numbers { display: flex; flex-wrap: wrap; + flex-direction: column; + justify-content: center; opacity: .6; + + margin-bottom: 20px; +} + +.umb-package-numbers small { + padding: 0 5px; + display: block; } .umb-package-link:hover .umb-package-numbers { @@ -180,15 +204,22 @@ flex: 1 0 auto; max-width: 25%; background-color: @blue; - padding: 10px; - font-size: 12px; + padding: 40px 10px; + font-size: 13px; border-radius: 3px; color: @white; - font-weight: bold; box-sizing: border-box; flex: 1 0 auto; margin: 5px; justify-content: center; + + text-transform: uppercase; + letter-spacing: 1.3px; + + &:hover { + background-color: @blueDark; + box-shadow: 0 3px 8px rgba(0,0,0,0.2); + } } .umb-packages-category:hover, @@ -200,4 +231,6 @@ .umb-packages-category-icon { font-size: 20px; margin-right: 5px; + + display: none; } diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js index 4ce5597429..e082448933 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js @@ -37,60 +37,46 @@ vm.packages = [ { - "name": "Test App", - "description": "lorem flaxis slk asjasd ks", + "name": "uSightly", + "description": "An HTML5 audio player based on jPlayer", "karma": "1", - "downloads": "2", - "icon": "flax" + "downloads": "1672", + "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" }, { - "name": "Tessti flaxi", - "description": "loremlaksjd lkajs dasjasd ks", - "karma": "10", - "downloads": "22", - "icon": "flaxo" + "name": "Kill IE6", + "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + "karma": "11", + "downloads": "688", + "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" }, { - "name": "Walla", - "description": "lorem flaxis slk asjasd ks", + "name": "Examine Media Indexer", + "description": "CogUmbracoExamineMediaIndexer", + "karma": "3", + "downloads": "1329", + "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "SVG Icon Picker", + "description": "A picker, for picking icons from an SVG spritesheet.", + "karma": "5", + "downloads": "8", + "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "Pipeline CRM", + "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + "karma": "3", + "downloads": "105", + "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "CodeMirror", + "description": "CodeMirror Editor for Umbraco", "karma": "1", - "downloads": "2", - "icon": "flax" - }, - { - "name": "Walla", - "description": "lorem flaxis slk asjasd ks", - "karma": "1", - "downloads": "2", - "icon": "flax" - }, - { - "name": "Test App", - "description": "lorem flaxis slk asjasd ks", - "karma": "1", - "downloads": "2", - "icon": "flax" - }, - { - "name": "Tessti flaxi", - "description": "loremlaksjd lkajs dasjasd ks", - "karma": "10", - "downloads": "22", - "icon": "flaxo" - }, - { - "name": "Walla", - "description": "lorem flaxis slk asjasd ks", - "karma": "1", - "downloads": "2", - "icon": "flax" - }, - { - "name": "Walla", - "description": "lorem flaxis slk asjasd ks", - "karma": "1", - "downloads": "2", - "icon": "flax" + "downloads": "70", + "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png" } ]; diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index c34c9487f2..cf9c68e7d9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -17,7 +17,7 @@
@@ -27,14 +27,15 @@
+ +
Popular
- + + + +
Latest
+
From 41b68333d27157b996c5f48687ccd7ab6474208f Mon Sep 17 00:00:00 2001 From: Shannon Date: Thu, 26 May 2016 16:36:53 +0200 Subject: [PATCH 016/168] publicizes EnableChangeTracking and DisableChangeTracking methods for entities, ensures that change tracking is disabled whenever building an entity for a repository as this is totally unnecessary and probably large memory overhead. Updates examine content indexer to page by 10000 rows --- .../EntityBase/TracksChangesEntityBase.cs | 6 +- .../Persistence/Factories/ContentFactory.cs | 51 ++++++----- .../Factories/ContentTypeFactory.cs | 36 ++++++-- .../Factories/DataTypeDefinitionFactory.cs | 48 ++++++---- .../Factories/DictionaryItemFactory.cs | 26 ++++-- .../Factories/DictionaryTranslationFactory.cs | 22 +++-- .../Persistence/Factories/MacroFactory.cs | 25 ++++-- .../Persistence/Factories/MediaFactory.cs | 44 ++++++---- .../Persistence/Factories/MemberFactory.cs | 47 ++++++---- .../Factories/MemberGroupFactory.cs | 28 +++--- .../Factories/MemberTypeReadOnlyFactory.cs | 82 +++++++++-------- .../Persistence/Factories/PropertyFactory.cs | 22 +++-- .../Factories/PropertyGroupFactory.cs | 88 +++++++++++-------- .../Persistence/Factories/RelationFactory.cs | 29 +++--- .../Factories/RelationTypeFactory.cs | 27 ++++-- .../Persistence/Factories/TaskFactory.cs | 34 ++++--- .../Persistence/Factories/TemplateFactory.cs | 36 +++++--- .../Factories/UmbracoEntityFactory.cs | 78 ++++++++-------- .../Persistence/Factories/UserFactory.cs | 62 +++++++------ .../Persistence/Factories/UserTypeFactory.cs | 34 ++++--- src/UmbracoExamine/UmbracoContentIndexer.cs | 2 +- 21 files changed, 506 insertions(+), 321 deletions(-) diff --git a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs index 0d5378d253..8e4fbc13f5 100644 --- a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs +++ b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs @@ -138,18 +138,18 @@ namespace Umbraco.Core.Models.EntityBase _propertyChangedInfo = new Dictionary(); } - protected void ResetChangeTrackingCollections() + public void ResetChangeTrackingCollections() { _propertyChangedInfo = new Dictionary(); _lastPropertyChangedInfo = new Dictionary(); } - protected void DisableChangeTracking() + public void DisableChangeTracking() { _changeTrackingEnabled = false; } - protected void EnableChangeTracking() + public void EnableChangeTracking() { _changeTrackingEnabled = true; } diff --git a/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs b/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs index d21aea33e6..3cc5608620 100644 --- a/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/ContentFactory.cs @@ -29,28 +29,37 @@ namespace Umbraco.Core.Persistence.Factories public IContent BuildEntity(DocumentDto dto) { - var content = new Content(dto.Text, dto.ContentVersionDto.ContentDto.NodeDto.ParentId, _contentType) + var content = new Content(dto.Text, dto.ContentVersionDto.ContentDto.NodeDto.ParentId, _contentType); + + try { - Id = _id, - Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId, - Name = dto.Text, - NodeName = dto.ContentVersionDto.ContentDto.NodeDto.Text, - Path = dto.ContentVersionDto.ContentDto.NodeDto.Path, - CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value, - WriterId = dto.WriterUserId, - Level = dto.ContentVersionDto.ContentDto.NodeDto.Level, - ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId, - SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder, - Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed, - Published = dto.Published, - CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate, - UpdateDate = dto.ContentVersionDto.VersionDate, - ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?)null, - ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?)null, - Version = dto.ContentVersionDto.VersionId, - PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished, - PublishedVersionGuid = dto.DocumentPublishedReadOnlyDto == null ? default(Guid) : dto.DocumentPublishedReadOnlyDto.VersionId - }; + content.DisableChangeTracking(); + + content.Id = _id; + content.Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId; + content.Name = dto.Text; + content.NodeName = dto.ContentVersionDto.ContentDto.NodeDto.Text; + content.Path = dto.ContentVersionDto.ContentDto.NodeDto.Path; + content.CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value; + content.WriterId = dto.WriterUserId; + content.Level = dto.ContentVersionDto.ContentDto.NodeDto.Level; + content.ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId; + content.SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder; + content.Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed; + content.Published = dto.Published; + content.CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate; + content.UpdateDate = dto.ContentVersionDto.VersionDate; + content.ExpireDate = dto.ExpiresDate.HasValue ? dto.ExpiresDate.Value : (DateTime?) null; + content.ReleaseDate = dto.ReleaseDate.HasValue ? dto.ReleaseDate.Value : (DateTime?) null; + content.Version = dto.ContentVersionDto.VersionId; + content.PublishedState = dto.Published ? PublishedState.Published : PublishedState.Unpublished; + content.PublishedVersionGuid = dto.DocumentPublishedReadOnlyDto == null ? default(Guid) : dto.DocumentPublishedReadOnlyDto.VersionId; + } + finally + { + content.EnableChangeTracking(); + } + //on initial construction we don't want to have dirty properties tracked // http://issues.umbraco.org/issue/U4-1946 content.ResetDirtyProperties(false); diff --git a/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs index 54c7d8d2c9..6fa13654ad 100644 --- a/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/ContentTypeFactory.cs @@ -21,13 +21,22 @@ namespace Umbraco.Core.Persistence.Factories public IContentType BuildContentTypeEntity(ContentTypeDto dto) { var contentType = new ContentType(dto.NodeDto.ParentId); - BuildCommonEntity(contentType, dto); - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - contentType.ResetDirtyProperties(false); + try + { + contentType.DisableChangeTracking(); - return contentType; + BuildCommonEntity(contentType, dto); + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + contentType.ResetDirtyProperties(false); + return contentType; + } + finally + { + contentType.EnableChangeTracking(); + } } #endregion @@ -37,11 +46,20 @@ namespace Umbraco.Core.Persistence.Factories public IMediaType BuildMediaTypeEntity(ContentTypeDto dto) { var contentType = new MediaType(dto.NodeDto.ParentId); - BuildCommonEntity(contentType, dto); + try + { + contentType.DisableChangeTracking(); - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - contentType.ResetDirtyProperties(false); + BuildCommonEntity(contentType, dto); + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + contentType.ResetDirtyProperties(false); + } + finally + { + contentType.EnableChangeTracking(); + } return contentType; } diff --git a/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs b/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs index 377d70e3cb..cf487fa1a2 100644 --- a/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/DataTypeDefinitionFactory.cs @@ -19,25 +19,35 @@ namespace Umbraco.Core.Persistence.Factories public IDataTypeDefinition BuildEntity(DataTypeDto dto) { - var dataTypeDefinition = new DataTypeDefinition(dto.PropertyEditorAlias) - { - CreateDate = dto.NodeDto.CreateDate, - DatabaseType = dto.DbType.EnumParse(true), - Id = dto.DataTypeId, - Key = dto.NodeDto.UniqueId, - Level = dto.NodeDto.Level, - UpdateDate = dto.NodeDto.CreateDate, - Name = dto.NodeDto.Text, - ParentId = dto.NodeDto.ParentId, - Path = dto.NodeDto.Path, - SortOrder = dto.NodeDto.SortOrder, - Trashed = dto.NodeDto.Trashed, - CreatorId = dto.NodeDto.UserId.Value - }; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - dataTypeDefinition.ResetDirtyProperties(false); - return dataTypeDefinition; + var dataTypeDefinition = new DataTypeDefinition(dto.PropertyEditorAlias); + + + try + { + dataTypeDefinition.DisableChangeTracking(); + + dataTypeDefinition.CreateDate = dto.NodeDto.CreateDate; + dataTypeDefinition.DatabaseType = dto.DbType.EnumParse(true); + dataTypeDefinition.Id = dto.DataTypeId; + dataTypeDefinition.Key = dto.NodeDto.UniqueId; + dataTypeDefinition.Level = dto.NodeDto.Level; + dataTypeDefinition.UpdateDate = dto.NodeDto.CreateDate; + dataTypeDefinition.Name = dto.NodeDto.Text; + dataTypeDefinition.ParentId = dto.NodeDto.ParentId; + dataTypeDefinition.Path = dto.NodeDto.Path; + dataTypeDefinition.SortOrder = dto.NodeDto.SortOrder; + dataTypeDefinition.Trashed = dto.NodeDto.Trashed; + dataTypeDefinition.CreatorId = dto.NodeDto.UserId.Value; + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + dataTypeDefinition.ResetDirtyProperties(false); + return dataTypeDefinition; + } + finally + { + dataTypeDefinition.EnableChangeTracking(); + } } public DataTypeDto BuildDto(IDataTypeDefinition entity) diff --git a/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs b/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs index 1b9d73bdd4..4bcfea58ca 100644 --- a/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/DictionaryItemFactory.cs @@ -10,15 +10,23 @@ namespace Umbraco.Core.Persistence.Factories public IDictionaryItem BuildEntity(DictionaryDto dto) { - var item = new DictionaryItem(dto.Parent, dto.Key) - { - Id = dto.PrimaryKey, - Key = dto.UniqueId - }; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - item.ResetDirtyProperties(false); - return item; + var item = new DictionaryItem(dto.Parent, dto.Key); + + try + { + item.DisableChangeTracking(); + + item.Id = dto.PrimaryKey; + item.Key = dto.UniqueId; + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + item.ResetDirtyProperties(false); + return item; + } + finally + { + item.EnableChangeTracking(); + } } public DictionaryDto BuildDto(IDictionaryItem entity) diff --git a/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs b/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs index 65297b9529..2a931f6069 100644 --- a/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/DictionaryTranslationFactory.cs @@ -17,13 +17,23 @@ namespace Umbraco.Core.Persistence.Factories public IDictionaryTranslation BuildEntity(LanguageTextDto dto) { - var item = new DictionaryTranslation(dto.LanguageId, dto.Value, _uniqueId) - {Id = dto.PrimaryKey}; + var item = new DictionaryTranslation(dto.LanguageId, dto.Value, _uniqueId); - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - item.ResetDirtyProperties(false); - return item; + try + { + item.DisableChangeTracking(); + + item.Id = dto.PrimaryKey; + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + item.ResetDirtyProperties(false); + return item; + } + finally + { + item.EnableChangeTracking(); + } } public LanguageTextDto BuildDto(IDictionaryTranslation entity) diff --git a/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs b/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs index 66b493ea4d..2ec20b08eb 100644 --- a/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MacroFactory.cs @@ -12,15 +12,26 @@ namespace Umbraco.Core.Persistence.Factories public IMacro BuildEntity(MacroDto dto) { var model = new Macro(dto.Id, dto.UseInEditor, dto.RefreshRate, dto.Alias, dto.Name, dto.ScriptType, dto.ScriptAssembly, dto.Xslt, dto.CacheByPage, dto.CachePersonalized, dto.DontRender, dto.Python); - foreach (var p in dto.MacroPropertyDtos) + + + try { - model.Properties.Add(new MacroProperty(p.Id, p.Alias, p.Name, p.SortOrder, p.EditorAlias)); + model.DisableChangeTracking(); + + foreach (var p in dto.MacroPropertyDtos) + { + model.Properties.Add(new MacroProperty(p.Id, p.Alias, p.Name, p.SortOrder, p.EditorAlias)); + } + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + model.ResetDirtyProperties(false); + return model; + } + finally + { + model.EnableChangeTracking(); } - - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - model.ResetDirtyProperties(false); - return model; } public MacroDto BuildDto(IMacro entity) diff --git a/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs b/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs index 2d8edcac52..0fcb654cb7 100644 --- a/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MediaFactory.cs @@ -29,24 +29,32 @@ namespace Umbraco.Core.Persistence.Factories public IMedia BuildEntity(ContentVersionDto dto) { - var media = new Models.Media(dto.ContentDto.NodeDto.Text, dto.ContentDto.NodeDto.ParentId, _contentType) - { - Id = _id, - Key = dto.ContentDto.NodeDto.UniqueId, - Path = dto.ContentDto.NodeDto.Path, - CreatorId = dto.ContentDto.NodeDto.UserId.Value, - Level = dto.ContentDto.NodeDto.Level, - ParentId = dto.ContentDto.NodeDto.ParentId, - SortOrder = dto.ContentDto.NodeDto.SortOrder, - Trashed = dto.ContentDto.NodeDto.Trashed, - CreateDate = dto.ContentDto.NodeDto.CreateDate, - UpdateDate = dto.VersionDate, - Version = dto.VersionId - }; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - media.ResetDirtyProperties(false); - return media; + var media = new Models.Media(dto.ContentDto.NodeDto.Text, dto.ContentDto.NodeDto.ParentId, _contentType); + + try + { + media.DisableChangeTracking(); + + media.Id = _id; + media.Key = dto.ContentDto.NodeDto.UniqueId; + media.Path = dto.ContentDto.NodeDto.Path; + media.CreatorId = dto.ContentDto.NodeDto.UserId.Value; + media.Level = dto.ContentDto.NodeDto.Level; + media.ParentId = dto.ContentDto.NodeDto.ParentId; + media.SortOrder = dto.ContentDto.NodeDto.SortOrder; + media.Trashed = dto.ContentDto.NodeDto.Trashed; + media.CreateDate = dto.ContentDto.NodeDto.CreateDate; + media.UpdateDate = dto.VersionDate; + media.Version = dto.VersionId; + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + media.ResetDirtyProperties(false); + return media; + } + finally + { + media.EnableChangeTracking(); + } } public ContentVersionDto BuildDto(IMedia entity) diff --git a/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs index a35c472f24..2901f48539 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberFactory.cs @@ -31,26 +31,35 @@ namespace Umbraco.Core.Persistence.Factories public IMember BuildEntity(MemberDto dto) { var member = new Member( - dto.ContentVersionDto.ContentDto.NodeDto.Text, - dto.Email,dto.LoginName,dto.Password, _contentType) + dto.ContentVersionDto.ContentDto.NodeDto.Text, + dto.Email, dto.LoginName, dto.Password, _contentType); + + try { - Id = _id, - Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId, - Path = dto.ContentVersionDto.ContentDto.NodeDto.Path, - CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value, - Level = dto.ContentVersionDto.ContentDto.NodeDto.Level, - ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId, - SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder, - Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed, - CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate, - UpdateDate = dto.ContentVersionDto.VersionDate, - Version = dto.ContentVersionDto.VersionId - }; - member.ProviderUserKey = member.Key; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - member.ResetDirtyProperties(false); - return member; + member.DisableChangeTracking(); + + member.Id = _id; + member.Key = dto.ContentVersionDto.ContentDto.NodeDto.UniqueId; + member.Path = dto.ContentVersionDto.ContentDto.NodeDto.Path; + member.CreatorId = dto.ContentVersionDto.ContentDto.NodeDto.UserId.Value; + member.Level = dto.ContentVersionDto.ContentDto.NodeDto.Level; + member.ParentId = dto.ContentVersionDto.ContentDto.NodeDto.ParentId; + member.SortOrder = dto.ContentVersionDto.ContentDto.NodeDto.SortOrder; + member.Trashed = dto.ContentVersionDto.ContentDto.NodeDto.Trashed; + member.CreateDate = dto.ContentVersionDto.ContentDto.NodeDto.CreateDate; + member.UpdateDate = dto.ContentVersionDto.VersionDate; + member.Version = dto.ContentVersionDto.VersionId; + + member.ProviderUserKey = member.Key; + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + member.ResetDirtyProperties(false); + return member; + } + finally + { + member.EnableChangeTracking(); + } } public MemberDto BuildDto(IMember entity) diff --git a/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs index 9544d170e2..a4e069e85c 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberGroupFactory.cs @@ -18,18 +18,26 @@ namespace Umbraco.Core.Persistence.Factories public IMemberGroup BuildEntity(NodeDto dto) { - var template = new MemberGroup + var group = new MemberGroup(); + + try { - CreateDate = dto.CreateDate, - Id = dto.NodeId, - Key = dto.UniqueId, - Name = dto.Text - }; + group.DisableChangeTracking(); - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - template.ResetDirtyProperties(false); - return template; + group.CreateDate = dto.CreateDate; + group.Id = dto.NodeId; + group.Key = dto.UniqueId; + group.Name = dto.Text; + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + group.ResetDirtyProperties(false); + return group; + } + finally + { + group.EnableChangeTracking(); + } } public NodeDto BuildDto(IMemberGroup entity) diff --git a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs index eebbc34eda..10650528a4 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs @@ -12,48 +12,56 @@ namespace Umbraco.Core.Persistence.Factories public IMemberType BuildEntity(MemberTypeReadOnlyDto dto) { var standardPropertyTypes = Constants.Conventions.Member.GetStandardPropertyTypeStubs(); - - var memberType = new MemberType(dto.ParentId) - { - Alias = dto.Alias, - AllowedAsRoot = dto.AllowAtRoot, - CreateDate = dto.CreateDate, - CreatorId = dto.UserId.HasValue ? dto.UserId.Value : 0, - Description = dto.Description, - Icon = dto.Icon, - Id = dto.NodeId, - IsContainer = dto.IsContainer, - Key = dto.UniqueId.Value, - Level = dto.Level, - Name = dto.Text, - Path = dto.Path, - SortOrder = dto.SortOrder, - Thumbnail = dto.Thumbnail, - Trashed = dto.Trashed, - UpdateDate = dto.CreateDate, - AllowedContentTypes = Enumerable.Empty() - }; - var propertyTypeGroupCollection = GetPropertyTypeGroupCollection(dto, memberType, standardPropertyTypes); - memberType.PropertyGroups = propertyTypeGroupCollection; + var memberType = new MemberType(dto.ParentId); - var propertyTypes = GetPropertyTypes(dto, memberType, standardPropertyTypes); - - //By Convention we add 9 stnd PropertyTypes - This is only here to support loading of types that didn't have these conventions before. - foreach (var standardPropertyType in standardPropertyTypes) + try { - if(dto.PropertyTypes.Any(x => x.Alias.Equals(standardPropertyType.Key))) continue; - - //Add the standard PropertyType to the current list - propertyTypes.Add(standardPropertyType.Value); + memberType.DisableChangeTracking(); - //Internal dictionary for adding "MemberCanEdit" and "VisibleOnProfile" properties to each PropertyType - memberType.MemberTypePropertyTypes.Add(standardPropertyType.Key, - new MemberTypePropertyProfileAccess(false, false)); + memberType.Alias = dto.Alias; + memberType.AllowedAsRoot = dto.AllowAtRoot; + memberType.CreateDate = dto.CreateDate; + memberType.CreatorId = dto.UserId.HasValue ? dto.UserId.Value : 0; + memberType.Description = dto.Description; + memberType.Icon = dto.Icon; + memberType.Id = dto.NodeId; + memberType.IsContainer = dto.IsContainer; + memberType.Key = dto.UniqueId.Value; + memberType.Level = dto.Level; + memberType.Name = dto.Text; + memberType.Path = dto.Path; + memberType.SortOrder = dto.SortOrder; + memberType.Thumbnail = dto.Thumbnail; + memberType.Trashed = dto.Trashed; + memberType.UpdateDate = dto.CreateDate; + memberType.AllowedContentTypes = Enumerable.Empty(); + + var propertyTypeGroupCollection = GetPropertyTypeGroupCollection(dto, memberType, standardPropertyTypes); + memberType.PropertyGroups = propertyTypeGroupCollection; + + var propertyTypes = GetPropertyTypes(dto, memberType, standardPropertyTypes); + + //By Convention we add 9 stnd PropertyTypes - This is only here to support loading of types that didn't have these conventions before. + foreach (var standardPropertyType in standardPropertyTypes) + { + if (dto.PropertyTypes.Any(x => x.Alias.Equals(standardPropertyType.Key))) continue; + + //Add the standard PropertyType to the current list + propertyTypes.Add(standardPropertyType.Value); + + //Internal dictionary for adding "MemberCanEdit" and "VisibleOnProfile" properties to each PropertyType + memberType.MemberTypePropertyTypes.Add(standardPropertyType.Key, + new MemberTypePropertyProfileAccess(false, false)); + } + memberType.NoGroupPropertyTypes = propertyTypes; + + return memberType; + } + finally + { + memberType.EnableChangeTracking(); } - memberType.NoGroupPropertyTypes = propertyTypes; - - return memberType; } private PropertyGroupCollection GetPropertyTypeGroupCollection(MemberTypeReadOnlyDto dto, MemberType memberType, Dictionary standardProps) diff --git a/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs b/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs index 8d51b627ea..a69539e9ea 100644 --- a/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/PropertyFactory.cs @@ -42,12 +42,22 @@ namespace Umbraco.Core.Persistence.Factories : propertyType.CreatePropertyFromRawValue(propertyDataDto.GetValue, propertyDataDto.VersionId.Value, propertyDataDto.Id); - //on initial construction we don't want to have dirty properties tracked - property.CreateDate = _createDate; - property.UpdateDate = _updateDate; - // http://issues.umbraco.org/issue/U4-1946 - property.ResetDirtyProperties(false); - properties.Add(property); + try + { + //on initial construction we don't want to have dirty properties tracked + property.DisableChangeTracking(); + + property.CreateDate = _createDate; + property.UpdateDate = _updateDate; + // http://issues.umbraco.org/issue/U4-1946 + property.ResetDirtyProperties(false); + properties.Add(property); + } + finally + { + property.EnableChangeTracking(); + } + } return properties; diff --git a/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs b/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs index 2dfb996bb3..e1db8dcebf 100644 --- a/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/PropertyGroupFactory.cs @@ -39,47 +39,65 @@ namespace Umbraco.Core.Persistence.Factories { var group = new PropertyGroup(); - // if the group is defined on the current content type, - // assign its identifier, else it will be zero - if (groupDto.ContentTypeNodeId == _contentTypeId) - group.Id = groupDto.Id; - - group.Name = groupDto.Text; - group.SortOrder = groupDto.SortOrder; - group.PropertyTypes = new PropertyTypeCollection(); - group.Key = groupDto.UniqueId; - - //Because we are likely to have a group with no PropertyTypes we need to ensure that these are excluded - var typeDtos = groupDto.PropertyTypeDtos.Where(x => x.Id > 0); - foreach (var typeDto in typeDtos) + try { - var tempGroupDto = groupDto; - var propertyType = _propertyTypeCtor(typeDto.DataTypeDto.PropertyEditorAlias, - typeDto.DataTypeDto.DbType.EnumParse(true), - typeDto.Alias); + group.DisableChangeTracking(); - propertyType.Alias = typeDto.Alias; - propertyType.DataTypeDefinitionId = typeDto.DataTypeId; - propertyType.Description = typeDto.Description; - propertyType.Id = typeDto.Id; - propertyType.Key = typeDto.UniqueId; - propertyType.Name = typeDto.Name; - propertyType.Mandatory = typeDto.Mandatory; - propertyType.SortOrder = typeDto.SortOrder; - propertyType.ValidationRegExp = typeDto.ValidationRegExp; - propertyType.PropertyGroupId = new Lazy(() => tempGroupDto.Id); - propertyType.CreateDate = _createDate; - propertyType.UpdateDate = _updateDate; + // if the group is defined on the current content type, + // assign its identifier, else it will be zero + if (groupDto.ContentTypeNodeId == _contentTypeId) + group.Id = groupDto.Id; + group.Name = groupDto.Text; + group.SortOrder = groupDto.SortOrder; + group.PropertyTypes = new PropertyTypeCollection(); + group.Key = groupDto.UniqueId; + + //Because we are likely to have a group with no PropertyTypes we need to ensure that these are excluded + var typeDtos = groupDto.PropertyTypeDtos.Where(x => x.Id > 0); + foreach (var typeDto in typeDtos) + { + var tempGroupDto = groupDto; + var propertyType = _propertyTypeCtor(typeDto.DataTypeDto.PropertyEditorAlias, + typeDto.DataTypeDto.DbType.EnumParse(true), + typeDto.Alias); + + try + { + propertyType.DisableChangeTracking(); + + propertyType.Alias = typeDto.Alias; + propertyType.DataTypeDefinitionId = typeDto.DataTypeId; + propertyType.Description = typeDto.Description; + propertyType.Id = typeDto.Id; + propertyType.Key = typeDto.UniqueId; + propertyType.Name = typeDto.Name; + propertyType.Mandatory = typeDto.Mandatory; + propertyType.SortOrder = typeDto.SortOrder; + propertyType.ValidationRegExp = typeDto.ValidationRegExp; + propertyType.PropertyGroupId = new Lazy(() => tempGroupDto.Id); + propertyType.CreateDate = _createDate; + propertyType.UpdateDate = _updateDate; + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + propertyType.ResetDirtyProperties(false); + group.PropertyTypes.Add(propertyType); + } + finally + { + propertyType.EnableChangeTracking(); + } + } //on initial construction we don't want to have dirty properties tracked // http://issues.umbraco.org/issue/U4-1946 - propertyType.ResetDirtyProperties(false); - group.PropertyTypes.Add(propertyType); + group.ResetDirtyProperties(false); + propertyGroups.Add(group); + } + finally + { + group.EnableChangeTracking(); } - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - group.ResetDirtyProperties(false); - propertyGroups.Add(group); } return propertyGroups; diff --git a/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs b/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs index 5d614fb6d3..47adf75d89 100644 --- a/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/RelationFactory.cs @@ -16,17 +16,26 @@ namespace Umbraco.Core.Persistence.Factories public IRelation BuildEntity(RelationDto dto) { - var entity = new Relation(dto.ParentId, dto.ChildId, _relationType) + var entity = new Relation(dto.ParentId, dto.ChildId, _relationType); + + try { - Comment = dto.Comment, - CreateDate = dto.Datetime, - Id = dto.Id, - UpdateDate = dto.Datetime - }; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - entity.ResetDirtyProperties(false); - return entity; + entity.DisableChangeTracking(); + + entity.Comment = dto.Comment; + entity.CreateDate = dto.Datetime; + entity.Id = dto.Id; + entity.UpdateDate = dto.Datetime; + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + entity.ResetDirtyProperties(false); + return entity; + } + finally + { + entity.EnableChangeTracking(); + } } public RelationDto BuildDto(IRelation entity) diff --git a/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs index 358b652d0b..98d4f30042 100644 --- a/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/RelationTypeFactory.cs @@ -9,16 +9,25 @@ namespace Umbraco.Core.Persistence.Factories public IRelationType BuildEntity(RelationTypeDto dto) { - var entity = new RelationType(dto.ChildObjectType, dto.ParentObjectType, dto.Alias) + var entity = new RelationType(dto.ChildObjectType, dto.ParentObjectType, dto.Alias); + + try { - Id = dto.Id, - IsBidirectional = dto.Dual, - Name = dto.Name - }; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - entity.ResetDirtyProperties(false); - return entity; + entity.DisableChangeTracking(); + + entity.Id = dto.Id; + entity.IsBidirectional = dto.Dual; + entity.Name = dto.Name; + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + entity.ResetDirtyProperties(false); + return entity; + } + finally + { + entity.EnableChangeTracking(); + } } public RelationTypeDto BuildDto(IRelationType entity) diff --git a/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs b/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs index 81a6703324..d60403abea 100644 --- a/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/TaskFactory.cs @@ -12,20 +12,28 @@ namespace Umbraco.Core.Persistence.Factories { public Task BuildEntity(TaskDto dto) { - var entity = new Task(new TaskType(dto.TaskTypeDto.Alias) { Id = dto.TaskTypeDto.Id }) + var entity = new Task(new TaskType(dto.TaskTypeDto.Alias) { Id = dto.TaskTypeDto.Id }); + + try { - Closed = dto.Closed, - AssigneeUserId = dto.UserId, - Comment = dto.Comment, - CreateDate = dto.DateTime, - EntityId = dto.NodeId, - Id = dto.Id, - OwnerUserId = dto.ParentUserId, - }; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - entity.ResetDirtyProperties(false); - return entity; + entity.DisableChangeTracking(); + + entity.Closed = dto.Closed; + entity.AssigneeUserId = dto.UserId; + entity.Comment = dto.Comment; + entity.CreateDate = dto.DateTime; + entity.EntityId = dto.NodeId; + entity.Id = dto.Id; + entity.OwnerUserId = dto.ParentUserId; + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + entity.ResetDirtyProperties(false); + return entity; + } + finally + { + entity.EnableChangeTracking(); + } } public TaskDto BuildDto(Task entity) diff --git a/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs b/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs index 60cde916b6..ecff14d99c 100644 --- a/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/TemplateFactory.cs @@ -35,23 +35,31 @@ namespace Umbraco.Core.Persistence.Factories public Template BuildEntity(TemplateDto dto, IEnumerable childDefinitions, Func getFileContent) { - var template = new Template(dto.NodeDto.Text, dto.Alias, getFileContent) - { - CreateDate = dto.NodeDto.CreateDate, - Id = dto.NodeId, - Key = dto.NodeDto.UniqueId, - Path = dto.NodeDto.Path - }; + var template = new Template(dto.NodeDto.Text, dto.Alias, getFileContent); - template.IsMasterTemplate = childDefinitions.Any(x => x.ParentId == dto.NodeId); + try + { + template.DisableChangeTracking(); - if(dto.NodeDto.ParentId > 0) - template.MasterTemplateId = new Lazy(() => dto.NodeDto.ParentId); + template.CreateDate = dto.NodeDto.CreateDate; + template.Id = dto.NodeId; + template.Key = dto.NodeDto.UniqueId; + template.Path = dto.NodeDto.Path; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - template.ResetDirtyProperties(false); - return template; + template.IsMasterTemplate = childDefinitions.Any(x => x.ParentId == dto.NodeId); + + if (dto.NodeDto.ParentId > 0) + template.MasterTemplateId = new Lazy(() => dto.NodeDto.ParentId); + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + template.ResetDirtyProperties(false); + return template; + } + finally + { + template.EnableChangeTracking(); + } } public TemplateDto BuildDto(Template entity) diff --git a/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs b/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs index 660cc95029..18073c088e 100644 --- a/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UmbracoEntityFactory.cs @@ -28,44 +28,52 @@ namespace Umbraco.Core.Persistence.Factories { var asDictionary = (IDictionary)d; - var entity = new UmbracoEntity(d.trashed) - { - CreateDate = d.createDate, - CreatorId = d.nodeUser, - Id = d.id, - Key = d.uniqueID, - Level = d.level, - Name = d.text, - NodeObjectTypeId = d.nodeObjectType, - ParentId = d.parentID, - Path = d.path, - SortOrder = d.sortOrder, - HasChildren = d.children > 0, - ContentTypeAlias = asDictionary.ContainsKey("alias") ? (d.alias ?? string.Empty) : string.Empty, - ContentTypeIcon = asDictionary.ContainsKey("icon") ? (d.icon ?? string.Empty) : string.Empty, - ContentTypeThumbnail = asDictionary.ContainsKey("thumbnail") ? (d.thumbnail ?? string.Empty) : string.Empty, - }; + var entity = new UmbracoEntity(d.trashed); - var publishedVersion = default(Guid); - //some content items don't have a published version - if (asDictionary.ContainsKey("publishedVersion") && asDictionary["publishedVersion"] != null) + try { - Guid.TryParse(d.publishedVersion.ToString(), out publishedVersion); - } - var newestVersion = default(Guid); - if (asDictionary.ContainsKey("newestVersion") && d.newestVersion != null) - { - Guid.TryParse(d.newestVersion.ToString(), out newestVersion); - } + entity.DisableChangeTracking(); - entity.IsPublished = publishedVersion != default(Guid) || (newestVersion != default(Guid) && publishedVersion == newestVersion); - entity.IsDraft = newestVersion != default(Guid) && (publishedVersion == default(Guid) || publishedVersion != newestVersion); - entity.HasPendingChanges = (publishedVersion != default(Guid) && newestVersion != default(Guid)) && publishedVersion != newestVersion; - - //Now we can assign the additional data! - AddAdditionalData(entity, asDictionary); - - return entity; + entity.CreateDate = d.createDate; + entity.CreatorId = d.nodeUser; + entity.Id = d.id; + entity.Key = d.uniqueID; + entity.Level = d.level; + entity.Name = d.text; + entity.NodeObjectTypeId = d.nodeObjectType; + entity.ParentId = d.parentID; + entity.Path = d.path; + entity.SortOrder = d.sortOrder; + entity.HasChildren = d.children > 0; + entity.ContentTypeAlias = asDictionary.ContainsKey("alias") ? (d.alias ?? string.Empty) : string.Empty; + entity.ContentTypeIcon = asDictionary.ContainsKey("icon") ? (d.icon ?? string.Empty) : string.Empty; + entity.ContentTypeThumbnail = asDictionary.ContainsKey("thumbnail") ? (d.thumbnail ?? string.Empty) : string.Empty; + + var publishedVersion = default(Guid); + //some content items don't have a published version + if (asDictionary.ContainsKey("publishedVersion") && asDictionary["publishedVersion"] != null) + { + Guid.TryParse(d.publishedVersion.ToString(), out publishedVersion); + } + var newestVersion = default(Guid); + if (asDictionary.ContainsKey("newestVersion") && d.newestVersion != null) + { + Guid.TryParse(d.newestVersion.ToString(), out newestVersion); + } + + entity.IsPublished = publishedVersion != default(Guid) || (newestVersion != default(Guid) && publishedVersion == newestVersion); + entity.IsDraft = newestVersion != default(Guid) && (publishedVersion == default(Guid) || publishedVersion != newestVersion); + entity.HasPendingChanges = (publishedVersion != default(Guid) && newestVersion != default(Guid)) && publishedVersion != newestVersion; + + //Now we can assign the additional data! + AddAdditionalData(entity, asDictionary); + + return entity; + } + finally + { + entity.EnableChangeTracking(); + } } public UmbracoEntity BuildEntity(EntityRepository.UmbracoEntityDto dto) diff --git a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs index bf6ff7d09e..0a13c82447 100644 --- a/src/Umbraco.Core/Persistence/Factories/UserFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UserFactory.cs @@ -21,36 +21,44 @@ namespace Umbraco.Core.Persistence.Factories public IUser BuildEntity(UserDto dto) { var guidId = dto.Id.ToGuid(); - var user = new User(_userType) - { - Id = dto.Id, - Key = guidId, - StartContentId = dto.ContentStartId, - StartMediaId = dto.MediaStartId.HasValue ? dto.MediaStartId.Value : -1, - RawPasswordValue = dto.Password, - Username = dto.Login, - Name = dto.UserName, - IsLockedOut = dto.NoConsole, - IsApproved = dto.Disabled == false, - Email = dto.Email, - Language = dto.UserLanguage, - SecurityStamp = dto.SecurityStampToken, - FailedPasswordAttempts = dto.FailedLoginAttempts ?? 0, - LastLockoutDate = dto.LastLockoutDate ?? DateTime.MinValue, - LastLoginDate = dto.LastLoginDate ?? DateTime.MinValue, - LastPasswordChangeDate = dto.LastPasswordChangeDate ?? DateTime.MinValue - }; + var user = new User(_userType); - foreach (var app in dto.User2AppDtos) + try { - user.AddAllowedSection(app.AppAlias); + user.DisableChangeTracking(); + + user.Id = dto.Id; + user.Key = guidId; + user.StartContentId = dto.ContentStartId; + user.StartMediaId = dto.MediaStartId.HasValue ? dto.MediaStartId.Value : -1; + user.RawPasswordValue = dto.Password; + user.Username = dto.Login; + user.Name = dto.UserName; + user.IsLockedOut = dto.NoConsole; + user.IsApproved = dto.Disabled == false; + user.Email = dto.Email; + user.Language = dto.UserLanguage; + user.SecurityStamp = dto.SecurityStampToken; + user.FailedPasswordAttempts = dto.FailedLoginAttempts ?? 0; + user.LastLockoutDate = dto.LastLockoutDate ?? DateTime.MinValue; + user.LastLoginDate = dto.LastLoginDate ?? DateTime.MinValue; + user.LastPasswordChangeDate = dto.LastPasswordChangeDate ?? DateTime.MinValue; + + foreach (var app in dto.User2AppDtos) + { + user.AddAllowedSection(app.AppAlias); + } + + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + user.ResetDirtyProperties(false); + + return user; + } + finally + { + user.EnableChangeTracking(); } - - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - user.ResetDirtyProperties(false); - - return user; } public UserDto BuildDto(IUser entity) diff --git a/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs b/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs index b5718b7c3b..5f9cfac994 100644 --- a/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/UserTypeFactory.cs @@ -11,19 +11,27 @@ namespace Umbraco.Core.Persistence.Factories public IUserType BuildEntity(UserTypeDto dto) { - var userType = new UserType - { - Alias = dto.Alias, - Id = dto.Id, - Name = dto.Name, - Permissions = dto.DefaultPermissions.IsNullOrWhiteSpace() - ? Enumerable.Empty() - : dto.DefaultPermissions.ToCharArray().Select(x => x.ToString(CultureInfo.InvariantCulture)) - }; - //on initial construction we don't want to have dirty properties tracked - // http://issues.umbraco.org/issue/U4-1946 - userType.ResetDirtyProperties(false); - return userType; + var userType = new UserType(); + + try + { + userType.DisableChangeTracking(); + + userType.Alias = dto.Alias; + userType.Id = dto.Id; + userType.Name = dto.Name; + userType.Permissions = dto.DefaultPermissions.IsNullOrWhiteSpace() + ? Enumerable.Empty() + : dto.DefaultPermissions.ToCharArray().Select(x => x.ToString(CultureInfo.InvariantCulture)); + //on initial construction we don't want to have dirty properties tracked + // http://issues.umbraco.org/issue/U4-1946 + userType.ResetDirtyProperties(false); + return userType; + } + finally + { + userType.EnableChangeTracking(); + } } public UserTypeDto BuildDto(IUserType entity) diff --git a/src/UmbracoExamine/UmbracoContentIndexer.cs b/src/UmbracoExamine/UmbracoContentIndexer.cs index 92a1fb776e..4fcf51deae 100644 --- a/src/UmbracoExamine/UmbracoContentIndexer.cs +++ b/src/UmbracoExamine/UmbracoContentIndexer.cs @@ -349,7 +349,7 @@ namespace UmbracoExamine protected override void PerformIndexAll(string type) { - const int pageSize = 5000; + const int pageSize = 10000; var pageIndex = 0; switch (type) From d0c030a34c2e5dcb879b270d2fdbcb981a0f8a9e Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 26 May 2016 16:49:55 +0200 Subject: [PATCH 017/168] Reduce dictionary allocs in TracksChangesEntityBase --- .../EntityBase/TracksChangesEntityBase.cs | 41 +++++++++---------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs index 8e4fbc13f5..109084e9b9 100644 --- a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs +++ b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs @@ -18,7 +18,9 @@ namespace Umbraco.Core.Models.EntityBase //TODO: This needs to go on to ICanBeDirty http://issues.umbraco.org/issue/U4-5662 public virtual IEnumerable GetDirtyProperties() { - return _propertyChangedInfo.Where(x => x.Value).Select(x => x.Key); + return _propertyChangedInfo == null + ? Enumerable.Empty() + : _propertyChangedInfo.Where(x => x.Value).Select(x => x.Key); } private bool _changeTrackingEnabled = true; @@ -26,12 +28,12 @@ namespace Umbraco.Core.Models.EntityBase /// /// Tracks the properties that have changed /// - private IDictionary _propertyChangedInfo = new Dictionary(); + private IDictionary _propertyChangedInfo; /// /// Tracks the properties that we're changed before the last commit (or last call to ResetDirtyProperties) /// - private IDictionary _lastPropertyChangedInfo = null; + private IDictionary _lastPropertyChangedInfo; /// /// Property changed event @@ -47,12 +49,12 @@ namespace Umbraco.Core.Models.EntityBase //return if we're not tracking changes if (_changeTrackingEnabled == false) return; + if (_propertyChangedInfo == null) + _propertyChangedInfo = new Dictionary(); + _propertyChangedInfo[propertyInfo.Name] = true; - if (PropertyChanged != null) - { - PropertyChanged(this, new PropertyChangedEventArgs(propertyInfo.Name)); - } + PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyInfo.Name)); } /// @@ -62,7 +64,7 @@ namespace Umbraco.Core.Models.EntityBase /// True if Property is dirty, otherwise False public virtual bool IsPropertyDirty(string propertyName) { - return _propertyChangedInfo.Any(x => x.Key == propertyName); + return _propertyChangedInfo != null && _propertyChangedInfo.Any(x => x.Key == propertyName); } /// @@ -71,7 +73,7 @@ namespace Umbraco.Core.Models.EntityBase /// True if entity is dirty, otherwise False public virtual bool IsDirty() { - return _propertyChangedInfo.Any(); + return _propertyChangedInfo != null && _propertyChangedInfo.Any(); } /// @@ -100,7 +102,7 @@ namespace Umbraco.Core.Models.EntityBase { //NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME // instance as the one on the clone, so we need to create a new instance. - _lastPropertyChangedInfo = new Dictionary(); + _lastPropertyChangedInfo = null; } /// @@ -135,13 +137,13 @@ namespace Umbraco.Core.Models.EntityBase //NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME // instance as the one on the clone, so we need to create a new instance. - _propertyChangedInfo = new Dictionary(); + _propertyChangedInfo = null; } public void ResetChangeTrackingCollections() { - _propertyChangedInfo = new Dictionary(); - _lastPropertyChangedInfo = new Dictionary(); + _propertyChangedInfo = null; + _lastPropertyChangedInfo = null; } public void DisableChangeTracking() @@ -179,7 +181,6 @@ namespace Umbraco.Core.Models.EntityBase //Standard Equals comparison (arg1, arg2) => Equals(arg1, arg2), arg => arg.GetHashCode())); - } /// @@ -204,14 +205,10 @@ namespace Umbraco.Core.Models.EntityBase //don't track changes, just set the value (above) if (_changeTrackingEnabled == false) return false; - if (comparer.Equals(initVal, newVal) == false) - { - OnPropertyChanged(propertySelector); - return true; - } - return false; + if (comparer.Equals(initVal, newVal)) return false; + + OnPropertyChanged(propertySelector); + return true; } - - } } \ No newline at end of file From 928e74f24cff21890592b66603ee10129f6542e6 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 26 May 2016 17:14:13 +0200 Subject: [PATCH 018/168] No C# 6 yet --- .../Models/EntityBase/TracksChangesEntityBase.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs index 109084e9b9..43da67297f 100644 --- a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs +++ b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs @@ -54,7 +54,8 @@ namespace Umbraco.Core.Models.EntityBase _propertyChangedInfo[propertyInfo.Name] = true; - PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyInfo.Name)); + if (PropertyChanged != null) + PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyInfo.Name)); } /// @@ -165,8 +166,8 @@ namespace Umbraco.Core.Models.EntityBase /// /// returns true if the value changed /// - /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we - /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set + /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we + /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set /// to the same value, so it's really not dirty. /// internal bool SetPropertyValueAndDetectChanges(Func setValue, T value, PropertyInfo propertySelector) @@ -193,8 +194,8 @@ namespace Umbraco.Core.Models.EntityBase /// The equality comparer to use /// returns true if the value changed /// - /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we - /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set + /// This is required because we don't want a property to show up as "dirty" if the value is the same. For example, when we + /// save a document type, nearly all properties are flagged as dirty just because we've 'reset' them, but they are all set /// to the same value, so it's really not dirty. /// internal bool SetPropertyValueAndDetectChanges(Func setValue, T value, PropertyInfo propertySelector, IEqualityComparer comparer) From 6a0ca68d173a90ab80cd3ed6935f326d0ebc3c29 Mon Sep 17 00:00:00 2001 From: Stephan Date: Thu, 26 May 2016 18:44:22 +0200 Subject: [PATCH 019/168] Fixing, stupid --- .../Models/EntityBase/TracksChangesEntityBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs index 43da67297f..7e93c8cef2 100644 --- a/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs +++ b/src/Umbraco.Core/Models/EntityBase/TracksChangesEntityBase.cs @@ -93,7 +93,7 @@ namespace Umbraco.Core.Models.EntityBase /// True if Property was changed, otherwise False. Returns false if the entity had not been previously changed. public virtual bool WasPropertyDirty(string propertyName) { - return WasDirty() && _lastPropertyChangedInfo.Any(x => x.Key == propertyName); + return WasDirty() && _lastPropertyChangedInfo!= null && _lastPropertyChangedInfo.Any(x => x.Key == propertyName); } /// @@ -133,7 +133,9 @@ namespace Umbraco.Core.Models.EntityBase if (rememberPreviouslyChangedProperties) { //copy the changed properties to the last changed properties - _lastPropertyChangedInfo = _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value); + _lastPropertyChangedInfo = _propertyChangedInfo == null + ? null + : _propertyChangedInfo.ToDictionary(v => v.Key, v => v.Value); } //NOTE: We cannot .Clear() because when we memberwise clone this will be the SAME From cd3140af217ba541116a9e0d665a6bfecac79dc3 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Thu, 26 May 2016 21:13:25 +0200 Subject: [PATCH 020/168] Fix tiny issues with dropzone border to the left for fixed header and header jump by 1px when it get sticky. --- .../less/components/editor/subheader/umb-editor-sub-header.less | 2 +- .../src/less/components/umb-file-dropzone.less | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less index 3a5367c7c9..b7d6015b76 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less @@ -12,7 +12,7 @@ .umb-editor-sub-header.-umb-sticky-bar { box-shadow: 0 5px 0 rgba(0, 0, 0, 0.08), 0 1px 0 rgba(0, 0, 0, 0.16); transition: box-shadow 1s; - top: 100px; + top: 101px; /* height of header: 100px + its bottom-border: 1px */ transform: translate(0, 50%); } diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-file-dropzone.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-file-dropzone.less index d4e82a6419..6b3c46d927 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-file-dropzone.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-file-dropzone.less @@ -5,7 +5,7 @@ // tall and small version - animate height .dropzone { height: 400px; - width: 100%; + width: auto; padding: 50px 0; border: 1px dashed @grayLight; text-align: center; From e3dae6d77e8b8a7826047b4a603932c396a806e4 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Thu, 26 May 2016 22:24:33 +0200 Subject: [PATCH 021/168] Fix a few translations in da.xml --- src/Umbraco.Web.UI/umbraco/config/lang/da.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index 0280a46e05..c5a0861d13 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -6,7 +6,7 @@ Tilføj domæne - Revisions spor + Revisionsspor Gennemse elementer Skift dokumenttype Kopier @@ -447,13 +447,13 @@ Tilføj fane - Tilføj property + Tilføj egenskab Tilføj editor Tilføj skabelon Tilføj child node Tilføj child - Rediger data type + Rediger datatype Naviger sektioner @@ -948,7 +948,7 @@ Mange hilsner fra Umbraco robotten Hvis indholdet af felterne skal sendes til en url, skal denne slåes til så specialtegn formateres Denne tekst vil blive brugt hvis ovenstående felter er tomme Dette felt vil blive brugt hvis ovenstående felt er tomt - Ja, med klokkeslet. Dato/tid separator: + Ja, med klokkeslæt. Dato/tid separator: Opgaver tildelt dig @@ -985,10 +985,10 @@ Mange hilsner fra Umbraco robotten Datatyper Ordbog Installerede pakker - Installér et skin' - Installér et starter kit' + Installér et skin + Installér et starterkit Sprog - Installer lokal pakke + Installér lokal pakke Makroer Medietyper Medlemmer @@ -1026,7 +1026,7 @@ Mange hilsner fra Umbraco robotten Du kan ændre dit kodeord, som giver dig adgang til Umbraco Back Office ved at udfylde formularen og klikke på knappen 'Skift dit kodeord' Indholdskanal Beskrivelsesfelt - Deaktivér User + Deaktivér bruger Dokumenttype Redaktør Uddragsfelt @@ -1070,4 +1070,4 @@ Mange hilsner fra Umbraco robotten ...eller indtast din egen validering Feltet er påkrævet - + \ No newline at end of file From 00ae650ee2f401b553d2fee9aa0209d774882ef8 Mon Sep 17 00:00:00 2001 From: bjarnef Date: Thu, 26 May 2016 22:37:49 +0200 Subject: [PATCH 022/168] Modify a few other keys --- src/Umbraco.Web.UI/umbraco/config/lang/da.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index c5a0861d13..a91731a503 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -119,12 +119,12 @@ Alias (hvordan ville du f.eks. beskrive billedet via telefonen?) Alternative links - Klik på musen for at redigere dette punkt + Klik for at redigere dette punkt Oprettet af Oprindelig forfatter Opdateret af Oprettet den - tidspunkt for oprettelse + Tidspunkt for oprettelse Dokumenttype Redigerer Nedtagningsdato From 2f1b234d851a0ace002bf9c3613cfe1d990d007b Mon Sep 17 00:00:00 2001 From: bjarnef Date: Thu, 26 May 2016 22:43:15 +0200 Subject: [PATCH 023/168] Fix template translation --- src/Umbraco.Web.UI/umbraco/config/lang/da.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml index a91731a503..9c4899d72c 100644 --- a/src/Umbraco.Web.UI/umbraco/config/lang/da.xml +++ b/src/Umbraco.Web.UI/umbraco/config/lang/da.xml @@ -873,7 +873,7 @@ Mange hilsner fra Umbraco robotten Medlem gemt Stylesheetegenskab gemt Stylesheet gemt - Template gemt + Skabelon gemt Der er opstået en fejl under redigering Bruger gemt Brugertype gemt From 140218b0ed83a2a9e4ff01daa6e66ac5c6ab981d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 27 May 2016 10:32:55 +0200 Subject: [PATCH 024/168] remove install button + make categories smaller --- .../src/less/components/umb-packages.less | 44 +++++++++---------- .../src/views/packagesNew/edit.html | 19 +++----- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index b226517bbf..f68db092a1 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -2,7 +2,11 @@ width: 100%; margin-top: 40px; - margin-bottom: 30px; + margin-bottom: 40px; + background: @grayLighter; + border-radius: 3px; + padding: 30px; + box-sizing: border-box; } .umb-packages-search input { @@ -13,6 +17,8 @@ padding: 4px 10px; font-size: 16px; border-color: #ececec; + margin-bottom: 0; + border-color: @grayLight; &:hover, &:focus { border-color: @grayLight; @@ -21,19 +27,16 @@ .umb-packages { - display: flex; - flex-wrap: wrap; - - margin: 0 -5px; + margin: 0 -10px; } // List .umb-package { - height: 260px; - width: 200px; - - padding: 20px; + float: left; + padding: 10px; + box-sizing: border-box; + width: 20%; } @@ -71,6 +74,7 @@ padding-top: 10px; padding-right: 10px; padding-left: 10px; + padding-bottom: 10px; text-align: center; background-color: white; @@ -86,27 +90,28 @@ // Info .umb-package-info { - padding-right: 20px; - padding-bottom: 20px; - padding-left: 20px; - + padding-right: 15px; + padding-bottom: 15px; + padding-left: 15px; text-align: center; } // Name .umb-package-name { + font-size: 15px; max-width: 250px; + margin-bottom: 5px; font-weight: bold; - margin-bottom: 10px; - white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: normal; + margin-left: auto; + margin-right: auto; } // Numbers @@ -117,8 +122,6 @@ justify-content: center; opacity: .6; - - margin-bottom: 20px; } .umb-package-numbers small { @@ -204,7 +207,7 @@ flex: 1 0 auto; max-width: 25%; background-color: @blue; - padding: 40px 10px; + padding: 10px; font-size: 13px; border-radius: 3px; color: @white; @@ -213,12 +216,9 @@ margin: 5px; justify-content: center; - text-transform: uppercase; - letter-spacing: 1.3px; - &:hover { background-color: @blueDark; - box-shadow: 0 3px 8px rgba(0,0,0,0.2); + //box-shadow: 0 3px 8px rgba(0,0,0,0.2); } } diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index cf9c68e7d9..0901a58827 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -28,21 +28,18 @@ -
Popular
-
+

Popular

+ -
Latest
-
+

Latest

+
From db21aef15091f7b7a98a2ec609e95d1e8d88ac9b Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Fri, 27 May 2016 11:59:19 +0200 Subject: [PATCH 025/168] added icons and versions --- .../src/less/components/umb-packages.less | 28 +++++++++++++++++-- .../src/views/packagesNew/edit.controller.js | 18 ++++++++---- .../src/views/packagesNew/edit.html | 9 +++--- 3 files changed, 43 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index f68db092a1..e07e6f69f2 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -47,6 +47,8 @@ flex-direction: column; justify-content: center; + position: relative; + height: 100%; width: 100%; @@ -118,22 +120,44 @@ .umb-package-numbers { display: flex; flex-wrap: wrap; - flex-direction: column; + flex-direction: row; justify-content: center; opacity: .6; + + margin-top: 10px; } .umb-package-numbers small { padding: 0 5px; - display: block; + + display: flex; + align-items: center; + justify-content: center; +} + +.umb-package-numbers i { + font-size: 14px; } .umb-package-link:hover .umb-package-numbers { opacity: 1; } +.umb-package-link:hover .umb-package-numbers .icon-hearts { + color: red !important; +} +// Version +.umb-package-version { + display: inline-flex; + font-size: 11px; + font-weight: bold; + padding: 1px 5px; + background: #ececec; + border-radius: 3px; + color: black; +} /* umb-buttons-era */ .umb-era-button { diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js index e082448933..be816bb62a 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js @@ -41,42 +41,48 @@ "description": "An HTML5 audio player based on jPlayer", "karma": "1", "downloads": "1672", - "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png", + "version":"No good" }, { "name": "Kill IE6", "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", "karma": "11", "downloads": "688", - "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png", + "version":"Fits perfectly" }, { "name": "Examine Media Indexer", "description": "CogUmbracoExamineMediaIndexer", "karma": "3", "downloads": "1329", - "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png", + "version":"Fits perfectly" }, { "name": "SVG Icon Picker", "description": "A picker, for picking icons from an SVG spritesheet.", "karma": "5", "downloads": "8", - "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png", + "version":"Fits perfectly" }, { "name": "Pipeline CRM", "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", "karma": "3", "downloads": "105", - "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png", + "version":"Fits perfectly" }, { "name": "CodeMirror", "description": "CodeMirror Editor for Umbraco", "karma": "1", "downloads": "70", - "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png" + "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png", + "version":"No good" } ]; diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html index 0901a58827..24f919a4e9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html @@ -40,12 +40,13 @@
{{ package.name }}
+
- Downloads {{ package.downloads }} + {{ package.downloads }} - Karma {{ package.karma }} + {{ package.karma }}
@@ -73,10 +74,10 @@
- Downloads {{ package.downloads }} + {{ package.downloads }} - Karma {{ package.karma }} + {{ package.karma }}
From d77986fb180c34e1b34d857a55c7db436b071c9d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 27 May 2016 13:11:03 +0200 Subject: [PATCH 026/168] open overview html instead of edit html.. add category html and link the two views --- ...t.controller.js => category.controller.js} | 30 +++--- .../src/views/packagesNew/category.html | 35 +++++++ .../views/packagesNew/overview.controller.js | 97 +++++++++++++++++++ .../packagesNew/{edit.html => overview.html} | 4 +- .../Trees/NewPackagesTreeController.cs | 3 + 5 files changed, 152 insertions(+), 17 deletions(-) rename src/Umbraco.Web.UI.Client/src/views/packagesNew/{edit.controller.js => category.controller.js} (86%) create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js rename src/Umbraco.Web.UI.Client/src/views/packagesNew/{edit.html => overview.html} (96%) diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js similarity index 86% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js index be816bb62a..1030266e23 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js @@ -1,12 +1,14 @@ (function () { "use strict"; - function PackagesEditController($scope) { + function PackagesCategoryController($scope) { var vm = this; vm.page = {}; - vm.page.name = "Packages"; + vm.page.name = "Category"; + + vm.selectCategory = selectCategory; vm.categories = [ { @@ -41,54 +43,52 @@ "description": "An HTML5 audio player based on jPlayer", "karma": "1", "downloads": "1672", - "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png", - "version":"No good" + "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" }, { "name": "Kill IE6", "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", "karma": "11", "downloads": "688", - "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png", - "version":"Fits perfectly" + "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" }, { "name": "Examine Media Indexer", "description": "CogUmbracoExamineMediaIndexer", "karma": "3", "downloads": "1329", - "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png", - "version":"Fits perfectly" + "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" }, { "name": "SVG Icon Picker", "description": "A picker, for picking icons from an SVG spritesheet.", "karma": "5", "downloads": "8", - "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png", - "version":"Fits perfectly" + "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" }, { "name": "Pipeline CRM", "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", "karma": "3", "downloads": "105", - "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png", - "version":"Fits perfectly" + "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" }, { "name": "CodeMirror", "description": "CodeMirror Editor for Umbraco", "karma": "1", "downloads": "70", - "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png", - "version":"No good" + "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png" } ]; + function selectCategory(category) { + + } + } - angular.module("umbraco").controller("Umbraco.Editors.Packages.EditController", PackagesEditController); + angular.module("umbraco").controller("Umbraco.Editors.Packages.CategoryController", PackagesCategoryController); })(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html new file mode 100644 index 0000000000..0262b2c8ae --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html @@ -0,0 +1,35 @@ +
+ + + +
+ + + + + + + + + This is my category + + + + + + + Breadcrumbs here + + + + + + +
+ +
diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js new file mode 100644 index 0000000000..d50249dafd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js @@ -0,0 +1,97 @@ +(function () { + "use strict"; + + function PackagesOverviewController($scope, $route, $location) { + + var vm = this; + + vm.page = {}; + vm.page.name = "Packages"; + + vm.selectCategory = selectCategory; + + vm.categories = [ + { + "icon": "icon-male-and-female", + "name": "Collaboration" + }, + { + "icon": "icon-molecular-network", + "name": "Backoffice extensions" + }, + { + "icon": "icon-brackets", + "name": "Developer tools" + }, + { + "icon": "icon-wand", + "name": "Starter kits" + }, + { + "icon": "icon-medal", + "name": "Umbraco Pro" + }, + { + "icon": "icon-wrench", + "name": "Website utilities" + } + ]; + + vm.packages = [ + { + "name": "uSightly", + "description": "An HTML5 audio player based on jPlayer", + "karma": "1", + "downloads": "1672", + "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "Kill IE6", + "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + "karma": "11", + "downloads": "688", + "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "Examine Media Indexer", + "description": "CogUmbracoExamineMediaIndexer", + "karma": "3", + "downloads": "1329", + "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "SVG Icon Picker", + "description": "A picker, for picking icons from an SVG spritesheet.", + "karma": "5", + "downloads": "8", + "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "Pipeline CRM", + "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + "karma": "3", + "downloads": "105", + "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "name": "CodeMirror", + "description": "CodeMirror Editor for Umbraco", + "karma": "1", + "downloads": "70", + "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png" + } + ]; + + function selectCategory(category) { + var section = $route.current.params.section; + var tree = $route.current.params.tree; + var path = "/" + section + "/" + tree + "/category"; + $location.path(path); + } + + + } + + angular.module("umbraco").controller("Umbraco.Editors.Packages.OverviewController", PackagesOverviewController); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html similarity index 96% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html rename to src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html index 24f919a4e9..837f3b32b2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/edit.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html @@ -1,4 +1,4 @@ -
+
@@ -21,7 +21,7 @@
- +
{{ category.name }}
diff --git a/src/Umbraco.Web/Trees/NewPackagesTreeController.cs b/src/Umbraco.Web/Trees/NewPackagesTreeController.cs index c6c4e67841..9d3726540a 100644 --- a/src/Umbraco.Web/Trees/NewPackagesTreeController.cs +++ b/src/Umbraco.Web/Trees/NewPackagesTreeController.cs @@ -26,10 +26,13 @@ namespace Umbraco.Web.Trees { protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) { + var baseUrl = Constants.Applications.Developer + "/packagesNew/"; + var nodes = new TreeNodeCollection(); var node = CreateTreeNode("1", id, queryStrings, "Name", "icon-folder", false, ""); node.Path = "path"; + node.RoutePath = baseUrl + "overview"; //node.NodeType = "container"; //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. //node.AdditionalData["jsClickCallback"] = "javascript:void(0);"; From a04cb1d97010f9b86581683a66f2494d8823546e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Fri, 27 May 2016 14:29:30 +0200 Subject: [PATCH 027/168] added details view --- .../views/packagesNew/details.controller.js | 92 +++++++++++++++++++ .../src/views/packagesNew/details.html | 35 +++++++ .../views/packagesNew/overview.controller.js | 8 ++ .../src/views/packagesNew/overview.html | 4 +- 4 files changed, 137 insertions(+), 2 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js new file mode 100644 index 0000000000..9b4313b743 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js @@ -0,0 +1,92 @@ +(function () { + "use strict"; + + function PackageDetailsController($scope) { + + var vm = this; + + vm.page = {}; + + vm.package = { + "name": "Merchello", + "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur dignissim purus pulvinar odio iaculis, sit amet euismod arcu volutpat. Sed ut hendrerit sem. Vestibulum enim nisl, luctus quis cursus et, porttitor a ligula. Donec sed congue urna. Integer tincidunt ultrices lorem vitae suscipit. Sed non turpis massa. Donec et velit ante. Sed interdum lectus id lorem congue, sit amet lacinia ex placerat. In id orci sed augue cursus sodales.", + "compatibility": [ + { + "version": "7.4.x", + "compatibility": "100%" + }, + { + "version": "7.3.x", + "compatibility": "86%" + }, + { + "version": "7.2.x", + "compatibility": "93%" + }, + { + "version": "7.1.x", + "compatibility": "100%" + }, + { + "version": "7.0.x", + "compatibility": "untested" + }, + { + "version": "6.1.x", + "compatibility": "untested" + }, + { + "version": "6.0.x", + "compatibility": "untested" + }, + { + "version": "4.11.x", + "compatibility": "untested" + }, + { + "version": "4.10.x", + "compatibility": "untested" + }, + { + "version": "4.9.1", + "compatibility": "untested" + }, + { + "version": "4.9.0", + "compatibility": "untested" + } + ], + "information": { + "owner": "Rusty Swayne", + "contributors": [ + { + "name": "Lee" + }, + { + "name": "Jason Prothero" + } + ], + "created": "18/12/2013", + "currentVersion": "2.0.0", + ".netVersion": "4.5", + "license": "MIT", + "downloads": "4198", + "karma": "53" + }, + "externalSources": [ + { + "name": "Source code", + "url": "https://github.com/merchello/Merchello" + }, + { + "name": "Issue tracker", + "url": "http://issues.merchello.com/youtrack/oauth?state=%2Fyoutrack%2FrootGo" + } + ] + }; + + } + + angular.module("umbraco").controller("Umbraco.Editors.Packages.DetailsController", PackageDetailsController); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html new file mode 100644 index 0000000000..595dc03868 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html @@ -0,0 +1,35 @@ +
+ + + +
+ + + + + + + + +
{{ vm.package | json }}
+ +
+ + + + + Breadcrumbs here + + + + +
+ +
+ +
diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js index d50249dafd..820e1d2cf1 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js @@ -9,6 +9,7 @@ vm.page.name = "Packages"; vm.selectCategory = selectCategory; + vm.showPackageDetails = showPackageDetails; vm.categories = [ { @@ -89,6 +90,13 @@ $location.path(path); } + function showPackageDetails(selectedPackage) { + var section = $route.current.params.section; + var tree = $route.current.params.tree; + var path = "/" + section + "/" + tree + "/details"; + $location.path(path); + } + } diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html index 837f3b32b2..724ea7af84 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html @@ -32,7 +32,7 @@
- +
@@ -61,7 +61,7 @@
- +
From 5b9d0638084f81c71a644233fa2a1e864b098896 Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Fri, 27 May 2016 14:52:31 +0200 Subject: [PATCH 028/168] Changed categories --- .../src/less/components/umb-packages.less | 54 +++++++++---- .../views/packagesNew/category.controller.js | 8 +- .../src/views/packagesNew/category.html | 78 ++++++++++++++++++- .../views/packagesNew/overview.controller.js | 8 +- .../src/views/packagesNew/overview.html | 21 ++++- 5 files changed, 147 insertions(+), 22 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index e07e6f69f2..658c690f39 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -27,7 +27,7 @@ .umb-packages { - margin: 0 -10px; + // margin: 0 -10px; } @@ -225,31 +225,32 @@ margin-bottom: 30px; } + + .umb-packages-category { display: flex; align-items: center; flex: 1 0 auto; - max-width: 25%; - background-color: @blue; - padding: 10px; - font-size: 13px; - border-radius: 3px; - color: @white; - box-sizing: border-box; - flex: 1 0 auto; - margin: 5px; justify-content: center; - &:hover { - background-color: @blueDark; - //box-shadow: 0 3px 8px rgba(0,0,0,0.2); - } + opacity: .6; + + max-width: 25%; + + font-size: 13px; + font-weight: bold; + color: @black; + + box-sizing: border-box; + + justify-content: center; } + .umb-packages-category:hover, .umb-packages-category:focus { text-decoration: none; - color: @white; + opacity: 1; } .umb-packages-category-icon { @@ -258,3 +259,26 @@ display: none; } + +// Collapsed +.umb-packages-categories.-collapsed { + margin-bottom: 0; +} + +.umb-packages-categories.-collapsed .umb-packages-category { + margin-right: 20px; + + &:last-child { + margin-right: 0; + } +} + +.-ma0 { + margin: 0 !important; +} + +.-collapsed .umb-packages-category.-active { + color: @black; + opacity: 1; + border-bottom: 2px solid @black; +} diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js index 1030266e23..3dbf0403a0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js @@ -13,7 +13,13 @@ vm.categories = [ { "icon": "icon-male-and-female", - "name": "Collaboration" + "name": "All", + "active": false + }, + { + "icon": "icon-male-and-female", + "name": "Collaboration", + "active": true }, { "icon": "icon-molecular-network", diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html index 0262b2c8ae..a012264d75 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html @@ -1,4 +1,4 @@ -
+
@@ -16,7 +16,81 @@ - This is my category + + + + + + + + + + + + +

Popular

+ + + +

Latest

+ diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js index 820e1d2cf1..e01f818cb0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js @@ -14,7 +14,13 @@ vm.categories = [ { "icon": "icon-male-and-female", - "name": "Collaboration" + "name": "All", + "active": true + }, + { + "icon": "icon-male-and-female", + "name": "Collaboration", + "active": false }, { "icon": "icon-molecular-network", diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html index 724ea7af84..3d18e27411 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html @@ -1,4 +1,4 @@ -
+
@@ -16,16 +16,31 @@ + + + + + + + + + + -
+

Popular

From 24959f44954b328f4a85cf6f30a5c79b33fef767 Mon Sep 17 00:00:00 2001 From: Jeremy Pyne Date: Fri, 27 May 2016 16:51:34 -0400 Subject: [PATCH 029/168] Macro's inserted in the grid should block link clicks so that users done accidentally navigate away from backoffice when trying to edit macro settings. --- .../src/views/propertyeditors/grid/editors/macro.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/macro.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/macro.html index 732b551b52..f36a870423 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/macro.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/macro.html @@ -7,7 +7,7 @@
From 521329feaca483edadcb793c6531b092d499e01b Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 30 May 2016 09:15:28 +0200 Subject: [PATCH 030/168] send id to category and details view --- .../src/views/packagesNew/category.controller.js | 2 +- .../src/views/packagesNew/details.controller.js | 2 +- .../src/views/packagesNew/overview.controller.js | 16 ++++++++++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js index 3dbf0403a0..61332e850f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js @@ -1,7 +1,7 @@ (function () { "use strict"; - function PackagesCategoryController($scope) { + function PackagesCategoryController($scope, $routeParams) { var vm = this; diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js index 9b4313b743..834c894c0c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js @@ -1,7 +1,7 @@ (function () { "use strict"; - function PackageDetailsController($scope) { + function PackageDetailsController($scope, $routeParams) { var vm = this; diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js index e01f818cb0..d98212e8fe 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js @@ -13,6 +13,7 @@ vm.categories = [ { + "id": 1, "icon": "icon-male-and-female", "name": "All", "active": true @@ -23,22 +24,27 @@ "active": false }, { + "id": 2, "icon": "icon-molecular-network", "name": "Backoffice extensions" }, { + "id": 3, "icon": "icon-brackets", "name": "Developer tools" }, { + "id": 4, "icon": "icon-wand", "name": "Starter kits" }, { + "id": 5, "icon": "icon-medal", "name": "Umbraco Pro" }, { + "id": 6, "icon": "icon-wrench", "name": "Website utilities" } @@ -46,6 +52,7 @@ vm.packages = [ { + "id": 1, "name": "uSightly", "description": "An HTML5 audio player based on jPlayer", "karma": "1", @@ -53,6 +60,7 @@ "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" }, { + "id": 2, "name": "Kill IE6", "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", "karma": "11", @@ -60,6 +68,7 @@ "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" }, { + "id": 3, "name": "Examine Media Indexer", "description": "CogUmbracoExamineMediaIndexer", "karma": "3", @@ -67,6 +76,7 @@ "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" }, { + "id": 4, "name": "SVG Icon Picker", "description": "A picker, for picking icons from an SVG spritesheet.", "karma": "5", @@ -74,6 +84,7 @@ "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" }, { + "id": 5, "name": "Pipeline CRM", "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", "karma": "3", @@ -81,6 +92,7 @@ "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" }, { + "id": 6, "name": "CodeMirror", "description": "CodeMirror Editor for Umbraco", "karma": "1", @@ -92,14 +104,14 @@ function selectCategory(category) { var section = $route.current.params.section; var tree = $route.current.params.tree; - var path = "/" + section + "/" + tree + "/category"; + var path = "/" + section + "/" + tree + "/category/" + category.id; $location.path(path); } function showPackageDetails(selectedPackage) { var section = $route.current.params.section; var tree = $route.current.params.tree; - var path = "/" + section + "/" + tree + "/details"; + var path = "/" + section + "/" + tree + "/details/" + selectedPackage.id; $location.path(path); } From c3e4b611a61646d5de6988e29133bbc4107d7bb5 Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Tue, 31 May 2016 11:18:34 +0200 Subject: [PATCH 031/168] added subviews --- .../src/less/components/umb-packages.less | 10 +- .../views/packagesNew/overview.controller.js | 19 +++ .../src/views/packagesNew/overview.html | 91 +------------ .../views/install-local.controller.js | 7 + .../packagesNew/views/install-local.html | 7 + .../views/packagesNew/views/installed.html | 1 + .../packagesNew/views/repo.controller.js | 120 ++++++++++++++++++ .../src/views/packagesNew/views/repo.html | 91 +++++++++++++ 8 files changed, 255 insertions(+), 91 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 658c690f39..6becc6805f 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -48,6 +48,7 @@ justify-content: center; position: relative; + box-sizing: border-box; height: 100%; width: 100%; @@ -237,7 +238,7 @@ max-width: 25%; - font-size: 13px; + font-size: 14px; font-weight: bold; color: @black; @@ -266,11 +267,8 @@ } .umb-packages-categories.-collapsed .umb-packages-category { - margin-right: 20px; - - &:last-child { - margin-right: 0; - } + margin-right: 15px; + margin-left: 15px; } .-ma0 { diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js index d98212e8fe..166b020a90 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js @@ -11,6 +11,25 @@ vm.selectCategory = selectCategory; vm.showPackageDetails = showPackageDetails; + vm.page.navigation = [ + { + "name": "Packages", + "icon": "icon-cloud", + "view": "views/packagesNew/views/repo.html", + "active": true + }, + { + "name": "Installed", + "icon": "icon-box", + "view": "views/packagesNew/views/installed.html" + }, + { + "name": "Install local", + "icon": "icon-add", + "view": "views/packagesNew/views/install-local.html" + } + ]; + vm.categories = [ { "id": 1, diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html index 3d18e27411..3f666ffba2 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html @@ -11,96 +11,17 @@ name-locked="true" hide-icon="true" hide-description="true" + navigation="vm.page.navigation" hide-alias="true"> - - - - - - - - - - - - - - - -

Popular

- - - -

Latest

- + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js new file mode 100644 index 0000000000..9ac88fe6f9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js @@ -0,0 +1,7 @@ +(function () { + "use strict"; + + + angular.module("umbraco").controller("Umbraco.Editors.Packages.InstallLocalController"); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html new file mode 100644 index 0000000000..fa93b06f48 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html @@ -0,0 +1,7 @@ +
+ + + + Install Local + +
diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html new file mode 100644 index 0000000000..84376928ca --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html @@ -0,0 +1 @@ +Installed diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js new file mode 100644 index 0000000000..8286f3ff31 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js @@ -0,0 +1,120 @@ +(function () { + "use strict"; + + function PackagesRepoController($scope, $route, $location) { + + var vm = this; + + vm.selectCategory = selectCategory; + vm.showPackageDetails = showPackageDetails; + + vm.categories = [ + { + "id": 1, + "icon": "icon-male-and-female", + "name": "All", + "active": true + }, + { + "icon": "icon-male-and-female", + "name": "Collaboration", + "active": false + }, + { + "id": 2, + "icon": "icon-molecular-network", + "name": "Backoffice extensions" + }, + { + "id": 3, + "icon": "icon-brackets", + "name": "Developer tools" + }, + { + "id": 4, + "icon": "icon-wand", + "name": "Starter kits" + }, + { + "id": 5, + "icon": "icon-medal", + "name": "Umbraco Pro" + }, + { + "id": 6, + "icon": "icon-wrench", + "name": "Website utilities" + } + ]; + + vm.packages = [ + { + "id": 1, + "name": "uSightly", + "description": "An HTML5 audio player based on jPlayer", + "karma": "1", + "downloads": "1672", + "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 2, + "name": "Kill IE6", + "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + "karma": "11", + "downloads": "688", + "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 3, + "name": "Examine Media Indexer", + "description": "CogUmbracoExamineMediaIndexer", + "karma": "3", + "downloads": "1329", + "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 4, + "name": "SVG Icon Picker", + "description": "A picker, for picking icons from an SVG spritesheet.", + "karma": "5", + "downloads": "8", + "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 5, + "name": "Pipeline CRM", + "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + "karma": "3", + "downloads": "105", + "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 6, + "name": "CodeMirror", + "description": "CodeMirror Editor for Umbraco", + "karma": "1", + "downloads": "70", + "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png" + } + ]; + + function selectCategory(category) { + var section = $route.current.params.section; + var tree = $route.current.params.tree; + var path = "/" + section + "/" + tree + "/category/" + category.id; + $location.path(path); + } + + function showPackageDetails(selectedPackage) { + var section = $route.current.params.section; + var tree = $route.current.params.tree; + var path = "/" + section + "/" + tree + "/details/" + selectedPackage.id; + $location.path(path); + } + + + } + + angular.module("umbraco").controller("Umbraco.Editors.Packages.RepoController", PackagesRepoController); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html new file mode 100644 index 0000000000..bd2dc96f77 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html @@ -0,0 +1,91 @@ + From 03d53737a04c8cd2bbe0acddc48d82629a07741e Mon Sep 17 00:00:00 2001 From: Shannon Date: Tue, 31 May 2016 13:39:14 +0200 Subject: [PATCH 032/168] Fixes issue with a zero offset time - which in JS also means false, so need to check for undefined explicitly --- .../views/propertyeditors/datepicker/datepicker.controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js index 95d0a1bdf6..bb12f0404d 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/datepicker/datepicker.controller.js @@ -68,7 +68,7 @@ function dateTimePickerController($scope, notificationsService, assetsService, a var elementData = $element.find("div:first").data().DateTimePicker; if ($scope.model.config.pickTime) { //check if we are supposed to offset the time - if ($scope.model.value && $scope.model.config.offsetTime === "1" && Umbraco.Sys.ServerVariables.application.serverTimeOffset) { + if ($scope.model.value && $scope.model.config.offsetTime === "1" && Umbraco.Sys.ServerVariables.application.serverTimeOffset !== undefined) { $scope.model.value = dateHelper.convertToServerStringTime(elementData.getDate(), Umbraco.Sys.ServerVariables.application.serverTimeOffset); $scope.serverTime = dateHelper.convertToServerStringTime(elementData.getDate(), Umbraco.Sys.ServerVariables.application.serverTimeOffset, "YYYY-MM-DD HH:mm:ss Z"); } From 5ba2967c15b839ecf9101302e543c63b3f37dea2 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 31 May 2016 14:02:07 +0200 Subject: [PATCH 033/168] added design for package details --- .../src/less/components/umb-packages.less | 158 ++++++++++++++++++ .../views/packagesNew/details.controller.js | 76 +++++---- .../src/views/packagesNew/details.html | 126 ++++++++++++-- 3 files changed, 316 insertions(+), 44 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 6becc6805f..46516c48d4 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -215,6 +215,11 @@ background-color: @blueDark; } +.umb-era-button.-full-width { + display: block; + width: 100%; +} + /* CATEGORIES */ @@ -280,3 +285,156 @@ opacity: 1; border-bottom: 2px solid @black; } + +/* PACKAGE DETAILS */ + +.umb-package-details { + display: flex; +} + +.umb-package-details__main-content { + flex: 1 1 auto; + margin-right: 40px; +} + +.umb-package-details__sidebar { + flex: 0 0 350px; +} + +.umb-package-details__section { + background: @grayLighter; + padding: 20px; + margin-bottom: 20px; + border-radius: 3px; +} + +.umb-package-details__section-title { + font-size: 17px; + font-weight: bold; + color: black; + margin-top: 0; + margin-bottom: 15px; +} + +.umb-package-details__section-description { + font-size: 12px; + line-height: 1.6em; + margin-bottom: 15px; +} + +.umb-package-details__information-item { + display: flex; + margin-bottom: 5px; + font-size: 13px; +} + +.umb-package-details__information-item-label { + color: black; + font-weight: bold; + margin-right: 3px; +} + +.umb-package-details__information-item-label-2 { + font-size: 12px; + color: @grayMed; +} + +.umb-package-details__compatability { + margin-bottom: 15px; +} + +.umb-package-details__compatability-label { + margin-bottom: 3px; +} + +.umb-package-details__description { + margin-bottom: 20px; + line-height: 1.6em; +} + +.umb-package-details__description p { + margin-bottom: 20px; +} + +/* Links */ + +.umb-package-details__link { + color: #DA3287; +} + +.umb-package-details__link:hover { + color: #B32D71; + text-decoration: none; +} + +/* Owner profile */ + +.umb-package-details__owner-profile { + display: flex; + align-items: center; +} +.umb-package-details__owner-profile-avatar { + margin-right: 15px; +} + +.umb-package-details__owner-profile-name { + font-size: 15px; + color: #000000; + font-weight: bold; +} + +.umb-package-details__owner-profile-karma { + font-size: 12px; + color: @grayMed; +} + +/* gallery */ + +.umb-gallery__thumbnails { + display: flex; + flex-wrap: wrap; +} + +.umb-gallery__thumbnail { + flex: 1 1 100px; + border: 1px solid @grayLight; + border-radius: 3px; + margin: 5px; + padding: 10px; + box-sizing: border-box; +} + +.umb-gallery__thumbnail:hover { + cursor: pointer; + border-color: @blue; +} + +/* Avatar */ + +.umb-avatar { + border-radius: 50%; + width: 50px; +} + +/* Progress bar */ + +.umb-progress-bar { + background: @grayLight; + width: 100%; + display: block; + height: 10px; + border-radius: 10px; + box-sizing: border-box; + position: relative; + overflow: hidden; +} + +.umb-progress-bar__progress { + background: #50C878; + position: absolute; + left: 0; + top: 0; + bottom: 0; + width: 100%; + border-radius: 10px; +} diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js index 834c894c0c..7f4a48ebb9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js @@ -9,55 +9,29 @@ vm.package = { "name": "Merchello", - "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur dignissim purus pulvinar odio iaculis, sit amet euismod arcu volutpat. Sed ut hendrerit sem. Vestibulum enim nisl, luctus quis cursus et, porttitor a ligula. Donec sed congue urna. Integer tincidunt ultrices lorem vitae suscipit. Sed non turpis massa. Donec et velit ante. Sed interdum lectus id lorem congue, sit amet lacinia ex placerat. In id orci sed augue cursus sodales.", + "description": "<p>Merchello is a high performance, designer friendly, open source Umbraco ecommerce package built for the store owner.</p> <p><strong>What Merchello does for you</strong></p> <p>In version 1, Merchello supports a large variety of products with options that can be attached to a single warehouse, processes orders, manages taxes and shipping, and sends out email notifications to your customers. The beauty of Merchello is that while it oversees all of your products, orders, and store settings, it allows Umbraco to maintain your content. This seamless integration gives you the flexibility to build your store in any way imagineable on a robust platform capable of handling a wide variety of store sizes.</p> <p><strong>Find out more on our website</strong></p> <p><strong><a href="https://merchello.com">https://merchello.com</a></strong></p> <p><strong>Contribute</strong></p> <p>We would love and need your help. If you want to contribute to Merchello's core, the easiest way to get started is to fork the project on https://github.com/merchello/Merchello and open src/Merchello.sln in Visual Studio. We're excited to see what you do!</p> <p><strong>Starter Kit</strong></p> <p>We have built a simple starter kit for Merchello called Bazaar, and you can download it below in the package files tab.</p>", "compatibility": [ { "version": "7.4.x", - "compatibility": "100%" + "percentage": "100" }, { "version": "7.3.x", - "compatibility": "86%" + "percentage": "86" }, { "version": "7.2.x", - "compatibility": "93%" + "percentage": "93" }, { "version": "7.1.x", - "compatibility": "100%" - }, - { - "version": "7.0.x", - "compatibility": "untested" - }, - { - "version": "6.1.x", - "compatibility": "untested" - }, - { - "version": "6.0.x", - "compatibility": "untested" - }, - { - "version": "4.11.x", - "compatibility": "untested" - }, - { - "version": "4.10.x", - "compatibility": "untested" - }, - { - "version": "4.9.1", - "compatibility": "untested" - }, - { - "version": "4.9.0", - "compatibility": "untested" + "percentage": "100" } ], "information": { "owner": "Rusty Swayne", + "ownerAvatar": "https://our.umbraco.org/media/upload/d476d257-a494-46d9-9a00-56c2f94a55c8/our-profile.jpg?width=200&height=200&mode=crop", + "ownerKarma": "2673", "contributors": [ { "name": "Lee" @@ -68,7 +42,7 @@ ], "created": "18/12/2013", "currentVersion": "2.0.0", - ".netVersion": "4.5", + "netVersion": "4.5", "license": "MIT", "downloads": "4198", "karma": "53" @@ -82,6 +56,40 @@ "name": "Issue tracker", "url": "http://issues.merchello.com/youtrack/oauth?state=%2Fyoutrack%2FrootGo" } + ], + "images": [ + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + }, + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + }, + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + }, + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + }, + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + }, + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + }, + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + }, + { + "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + } ] }; diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html index 595dc03868..fa69f55407 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html @@ -4,7 +4,7 @@
- + -
{{ vm.package | json }}
+
+ +
+ +
+ + + +
+ +
+ +
+ +
+ +
+
+
+ +
+
+
{{ vm.package.information.owner }}
+
+ {{ vm.package.information.owner }} has {{ vm.package.information.ownerKarma }} karma points +
+
+
+
+ +
+
Information
+
+ +
+
Owner:
+
{{vm.package.information.owner}}
+
+ +
+
Contributors:
+ +
+ +
+
Created:
+
{{vm.package.information.created}}
+
+ +
+
Current version:
+
{{vm.package.information.created}}
+
+ +
+
.Net Version:
+
{{vm.package.information.netVersion}}
+
+ +
+
License:
+
{{vm.package.information.license}}
+
+ +
+
Downloads:
+
{{vm.package.information.downloads}}
+
+ +
+
Karma:
+
{{vm.package.information.karma}}
+
+ +
+
+ +
+
Compatibility
+
This project is compatible with the following versions as reported by community members who have downloaded this package:
+
+
+ {{compatibility.version}} + ({{compatibility.percentage}}%) +
+
+ +
+
+
+ +
+
External sources
+ + +
+ +
+ +
- - - - Breadcrumbs here - - - -
From 8b3160cd79ece8f1768567904dbbf401c768742e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 31 May 2016 15:56:56 +0200 Subject: [PATCH 034/168] remove unused model --- src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html index 3f666ffba2..d5ec07db74 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html @@ -19,8 +19,7 @@ + sub-views="vm.page.navigation">
From c36db267ce2415401f64bec18a80a45aa7637466 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 31 May 2016 15:57:34 +0200 Subject: [PATCH 035/168] add val-form-manager to fix js errors --- src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html index d5ec07db74..f698580e14 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html @@ -2,7 +2,7 @@ -
+ From 4545e8353401ed48e80804d6183eeba45e9c67b4 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 31 May 2016 16:00:23 +0200 Subject: [PATCH 036/168] added list for installed packages --- .../src/less/components/umb-packages.less | 61 ++++++++++++++++ .../packagesNew/views/installed.controller.js | 69 +++++++++++++++++++ .../views/packagesNew/views/installed.html | 27 +++++++- 3 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 46516c48d4..12c4b3794b 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -1,3 +1,14 @@ +.umb-packages-view-title { + font-size: 20px; + font-weight: bold; + color: @black; + margin-bottom: 30px; +} + +.umb-packages-view-wrapper { + padding: 20px 60px; +} + .umb-packages-search { width: 100%; @@ -215,6 +226,11 @@ background-color: @blueDark; } +.umb-era-button.-red-orange { + background-color: #FF3F34; + color: white; +} + .umb-era-button.-full-width { display: block; width: 100%; @@ -438,3 +454,48 @@ width: 100%; border-radius: 10px; } + +/* PACKAGE LIST */ + +.umb-package-list { + display: flex; + flex-direction: column; +} + +.umb-package-list__item { + display: flex; + flex-direction: row; + background: @grayLighter; + margin-bottom: 10px; + border-radius: 3px; + padding: 20px; + align-items: center; +} + +.umb-package-list__item-icon { + flex: 0 0 50px; + margin-right: 20px; +} + +.umb-package-list__item-content { + flex: 1 1 auto; + margin-right: 20px; +} + +.umb-package-list__item-name { + font-size: 16px; + margin-bottom: 5px; + color: @black; + font-weight: bold; +} + +.umb-package-list__item-description { + font-size: 14px; + color: @grayMed; +} + +.umb-package-list__item-actions { + flex: 1 1 auto; + display: flex; + justify-content: flex-end; +} diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.controller.js new file mode 100644 index 0000000000..a4348df277 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.controller.js @@ -0,0 +1,69 @@ +(function () { + "use strict"; + + function PackagesInstalledController($scope, $route, $location) { + + var vm = this; + + vm.installedPackages = [ + { + "id": 1, + "name": "uSightly", + "description": "An HTML5 audio player based on jPlayer", + "karma": "1", + "downloads": "1672", + "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 2, + "name": "Kill IE6", + "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + "karma": "11", + "downloads": "688", + "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 3, + "name": "Examine Media Indexer", + "description": "CogUmbracoExamineMediaIndexer", + "karma": "3", + "downloads": "1329", + "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 4, + "name": "SVG Icon Picker", + "description": "A picker, for picking icons from an SVG spritesheet.", + "karma": "5", + "downloads": "8", + "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 5, + "name": "Pipeline CRM", + "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + "karma": "3", + "downloads": "105", + "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 6, + "name": "CodeMirror", + "description": "CodeMirror Editor for Umbraco", + "karma": "1", + "downloads": "70", + "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png" + } + ]; + + vm.uninstallPackage = uninstallPackage; + + function uninstallPackage(installedPackage) { + console.log(installedPackage); + } + + } + + angular.module("umbraco").controller("Umbraco.Editors.Packages.InstalledController", PackagesInstalledController); + +})(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html index 84376928ca..8550cfb00f 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html @@ -1 +1,26 @@ -Installed +
+ +
Installed packages
+ +
+ +
+ +
+ +
+ +
+
{{ installedPackage.name }}
+
{{ installedPackage.description }}
+
+ +
+ +
+ +
+ +
+ +
From c66de2298b9177712876f82cff4d4ea20fb58314 Mon Sep 17 00:00:00 2001 From: Simon Busborg Date: Tue, 31 May 2016 16:18:41 +0200 Subject: [PATCH 037/168] Added local installer --- .../src/less/components/umb-packages.less | 116 +++++++++++++++++- .../views/install-local.controller.js | 26 +++- .../packagesNew/views/install-local.html | 81 +++++++++++- 3 files changed, 213 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 12c4b3794b..983a59364c 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -179,12 +179,10 @@ font-size: 14px; font-weight: bold; - text-transform: capitalize; height: 38px; line-height: 38px; - max-width: 100%; padding: 0 18px; @@ -200,6 +198,8 @@ border-radius: 3px; border: 0 none; + cursor: pointer; + transition: background-color 80ms ease, color 80ms ease; } @@ -226,18 +226,34 @@ background-color: @blueDark; } -.umb-era-button.-red-orange { - background-color: #FF3F34; - color: white; +.umb-era-button.-link { + padding: 0; + background: transparent; } +.umb-era-button.-link:hover { + background-color: transparent; + opacity: .6; +} + +.umb-era-button.-inactive { + cursor: not-allowed; + background: whitesmoke; + color: @grayMed; +} + +.umb-era-button.-inactive:hover { + background: whitesmoke; + color: @grayMed; +} + + .umb-era-button.-full-width { display: block; width: 100%; } - /* CATEGORIES */ .umb-packages-categories { @@ -499,3 +515,91 @@ display: flex; justify-content: flex-end; } + + + +// Install local package + +// Accept terms +.umb-accept-terms { + margin-bottom: 40px; + display: flex; + align-items: center; + + font-size: 13px; +} + +.umb-package-installer-label .label-text { + margin-left: 5px; +} + +.umb-package-installer-label input[type="radio"], +.umb-package-installer-label input[type="checkbox"] { + margin-top: 0px; +} + +.umb-package-installer-label { + display: flex; + align-items: center; + + font-size: 13px; + user-select: none; +} + +// Install local package +.umb-center-allthings { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + + max-width: 640px; + margin: 0 auto; + text-align: center; +} + + +// Upload state +.umb-upload-local input[type="file"] { + display: none; +} + +.umb-upload-local { + display: flex; + flex-direction: row; + align-items: flex-start; + + margin: 40px auto; +} + +.umb-upload-local .loaded { + margin-left: 10px; +} + +.umb-upload-local .upload i { + font-size: 20px; + line-height: 1; +} + +.umb-upload-local .-large { + font-size: 18px; +} + +.uploaded-file-name { + margin-left: 10px; +} + + +// Info state +.umb-info-local { + +} + +.umb-info-local-item { + margin: 10px 0; diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js index 9ac88fe6f9..56a67db062 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js @@ -1,7 +1,31 @@ (function () { "use strict"; + function PackagesInstallLocalController($scope, $route, $location) { - angular.module("umbraco").controller("Umbraco.Editors.Packages.InstallLocalController"); + var vm = this; + + vm.state = "upload"; + vm.localPackage = { + "packageName": "SvgIconPicker Version: 0.1.0", + "packageAuthor": "Søren Kottal", + "packageAuthorLink": "https://github.com/skttl/", + "packageInfo": "https://github.com/skttl/Umbraco.SvgIconPicker", + "packageLicens": "GPLv3", + "packageLicensLink": "http://www.gnu.org/licenses/quick-guide-gplv3.en.html", + "packageLicensAccept": false, + "packageReadme": false, + "filePath": "", + "riskAccept": false + }; + + vm.loadPackage = loadPackage; + + function loadPackage(){ + vm.state = "packageDetails"; + } + } + + angular.module("umbraco").controller("Umbraco.Editors.Packages.InstallLocalController", PackagesInstallLocalController); })(); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html index fa93b06f48..93fb7d17ff 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html @@ -1,7 +1,82 @@ -
+
- - Install Local + +
+ +

Install local package

+

Browse for local packages, they usally have a ".zip" extension. You can find trusted packages on our.umbraco.com or in the package tab in Umbraco

+ + +
+ +
+ + + + + + +
+ + + +
+

{{ vm.localPackage.packageName }}

+ + + + + + + +
+ Accept license + +
+ +
+ Read me +
+ + +
+ +
+        {{ vm.localPackage | json }}
+    
+
From 86eaacc5d216687205e8c35101b6dd4b6f7172ca Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 31 May 2016 21:10:52 +0200 Subject: [PATCH 038/168] tighten repo overview a bit --- .../src/less/components/umb-packages.less | 65 ++++++------------- .../packagesNew/views/repo.controller.js | 43 ++++++++++-- .../src/views/packagesNew/views/repo.html | 31 +++------ 3 files changed, 67 insertions(+), 72 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index 983a59364c..e58019553a 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -11,8 +11,6 @@ .umb-packages-search { width: 100%; - - margin-top: 40px; margin-bottom: 40px; background: @grayLighter; border-radius: 3px; @@ -38,11 +36,10 @@ .umb-packages { - // margin: 0 -10px; + margin: 0 -10px; } - -// List +// Cards .umb-package { float: left; padding: 10px; @@ -50,8 +47,6 @@ width: 20%; } - -// Link (Wrapper) .umb-package-link { display: flex; flex-wrap: wrap; @@ -64,7 +59,7 @@ height: 100%; width: 100%; - border: 2px solid #ececec; + border: 1px solid #ececec; border-radius: 3px; text-decoration: none !important; @@ -93,7 +88,7 @@ text-align: center; background-color: white; - min-height: 80px; + min-height: 60px; } .umb-package-icon img { @@ -107,13 +102,16 @@ padding-right: 15px; padding-bottom: 15px; padding-left: 15px; + padding-top: 15px; text-align: center; + background: @grayLighter; + border-top: 1px solid #ececec; } // Name .umb-package-name { - font-size: 15px; + font-size: 14px; max-width: 250px; margin-bottom: 5px; @@ -263,59 +261,37 @@ margin-bottom: 30px; } - - .umb-packages-category { display: flex; align-items: center; flex: 1 0 auto; justify-content: center; - - opacity: .6; - max-width: 25%; - font-size: 14px; font-weight: bold; color: @black; - box-sizing: border-box; - justify-content: center; + border-top: 1px solid @grayLight; + border-bottom: 1px solid @grayLight; + border-right: 1px solid @grayLight; + padding: 5px; } - .umb-packages-category:hover, -.umb-packages-category:focus { +.umb-packages-category.-active { text-decoration: none; - opacity: 1; + color: @blue; } -.umb-packages-category-icon { - font-size: 20px; - margin-right: 5px; - - display: none; +.umb-packages-category.-first { + border-left: 1px solid @grayLight; + border-radius: 3px 0 0 3px; } -// Collapsed -.umb-packages-categories.-collapsed { - margin-bottom: 0; -} - -.umb-packages-categories.-collapsed .umb-packages-category { - margin-right: 15px; - margin-left: 15px; -} - -.-ma0 { - margin: 0 !important; -} - -.-collapsed .umb-packages-category.-active { - color: @black; - opacity: 1; - border-bottom: 2px solid @black; +.umb-packages-category.-last { + border-right: 1px solid @grayLight; + border-radius: 0 3px 3px 0; } /* PACKAGE DETAILS */ @@ -603,3 +579,4 @@ .umb-info-local-item { margin: 10px 0; +} diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js index 8286f3ff31..5217b0d20c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js @@ -17,8 +17,7 @@ }, { "icon": "icon-male-and-female", - "name": "Collaboration", - "active": false + "name": "Collaboration" }, { "id": 2, @@ -90,11 +89,43 @@ }, { "id": 6, - "name": "CodeMirror", - "description": "CodeMirror Editor for Umbraco", + "name": "uSightly", + "description": "An HTML5 audio player based on jPlayer", "karma": "1", - "downloads": "70", - "icon":"https://our.umbraco.org/media/wiki/151028/635810233171153461_logopng.png?bgcolor=fff&height=154&width=281&format=png" + "downloads": "1672", + "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 7, + "name": "Kill IE6", + "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + "karma": "11", + "downloads": "688", + "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 8, + "name": "Examine Media Indexer", + "description": "CogUmbracoExamineMediaIndexer", + "karma": "3", + "downloads": "1329", + "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 9, + "name": "SVG Icon Picker", + "description": "A picker, for picking icons from an SVG spritesheet.", + "karma": "5", + "downloads": "8", + "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + }, + { + "id": 10, + "name": "Pipeline CRM", + "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + "karma": "3", + "downloads": "105", + "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" } ]; diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html index bd2dc96f77..714be5c0d6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html @@ -1,33 +1,20 @@ -
- - - - - - - - - - +
- - - +

Popular

From 5858823252a08d2bd40397a2c0af483e35871776 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Tue, 31 May 2016 21:29:00 +0200 Subject: [PATCH 039/168] add even spacing to sections + a bit more padding to category nav --- .../src/less/components/umb-packages.less | 8 +- .../src/views/packagesNew/views/repo.html | 120 +++++++++--------- 2 files changed, 68 insertions(+), 60 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less index e58019553a..a5916fa14e 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/umb-packages.less @@ -9,9 +9,12 @@ padding: 20px 60px; } +.umb-packages-section { + margin-bottom: 40px; +} + .umb-packages-search { width: 100%; - margin-bottom: 40px; background: @grayLighter; border-radius: 3px; padding: 30px; @@ -258,7 +261,6 @@ display: flex; user-select: center; flex-wrap: wrap; - margin-bottom: 30px; } .umb-packages-category { @@ -275,7 +277,7 @@ border-top: 1px solid @grayLight; border-bottom: 1px solid @grayLight; border-right: 1px solid @grayLight; - padding: 5px; + padding: 10px 0; } .umb-packages-category:hover, diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html index 714be5c0d6..7aacb9a010 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html @@ -1,78 +1,84 @@
- -
[Obsolete("This is not used and will be removed from the codebase in future versions")] + [EditorBrowsable(EditorBrowsableState.Never)] public string Language { get { return _language; } diff --git a/src/Umbraco.Core/Models/IContent.cs b/src/Umbraco.Core/Models/IContent.cs index 2715e5fe3a..7caefc1121 100644 --- a/src/Umbraco.Core/Models/IContent.cs +++ b/src/Umbraco.Core/Models/IContent.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel; using System.Diagnostics; using Umbraco.Core.Persistence.Mappers; @@ -21,6 +22,7 @@ namespace Umbraco.Core.Models bool Published { get; } [Obsolete("This will be removed in future versions")] + [EditorBrowsable(EditorBrowsableState.Never)] string Language { get; set; } /// diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs index 2f448860b0..d85baa2884 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyTypeReadOnlyDto.cs @@ -51,5 +51,8 @@ namespace Umbraco.Core.Models.Rdbms [Column("dbType")] public string DbType { get; set; } + + [Column("UniqueID")] + public Guid UniqueId { get; set; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs index eebbc34eda..9e1c09d6d5 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs @@ -114,7 +114,8 @@ namespace Umbraco.Core.Persistence.Factories ValidationRegExp = typeDto.ValidationRegExp, PropertyGroupId = new Lazy(() => tempGroupDto.Id.Value), CreateDate = memberType.CreateDate, - UpdateDate = memberType.UpdateDate + UpdateDate = memberType.UpdateDate, + Key = typeDto.UniqueId }; //on initial construction we don't want to have dirty properties tracked // http://issues.umbraco.org/issue/U4-1946 @@ -166,7 +167,8 @@ namespace Umbraco.Core.Persistence.Factories ValidationRegExp = typeDto.ValidationRegExp, PropertyGroupId = null, CreateDate = dto.CreateDate, - UpdateDate = dto.CreateDate + UpdateDate = dto.CreateDate, + Key = typeDto.UniqueId }; propertyTypes.Add(propertyType); diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs index b35c793400..5157eec9f0 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs @@ -94,7 +94,7 @@ namespace Umbraco.Core.Persistence.Repositories } sql.Select("umbracoNode.*", "cmsContentType.*", "cmsPropertyType.id AS PropertyTypeId", "cmsPropertyType.Alias", - "cmsPropertyType.Name", "cmsPropertyType.Description", "cmsPropertyType.mandatory", + "cmsPropertyType.Name", "cmsPropertyType.Description", "cmsPropertyType.mandatory", "cmsPropertyType.UniqueID", "cmsPropertyType.validationRegExp", "cmsPropertyType.dataTypeId", "cmsPropertyType.sortOrder AS PropertyTypeSortOrder", "cmsPropertyType.propertyTypeGroupId AS PropertyTypesGroupId", "cmsMemberType.memberCanEdit", "cmsMemberType.viewOnProfile", "cmsDataType.propertyEditorAlias", "cmsDataType.dbType", "cmsPropertyTypeGroup.id AS PropertyTypeGroupId", diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs index d29b073df7..105793b42c 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentRepositoryTest.cs @@ -21,6 +21,7 @@ using Umbraco.Tests.TestHelpers; using Umbraco.Tests.TestHelpers.Entities; using umbraco.editorControls.tinyMCE3; using umbraco.interfaces; +using Umbraco.Core.Models.EntityBase; using Umbraco.Core.Persistence.DatabaseModelDefinitions; namespace Umbraco.Tests.Persistence.Repositories @@ -266,17 +267,18 @@ namespace Umbraco.Tests.Persistence.Repositories using (var repository = CreateRepository(unitOfWork, out contentTypeRepository)) { ContentType contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage2", "Textpage"); - Content textpage = MockedContent.CreateSimpleContent(contentType); + IContent textpage = MockedContent.CreateSimpleContent(contentType); // Act contentTypeRepository.AddOrUpdate(contentType); repository.AddOrUpdate(textpage); unitOfWork.Commit(); - + // Assert Assert.That(contentType.HasIdentity, Is.True); Assert.That(textpage.HasIdentity, Is.True); + } } @@ -305,9 +307,13 @@ namespace Umbraco.Tests.Persistence.Repositories repository.AddOrUpdate(textpage); unitOfWork.Commit(); + var fetched = repository.Get(textpage.Id); + // Assert Assert.That(textpage.Template, Is.Not.Null); Assert.That(textpage.Template, Is.EqualTo(contentType.DefaultTemplate)); + + TestHelper.AssertAllPropertyValuesAreEquals(textpage, fetched, "yyyy-MM-dd HH:mm:ss"); } } diff --git a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs index b2fed80f1b..7d8d7659c8 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/ContentTypeRepositoryTest.cs @@ -266,6 +266,8 @@ namespace Umbraco.Tests.Persistence.Repositories repository.AddOrUpdate(contentType); unitOfWork.Commit(); + var fetched = repository.Get(contentType.Id); + // Assert Assert.That(contentType.HasIdentity, Is.True); Assert.That(contentType.PropertyGroups.All(x => x.HasIdentity), Is.True); @@ -281,6 +283,8 @@ namespace Umbraco.Tests.Persistence.Repositories { Assert.AreNotEqual(propertyType.Key, Guid.Empty); } + + TestHelper.AssertAllPropertyValuesAreEquals(contentType, fetched, "yyyy-MM-dd HH:mm:ss", ignoreProperties: new [] { "DefaultTemplate", "AllowedTemplates", "UpdateDate" }); } } diff --git a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs index 2f1c31487c..4db63f6085 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/DataTypeDefinitionRepositoryTest.cs @@ -355,9 +355,13 @@ namespace Umbraco.Tests.Persistence.Repositories unitOfWork.Commit(); var exists = repository.Exists(dataTypeDefinition.Id); + var fetched = repository.Get(dataTypeDefinition.Id); + // Assert Assert.That(dataTypeDefinition.HasIdentity, Is.True); Assert.That(exists, Is.True); + + TestHelper.AssertAllPropertyValuesAreEquals(dataTypeDefinition, fetched, "yyyy-MM-dd HH:mm:ss"); } } diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs index 10256e7dee..a216eaaa45 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaRepositoryTest.cs @@ -127,9 +127,13 @@ namespace Umbraco.Tests.Persistence.Repositories repository.AddOrUpdate(image); unitOfWork.Commit(); + var fetched = repository.Get(image.Id); + // Assert Assert.That(mediaType.HasIdentity, Is.True); Assert.That(image.HasIdentity, Is.True); + + TestHelper.AssertAllPropertyValuesAreEquals(image, fetched, "yyyy-MM-dd HH:mm:ss"); } } diff --git a/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs index eaedef09e4..b9ff045c71 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MediaTypeRepositoryTest.cs @@ -197,11 +197,15 @@ namespace Umbraco.Tests.Persistence.Repositories repository.AddOrUpdate(contentType); unitOfWork.Commit(); + var fetched = repository.Get(contentType.Id); + // Assert Assert.That(contentType.HasIdentity, Is.True); Assert.That(contentType.PropertyGroups.All(x => x.HasIdentity), Is.True); Assert.That(contentType.Path.Contains(","), Is.True); - Assert.That(contentType.SortOrder, Is.GreaterThan(0)); + Assert.That(contentType.SortOrder, Is.GreaterThan(0)); + + TestHelper.AssertAllPropertyValuesAreEquals(contentType, fetched, "yyyy-MM-dd HH:mm:ss", ignoreProperties: new[] { "UpdateDate" }); } diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs index 0d3b4e4e47..c8ffda7aec 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberRepositoryTest.cs @@ -220,7 +220,9 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.That(sut.Name, Is.EqualTo("Johnny Hefty")); Assert.That(sut.Email, Is.EqualTo("johnny@example.com")); Assert.That(sut.RawPasswordValue, Is.EqualTo("123")); - Assert.That(sut.Username, Is.EqualTo("hefty")); + Assert.That(sut.Username, Is.EqualTo("hefty")); + + TestHelper.AssertAllPropertyValuesAreEquals(sut, member, "yyyy-MM-dd HH:mm:ss"); } } diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs index aa4027d8a8..2de69b5071 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs @@ -42,7 +42,7 @@ namespace Umbraco.Tests.Persistence.Repositories var unitOfWork = provider.GetUnitOfWork(); using (var repository = CreateRepository(unitOfWork)) { - var memberType = MockedContentTypes.CreateSimpleMemberType(); + var memberType = (IMemberType)MockedContentTypes.CreateSimpleMemberType(); repository.AddOrUpdate(memberType); unitOfWork.Commit(); @@ -56,6 +56,30 @@ namespace Umbraco.Tests.Persistence.Repositories Assert.That(sut.PropertyGroups.Any(x => x.HasIdentity == false || x.Id == 0), Is.False); Assert.That(sut.PropertyTypes.Any(x => x.HasIdentity == false || x.Id == 0), Is.False); + + TestHelper.AssertAllPropertyValuesAreEquals(sut, memberType, "yyyy-MM-dd HH:mm:ss"); + } + } + + [Test] + public void Can_Persist_Member_Type_Same_Property_Keys() + { + var provider = new PetaPocoUnitOfWorkProvider(Logger); + var unitOfWork = provider.GetUnitOfWork(); + using (var repository = CreateRepository(unitOfWork)) + { + var memberType = (IMemberType)MockedContentTypes.CreateSimpleMemberType(); + + repository.AddOrUpdate(memberType); + unitOfWork.Commit(); + + var propertyKeys = memberType.PropertyTypes.Select(x => x.Key).OrderBy(x => x).ToArray(); + + memberType = repository.Get(memberType.Id); + var propertyKeys2 = memberType.PropertyTypes.Select(x => x.Key).OrderBy(x => x).ToArray(); + + Assert.IsTrue(propertyKeys.SequenceEqual(propertyKeys2)); + } } diff --git a/src/Umbraco.Tests/TestHelpers/TestHelper.cs b/src/Umbraco.Tests/TestHelpers/TestHelper.cs index eec71f9a7f..5e362ee1f8 100644 --- a/src/Umbraco.Tests/TestHelpers/TestHelper.cs +++ b/src/Umbraco.Tests/TestHelpers/TestHelper.cs @@ -1,13 +1,17 @@ using System; +using System.Collections; using System.Collections.Generic; +using System.ComponentModel; using System.Configuration; using System.IO; using System.Linq; using System.Reflection; +using NUnit.Framework; using SqlCE4Umbraco; using Umbraco.Core; using Umbraco.Core.IO; using umbraco.DataLayer; +using Umbraco.Core.Models.EntityBase; using GlobalSettings = umbraco.GlobalSettings; namespace Umbraco.Tests.TestHelpers @@ -116,6 +120,83 @@ namespace Umbraco.Tests.TestHelpers File.Delete(umbracoSettingsFile); } + public static void AssertAllPropertyValuesAreEquals(object actual, object expected, string dateTimeFormat = null, Func sorter = null, string[] ignoreProperties = null) + { + var properties = expected.GetType().GetProperties(); + foreach (var property in properties) + { + //ignore properties that are attributed with this + var att = property.GetCustomAttribute(false); + if (att != null && att.State == EditorBrowsableState.Never) + continue; - } + if (ignoreProperties != null && ignoreProperties.Contains(property.Name)) + continue; + + var expectedValue = property.GetValue(expected, null); + var actualValue = property.GetValue(actual, null); + + if (((actualValue is string) == false) && actualValue is IEnumerable) + { + AssertListsAreEquals(property, (IEnumerable)actualValue, (IEnumerable)expectedValue, dateTimeFormat, sorter); + } + else if (dateTimeFormat.IsNullOrWhiteSpace() == false && actualValue is DateTime) + { + Assert.AreEqual(((DateTime) expectedValue).ToString(dateTimeFormat), ((DateTime)actualValue).ToString(dateTimeFormat), "Property {0}.{1} does not match. Expected: {2} but was: {3}", property.DeclaringType.Name, property.Name, expectedValue, actualValue); + } + else + { + Assert.AreEqual(expectedValue, actualValue, "Property {0}.{1} does not match. Expected: {2} but was: {3}", property.DeclaringType.Name, property.Name, expectedValue, actualValue); + } + } + } + + private static void AssertListsAreEquals(PropertyInfo property, IEnumerable actualList, IEnumerable expectedList, string dateTimeFormat, Func sorter) + { + if (sorter == null) + { + //this is pretty hackerific but saves us some code to write + sorter = enumerable => + { + //semi-generic way of ensuring any collection of IEntity are sorted by Ids for comparison + var entities = enumerable.OfType().ToList(); + if (entities.Count > 0) + { + return entities.OrderBy(x => x.Id); + } + else + { + return enumerable; + } + }; + } + + var actualListEx = sorter(actualList).Cast().ToList(); + var expectedListEx = sorter(expectedList).Cast().ToList(); + + if (actualListEx.Count != expectedListEx.Count) + Assert.Fail("Collection {0}.{1} does not match. Expected IEnumerable containing {2} elements but was IEnumerable containing {3} elements", property.PropertyType.Name, property.Name, expectedListEx.Count, actualListEx.Count); + + for (int i = 0; i < actualListEx.Count; i++) + { + var actualValue = actualListEx[i]; + var expectedValue = expectedListEx[i]; + + if (((actualValue is string) == false) && actualValue is IEnumerable) + { + AssertListsAreEquals(property, (IEnumerable)actualValue, (IEnumerable)expectedValue, dateTimeFormat, sorter); + } + else if (dateTimeFormat.IsNullOrWhiteSpace() == false && actualValue is DateTime) + { + Assert.AreEqual(((DateTime)expectedValue).ToString(dateTimeFormat), ((DateTime)actualValue).ToString(dateTimeFormat), "Property {0}.{1} does not match. Expected: {2} but was: {3}", property.DeclaringType.Name, property.Name, expectedValue, actualValue); + } + else + { + Assert.AreEqual(expectedValue, actualValue, "Property {0}.{1} does not match. Expected: {2} but was: {3}", property.DeclaringType.Name, property.Name, expectedValue, actualValue); + } + } + } + + + } } \ No newline at end of file From 38e59373c657404fbfba43d6d50f3fb08977c47f Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 8 Jun 2016 09:47:06 +0200 Subject: [PATCH 052/168] U4-8569 Saving a member type changes the UniqueId of custom properties and tabs This fixes the tab/group unique id mappings --- .../Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs | 6 +++++- .../Persistence/Factories/MemberTypeReadOnlyFactory.cs | 1 + .../Persistence/Repositories/MemberTypeRepository.cs | 2 +- .../Persistence/Repositories/MemberTypeRepositoryTest.cs | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs index beebef9eeb..57c973fb64 100644 --- a/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/PropertyTypeGroupReadOnlyDto.cs @@ -1,4 +1,5 @@ -using Umbraco.Core.Persistence; +using System; +using Umbraco.Core.Persistence; namespace Umbraco.Core.Models.Rdbms { @@ -18,5 +19,8 @@ namespace Umbraco.Core.Models.Rdbms [Column("contenttypeNodeId")] public int ContentTypeNodeId { get; set; } + + [Column("PropertyGroupUniqueID")] + public Guid UniqueId { get; set; } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs index 9e1c09d6d5..468ea1b8bb 100644 --- a/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs +++ b/src/Umbraco.Core/Persistence/Factories/MemberTypeReadOnlyFactory.cs @@ -75,6 +75,7 @@ namespace Umbraco.Core.Persistence.Factories group.Id = groupDto.Id.Value; } + group.Key = groupDto.UniqueId; group.Name = groupDto.Text; group.SortOrder = groupDto.SortOrder; group.PropertyTypes = new PropertyTypeCollection(); diff --git a/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs b/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs index 5157eec9f0..d06399a85b 100644 --- a/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/MemberTypeRepository.cs @@ -98,7 +98,7 @@ namespace Umbraco.Core.Persistence.Repositories "cmsPropertyType.validationRegExp", "cmsPropertyType.dataTypeId", "cmsPropertyType.sortOrder AS PropertyTypeSortOrder", "cmsPropertyType.propertyTypeGroupId AS PropertyTypesGroupId", "cmsMemberType.memberCanEdit", "cmsMemberType.viewOnProfile", "cmsDataType.propertyEditorAlias", "cmsDataType.dbType", "cmsPropertyTypeGroup.id AS PropertyTypeGroupId", - "cmsPropertyTypeGroup.text AS PropertyGroupName", + "cmsPropertyTypeGroup.text AS PropertyGroupName", "cmsPropertyTypeGroup.uniqueID AS PropertyGroupUniqueID", "cmsPropertyTypeGroup.sortorder AS PropertyGroupSortOrder", "cmsPropertyTypeGroup.contenttypeNodeId") .From() .InnerJoin().On(left => left.NodeId, right => right.NodeId) diff --git a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs index 2de69b5071..32341fac10 100644 --- a/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs +++ b/src/Umbraco.Tests/Persistence/Repositories/MemberTypeRepositoryTest.cs @@ -74,11 +74,14 @@ namespace Umbraco.Tests.Persistence.Repositories unitOfWork.Commit(); var propertyKeys = memberType.PropertyTypes.Select(x => x.Key).OrderBy(x => x).ToArray(); + var groupKeys = memberType.PropertyGroups.Select(x => x.Key).OrderBy(x => x).ToArray(); memberType = repository.Get(memberType.Id); var propertyKeys2 = memberType.PropertyTypes.Select(x => x.Key).OrderBy(x => x).ToArray(); + var groupKeys2 = memberType.PropertyGroups.Select(x => x.Key).OrderBy(x => x).ToArray(); Assert.IsTrue(propertyKeys.SequenceEqual(propertyKeys2)); + Assert.IsTrue(groupKeys.SequenceEqual(groupKeys2)); } } From fed8a170cd9d0ba59f36b55bcf03c4748166f20a Mon Sep 17 00:00:00 2001 From: Jeremy Pyne Date: Wed, 8 Jun 2016 12:40:15 -0400 Subject: [PATCH 053/168] Update CodeArea.cs Added a missing include so the matchbrackets tag works in CodeMirror. --- src/umbraco.controls/CodeArea.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/umbraco.controls/CodeArea.cs b/src/umbraco.controls/CodeArea.cs index e93022c0bd..fa0c62318a 100644 --- a/src/umbraco.controls/CodeArea.cs +++ b/src/umbraco.controls/CodeArea.cs @@ -81,6 +81,8 @@ namespace umbraco.uicontrols ClientDependencyLoader.Instance.RegisterDependency(1, "CodeMirror/js/mode/javascript/javascript.js", "UmbracoClient", ClientDependencyType.Javascript); ClientDependencyLoader.Instance.RegisterDependency(1, "CodeMirror/js/mode/css/css.js", "UmbracoClient", ClientDependencyType.Javascript); } + + ClientDependencyLoader.Instance.RegisterDependency(1, "CodeMirror/addon/edit/matchbrackets.js", "UmbracoClient", ClientDependencyType.Javascript); ClientDependencyLoader.Instance.RegisterDependency(2, "CodeMirror/js/lib/codemirror.css", "UmbracoClient", ClientDependencyType.Css); From ae7c145fcd21c6325c3b9cd13c634ff79ecbca89 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Sun, 12 Jun 2016 11:45:57 +0200 Subject: [PATCH 054/168] add scrollable header to details page --- .../editor/subheader/umb-editor-sub-header.less | 4 ++-- .../src/views/packagesNew/views/repo.html | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less index 3a5367c7c9..9cd9d541a3 100644 --- a/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less +++ b/src/Umbraco.Web.UI.Client/src/less/components/editor/subheader/umb-editor-sub-header.less @@ -13,8 +13,8 @@ box-shadow: 0 5px 0 rgba(0, 0, 0, 0.08), 0 1px 0 rgba(0, 0, 0, 0.16); transition: box-shadow 1s; top: 100px; - transform: translate(0, 50%); - + margin-top: 0; + margin-bottom: 0; } .umb-group-builder__property-preview .umb-editor-sub-header { diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html index f6f79c4b05..0074eb8e9c 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html +++ b/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html @@ -104,11 +104,11 @@
- + + + ← Take me back + +
From 36fbb9df8633194321bec27a9e711f9a88c8147e Mon Sep 17 00:00:00 2001 From: Stephan Date: Sun, 12 Jun 2016 12:38:35 +0200 Subject: [PATCH 055/168] U4-8361 - initial work --- src/Umbraco.Core/Models/ContentUrlRule.cs | 20 +++ .../Models/Rdbms/ContentUrlRuleDto.cs | 35 +++++ .../CreateContentUrlRuleTable.cs | 39 +++++ .../Services/ContentUrlRuleService.cs | 135 ++++++++++++++++++ .../Services/IContentUrlRuleService.cs | 25 ++++ src/Umbraco.Core/Umbraco.Core.csproj | 5 + 6 files changed, 259 insertions(+) create mode 100644 src/Umbraco.Core/Models/ContentUrlRule.cs create mode 100644 src/Umbraco.Core/Models/Rdbms/ContentUrlRuleDto.cs create mode 100644 src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/CreateContentUrlRuleTable.cs create mode 100644 src/Umbraco.Core/Services/ContentUrlRuleService.cs create mode 100644 src/Umbraco.Core/Services/IContentUrlRuleService.cs diff --git a/src/Umbraco.Core/Models/ContentUrlRule.cs b/src/Umbraco.Core/Models/ContentUrlRule.cs new file mode 100644 index 0000000000..d8a23d431e --- /dev/null +++ b/src/Umbraco.Core/Models/ContentUrlRule.cs @@ -0,0 +1,20 @@ +using System; + +namespace Umbraco.Core.Models +{ + public class ContentUrlRule + { + public ContentUrlRule() + { + CreateDateUtc = DateTime.UtcNow; + } + + public int Id { get; internal set; } + + public int ContentId { get; set; } + + public DateTime CreateDateUtc { get; set; } + + public string Url { get; set; } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Models/Rdbms/ContentUrlRuleDto.cs b/src/Umbraco.Core/Models/Rdbms/ContentUrlRuleDto.cs new file mode 100644 index 0000000000..49f14dedf3 --- /dev/null +++ b/src/Umbraco.Core/Models/Rdbms/ContentUrlRuleDto.cs @@ -0,0 +1,35 @@ +using System; +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.DatabaseAnnotations; + +namespace Umbraco.Core.Models.Rdbms +{ + [TableName("umbracoContentUrlRule")] + [PrimaryKey("id")] + [ExplicitColumns] + class ContentUrlRuleDto + { + public ContentUrlRuleDto() + { + CreateDateUtc = DateTime.UtcNow; + } + + [Column("id")] + [PrimaryKeyColumn(IdentitySeed = 1, Name = "PK_umbracoContentUrlRule")] + public int Id { get; set; } + + [Column("contentId")] + [NullSetting(NullSetting = NullSettings.NotNull)] + [ForeignKey(typeof(NodeDto), Column = "id")] + public int ContentId { get; set; } + + [Column("createDateUtc")] + [NullSetting(NullSetting = NullSettings.NotNull)] + public DateTime CreateDateUtc { get; set; } + + [Column("url")] + [NullSetting(NullSetting = NullSettings.NotNull)] + [Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoContentUrlRule", ForColumns = "url, createDateUtc")] + public string Url { get; set; } + } +} diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/CreateContentUrlRuleTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/CreateContentUrlRuleTable.cs new file mode 100644 index 0000000000..8706fb747a --- /dev/null +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/CreateContentUrlRuleTable.cs @@ -0,0 +1,39 @@ +using System.Linq; +using Umbraco.Core.Configuration; +using Umbraco.Core.Logging; +using Umbraco.Core.Persistence.SqlSyntax; + +namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZero +{ + [Migration("7.5.0", 100, GlobalSettings.UmbracoMigrationName)] + public class CreateContentUrlRuleTable : MigrationBase + { + public CreateContentUrlRuleTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) + : base(sqlSyntax, logger) + { } + + public override void Up() + { + // don't exeucte if the table is already there + var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray(); + if (tables.InvariantContains("umbracoContentUrlRule")) return; + + Create.Table("umbracoContentUrlRule") + .WithColumn("id").AsInt32().Identity().PrimaryKey("PK_umbracoContentUrlRule") + .WithColumn("contentId").AsInt32().NotNullable() + .WithColumn("createDateUtc").AsDateTime().NotNullable() + .WithColumn("url").AsString(2048).NotNullable(); + + Create.PrimaryKey("PK_umbracoContentUrlRule").OnTable("umbracoContentUrlRule").Columns(new[] { "id" }); + + Create.Index("IX_umbracoContenUrlRule").OnTable("umbracoContentUrlRule") + .OnColumn("url") + .Ascending() + .OnColumn("createDateUtc") + .Ascending(); + } + + public override void Down() + { } + } +} diff --git a/src/Umbraco.Core/Services/ContentUrlRuleService.cs b/src/Umbraco.Core/Services/ContentUrlRuleService.cs new file mode 100644 index 0000000000..cff6c080f4 --- /dev/null +++ b/src/Umbraco.Core/Services/ContentUrlRuleService.cs @@ -0,0 +1,135 @@ +using System.Collections.Generic; +using System.Linq; +using Umbraco.Core.Events; +using Umbraco.Core.Logging; +using Umbraco.Core.Models; +using Umbraco.Core.Models.Rdbms; +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.UnitOfWork; + +namespace Umbraco.Core.Services +{ + class ContentUrlRuleService : RepositoryService, IContentUrlRuleService + { + public ContentUrlRuleService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory) + : base(provider, repositoryFactory, logger, eventMessagesFactory) + { } + + public void Save(ContentUrlRule rule) + { + // check if the url already exists + // the url actually is a primary key? + // though we might want to keep the history? + + using (var uow = UowProvider.GetUnitOfWork()) + { + var dto = new ContentUrlRuleDto + { + Id = rule.Id, + ContentId = rule.ContentId, + CreateDateUtc = rule.CreateDateUtc, + Url = rule.Url + }; + uow.Database.InsertOrUpdate(dto); + uow.Commit(); + rule.Id = dto.Id; + } + } + + public void Delete(int ruleId) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + uow.Database.Execute("DELETE FROM umbracoContentUrlRule WHERE id=@id", new { id = ruleId }); + uow.Commit(); + } + } + + public void DeleteContentRules(int contentId) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + uow.Database.Execute("DELETE FROM umbracoContentUrlRule WHERE contenId=@id", new { id = contentId }); + uow.Commit(); + } + } + + public ContentUrlRule GetMostRecentRule(string url) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE url=@url ORDER BY createDateUtc DESC;", + new { url }); + var ruleDto = ruleDtos.FirstOrDefault(); + var rule = ruleDto == null ? null : new ContentUrlRule + { + Id = ruleDto.Id, + ContentId = ruleDto.ContentId, + CreateDateUtc = ruleDto.CreateDateUtc, + Url = ruleDto.Url + }; + uow.Commit(); + return rule; + } + } + + public IEnumerable GetRules(int contentId) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE contentId=@id ORDER BY createDateUtc DESC;", + new { id = contentId }); + var rules = ruleDtos.Select(x=> new ContentUrlRule + { + Id = x.Id, + ContentId = x.ContentId, + CreateDateUtc = x.CreateDateUtc, + Url = x.Url + }); + uow.Commit(); + return rules; + } + } + + public IEnumerable GetAllRules(long pageIndex, int pageSize, out long total) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule ORDER BY createDateUtc DESC;"); + var rules = ruleDtos.Select(x => new ContentUrlRule + { + Id = x.Id, + ContentId = x.ContentId, + CreateDateUtc = x.CreateDateUtc, + Url = x.Url + }).ToArray(); + total = rules.Length; + uow.Commit(); + return rules; + } + } + + public IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + var path = "%," + rootContentId + ",%"; + + var ruleDtos = uow.Database.Fetch(@"SELECT * FROM umbracoContentUrlRule +JOIN umbracoNode ON umbracoNode.id=umbracoContentUrlRule.contentId +WHERE umbracoNode.path LIKE @path +ORDER BY createDateUtc DESC;", new { path }); + var rules = ruleDtos.Select(x => new ContentUrlRule + { + Id = x.Id, + ContentId = x.ContentId, + CreateDateUtc = x.CreateDateUtc, + Url = x.Url + }).ToArray(); + total = rules.Length; + uow.Commit(); + return rules; + } + } + } +} diff --git a/src/Umbraco.Core/Services/IContentUrlRuleService.cs b/src/Umbraco.Core/Services/IContentUrlRuleService.cs new file mode 100644 index 0000000000..4d43e90aba --- /dev/null +++ b/src/Umbraco.Core/Services/IContentUrlRuleService.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Umbraco.Core.Models; + +namespace Umbraco.Core.Services +{ + public interface IContentUrlRuleService + { + void Save(ContentUrlRule rule); + + void Delete(int ruleId); + + void DeleteContentRules(int contentId); + + ContentUrlRule GetMostRecentRule(string url); + + IEnumerable GetRules(int contentId); + + IEnumerable GetAllRules(long pageIndex, int pageSize, out long total); + + IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total); + } +} diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 141622687e..ff86e2f574 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -396,6 +396,7 @@ + @@ -417,6 +418,7 @@ + @@ -508,9 +510,12 @@ + + + From a7759c6175ed05ccb19dfd024a184073164a9217 Mon Sep 17 00:00:00 2001 From: Stephan Date: Sun, 12 Jun 2016 13:07:00 +0200 Subject: [PATCH 056/168] U4-8361 - renaming --- src/Umbraco.Core/Models/IRedirectUrl.cs | 18 ++++++ ...ContentUrlRuleDto.cs => RedirectUrlDto.cs} | 10 ++-- .../{ContentUrlRule.cs => RedirectUrl.cs} | 10 ++-- ...UrlRuleTable.cs => AddRedirectUrlTable.cs} | 14 ++--- .../Interfaces/IRedirectUrlRepository.cs | 13 +++++ .../Services/IContentUrlRuleService.cs | 25 --------- .../Services/IRedirectUrlService.cs | 24 ++++++++ ...rlRuleService.cs => RedirectUrlService.cs} | 55 +++++++++++-------- src/Umbraco.Core/Umbraco.Core.csproj | 12 ++-- 9 files changed, 112 insertions(+), 69 deletions(-) create mode 100644 src/Umbraco.Core/Models/IRedirectUrl.cs rename src/Umbraco.Core/Models/Rdbms/{ContentUrlRuleDto.cs => RedirectUrlDto.cs} (78%) rename src/Umbraco.Core/Models/{ContentUrlRule.cs => RedirectUrl.cs} (55%) rename src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/{CreateContentUrlRuleTable.cs => AddRedirectUrlTable.cs} (66%) create mode 100644 src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs delete mode 100644 src/Umbraco.Core/Services/IContentUrlRuleService.cs create mode 100644 src/Umbraco.Core/Services/IRedirectUrlService.cs rename src/Umbraco.Core/Services/{ContentUrlRuleService.cs => RedirectUrlService.cs} (61%) diff --git a/src/Umbraco.Core/Models/IRedirectUrl.cs b/src/Umbraco.Core/Models/IRedirectUrl.cs new file mode 100644 index 0000000000..4f15b1e082 --- /dev/null +++ b/src/Umbraco.Core/Models/IRedirectUrl.cs @@ -0,0 +1,18 @@ +using System; +using System.Runtime.Serialization; +using Umbraco.Core.Models.EntityBase; + +namespace Umbraco.Core.Models +{ + public interface IRedirectUrl : IAggregateRoot, IRememberBeingDirty + { + [DataMember] + int ContentId { get; set; } + + [DataMember] + DateTime CreateDateUtc { get; set; } + + [DataMember] + string Url { get; set; } + } +} diff --git a/src/Umbraco.Core/Models/Rdbms/ContentUrlRuleDto.cs b/src/Umbraco.Core/Models/Rdbms/RedirectUrlDto.cs similarity index 78% rename from src/Umbraco.Core/Models/Rdbms/ContentUrlRuleDto.cs rename to src/Umbraco.Core/Models/Rdbms/RedirectUrlDto.cs index 49f14dedf3..6ada1dca74 100644 --- a/src/Umbraco.Core/Models/Rdbms/ContentUrlRuleDto.cs +++ b/src/Umbraco.Core/Models/Rdbms/RedirectUrlDto.cs @@ -4,18 +4,18 @@ using Umbraco.Core.Persistence.DatabaseAnnotations; namespace Umbraco.Core.Models.Rdbms { - [TableName("umbracoContentUrlRule")] + [TableName("umbracoRedirectUrl")] [PrimaryKey("id")] [ExplicitColumns] - class ContentUrlRuleDto + class RedirectUrlDto { - public ContentUrlRuleDto() + public RedirectUrlDto() { CreateDateUtc = DateTime.UtcNow; } [Column("id")] - [PrimaryKeyColumn(IdentitySeed = 1, Name = "PK_umbracoContentUrlRule")] + [PrimaryKeyColumn(IdentitySeed = 1, Name = "PK_umbracoRedirectUrl")] public int Id { get; set; } [Column("contentId")] @@ -29,7 +29,7 @@ namespace Umbraco.Core.Models.Rdbms [Column("url")] [NullSetting(NullSetting = NullSettings.NotNull)] - [Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoContentUrlRule", ForColumns = "url, createDateUtc")] + [Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoRedirectUrl", ForColumns = "url, createDateUtc")] public string Url { get; set; } } } diff --git a/src/Umbraco.Core/Models/ContentUrlRule.cs b/src/Umbraco.Core/Models/RedirectUrl.cs similarity index 55% rename from src/Umbraco.Core/Models/ContentUrlRule.cs rename to src/Umbraco.Core/Models/RedirectUrl.cs index d8a23d431e..28c7d8635a 100644 --- a/src/Umbraco.Core/Models/ContentUrlRule.cs +++ b/src/Umbraco.Core/Models/RedirectUrl.cs @@ -1,16 +1,18 @@ using System; +using System.Runtime.Serialization; +using Umbraco.Core.Models.EntityBase; namespace Umbraco.Core.Models { - public class ContentUrlRule + [Serializable] + [DataContract(IsReference = true)] + public class RedirectUrl : Entity, IRedirectUrl { - public ContentUrlRule() + public RedirectUrl() { CreateDateUtc = DateTime.UtcNow; } - public int Id { get; internal set; } - public int ContentId { get; set; } public DateTime CreateDateUtc { get; set; } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/CreateContentUrlRuleTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs similarity index 66% rename from src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/CreateContentUrlRuleTable.cs rename to src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs index 8706fb747a..43c2da780b 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/CreateContentUrlRuleTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs @@ -6,9 +6,9 @@ using Umbraco.Core.Persistence.SqlSyntax; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZero { [Migration("7.5.0", 100, GlobalSettings.UmbracoMigrationName)] - public class CreateContentUrlRuleTable : MigrationBase + public class AddRedirectUrlTable : MigrationBase { - public CreateContentUrlRuleTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) + public AddRedirectUrlTable(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger) { } @@ -16,17 +16,17 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer { // don't exeucte if the table is already there var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray(); - if (tables.InvariantContains("umbracoContentUrlRule")) return; + if (tables.InvariantContains("umbracoRedirectUrl")) return; - Create.Table("umbracoContentUrlRule") - .WithColumn("id").AsInt32().Identity().PrimaryKey("PK_umbracoContentUrlRule") + Create.Table("umbracoRedirectUrl") + .WithColumn("id").AsInt32().Identity().PrimaryKey("PK_umbracoRedirectUrl") .WithColumn("contentId").AsInt32().NotNullable() .WithColumn("createDateUtc").AsDateTime().NotNullable() .WithColumn("url").AsString(2048).NotNullable(); - Create.PrimaryKey("PK_umbracoContentUrlRule").OnTable("umbracoContentUrlRule").Columns(new[] { "id" }); + Create.PrimaryKey("PK_umbracoRedirectUrl").OnTable("umbracoRedirectUrl").Columns(new[] { "id" }); - Create.Index("IX_umbracoContenUrlRule").OnTable("umbracoContentUrlRule") + Create.Index("IX_umbracoRedirectUrl").OnTable("umbracoRedirectUrl") .OnColumn("url") .Ascending() .OnColumn("createDateUtc") diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs new file mode 100644 index 0000000000..bebed2b336 --- /dev/null +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Umbraco.Core.Models; + +namespace Umbraco.Core.Persistence.Repositories +{ + interface IRedirectUrlRepository : IRepositoryQueryable + { + } +} diff --git a/src/Umbraco.Core/Services/IContentUrlRuleService.cs b/src/Umbraco.Core/Services/IContentUrlRuleService.cs deleted file mode 100644 index 4d43e90aba..0000000000 --- a/src/Umbraco.Core/Services/IContentUrlRuleService.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Umbraco.Core.Models; - -namespace Umbraco.Core.Services -{ - public interface IContentUrlRuleService - { - void Save(ContentUrlRule rule); - - void Delete(int ruleId); - - void DeleteContentRules(int contentId); - - ContentUrlRule GetMostRecentRule(string url); - - IEnumerable GetRules(int contentId); - - IEnumerable GetAllRules(long pageIndex, int pageSize, out long total); - - IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total); - } -} diff --git a/src/Umbraco.Core/Services/IRedirectUrlService.cs b/src/Umbraco.Core/Services/IRedirectUrlService.cs new file mode 100644 index 0000000000..88d010b8e0 --- /dev/null +++ b/src/Umbraco.Core/Services/IRedirectUrlService.cs @@ -0,0 +1,24 @@ +using System.Collections.Generic; +using Umbraco.Core.Models; + +namespace Umbraco.Core.Services +{ + public interface IRedirectUrlService : IService + { + void Save(RedirectUrl redirectUrl); + + void Delete(int id); + + void DeleteContentRules(int contentId); + + void DeleteAll(); + + RedirectUrl GetMostRecentRule(string url); + + IEnumerable GetRules(int contentId); + + IEnumerable GetAllRules(long pageIndex, int pageSize, out long total); + + IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total); + } +} diff --git a/src/Umbraco.Core/Services/ContentUrlRuleService.cs b/src/Umbraco.Core/Services/RedirectUrlService.cs similarity index 61% rename from src/Umbraco.Core/Services/ContentUrlRuleService.cs rename to src/Umbraco.Core/Services/RedirectUrlService.cs index cff6c080f4..f2496a9e89 100644 --- a/src/Umbraco.Core/Services/ContentUrlRuleService.cs +++ b/src/Umbraco.Core/Services/RedirectUrlService.cs @@ -9,13 +9,13 @@ using Umbraco.Core.Persistence.UnitOfWork; namespace Umbraco.Core.Services { - class ContentUrlRuleService : RepositoryService, IContentUrlRuleService + class RedirectUrlService : RepositoryService, IRedirectUrlService { - public ContentUrlRuleService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory) + public RedirectUrlService(IDatabaseUnitOfWorkProvider provider, RepositoryFactory repositoryFactory, ILogger logger, IEventMessagesFactory eventMessagesFactory) : base(provider, repositoryFactory, logger, eventMessagesFactory) { } - public void Save(ContentUrlRule rule) + public void Save(RedirectUrl redirectUrl) { // check if the url already exists // the url actually is a primary key? @@ -23,24 +23,24 @@ namespace Umbraco.Core.Services using (var uow = UowProvider.GetUnitOfWork()) { - var dto = new ContentUrlRuleDto + var dto = new RedirectUrlDto { - Id = rule.Id, - ContentId = rule.ContentId, - CreateDateUtc = rule.CreateDateUtc, - Url = rule.Url + Id = redirectUrl.Id, + ContentId = redirectUrl.ContentId, + CreateDateUtc = redirectUrl.CreateDateUtc, + Url = redirectUrl.Url }; uow.Database.InsertOrUpdate(dto); uow.Commit(); - rule.Id = dto.Id; + redirectUrl.Id = dto.Id; } } - public void Delete(int ruleId) + public void Delete(int id) { using (var uow = UowProvider.GetUnitOfWork()) { - uow.Database.Execute("DELETE FROM umbracoContentUrlRule WHERE id=@id", new { id = ruleId }); + uow.Database.Execute("DELETE FROM umbracoContentUrlRule WHERE id=@id", new { id = id }); uow.Commit(); } } @@ -54,14 +54,23 @@ namespace Umbraco.Core.Services } } - public ContentUrlRule GetMostRecentRule(string url) + public void DeleteAll() { using (var uow = UowProvider.GetUnitOfWork()) { - var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE url=@url ORDER BY createDateUtc DESC;", + uow.Database.Execute("DELETE FROM umbracoContentUrlRule;"); + uow.Commit(); + } + } + + public RedirectUrl GetMostRecentRule(string url) + { + using (var uow = UowProvider.GetUnitOfWork()) + { + var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE url=@url ORDER BY createDateUtc DESC;", new { url }); var ruleDto = ruleDtos.FirstOrDefault(); - var rule = ruleDto == null ? null : new ContentUrlRule + var rule = ruleDto == null ? null : new RedirectUrl { Id = ruleDto.Id, ContentId = ruleDto.ContentId, @@ -73,13 +82,13 @@ namespace Umbraco.Core.Services } } - public IEnumerable GetRules(int contentId) + public IEnumerable GetRules(int contentId) { using (var uow = UowProvider.GetUnitOfWork()) { - var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE contentId=@id ORDER BY createDateUtc DESC;", + var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE contentId=@id ORDER BY createDateUtc DESC;", new { id = contentId }); - var rules = ruleDtos.Select(x=> new ContentUrlRule + var rules = ruleDtos.Select(x=> new RedirectUrl { Id = x.Id, ContentId = x.ContentId, @@ -91,12 +100,12 @@ namespace Umbraco.Core.Services } } - public IEnumerable GetAllRules(long pageIndex, int pageSize, out long total) + public IEnumerable GetAllRules(long pageIndex, int pageSize, out long total) { using (var uow = UowProvider.GetUnitOfWork()) { - var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule ORDER BY createDateUtc DESC;"); - var rules = ruleDtos.Select(x => new ContentUrlRule + var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule ORDER BY createDateUtc DESC;"); + var rules = ruleDtos.Select(x => new RedirectUrl { Id = x.Id, ContentId = x.ContentId, @@ -109,17 +118,17 @@ namespace Umbraco.Core.Services } } - public IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total) + public IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total) { using (var uow = UowProvider.GetUnitOfWork()) { var path = "%," + rootContentId + ",%"; - var ruleDtos = uow.Database.Fetch(@"SELECT * FROM umbracoContentUrlRule + var ruleDtos = uow.Database.Fetch(@"SELECT * FROM umbracoContentUrlRule JOIN umbracoNode ON umbracoNode.id=umbracoContentUrlRule.contentId WHERE umbracoNode.path LIKE @path ORDER BY createDateUtc DESC;", new { path }); - var rules = ruleDtos.Select(x => new ContentUrlRule + var rules = ruleDtos.Select(x => new RedirectUrl { Id = x.Id, ContentId = x.ContentId, diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index ff86e2f574..7af77f359a 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -373,6 +373,7 @@ + @@ -396,7 +397,7 @@ - + @@ -418,7 +419,7 @@ - + @@ -471,6 +472,7 @@ + @@ -510,12 +512,12 @@ - - + + - + From cba91145eed1262b2afcb4829bb262710d8b6a9d Mon Sep 17 00:00:00 2001 From: Shannon Date: Sun, 12 Jun 2016 15:19:42 +0200 Subject: [PATCH 057/168] Updates new packages tree, obsoletes old one, have the package UI running for root node and sub nodes only for created packages. --- src/Umbraco.Core/Constants-Applications.cs | 5 + .../category.controller.js | 0 .../{packagesNew => packager}/category.html | 0 .../details.controller.js | 0 .../{packagesNew => packager}/details.html | 0 .../overview.controller.js | 6 +- .../{packagesNew => packager}/overview.html | 0 .../views/install-local.controller.js | 0 .../views/install-local.html | 0 .../views/installed.controller.js | 0 .../views/installed.html | 0 .../views/repo.controller.js | 0 .../{packagesNew => packager}/views/repo.html | 0 src/Umbraco.Web.UI/config/trees.config | 4 +- .../Trees/NewPackagesTreeController.cs | 51 ---------- .../Trees/PackagesTreeController.cs | 97 +++++++++++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 2 +- .../umbraco/Trees/loadPackager.cs | 3 +- .../umbraco/Trees/loadPackages.cs | 3 +- .../developer/Packages/editPackage.aspx.cs | 5 +- 20 files changed, 116 insertions(+), 60 deletions(-) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/category.controller.js (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/category.html (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/details.controller.js (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/details.html (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/overview.controller.js (83%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/overview.html (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/views/install-local.controller.js (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/views/install-local.html (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/views/installed.controller.js (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/views/installed.html (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/views/repo.controller.js (100%) rename src/Umbraco.Web.UI.Client/src/views/{packagesNew => packager}/views/repo.html (100%) delete mode 100644 src/Umbraco.Web/Trees/NewPackagesTreeController.cs create mode 100644 src/Umbraco.Web/Trees/PackagesTreeController.cs diff --git a/src/Umbraco.Core/Constants-Applications.cs b/src/Umbraco.Core/Constants-Applications.cs index 12f7076fc4..fb1fb42044 100644 --- a/src/Umbraco.Core/Constants-Applications.cs +++ b/src/Umbraco.Core/Constants-Applications.cs @@ -73,6 +73,11 @@ /// public const string DataTypes = "dataTypes"; + /// + /// alias for the packages tree + /// + public const string Packages = "packager"; + /// /// alias for the dictionary tree. /// diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/category.controller.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/category.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packager/category.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html b/src/Umbraco.Web.UI.Client/src/views/packager/category.html similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/category.html rename to src/Umbraco.Web.UI.Client/src/views/packager/category.html diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/details.controller.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/details.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packager/details.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html b/src/Umbraco.Web.UI.Client/src/views/packager/details.html similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/details.html rename to src/Umbraco.Web.UI.Client/src/views/packager/details.html diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js similarity index 83% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js index 3a45f42761..487a715042 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js @@ -1,7 +1,7 @@ (function () { "use strict"; - function PackagesOverviewController($scope, $route, $location) { + function PackagesOverviewController($scope, $route, $location, navigationService, $timeout) { var vm = this; @@ -26,6 +26,10 @@ } ]; + $timeout(function() { + navigationService.syncTree({ tree: "packager", path: "-1" }); + }); + } angular.module("umbraco").controller("Umbraco.Editors.Packages.OverviewController", PackagesOverviewController); diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html b/src/Umbraco.Web.UI.Client/src/views/packager/overview.html similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/overview.html rename to src/Umbraco.Web.UI.Client/src/views/packager/overview.html diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/views/install-local.html rename to src/Umbraco.Web.UI.Client/src/views/packager/views/install-local.html diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/views/installed.controller.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packager/views/installed.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/installed.html similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/views/installed.html rename to src/Umbraco.Web.UI.Client/src/views/packager/views/installed.html diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.controller.js rename to src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js diff --git a/src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html similarity index 100% rename from src/Umbraco.Web.UI.Client/src/views/packagesNew/views/repo.html rename to src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html diff --git a/src/Umbraco.Web.UI/config/trees.config b/src/Umbraco.Web.UI/config/trees.config index 6c9fb153b6..456a72cecb 100644 --- a/src/Umbraco.Web.UI/config/trees.config +++ b/src/Umbraco.Web.UI/config/trees.config @@ -19,8 +19,6 @@ - - @@ -42,5 +40,5 @@ - + \ No newline at end of file diff --git a/src/Umbraco.Web/Trees/NewPackagesTreeController.cs b/src/Umbraco.Web/Trees/NewPackagesTreeController.cs deleted file mode 100644 index 9d3726540a..0000000000 --- a/src/Umbraco.Web/Trees/NewPackagesTreeController.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Linq; -using System.Net; -using System.Net.Http.Formatting; -using System.Web.Http; -using Umbraco.Core; -using Umbraco.Core.Models; -using Umbraco.Web.Models.Trees; -using Umbraco.Web.Mvc; -using Umbraco.Web.WebApi.Filters; -using umbraco; -using umbraco.BusinessLogic.Actions; -using Umbraco.Core.Models.EntityBase; -using Umbraco.Core.Services; -using Constants = Umbraco.Core.Constants; - -namespace Umbraco.Web.Trees -{ - [UmbracoTreeAuthorize(Constants.Trees.DataTypes)] - [Tree(Constants.Applications.Developer, "packagesNew")] - [PluginController("UmbracoTrees")] - [CoreTree] - public class NewPackagesTreeController : TreeController - { - protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) - { - var baseUrl = Constants.Applications.Developer + "/packagesNew/"; - - var nodes = new TreeNodeCollection(); - - var node = CreateTreeNode("1", id, queryStrings, "Name", "icon-folder", false, ""); - node.Path = "path"; - node.RoutePath = baseUrl + "overview"; - //node.NodeType = "container"; - //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. - //node.AdditionalData["jsClickCallback"] = "javascript:void(0);"; - - nodes.Add(node); - - return nodes; - } - - protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings) - { - var menu = new MenuItemCollection(); - return menu; - } - } -} \ No newline at end of file diff --git a/src/Umbraco.Web/Trees/PackagesTreeController.cs b/src/Umbraco.Web/Trees/PackagesTreeController.cs new file mode 100644 index 0000000000..4f8b70693e --- /dev/null +++ b/src/Umbraco.Web/Trees/PackagesTreeController.cs @@ -0,0 +1,97 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Net; +using System.Net.Http.Formatting; +using System.Web.Http; +using Umbraco.Core; +using Umbraco.Core.Models; +using Umbraco.Web.Models.Trees; +using Umbraco.Web.Mvc; +using Umbraco.Web.WebApi.Filters; +using umbraco; +using umbraco.BusinessLogic.Actions; +using umbraco.cms.businesslogic.packager; +using Umbraco.Core.Models.EntityBase; +using Umbraco.Core.Services; +using Constants = Umbraco.Core.Constants; + +namespace Umbraco.Web.Trees +{ + [UmbracoTreeAuthorize(Constants.Trees.Packages)] + [Tree(Constants.Applications.Developer, Constants.Trees.Packages, null, sortOrder: 3)] + [PluginController("UmbracoTrees")] + [CoreTree] + [LegacyBaseTree(typeof(loadPackager))] + public class PackagesTreeController : TreeController + { + /// + /// Helper method to create a root model for a tree + /// + /// + protected override TreeNode CreateRootNode(FormDataCollection queryStrings) + { + var root = base.CreateRootNode(queryStrings); + + //this will load in a custom UI instead of the dashboard for the root node + root.RoutePath = string.Format("{0}/{1}/{2}", Constants.Applications.Developer, Constants.Trees.Packages, "overview"); + root.Icon = "icon-box"; + + return root; + } + + protected override TreeNodeCollection GetTreeNodes(string id, FormDataCollection queryStrings) + { + var baseUrl = Constants.Applications.Developer + "/packages/"; + + var nodes = new TreeNodeCollection(); + + var createdPackages = CreatedPackage.GetAllCreatedPackages(); + + if (id == "created") + { + nodes.AddRange( + createdPackages + .OrderBy(entity => entity.Data.Name) + .Select(dt => + { + var node = CreateTreeNode(dt.Data.Id.ToString(), id, queryStrings, dt.Data.Name, "icon-inbox", false, + string.Format("/{0}/framed/{1}", + queryStrings.GetValue("application"), + Uri.EscapeDataString("developer/Packages/EditPackage.aspx?id=" + dt.Data.Id))); + return node; + })); + } + else + { + //must be root + var node = CreateTreeNode( + "created", + id, + queryStrings, + Services.TextService.Localize("treeHeaders/createdPackages"), + "icon-folder", + createdPackages.Count > 0, + string.Empty); + + + + //TODO: This isn't the best way to ensure a noop process for clicking a node but it works for now. + node.AdditionalData["jsClickCallback"] = "javascript:void(0);"; + + nodes.Add(node); + } + + + + return nodes; + } + + protected override MenuItemCollection GetMenuForNode(string id, FormDataCollection queryStrings) + { + var menu = new MenuItemCollection(); + return menu; + } + } +} \ No newline at end of file diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 5102416548..f0e4b82aa3 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -376,7 +376,7 @@ - + diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs index 5df6cc6f2a..5470d530ad 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackager.cs @@ -30,7 +30,8 @@ namespace umbraco /// /// Handles loading of the packager application into the developer application tree /// - [Tree(Constants.Applications.Developer, "packager", "Packages", sortOrder: 3)] + //[Tree(Constants.Applications.Developer, "packager", "Packages", sortOrder: 3)] + [Obsolete("This is no longer used and will be removed from the codebase in the future")] public class loadPackager : BaseTree { #region TreeI Members diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs index 7bbf789981..154f995618 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/Trees/loadPackages.cs @@ -12,7 +12,8 @@ using umbraco.interfaces; namespace umbraco { - [Tree(Constants.Applications.Developer, "packagerPackages", "Packager Packages", initialize: false, sortOrder: 1)] + //[Tree(Constants.Applications.Developer, "packagerPackages", "Packager Packages", initialize: false, sortOrder: 1)] + [Obsolete("This is no longer used and will be removed from the codebase in the future")] public class loadPackages : BaseTree { diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs index ceae3d5659..f9835223be 100644 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs +++ b/src/Umbraco.Web/umbraco.presentation/umbraco/developer/Packages/editPackage.aspx.cs @@ -12,6 +12,7 @@ using umbraco.cms.businesslogic.template; using umbraco.cms.businesslogic.web; using umbraco.cms.presentation.Trees; using umbraco.controls; +using Umbraco.Core; using Umbraco.Core.IO; namespace umbraco.presentation.developer.packages @@ -65,8 +66,8 @@ namespace umbraco.presentation.developer.packages if (Page.IsPostBack == false) { ClientTools - .SetActiveTreeType(TreeDefinitionCollection.Instance.FindTree().Tree.Alias) - .SyncTree("-1,init," + loadPackages.PACKAGE_TREE_PREFIX + createdPackage.Data.Id, false); + .SetActiveTreeType(Constants.Trees.Packages) + .SyncTree("-1,created," + createdPackage.Data.Id, false); packageAuthorName.Text = pack.Author; packageAuthorUrl.Text = pack.AuthorUrl; From 79bbd6a70c9b3dc8203b29ddac2f35f99a35c99f Mon Sep 17 00:00:00 2001 From: Stephan Date: Sun, 12 Jun 2016 15:27:54 +0200 Subject: [PATCH 058/168] U4-8361 - implement repository --- src/Umbraco.Core/Models/RedirectUrl.cs | 45 ++++- .../Interfaces/IRedirectUrlRepository.cs | 9 +- .../Repositories/RedirectUrlRepository.cs | 186 ++++++++++++++++++ .../ServerRegistrationRepository.cs | 4 +- .../Persistence/RepositoryFactory.cs | 9 + .../Services/IRedirectUrlService.cs | 16 +- .../Services/RedirectUrlService.cs | 92 +++------ src/Umbraco.Core/Services/ServiceContext.cs | 18 +- src/Umbraco.Core/Umbraco.Core.csproj | 1 + 9 files changed, 304 insertions(+), 76 deletions(-) create mode 100644 src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs diff --git a/src/Umbraco.Core/Models/RedirectUrl.cs b/src/Umbraco.Core/Models/RedirectUrl.cs index 28c7d8635a..6622d2d182 100644 --- a/src/Umbraco.Core/Models/RedirectUrl.cs +++ b/src/Umbraco.Core/Models/RedirectUrl.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using System.Runtime.Serialization; using Umbraco.Core.Models.EntityBase; @@ -13,10 +14,48 @@ namespace Umbraco.Core.Models CreateDateUtc = DateTime.UtcNow; } - public int ContentId { get; set; } + private static readonly PropertyInfo ContentIdSelector = ExpressionHelper.GetPropertyInfo(x => x.ContentId); + private static readonly PropertyInfo CreateDateUtcSelector = ExpressionHelper.GetPropertyInfo(x => x.CreateDateUtc); + private static readonly PropertyInfo UrlSelector = ExpressionHelper.GetPropertyInfo(x => x.Url); - public DateTime CreateDateUtc { get; set; } + private int _contentId; + private DateTime _createDateUtc; + private string _url; - public string Url { get; set; } + public int ContentId + { + get { return _contentId; } + set + { + SetPropertyValueAndDetectChanges(o => + { + return _contentId = value; + }, _contentId, ContentIdSelector); + } + } + + public DateTime CreateDateUtc + { + get { return _createDateUtc; } + set + { + SetPropertyValueAndDetectChanges(o => + { + return _createDateUtc = value; + }, _createDateUtc, CreateDateUtcSelector); + } + } + + public string Url + { + get { return _url; } + set + { + SetPropertyValueAndDetectChanges(o => + { + return _url = value; + }, _url, UrlSelector); + } + } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs index bebed2b336..9608c55e4c 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs @@ -7,7 +7,14 @@ using Umbraco.Core.Models; namespace Umbraco.Core.Persistence.Repositories { - interface IRedirectUrlRepository : IRepositoryQueryable + public interface IRedirectUrlRepository : IRepositoryQueryable { + void Delete(int id); + void DeleteAll(); + void DeleteContentUrls(int contentId); + IRedirectUrl GetMostRecentRule(string url); + IEnumerable GetContentUrls(int contentId); + IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total); + IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total); } } diff --git a/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs new file mode 100644 index 0000000000..e33ba82f63 --- /dev/null +++ b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs @@ -0,0 +1,186 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Umbraco.Core.Logging; +using Umbraco.Core.Models; +using Umbraco.Core.Models.Rdbms; +using Umbraco.Core.Persistence.Querying; +using Umbraco.Core.Persistence.SqlSyntax; +using Umbraco.Core.Persistence.UnitOfWork; + +namespace Umbraco.Core.Persistence.Repositories +{ + class RedirectUrlRepository : PetaPocoRepositoryBase, IRedirectUrlRepository + { + public RedirectUrlRepository(IDatabaseUnitOfWork work, CacheHelper cache, ILogger logger, ISqlSyntaxProvider sqlSyntax) + : base(work, cache, logger, sqlSyntax) + { } + + protected override int PerformCount(IQuery query) + { + throw new NotSupportedException("This repository does not support this method."); + } + + protected override bool PerformExists(int id) + { + return PerformGet(id) != null; + } + + protected override IRedirectUrl PerformGet(int id) + { + var sql = GetBaseQuery(false).Where(x => x.Id == id); + var dto = Database.Fetch(sql).FirstOrDefault(); + return dto == null ? null : Map(dto); + } + + protected override IEnumerable PerformGetAll(params int[] ids) + { + if (ids.Length > 2000) + throw new NotSupportedException("This repository does not support more than 2000 ids."); + var sql = GetBaseQuery(false).WhereIn(x => x.Id, ids); + var dtos = Database.Fetch(sql); + return dtos.WhereNotNull().Select(Map); + } + + protected override IEnumerable PerformGetByQuery(IQuery query) + { + throw new NotSupportedException("This repository does not support this method."); + } + + protected override Sql GetBaseQuery(bool isCount) + { + var sql = new Sql(); + sql.Select(isCount ? "COUNT(*)" : "*").From(SqlSyntax); + return sql; + } + + protected override string GetBaseWhereClause() + { + return "id = @Id"; + } + + protected override IEnumerable GetDeleteClauses() + { + var list = new List + { + "DELETE FROM umbracoRedirectUrl WHERE id = @Id" + }; + return list; + } + + protected override Guid NodeObjectTypeId + { + get { throw new NotImplementedException(); } + } + + protected override void PersistNewItem(IRedirectUrl entity) + { + var dto = Map(entity); + Database.Insert(dto); + entity.Id = dto.Id; + } + + protected override void PersistUpdatedItem(IRedirectUrl entity) + { + var dto = Map(entity); + Database.Update(dto); + } + + private static RedirectUrlDto Map(IRedirectUrl redirectUrl) + { + if (redirectUrl == null) return null; + + return new RedirectUrlDto + { + Id = redirectUrl.Id, + ContentId = redirectUrl.ContentId, + CreateDateUtc = redirectUrl.CreateDateUtc, + Url = redirectUrl.Url + }; + } + + private static IRedirectUrl Map(RedirectUrlDto dto) + { + if (dto == null) return null; + + return new RedirectUrl + { + Id = dto.Id, + ContentId = dto.ContentId, + CreateDateUtc = dto.CreateDateUtc, + Url = dto.Url + }; + } + + public void DeleteAll() + { + Database.Execute("DELETE FROM umbracoContentUrl"); + } + + public void DeleteContentUrls(int contentId) + { + Database.Execute("DELETE FROM umbracoContentUrl WHERE contentId=@contentId", new { contentId }); + } + + public void Delete(int id) + { + Database.Delete(id); + } + + public IRedirectUrl GetMostRecentRule(string url) + { + var dtos = Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE url=@url ORDER BY createDateUtc DESC;", + new { url }); + var dto = dtos.FirstOrDefault(); + return dto == null ? null : Map(dto); + } + + public IEnumerable GetContentUrls(int contentId) + { + var dtos = Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE contentId=@id ORDER BY createDateUtc DESC;", + new { id = contentId }); + return dtos.Select(x => new RedirectUrl + { + Id = x.Id, + ContentId = x.ContentId, + CreateDateUtc = x.CreateDateUtc, + Url = x.Url + }); + } + + public IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total) + { + var sql = GetBaseQuery(false).OrderByDescending(x => x.CreateDateUtc, SqlSyntax); + var result = Database.Page(pageIndex + 1, pageSize, sql); + total = Convert.ToInt32(result.TotalItems); + + var rules = result.Items.Select(x => new RedirectUrl + { + Id = x.Id, + ContentId = x.ContentId, + CreateDateUtc = x.CreateDateUtc, + Url = x.Url + }); + return rules; + } + + public IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total) + { + var sql = GetBaseQuery(false) + .InnerJoin(SqlSyntax).On(SqlSyntax, left => left.NodeId, right => right.ContentId) + .Where("umbracoNode.path LIKE @path", new { path = "%," + rootContentId + ",%" }) + .OrderByDescending(x => x.CreateDateUtc, SqlSyntax); + var result = Database.Page(pageIndex + 1, pageSize, sql); + total = Convert.ToInt32(result.TotalItems); + + var rules = result.Items.Select(x => new RedirectUrl + { + Id = x.Id, + ContentId = x.ContentId, + CreateDateUtc = x.CreateDateUtc, + Url = x.Url + }); + return rules; + } + } +} diff --git a/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs b/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs index 20d3c38042..02794ef1fb 100644 --- a/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/ServerRegistrationRepository.cs @@ -25,7 +25,7 @@ namespace Umbraco.Core.Persistence.Repositories protected override int PerformCount(IQuery query) { - throw new NotSupportedException("This repository does not support this method"); + throw new NotSupportedException("This repository does not support this method."); } protected override bool PerformExists(int id) @@ -55,7 +55,7 @@ namespace Umbraco.Core.Persistence.Repositories protected override IEnumerable PerformGetByQuery(IQuery query) { - throw new NotSupportedException("This repository does not support this method"); + throw new NotSupportedException("This repository does not support this method."); } protected override Sql GetBaseQuery(bool isCount) diff --git a/src/Umbraco.Core/Persistence/RepositoryFactory.cs b/src/Umbraco.Core/Persistence/RepositoryFactory.cs index e2b2c2cc22..85eb00ea87 100644 --- a/src/Umbraco.Core/Persistence/RepositoryFactory.cs +++ b/src/Umbraco.Core/Persistence/RepositoryFactory.cs @@ -333,5 +333,14 @@ namespace Umbraco.Core.Persistence _logger, _sqlSyntax, containerObjectType); } + + public IRedirectUrlRepository CreateRedirectUrlRepository(IDatabaseUnitOfWork uow) + { + return new RedirectUrlRepository( + uow, + _cacheHelper, + _logger, + _sqlSyntax); + } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Services/IRedirectUrlService.cs b/src/Umbraco.Core/Services/IRedirectUrlService.cs index 88d010b8e0..6dd36d438c 100644 --- a/src/Umbraco.Core/Services/IRedirectUrlService.cs +++ b/src/Umbraco.Core/Services/IRedirectUrlService.cs @@ -5,20 +5,22 @@ namespace Umbraco.Core.Services { public interface IRedirectUrlService : IService { - void Save(RedirectUrl redirectUrl); + void Save(IRedirectUrl redirectUrl); + + void DeleteContentUrls(int contentId); + + void Delete(IRedirectUrl redirectUrl); void Delete(int id); - void DeleteContentRules(int contentId); - void DeleteAll(); - RedirectUrl GetMostRecentRule(string url); + IRedirectUrl GetMostRecentRule(string url); - IEnumerable GetRules(int contentId); + IEnumerable GetContentUrls(int contentId); - IEnumerable GetAllRules(long pageIndex, int pageSize, out long total); + IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total); - IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total); + IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total); } } diff --git a/src/Umbraco.Core/Services/RedirectUrlService.cs b/src/Umbraco.Core/Services/RedirectUrlService.cs index f2496a9e89..39c7fd0da5 100644 --- a/src/Umbraco.Core/Services/RedirectUrlService.cs +++ b/src/Umbraco.Core/Services/RedirectUrlService.cs @@ -15,41 +15,46 @@ namespace Umbraco.Core.Services : base(provider, repositoryFactory, logger, eventMessagesFactory) { } - public void Save(RedirectUrl redirectUrl) + public void Save(IRedirectUrl redirectUrl) { // check if the url already exists // the url actually is a primary key? // though we might want to keep the history? using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - var dto = new RedirectUrlDto - { - Id = redirectUrl.Id, - ContentId = redirectUrl.ContentId, - CreateDateUtc = redirectUrl.CreateDateUtc, - Url = redirectUrl.Url - }; - uow.Database.InsertOrUpdate(dto); + repo.AddOrUpdate(redirectUrl); + uow.Commit(); + } + } + + public void Delete(IRedirectUrl redirectUrl) + { + using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) + { + repo.Delete(redirectUrl); uow.Commit(); - redirectUrl.Id = dto.Id; } } public void Delete(int id) { using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - uow.Database.Execute("DELETE FROM umbracoContentUrlRule WHERE id=@id", new { id = id }); + repo.Delete(id); uow.Commit(); } } - public void DeleteContentRules(int contentId) + public void DeleteContentUrls(int contentId) { using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - uow.Database.Execute("DELETE FROM umbracoContentUrlRule WHERE contenId=@id", new { id = contentId }); + repo.DeleteContentUrls(contentId); uow.Commit(); } } @@ -57,85 +62,52 @@ namespace Umbraco.Core.Services public void DeleteAll() { using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - uow.Database.Execute("DELETE FROM umbracoContentUrlRule;"); + repo.DeleteAll(); uow.Commit(); } } - public RedirectUrl GetMostRecentRule(string url) + public IRedirectUrl GetMostRecentRule(string url) { using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE url=@url ORDER BY createDateUtc DESC;", - new { url }); - var ruleDto = ruleDtos.FirstOrDefault(); - var rule = ruleDto == null ? null : new RedirectUrl - { - Id = ruleDto.Id, - ContentId = ruleDto.ContentId, - CreateDateUtc = ruleDto.CreateDateUtc, - Url = ruleDto.Url - }; + var rule = repo.GetMostRecentRule(url); uow.Commit(); return rule; } } - public IEnumerable GetRules(int contentId) + public IEnumerable GetContentUrls(int contentId) { using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE contentId=@id ORDER BY createDateUtc DESC;", - new { id = contentId }); - var rules = ruleDtos.Select(x=> new RedirectUrl - { - Id = x.Id, - ContentId = x.ContentId, - CreateDateUtc = x.CreateDateUtc, - Url = x.Url - }); + var rules = repo.GetContentUrls(contentId); uow.Commit(); return rules; } } - public IEnumerable GetAllRules(long pageIndex, int pageSize, out long total) + public IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total) { using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - var ruleDtos = uow.Database.Fetch("SELECT * FROM umbracoContentUrlRule ORDER BY createDateUtc DESC;"); - var rules = ruleDtos.Select(x => new RedirectUrl - { - Id = x.Id, - ContentId = x.ContentId, - CreateDateUtc = x.CreateDateUtc, - Url = x.Url - }).ToArray(); - total = rules.Length; + var rules = repo.GetAllUrls(pageIndex, pageSize, out total); uow.Commit(); return rules; } } - public IEnumerable GetAllRules(int rootContentId, long pageIndex, int pageSize, out long total) + public IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total) { using (var uow = UowProvider.GetUnitOfWork()) + using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - var path = "%," + rootContentId + ",%"; - - var ruleDtos = uow.Database.Fetch(@"SELECT * FROM umbracoContentUrlRule -JOIN umbracoNode ON umbracoNode.id=umbracoContentUrlRule.contentId -WHERE umbracoNode.path LIKE @path -ORDER BY createDateUtc DESC;", new { path }); - var rules = ruleDtos.Select(x => new RedirectUrl - { - Id = x.Id, - ContentId = x.ContentId, - CreateDateUtc = x.CreateDateUtc, - Url = x.Url - }).ToArray(); - total = rules.Length; + var rules = repo.GetAllUrls(rootContentId, pageIndex, pageSize, out total); uow.Commit(); return rules; } diff --git a/src/Umbraco.Core/Services/ServiceContext.cs b/src/Umbraco.Core/Services/ServiceContext.cs index 10601a30fa..a18df0ade1 100644 --- a/src/Umbraco.Core/Services/ServiceContext.cs +++ b/src/Umbraco.Core/Services/ServiceContext.cs @@ -1,5 +1,4 @@ using System; -using log4net; using Umbraco.Core.Logging; using System.IO; using System.Linq; @@ -7,7 +6,6 @@ using Umbraco.Core.IO; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.UnitOfWork; using Umbraco.Core.Publishing; -using umbraco.interfaces; using Umbraco.Core.Events; namespace Umbraco.Core.Services @@ -64,6 +62,7 @@ namespace Umbraco.Core.Services private Lazy _memberGroupService; private Lazy _notificationService; private Lazy _externalLoginService; + private Lazy _redirectUrlService; /// /// public ctor - will generally just be used for unit testing all items are optional and if not specified, the defaults will be used @@ -93,6 +92,7 @@ namespace Umbraco.Core.Services /// /// /// + /// public ServiceContext( IContentService contentService = null, IMediaService mediaService = null, @@ -118,7 +118,8 @@ namespace Umbraco.Core.Services IMacroService macroService = null, IPublicAccessService publicAccessService = null, IExternalLoginService externalLoginService = null, - IMigrationEntryService migrationEntryService = null) + IMigrationEntryService migrationEntryService = null, + IRedirectUrlService redirectUrlService = null) { if (migrationEntryService != null) _migrationEntryService = new Lazy(() => migrationEntryService); if (externalLoginService != null) _externalLoginService = new Lazy(() => externalLoginService); @@ -145,6 +146,7 @@ namespace Umbraco.Core.Services if (taskService != null) _taskService = new Lazy(() => taskService); if (macroService != null) _macroService = new Lazy(() => macroService); if (publicAccessService != null) _publicAccessService = new Lazy(() => publicAccessService); + if (redirectUrlService != null) _redirectUrlService = new Lazy(() => redirectUrlService); } /// @@ -310,6 +312,8 @@ namespace Umbraco.Core.Services if (_memberGroupService == null) _memberGroupService = new Lazy(() => new MemberGroupService(provider, repositoryFactory, logger, eventMessagesFactory)); + if (_redirectUrlService == null) + _redirectUrlService = new Lazy(() => new RedirectUrlService(provider, repositoryFactory, logger, eventMessagesFactory)); } /// @@ -516,5 +520,13 @@ namespace Umbraco.Core.Services { get { return _externalLoginService.Value; } } + + /// + /// Gets the RedirectUrlService. + /// + public IRedirectUrlService RedirectUrlService + { + get { return _redirectUrlService.Value; } + } } } \ No newline at end of file diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 7af77f359a..1b3b8022f9 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -479,6 +479,7 @@ + From c916c09deee6298ceb96d3feaa354827893d93a1 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Sun, 12 Jun 2016 23:51:22 +1000 Subject: [PATCH 059/168] Add IContentFinder implementation. --- .../Routing/ContentFinderByRedirectUrl.cs | 67 +++++++++++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 1 + 2 files changed, 68 insertions(+) create mode 100644 src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs diff --git a/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs new file mode 100644 index 0000000000..0e112fdbe9 --- /dev/null +++ b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs @@ -0,0 +1,67 @@ +namespace Umbraco.Web.Routing +{ + using Umbraco.Core; + using Umbraco.Core.Logging; + + /// + /// Provides an implementation of that handles page url rewrites + /// that are stored when moving, saving, or deleting a node. + /// + /// + /// Assigns a permanent redirect notification to the request. + /// + public class ContentFinderByRedirectUrl : IContentFinder + { + /// + /// Tries to find and assign an Umbraco document to a PublishedContentRequest. + /// + /// The PublishedContentRequest. + /// A value indicating whether an Umbraco document was found and assigned. + /// Optionally, can also assign the template or anything else on the document request, although that is not required. + public bool TryFindContent(PublishedContentRequest contentRequest) + { + string route; + if (contentRequest.HasDomain) + { + route = contentRequest.UmbracoDomain.RootContentId + DomainHelper.PathRelativeToDomain(contentRequest.DomainUri, contentRequest.Uri.GetAbsolutePathDecoded()); + } + else + { + route = contentRequest.Uri.GetAbsolutePathDecoded(); + } + + return this.FindContent(contentRequest, route); + } + + /// + /// Tries to find an Umbraco document for a PublishedContentRequest and a route. + /// + /// The document request. + /// The route. + /// True if a redirect is to take place, otherwise; false. + protected bool FindContent(PublishedContentRequest contentRequest, string route) + { + var rule = contentRequest.RoutingContext + .UmbracoContext.Application.Services + .RedirectUrlService.GetMostRecentRule(route); + + if (rule != null) + { + var content = contentRequest.RoutingContext.UmbracoContext.ContentCache.GetById(rule.ContentId); + if (content != null) + { + var url = content.Url; + if (url != "#") + { + contentRequest.SetRedirectPermanent(url); + LogHelper.Debug("Got content, id={0}", () => content.Id); + return true; + } + } + } + + LogHelper.Debug("No match for the url: {0}.", () => route); + return false; + } + } +} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index de4b49bc77..3ca753db63 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -360,6 +360,7 @@ + From 2570a9139c2803826b4b8a7ebc48c68e473db46f Mon Sep 17 00:00:00 2001 From: Stephan Date: Sun, 12 Jun 2016 16:22:06 +0200 Subject: [PATCH 060/168] U4-8361 - service & repository --- .../Initial/DatabaseSchemaCreation.cs | 5 +- .../Interfaces/IRedirectUrlRepository.cs | 2 +- .../Repositories/RedirectUrlRepository.cs | 10 +- .../Services/RedirectUrlService.cs | 4 +- .../RedirectUrlRepositoryTests.cs | 216 ++++++++++++++++++ src/Umbraco.Tests/Umbraco.Tests.csproj | 1 + 6 files changed, 227 insertions(+), 11 deletions(-) create mode 100644 src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs index 0ae044d1ee..de9177cf8f 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs @@ -80,11 +80,12 @@ namespace Umbraco.Core.Persistence.Migrations.Initial {40, typeof (ServerRegistrationDto)}, {41, typeof (AccessDto)}, {42, typeof (AccessRuleDto)}, - {43, typeof(CacheInstructionDto)}, + {43, typeof (CacheInstructionDto)}, {44, typeof (ExternalLoginDto)}, {45, typeof (MigrationDto)}, {46, typeof (UmbracoDeployChecksumDto)}, - {47, typeof (UmbracoDeployDependencyDto)} + {47, typeof (UmbracoDeployDependencyDto)}, + {48, typeof (RedirectUrlDto) } }; #endregion diff --git a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs index 9608c55e4c..31918fb052 100644 --- a/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/Interfaces/IRedirectUrlRepository.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Repositories void Delete(int id); void DeleteAll(); void DeleteContentUrls(int contentId); - IRedirectUrl GetMostRecentRule(string url); + IRedirectUrl GetMostRecentUrl(string url); IEnumerable GetContentUrls(int contentId); IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total); IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total); diff --git a/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs index e33ba82f63..1c767e79cc 100644 --- a/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs +++ b/src/Umbraco.Core/Persistence/Repositories/RedirectUrlRepository.cs @@ -114,12 +114,12 @@ namespace Umbraco.Core.Persistence.Repositories public void DeleteAll() { - Database.Execute("DELETE FROM umbracoContentUrl"); + Database.Execute("DELETE FROM umbracoRedirectUrl"); } public void DeleteContentUrls(int contentId) { - Database.Execute("DELETE FROM umbracoContentUrl WHERE contentId=@contentId", new { contentId }); + Database.Execute("DELETE FROM umbracoRedirectUrl WHERE contentId=@contentId", new { contentId }); } public void Delete(int id) @@ -127,9 +127,9 @@ namespace Umbraco.Core.Persistence.Repositories Database.Delete(id); } - public IRedirectUrl GetMostRecentRule(string url) + public IRedirectUrl GetMostRecentUrl(string url) { - var dtos = Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE url=@url ORDER BY createDateUtc DESC;", + var dtos = Database.Fetch("SELECT * FROM umbracoRedirectUrl WHERE url=@url ORDER BY createDateUtc DESC;", new { url }); var dto = dtos.FirstOrDefault(); return dto == null ? null : Map(dto); @@ -137,7 +137,7 @@ namespace Umbraco.Core.Persistence.Repositories public IEnumerable GetContentUrls(int contentId) { - var dtos = Database.Fetch("SELECT * FROM umbracoContentUrlRule WHERE contentId=@id ORDER BY createDateUtc DESC;", + var dtos = Database.Fetch("SELECT * FROM umbracoRedirectUrl WHERE contentId=@id ORDER BY createDateUtc DESC;", new { id = contentId }); return dtos.Select(x => new RedirectUrl { diff --git a/src/Umbraco.Core/Services/RedirectUrlService.cs b/src/Umbraco.Core/Services/RedirectUrlService.cs index 39c7fd0da5..c2879fac24 100644 --- a/src/Umbraco.Core/Services/RedirectUrlService.cs +++ b/src/Umbraco.Core/Services/RedirectUrlService.cs @@ -1,9 +1,7 @@ using System.Collections.Generic; -using System.Linq; using Umbraco.Core.Events; using Umbraco.Core.Logging; using Umbraco.Core.Models; -using Umbraco.Core.Models.Rdbms; using Umbraco.Core.Persistence; using Umbraco.Core.Persistence.UnitOfWork; @@ -74,7 +72,7 @@ namespace Umbraco.Core.Services using (var uow = UowProvider.GetUnitOfWork()) using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) { - var rule = repo.GetMostRecentRule(url); + var rule = repo.GetMostRecentUrl(url); uow.Commit(); return rule; } diff --git a/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs b/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs new file mode 100644 index 0000000000..c511ed21da --- /dev/null +++ b/src/Umbraco.Tests/Persistence/Repositories/RedirectUrlRepositoryTests.cs @@ -0,0 +1,216 @@ +using System; +using System.Linq; +using NUnit.Framework; +using Umbraco.Core; +using Umbraco.Core.Models; +using Umbraco.Core.Persistence.Repositories; +using Umbraco.Core.Persistence.UnitOfWork; +using Umbraco.Tests.TestHelpers; +using Umbraco.Tests.TestHelpers.Entities; + +namespace Umbraco.Tests.Persistence.Repositories +{ + [DatabaseTestBehavior(DatabaseBehavior.NewDbFileAndSchemaPerTest)] + [TestFixture] + public class RedirectUrlRepositoryTests : BaseDatabaseFactoryTest + { + [SetUp] + public override void Initialize() + { + base.Initialize(); + CreateTestData(); + } + + [TearDown] + public override void TearDown() + { + base.TearDown(); + } + + [Test] + public void CanSaveAndGet() + { + var provider = new PetaPocoUnitOfWorkProvider(Logger); + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + var rurl = new RedirectUrl + { + ContentId = _textpage.Id, + Url = "blah" + }; + repo.AddOrUpdate(rurl); + uow.Commit(); + + Assert.AreNotEqual(0, rurl.Id); + } + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + var rurl = repo.GetMostRecentUrl("blah"); + uow.Commit(); + + Assert.IsNotNull(rurl); + Assert.AreEqual(_textpage.Id, rurl.ContentId); + } + } + + [Test] + public void CanSaveAndGetMostRecent() + { + var provider = new PetaPocoUnitOfWorkProvider(Logger); + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + var rurl = new RedirectUrl + { + ContentId = _textpage.Id, + Url = "blah" + }; + repo.AddOrUpdate(rurl); + uow.Commit(); + + Assert.AreNotEqual(0, rurl.Id); + + rurl = new RedirectUrl + { + ContentId = _otherpage.Id, + Url = "blah" + }; + repo.AddOrUpdate(rurl); + uow.Commit(); + + Assert.AreNotEqual(0, rurl.Id); + } + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + var rurl = repo.GetMostRecentUrl("blah"); + uow.Commit(); + + Assert.IsNotNull(rurl); + Assert.AreEqual(_otherpage.Id, rurl.ContentId); + } + } + + [Test] + public void CanSaveAndGetByContent() + { + var provider = new PetaPocoUnitOfWorkProvider(Logger); + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + var rurl = new RedirectUrl + { + ContentId = _textpage.Id, + Url = "blah" + }; + repo.AddOrUpdate(rurl); + uow.Commit(); + + Assert.AreNotEqual(0, rurl.Id); + + rurl = new RedirectUrl + { + ContentId = _textpage.Id, + Url = "durg" + }; + repo.AddOrUpdate(rurl); + uow.Commit(); + + Assert.AreNotEqual(0, rurl.Id); + } + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + var rurls = repo.GetContentUrls(_textpage.Id).ToArray(); + uow.Commit(); + + Assert.AreEqual(2, rurls.Length); + Assert.AreEqual("durg", rurls[0].Url); + Assert.AreEqual("blah", rurls[1].Url); + } + } + + [Test] + public void CanSaveAndDelete() + { + var provider = new PetaPocoUnitOfWorkProvider(Logger); + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + var rurl = new RedirectUrl + { + ContentId = _textpage.Id, + Url = "blah" + }; + repo.AddOrUpdate(rurl); + uow.Commit(); + + Assert.AreNotEqual(0, rurl.Id); + + rurl = new RedirectUrl + { + ContentId = _otherpage.Id, + Url = "durg" + }; + repo.AddOrUpdate(rurl); + uow.Commit(); + + Assert.AreNotEqual(0, rurl.Id); + } + + using (var uow = provider.GetUnitOfWork()) + using (var repo = CreateRepository(uow)) + { + repo.DeleteContentUrls(_textpage.Id); + uow.Commit(); + + var rurls = repo.GetContentUrls(_textpage.Id); + + Assert.AreEqual(0, rurls.Count()); + } + } + + private IRedirectUrlRepository CreateRepository(IDatabaseUnitOfWork uow) + { + return new RedirectUrlRepository(uow, CacheHelper.CreateDisabledCacheHelper(), Logger, SqlSyntax); + } + + private IContent _textpage, _subpage, _otherpage, _trashed; + + public void CreateTestData() + { + //Create and Save ContentType "umbTextpage" -> (NodeDto.NodeIdSeed) + var contentType = MockedContentTypes.CreateSimpleContentType("umbTextpage", "Textpage"); + contentType.Key = new Guid("1D3A8E6E-2EA9-4CC1-B229-1AEE19821522"); + ServiceContext.ContentTypeService.Save(contentType); + + //Create and Save Content "Homepage" based on "umbTextpage" -> (NodeDto.NodeIdSeed + 1) + _textpage = MockedContent.CreateSimpleContent(contentType); + _textpage.Key = new Guid("B58B3AD4-62C2-4E27-B1BE-837BD7C533E0"); + ServiceContext.ContentService.Save(_textpage, 0); + + //Create and Save Content "Text Page 1" based on "umbTextpage" -> (NodeDto.NodeIdSeed + 2) + _subpage = MockedContent.CreateSimpleContent(contentType, "Text Page 1", _textpage.Id); + _subpage.Key = new Guid("FF11402B-7E53-4654-81A7-462AC2108059"); + ServiceContext.ContentService.Save(_subpage, 0); + + //Create and Save Content "Text Page 1" based on "umbTextpage" -> (NodeDto.NodeIdSeed + 3) + _otherpage = MockedContent.CreateSimpleContent(contentType, "Text Page 2", _textpage.Id); + ServiceContext.ContentService.Save(_otherpage, 0); + + //Create and Save Content "Text Page Deleted" based on "umbTextpage" -> (NodeDto.NodeIdSeed + 4) + _trashed = MockedContent.CreateSimpleContent(contentType, "Text Page Deleted", -20); + ((Content) _trashed).Trashed = true; + ServiceContext.ContentService.Save(_trashed, 0); + } + } +} diff --git a/src/Umbraco.Tests/Umbraco.Tests.csproj b/src/Umbraco.Tests/Umbraco.Tests.csproj index d8657cc515..765ded480c 100644 --- a/src/Umbraco.Tests/Umbraco.Tests.csproj +++ b/src/Umbraco.Tests/Umbraco.Tests.csproj @@ -177,6 +177,7 @@ + From 7c49bb4acadcaea1986c332e7d7a0be6eecbbfc1 Mon Sep 17 00:00:00 2001 From: Marc Goodson Date: Sun, 12 Jun 2016 16:54:13 +0100 Subject: [PATCH 061/168] Event Handler to wire up to publishing and moving events to track Url changes, and then create appropriate 301 redirects using the new RedirectUrlService to maintain google juice --- .../Redirects/RedirectTrackingEventHandler.cs | 123 ++++++++++++++++++ src/Umbraco.Web/Umbraco.Web.csproj | 1 + 2 files changed, 124 insertions(+) create mode 100644 src/Umbraco.Web/Redirects/RedirectTrackingEventHandler.cs diff --git a/src/Umbraco.Web/Redirects/RedirectTrackingEventHandler.cs b/src/Umbraco.Web/Redirects/RedirectTrackingEventHandler.cs new file mode 100644 index 0000000000..6bc5259850 --- /dev/null +++ b/src/Umbraco.Web/Redirects/RedirectTrackingEventHandler.cs @@ -0,0 +1,123 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Umbraco.Core; +using Umbraco.Core.Models; +using Umbraco.Core.Services; +using Umbraco.Core.Strings; + +namespace Umbraco.Web.Redirects +{ + //when content is renamed or moved, we want to create a permanent 301 redirect from it's old url + public class RedirectTrackingEventHandler : ApplicationEventHandler + { + protected override void ApplicationStarting + (UmbracoApplicationBase umbracoApplication, + ApplicationContext applicationContext) + { + //create a redirect if the item is published + // on the publishing event the previous Url won't have been updated in the cache yet + ContentService.Publishing += ContentService_Publishing; + + // create a redirect if the item is being moved + ContentService.Moving += ContentService_Moving; + + //rolled back items have to be published, so publishing will take care of that + + // do we want to do anything if a content item is unpublished or deleted ? + // eg. remove any redirects to the node or associated redirects created by previous nodes + // for now it will just 404 which is correct I think + } + private void ContentService_Publishing(Core.Publishing.IPublishingStrategy sender, Core.Events.PublishEventArgs e) + { + foreach (var publishedEntity in e.PublishedEntities) + { + CreateRedirectsIfUrlHasChanged(publishedEntity); + } + } + private void ContentService_Moving(IContentService sender, Core.Events.MoveEventArgs e) + { + var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current); + var redirectUrlService = ApplicationContext.Current.Services.RedirectUrlService; + + foreach (var moveEventInfo in e.MoveInfoCollection) + { + var entityBeingMoved = moveEventInfo.Entity; + //entity hasn't moved yet so current Url is ? + var currentUrl = umbracoHelper.Url(moveEventInfo.Entity.Id); + if (!String.IsNullOrWhiteSpace(currentUrl) && currentUrl != "/") + { + //create redirectUrl + var redirectUrl = new RedirectUrl() + { + ContentId = entityBeingMoved.Id, + Url = currentUrl, + CreateDateUtc = DateTime.UtcNow + }; + redirectUrlService.Save(redirectUrl); + + // has the moved item got descendants ? + CreateRedirectsForDescendants(entityBeingMoved); + } + + // thoughts + // is the entity being moved from the recycle bin ? + } + } + private void CreateRedirectsIfUrlHasChanged(IContent entity) + { + var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current); + var redirectUrlService = ApplicationContext.Current.Services.RedirectUrlService; + //url won't have changed in the cache yet + var currentUrl = umbracoHelper.UrlAbsolute(entity.Id); + if (!String.IsNullOrWhiteSpace(currentUrl)) + { + //get last segment of current url + var currentUri = new Uri(currentUrl); + var currentLastSegment = (currentUri != null && currentUri.Segments.Any()) ? currentUri.Segments.LastOrDefault().Replace("/", "") : String.Empty; + // get segment of update entity + var updatedUrlSegment = entity.GetUrlSegment(); + if (!String.IsNullOrWhiteSpace(currentLastSegment) && !currentLastSegment.InvariantEquals(updatedUrlSegment)) + { + //url has changed... + //create redirectUrl + var redirectUrl = new RedirectUrl() + { + ContentId = entity.Id, + Url = currentUrl, + CreateDateUtc = DateTime.UtcNow + }; + //create redirect for any descendants + CreateRedirectsForDescendants(entity); + } + } + } + private void CreateRedirectsForDescendants(IContent entity) + { + var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current); + var redirectUrlService = ApplicationContext.Current.Services.RedirectUrlService; + var descendants = entity.Descendants(); + if (descendants.Any()) + { + foreach (var descendant in descendants) + { + // create redirect url for each descendant item + var currentUrl = umbracoHelper.Url(descendant.Id); + if (!String.IsNullOrWhiteSpace(currentUrl)) + { + //create redirectUrl + var redirectUrl = new RedirectUrl() + { + ContentId = descendant.Id, + Url = currentUrl, + CreateDateUtc = DateTime.UtcNow + }; + + } + } + } + } + } +} diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index 3ca753db63..18a4ded950 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -358,6 +358,7 @@ + From 7cfead45a6fe74fc4df27d5f3b22a15d5007b712 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Mon, 13 Jun 2016 03:30:54 +1000 Subject: [PATCH 062/168] Fix #U4-8583 Add styles to the hacks.less file that fixes all pre and code samples within the back office. --- src/Umbraco.Web.UI.Client/src/less/hacks.less | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/Umbraco.Web.UI.Client/src/less/hacks.less b/src/Umbraco.Web.UI.Client/src/less/hacks.less index fb809af015..716cb40256 100644 --- a/src/Umbraco.Web.UI.Client/src/less/hacks.less +++ b/src/Umbraco.Web.UI.Client/src/less/hacks.less @@ -173,3 +173,49 @@ iframe, .content-column-body { .pa-form + .pa-form { margin-top: 10px; } + + +// The below adds a default selector to all pre elements to ensure that styles are applied +// without having to add the class ".code" to the element. Styles have been created by +// combining the various declarations from the Bootstrap code.less file and fixing some mistakes +// in Bootstrap 2. +// This fixes issues with the markdown editor preview and should not cause issues with any other editor. + +// Inline code +// 1: Revert border radius to match look and feel of 7.4+ +code{ + .border-radius(@baseBorderRadius); // 1 +} + +// Blocks of code +// 1: Wrapping code is unreadable on small devices. +pre { + display: block; + padding: (@baseLineHeight - 1) / 2; + margin: 0 0 @baseLineHeight / 2; + #font > #family > .monospace; + font-size: @baseFontSize - 1; // 14px to 13px + color: @grayDark; + line-height: @baseLineHeight; + white-space: pre; // 1 + overflow-x: auto; // 1 + background-color: #f5f5f5; + border: 1px solid #ccc; // fallback for IE7-8 + border: 1px solid rgba(0,0,0,.15); + .border-radius(@baseBorderRadius); + + + // Make prettyprint styles more spaced out for readability + &.prettyprint { + margin-bottom: @baseLineHeight; + } + + // Account for some code outputs that place code tags in pre tags + code { + padding: 0; + white-space: pre; // 1 + word-wrap: normal; // 1 + background-color: transparent; + border: 0; + } +} \ No newline at end of file From e231206555cf6001a64b639d72e95f2183dbdda8 Mon Sep 17 00:00:00 2001 From: Stephan Date: Sun, 12 Jun 2016 19:47:11 +0200 Subject: [PATCH 063/168] U4-8361 - bugfix, get finder to work --- .../Configuration/UmbracoVersion.cs | 2 +- .../AddRedirectUrlTable.cs | 5 +- .../Services/IRedirectUrlService.cs | 10 +-- .../Services/RedirectUrlService.cs | 10 +-- .../Routing/ContentFinderByRedirectUrl.cs | 64 +++++++------------ src/Umbraco.Web/WebBootManager.cs | 2 + 6 files changed, 40 insertions(+), 53 deletions(-) diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 762d3da59c..7fc03df6eb 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration /// Gets the version comment (like beta or RC). /// /// The version comment. - public static string CurrentComment { get { return ""; } } + public static string CurrentComment { get { return "alpha002"; } } // 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 diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs index 43c2da780b..56e423ebaf 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFiveZero/AddRedirectUrlTable.cs @@ -24,13 +24,14 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFiveZer .WithColumn("createDateUtc").AsDateTime().NotNullable() .WithColumn("url").AsString(2048).NotNullable(); - Create.PrimaryKey("PK_umbracoRedirectUrl").OnTable("umbracoRedirectUrl").Columns(new[] { "id" }); + //Create.PrimaryKey("PK_umbracoRedirectUrl").OnTable("umbracoRedirectUrl").Columns(new[] { "id" }); Create.Index("IX_umbracoRedirectUrl").OnTable("umbracoRedirectUrl") .OnColumn("url") .Ascending() .OnColumn("createDateUtc") - .Ascending(); + .Ascending() + .WithOptions().NonClustered(); } public override void Down() diff --git a/src/Umbraco.Core/Services/IRedirectUrlService.cs b/src/Umbraco.Core/Services/IRedirectUrlService.cs index 6dd36d438c..e7c60c7d5a 100644 --- a/src/Umbraco.Core/Services/IRedirectUrlService.cs +++ b/src/Umbraco.Core/Services/IRedirectUrlService.cs @@ -7,7 +7,7 @@ namespace Umbraco.Core.Services { void Save(IRedirectUrl redirectUrl); - void DeleteContentUrls(int contentId); + void DeleteContentRedirectUrls(int contentId); void Delete(IRedirectUrl redirectUrl); @@ -15,12 +15,12 @@ namespace Umbraco.Core.Services void DeleteAll(); - IRedirectUrl GetMostRecentRule(string url); + IRedirectUrl GetMostRecentRedirectUrl(string url); - IEnumerable GetContentUrls(int contentId); + IEnumerable GetContentRedirectUrls(int contentId); - IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total); + IEnumerable GetAllRedirectUrls(long pageIndex, int pageSize, out long total); - IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total); + IEnumerable GetAllRedirectUrls(int rootContentId, long pageIndex, int pageSize, out long total); } } diff --git a/src/Umbraco.Core/Services/RedirectUrlService.cs b/src/Umbraco.Core/Services/RedirectUrlService.cs index c2879fac24..9316e00b6f 100644 --- a/src/Umbraco.Core/Services/RedirectUrlService.cs +++ b/src/Umbraco.Core/Services/RedirectUrlService.cs @@ -47,7 +47,7 @@ namespace Umbraco.Core.Services } } - public void DeleteContentUrls(int contentId) + public void DeleteContentRedirectUrls(int contentId) { using (var uow = UowProvider.GetUnitOfWork()) using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) @@ -67,7 +67,7 @@ namespace Umbraco.Core.Services } } - public IRedirectUrl GetMostRecentRule(string url) + public IRedirectUrl GetMostRecentRedirectUrl(string url) { using (var uow = UowProvider.GetUnitOfWork()) using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) @@ -78,7 +78,7 @@ namespace Umbraco.Core.Services } } - public IEnumerable GetContentUrls(int contentId) + public IEnumerable GetContentRedirectUrls(int contentId) { using (var uow = UowProvider.GetUnitOfWork()) using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) @@ -89,7 +89,7 @@ namespace Umbraco.Core.Services } } - public IEnumerable GetAllUrls(long pageIndex, int pageSize, out long total) + public IEnumerable GetAllRedirectUrls(long pageIndex, int pageSize, out long total) { using (var uow = UowProvider.GetUnitOfWork()) using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) @@ -100,7 +100,7 @@ namespace Umbraco.Core.Services } } - public IEnumerable GetAllUrls(int rootContentId, long pageIndex, int pageSize, out long total) + public IEnumerable GetAllRedirectUrls(int rootContentId, long pageIndex, int pageSize, out long total) { using (var uow = UowProvider.GetUnitOfWork()) using (var repo = RepositoryFactory.CreateRedirectUrlRepository(uow)) diff --git a/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs index 0e112fdbe9..aa68922f21 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByRedirectUrl.cs @@ -1,8 +1,8 @@ -namespace Umbraco.Web.Routing -{ - using Umbraco.Core; - using Umbraco.Core.Logging; +using Umbraco.Core; +using Umbraco.Core.Logging; +namespace Umbraco.Web.Routing +{ /// /// Provides an implementation of that handles page url rewrites /// that are stored when moving, saving, or deleting a node. @@ -20,48 +20,32 @@ /// Optionally, can also assign the template or anything else on the document request, although that is not required. public bool TryFindContent(PublishedContentRequest contentRequest) { - string route; - if (contentRequest.HasDomain) + var route = contentRequest.HasDomain + ? contentRequest.UmbracoDomain.RootContentId + DomainHelper.PathRelativeToDomain(contentRequest.DomainUri, contentRequest.Uri.GetAbsolutePathDecoded()) + : contentRequest.Uri.GetAbsolutePathDecoded(); + + var service = contentRequest.RoutingContext.UmbracoContext.Application.Services.RedirectUrlService; + var redirectUrl = service.GetMostRecentRedirectUrl(route); + + if (redirectUrl == null) { - route = contentRequest.UmbracoDomain.RootContentId + DomainHelper.PathRelativeToDomain(contentRequest.DomainUri, contentRequest.Uri.GetAbsolutePathDecoded()); - } - else - { - route = contentRequest.Uri.GetAbsolutePathDecoded(); + LogHelper.Debug("No match for route: \"{0}\".", () => route); + return false; } - return this.FindContent(contentRequest, route); - } - - /// - /// Tries to find an Umbraco document for a PublishedContentRequest and a route. - /// - /// The document request. - /// The route. - /// True if a redirect is to take place, otherwise; false. - protected bool FindContent(PublishedContentRequest contentRequest, string route) - { - var rule = contentRequest.RoutingContext - .UmbracoContext.Application.Services - .RedirectUrlService.GetMostRecentRule(route); - - if (rule != null) + var content = contentRequest.RoutingContext.UmbracoContext.ContentCache.GetById(redirectUrl.ContentId); + var url = content == null ? "#" : content.Url; + if (url.StartsWith("#")) { - var content = contentRequest.RoutingContext.UmbracoContext.ContentCache.GetById(rule.ContentId); - if (content != null) - { - var url = content.Url; - if (url != "#") - { - contentRequest.SetRedirectPermanent(url); - LogHelper.Debug("Got content, id={0}", () => content.Id); - return true; - } - } + LogHelper.Debug("Route \"{0}\" matches content {1} which has no url.", + () => route, () => redirectUrl.ContentId); + return false; } - LogHelper.Debug("No match for the url: {0}.", () => route); - return false; + LogHelper.Debug("Route \"{0}\" matches content {1} with url \"{2}\", redirecting.", + () => route, () => content.Id, () => url); + contentRequest.SetRedirectPermanent(url); + return true; } } } diff --git a/src/Umbraco.Web/WebBootManager.cs b/src/Umbraco.Web/WebBootManager.cs index 93928d0867..06f47abe81 100644 --- a/src/Umbraco.Web/WebBootManager.cs +++ b/src/Umbraco.Web/WebBootManager.cs @@ -514,6 +514,8 @@ namespace Umbraco.Web //typeof (ContentFinderByProfile), //typeof (ContentFinderByUrlAlias), + typeof(ContentFinderByRedirectUrl), // fixme - position? + // implement INotFoundHandler support... remove once we get rid of it typeof(ContentFinderByNotFoundHandlers) ); From 5a32e1a2945b31479bf12eb2bdfcbd4f928ce23a Mon Sep 17 00:00:00 2001 From: Shannon Date: Sun, 12 Jun 2016 21:39:29 +0200 Subject: [PATCH 064/168] package tree is basically done, got the editor updated to work with the server data to display the initial screen and details --- .../ourpackagerrepository.resource.js | 48 ++ .../src/views/packager/category.html | 4 +- .../src/views/packager/overview.controller.js | 8 +- .../views/packager/views/repo.controller.js | 442 +++++++++--------- .../src/views/packager/views/repo.html | 31 +- .../Trees/PackagesTreeController.cs | 12 + .../developer/Packages/editPackage.aspx.cs | 4 +- 7 files changed, 315 insertions(+), 234 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js diff --git a/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js new file mode 100644 index 0000000000..fec6a75925 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/common/resources/ourpackagerrepository.resource.js @@ -0,0 +1,48 @@ +/** + * @ngdoc service + * @name umbraco.resources.ourPackageRepositoryResource + * @description handles data for package installations + **/ +function ourPackageRepositoryResource($q, $http, umbDataFormatter, umbRequestHelper) { + + var baseurl = "http://localhost:24292/webapi/packages/v1"; + + return { + + getDetails: function (packageId) { + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/getdetails/" + packageId), + 'Failed to get package details'); + }, + + getCategories: function () { + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/getcategories"), + 'Failed to query packages'); + }, + + getPopular: function (maxResults) { + + if (maxResults === undefined) { + maxResults = 10; + } + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/GetPopular?maxResults=" + maxResults), + 'Failed to query packages'); + }, + + getLatest: function (pageIndex, pageSize, category) { + + return umbRequestHelper.resourcePromise( + $http.get(baseurl + "/GetLatest?pageIndex=" + pageIndex + "&pageSize=" + pageSize + "&category=" + category), + 'Failed to query packages'); + } + + + }; +} + +angular.module('umbraco.resources').factory('ourPackageRepositoryResource', ourPackageRepositoryResource); diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/category.html b/src/Umbraco.Web.UI.Client/src/views/packager/category.html index a012264d75..d408b21cd9 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/category.html +++ b/src/Umbraco.Web.UI.Client/src/views/packager/category.html @@ -51,7 +51,7 @@ {{ package.downloads }} - {{ package.karma }} + {{ package.ownerInfo.karma }}
@@ -82,7 +82,7 @@ {{ package.downloads }} - {{ package.karma }} + {{ package.ownerInfo.karma }}
diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js index 487a715042..5cf6e6bc07 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packager/overview.controller.js @@ -11,22 +11,22 @@ { "name": "Packages", "icon": "icon-cloud", - "view": "views/packagesNew/views/repo.html", + "view": "views/packager/views/repo.html", "active": true }, { "name": "Installed", "icon": "icon-box", - "view": "views/packagesNew/views/installed.html" + "view": "views/packager/views/installed.html" }, { "name": "Install local", "icon": "icon-add", - "view": "views/packagesNew/views/install-local.html" + "view": "views/packager/views/install-local.html" } ]; - $timeout(function() { + $timeout(function () { navigationService.syncTree({ tree: "packager", path: "-1" }); }); diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js index a69cd3f175..61383b12bf 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.controller.js @@ -1,7 +1,7 @@ (function () { "use strict"; - function PackagesRepoController($scope, $route, $location, $timeout) { + function PackagesRepoController($scope, $route, $location, $timeout, ourPackageRepositoryResource, $q) { var vm = this; @@ -9,7 +9,8 @@ vm.loading = false; vm.pagination = { pageNumber: 1, - totalPages: 10 + totalPages: 10, + pageSize: 12 }; vm.selectCategory = selectCategory; @@ -19,221 +20,235 @@ vm.prevPage = prevPage; vm.goToPage = goToPage; + //vm.categories = [ + // { + // "id": 1, + // "icon": "icon-male-and-female", + // "name": "All", + // "active": true + // }, + // { + // "icon": "icon-male-and-female", + // "name": "Collaboration" + // }, + // { + // "id": 2, + // "icon": "icon-molecular-network", + // "name": "Backoffice extensions" + // }, + // { + // "id": 3, + // "icon": "icon-brackets", + // "name": "Developer tools" + // }, + // { + // "id": 4, + // "icon": "icon-wand", + // "name": "Starter kits" + // }, + // { + // "id": 5, + // "icon": "icon-medal", + // "name": "Umbraco Pro" + // }, + // { + // "id": 6, + // "icon": "icon-wrench", + // "name": "Website utilities" + // } + //]; - vm.categories = [ - { - "id": 1, - "icon": "icon-male-and-female", - "name": "All", - "active": true - }, - { - "icon": "icon-male-and-female", - "name": "Collaboration" - }, - { - "id": 2, - "icon": "icon-molecular-network", - "name": "Backoffice extensions" - }, - { - "id": 3, - "icon": "icon-brackets", - "name": "Developer tools" - }, - { - "id": 4, - "icon": "icon-wand", - "name": "Starter kits" - }, - { - "id": 5, - "icon": "icon-medal", - "name": "Umbraco Pro" - }, - { - "id": 6, - "icon": "icon-wrench", - "name": "Website utilities" - } - ]; + //vm.packages = [ + // { + // "id": 1, + // "name": "uSightly", + // "description": "An HTML5 audio player based on jPlayer", + // "karma": "1", + // "downloads": "1672", + // "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 2, + // "name": "Kill IE6", + // "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + // "karma": "11", + // "downloads": "688", + // "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 3, + // "name": "Examine Media Indexer", + // "description": "CogUmbracoExamineMediaIndexer", + // "karma": "3", + // "downloads": "1329", + // "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 4, + // "name": "SVG Icon Picker", + // "description": "A picker, for picking icons from an SVG spritesheet.", + // "karma": "5", + // "downloads": "8", + // "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 5, + // "name": "Pipeline CRM", + // "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + // "karma": "3", + // "downloads": "105", + // "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 6, + // "name": "uSightly", + // "description": "An HTML5 audio player based on jPlayer", + // "karma": "1", + // "downloads": "1672", + // "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 7, + // "name": "Kill IE6", + // "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", + // "karma": "11", + // "downloads": "688", + // "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 8, + // "name": "Examine Media Indexer", + // "description": "CogUmbracoExamineMediaIndexer", + // "karma": "3", + // "downloads": "1329", + // "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 9, + // "name": "SVG Icon Picker", + // "description": "A picker, for picking icons from an SVG spritesheet.", + // "karma": "5", + // "downloads": "8", + // "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" + // }, + // { + // "id": 10, + // "name": "Pipeline CRM", + // "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", + // "karma": "3", + // "downloads": "105", + // "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" + // } + //]; - vm.packages = [ - { - "id": 1, - "name": "uSightly", - "description": "An HTML5 audio player based on jPlayer", - "karma": "1", - "downloads": "1672", - "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 2, - "name": "Kill IE6", - "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", - "karma": "11", - "downloads": "688", - "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 3, - "name": "Examine Media Indexer", - "description": "CogUmbracoExamineMediaIndexer", - "karma": "3", - "downloads": "1329", - "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 4, - "name": "SVG Icon Picker", - "description": "A picker, for picking icons from an SVG spritesheet.", - "karma": "5", - "downloads": "8", - "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 5, - "name": "Pipeline CRM", - "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", - "karma": "3", - "downloads": "105", - "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 6, - "name": "uSightly", - "description": "An HTML5 audio player based on jPlayer", - "karma": "1", - "downloads": "1672", - "icon":"https://our.umbraco.org/media/wiki/150283/635768313097111400_usightlylogopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 7, - "name": "Kill IE6", - "description": "A simple port of the IE6 warning script (http://code.google.com/p/ie6-upgrade-warning/) to use in your Umbraco websites.", - "karma": "11", - "downloads": "688", - "icon":"https://our.umbraco.org/media/wiki/9138/634697622367666000_offroadcode-100x100.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 8, - "name": "Examine Media Indexer", - "description": "CogUmbracoExamineMediaIndexer", - "karma": "3", - "downloads": "1329", - "icon":"https://our.umbraco.org/media/wiki/50703/634782902373558000_cogworks.jpg?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 9, - "name": "SVG Icon Picker", - "description": "A picker, for picking icons from an SVG spritesheet.", - "karma": "5", - "downloads": "8", - "icon":"https://our.umbraco.org/media/wiki/154472/635997115126742822_logopng.png?bgcolor=fff&height=154&width=281&format=png" - }, - { - "id": 10, - "name": "Pipeline CRM", - "description": "Pipeline is a social CRM that lives in Umbraco back-office. It tracks opportunities and helps teams collaborate with timelines and tasks. It stores information about your customers and your interactions with them. It integrates with your website, capturing opportunities from forms and powering personal portals.", - "karma": "3", - "downloads": "105", - "icon":"https://our.umbraco.org/media/wiki/152476/635917291068518788_pipeline-crm-logopng.png?bgcolor=fff&height=154&width=281&format=png" - } - ]; - - vm.package = { - "name": "Merchello", - "description": "<p>Merchello is a high performance, designer friendly, open source Umbraco ecommerce package built for the store owner.</p> <p><strong>What Merchello does for you</strong></p> <p>In version 1, Merchello supports a large variety of products with options that can be attached to a single warehouse, processes orders, manages taxes and shipping, and sends out email notifications to your customers. The beauty of Merchello is that while it oversees all of your products, orders, and store settings, it allows Umbraco to maintain your content. This seamless integration gives you the flexibility to build your store in any way imagineable on a robust platform capable of handling a wide variety of store sizes.</p> <p><strong>Find out more on our website</strong></p> <p><strong><a href="https://merchello.com">https://merchello.com</a></strong></p> <p><strong>Contribute</strong></p> <p>We would love and need your help. If you want to contribute to Merchello's core, the easiest way to get started is to fork the project on https://github.com/merchello/Merchello and open src/Merchello.sln in Visual Studio. We're excited to see what you do!</p> <p><strong>Starter Kit</strong></p> <p>We have built a simple starter kit for Merchello called Bazaar, and you can download it below in the package files tab.</p>", - "compatibility": [ - { - "version": "7.4.x", - "percentage": "100" - }, - { - "version": "7.3.x", - "percentage": "86" - }, - { - "version": "7.2.x", - "percentage": "93" - }, - { - "version": "7.1.x", - "percentage": "100" - } - ], - "information": { - "owner": "Rusty Swayne", - "ownerAvatar": "https://our.umbraco.org/media/upload/d476d257-a494-46d9-9a00-56c2f94a55c8/our-profile.jpg?width=200&height=200&mode=crop", - "ownerKarma": "2673", - "contributors": [ - { - "name": "Lee" - }, - { - "name": "Jason Prothero" - } - ], - "created": "18/12/2013", - "currentVersion": "2.0.0", - "netVersion": "4.5", - "license": "MIT", - "downloads": "4198", - "karma": "53" - }, - "externalSources": [ - { - "name": "Source code", - "url": "https://github.com/merchello/Merchello" - }, - { - "name": "Issue tracker", - "url": "http://issues.merchello.com/youtrack/oauth?state=%2Fyoutrack%2FrootGo" - } - ], - "images": [ - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - }, - { - "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", - "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" - } - ] - }; + //vm.package = { + // "name": "Merchello", + // "description": "<p>Merchello is a high performance, designer friendly, open source Umbraco ecommerce package built for the store owner.</p> <p><strong>What Merchello does for you</strong></p> <p>In version 1, Merchello supports a large variety of products with options that can be attached to a single warehouse, processes orders, manages taxes and shipping, and sends out email notifications to your customers. The beauty of Merchello is that while it oversees all of your products, orders, and store settings, it allows Umbraco to maintain your content. This seamless integration gives you the flexibility to build your store in any way imagineable on a robust platform capable of handling a wide variety of store sizes.</p> <p><strong>Find out more on our website</strong></p> <p><strong><a href="https://merchello.com">https://merchello.com</a></strong></p> <p><strong>Contribute</strong></p> <p>We would love and need your help. If you want to contribute to Merchello's core, the easiest way to get started is to fork the project on https://github.com/merchello/Merchello and open src/Merchello.sln in Visual Studio. We're excited to see what you do!</p> <p><strong>Starter Kit</strong></p> <p>We have built a simple starter kit for Merchello called Bazaar, and you can download it below in the package files tab.</p>", + // "compatibility": [ + // { + // "version": "7.4.x", + // "percentage": "100" + // }, + // { + // "version": "7.3.x", + // "percentage": "86" + // }, + // { + // "version": "7.2.x", + // "percentage": "93" + // }, + // { + // "version": "7.1.x", + // "percentage": "100" + // } + // ], + // "information": { + // "owner": "Rusty Swayne", + // "ownerAvatar": "https://our.umbraco.org/media/upload/d476d257-a494-46d9-9a00-56c2f94a55c8/our-profile.jpg?width=200&height=200&mode=crop", + // "ownerKarma": "2673", + // "contributors": [ + // { + // "name": "Lee" + // }, + // { + // "name": "Jason Prothero" + // } + // ], + // "created": "18/12/2013", + // "currentVersion": "2.0.0", + // "netVersion": "4.5", + // "license": "MIT", + // "downloads": "4198", + // "karma": "53" + // }, + // "externalSources": [ + // { + // "name": "Source code", + // "url": "https://github.com/merchello/Merchello" + // }, + // { + // "name": "Issue tracker", + // "url": "http://issues.merchello.com/youtrack/oauth?state=%2Fyoutrack%2FrootGo" + // } + // ], + // "images": [ + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // }, + // { + // "thumbnail": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png?bgcolor=fff&height=154&width=281&format=png", + // "source": "https://our.umbraco.org/media/wiki/104946/635591947547374885_Product-Listpng.png" + // } + // ] + //}; function init() { vm.loading = true; - $timeout(function () { - vm.loading = false; - }, 500); + $q.all([ + ourPackageRepositoryResource.getCategories() + .then(function(cats) { + vm.categories = cats; + }), + ourPackageRepositoryResource.getPopular(10) + .then(function(pack) { + vm.popular = pack; + }), + ourPackageRepositoryResource.getLatest(vm.pagination.pageNumber - 1, vm.pagination.pageSize, "") + .then(function(pack) { + vm.packages = pack.packages; + vm.pagination.totalPages = Math.ceil(pack.total / vm.pagination.pageSize); + }) + ]) + .then(function() { + vm.loading = false; + }); } @@ -246,7 +261,12 @@ } function showPackageDetails(selectedPackage) { - vm.packageViewState = "packageDetails"; + ourPackageRepositoryResource.getDetails(selectedPackage.id) + .then(function(pack) { + vm.package = pack; + vm.packageViewState = "packageDetails"; + }); + } function setPackageViewState(state) { diff --git a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html index 0074eb8e9c..77a4ad6d33 100644 --- a/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html +++ b/src/Umbraco.Web.UI.Client/src/views/packager/views/repo.html @@ -4,7 +4,8 @@
- + +