From a06952c65f972d01aa260164f58d152116001c5c Mon Sep 17 00:00:00 2001 From: Thomas Andresen Date: Tue, 9 Jun 2020 09:36:12 +0200 Subject: [PATCH 01/11] If content type is deleted/changed which other document types has a reference to, fire a change event for those --- ...ntentTypeServiceBaseOfTRepositoryTItemTService.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs b/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs index fdd2d9ceae..3d4c109bfb 100644 --- a/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs +++ b/src/Umbraco.Core/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs @@ -511,6 +511,16 @@ namespace Umbraco.Core.Services.Implement // delete content DeleteItemsOfTypes(descendantsAndSelf.Select(x => x.Id)); + + // Next find all other document types that have a reference to this content type + var referenceToAllowedContentTypes = GetAll().Where(q => q.AllowedContentTypes.Any(p=>p.Id.Value==item.Id)); + foreach (var reference in referenceToAllowedContentTypes) + { + reference.AllowedContentTypes = reference.AllowedContentTypes.Where(p => p.Id.Value != item.Id); + var changedRef = new List>() { new ContentTypeChange(reference, ContentTypeChangeTypes.RefreshMain) }; + // Fire change event + OnChanged(scope, changedRef.ToEventArgs()); + } // finally delete the content type // - recursively deletes all descendants @@ -518,7 +528,7 @@ namespace Umbraco.Core.Services.Implement // (contents of any descendant type have been deleted but // contents of any composed (impacted) type remain but // need to have their property data cleared) - Repository.Delete(item); + Repository.Delete(item); //... var changes = descendantsAndSelf.Select(x => new ContentTypeChange(x, ContentTypeChangeTypes.Remove)) From 96ab448e74f920f23f4b6980d560f4d167ce6494 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 17 Jun 2020 09:47:53 +0000 Subject: [PATCH 02/11] Azure DevOps YML pipeline for creating C# & JS Docs (#8282) --- build/V8-Docs-Pipeline.yml | 51 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 build/V8-Docs-Pipeline.yml diff --git a/build/V8-Docs-Pipeline.yml b/build/V8-Docs-Pipeline.yml new file mode 100644 index 0000000000..1df4092397 --- /dev/null +++ b/build/V8-Docs-Pipeline.yml @@ -0,0 +1,51 @@ +############################################################## +## V8 CMS - .NET & AngularJS Doc sites ## +## Built on demand only, NO automatic PR/branch triggers ## +## ## +## This build pipeline has a webhook for sucessful ## +## builds, that sends the ZIP artifacts to our.umb to host ## +############################################################## + +# Name != name of pipeline but the build number format +# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/run-number?view=azure-devops&tabs=yaml + +# Build Pipeline triggers +# https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#ci-triggers +trigger: none +pr: none + +# Variables & their default values +variables: + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +# VM to run the build on & it's installed software +# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops +# https://github.com/actions/virtual-environments/blob/master/images/win/Windows2019-Readme.md +pool: + vmImage: 'windows-2019' + +jobs: + - job: buildDocs + displayName: 'Build static docs site as ZIPs' + steps: + + - task: PowerShell@2 + displayName: 'Prep build tool, build C# & JS Docs' + inputs: + targetType: 'inline' + script: | + $uenv=./build.ps1 -get -doc + $uenv.SandboxNode() + $uenv.PrepareAngularDocs() + $nugetsourceUmbraco = "https://api.nuget.org/v3/index.json" + $uenv.PrepareCSharpDocs() + $uenv.RestoreNode() + errorActionPreference: 'continue' + workingDirectory: 'build' + + - task: PublishPipelineArtifact@1 + inputs: + targetPath: '$(Build.Repository.LocalPath)\build.out\' + artifact: 'docs' + publishLocation: 'pipeline' \ No newline at end of file From 0836118d542d99670e009cc05a55277e309a95d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 17 Jun 2020 12:07:15 +0200 Subject: [PATCH 03/11] force-resolutions and be able to run server including watching files for changes. --- src/Umbraco.Web.UI.Docs/gulpfile.js | 3 +++ src/Umbraco.Web.UI.Docs/package.json | 9 ++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Docs/gulpfile.js b/src/Umbraco.Web.UI.Docs/gulpfile.js index a3e596ecad..a2a913d5fc 100644 --- a/src/Umbraco.Web.UI.Docs/gulpfile.js +++ b/src/Umbraco.Web.UI.Docs/gulpfile.js @@ -54,3 +54,6 @@ gulp.task('open:docs', function (cb) { .pipe(open(options)); cb(); }); + +gulp.task('watch', ['docs', 'connect:docs', 'open:docs']); + diff --git a/src/Umbraco.Web.UI.Docs/package.json b/src/Umbraco.Web.UI.Docs/package.json index 843740482e..6e58f958cf 100644 --- a/src/Umbraco.Web.UI.Docs/package.json +++ b/src/Umbraco.Web.UI.Docs/package.json @@ -1,9 +1,16 @@ { "private": true, "scripts": { + "preinstall": "npx npm-force-resolutions", "docs": "gulp docs", "start": "gulp docs", - "default": "gulp docs" + "default": "gulp docs", + "dev": "gulp watch", + "serve": "gulp watch", + "watch": "gulp watch" + }, + "resolutions": { + "graceful-fs": "4.2.3" }, "devDependencies": { "gulp": "^3.9.1", From d7cd52161fce0061fe2ba7ccc235a904ddaa77a9 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 17 Jun 2020 12:46:11 +0100 Subject: [PATCH 04/11] Fix SkipStep in tour directive was looking at wrong DOM selector it needs to be skipStepIfVisible --- .../directives/components/application/umbtour.directive.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js index 01d73568ec..eb521312fc 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js @@ -264,13 +264,14 @@ In the following example you see how to run some custom logic before a step goes // If the currentStep JSON object has 'skipStepIfVisible' // It's a DOM selector - if we find it then we ship over this step - if(upcomingStep.skipStepIfVisible) { - let tryFindDomEl = document.querySelector(upcomingStep.element); - if(tryFindDomEl) { + if (upcomingStep.skipStepIfVisible) { + let tryFindDomEl = document.querySelector(upcomingStep.skipStepIfVisible); + if (tryFindDomEl) { // check if element is visible: if( tryFindDomEl.offsetWidth || tryFindDomEl.offsetHeight || tryFindDomEl.getClientRects().length ) { // if it was visible then we skip the step. nextStep(); + return; } } } From d4c464c1233816c43e0524df4dde2b20701c7844 Mon Sep 17 00:00:00 2001 From: Warren Buckley Date: Wed, 17 Jun 2020 12:50:31 +0100 Subject: [PATCH 05/11] Remove duplicate comment # Conflicts: # src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js --- .../directives/components/application/umbtour.directive.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js index eb521312fc..1a9c3c771a 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/components/application/umbtour.directive.js @@ -277,7 +277,7 @@ In the following example you see how to run some custom logic before a step goes } startStep(); - + // tour completed - final step } else { // tour completed - final step scope.loadingStep = true; From 25488d20167ff7ee38f631b0efc6b1e99cdf82d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 17 Jun 2020 15:32:54 +0200 Subject: [PATCH 06/11] add watch functionallity --- src/Umbraco.Web.UI.Docs/gulpfile.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Docs/gulpfile.js b/src/Umbraco.Web.UI.Docs/gulpfile.js index a2a913d5fc..5dd4c57032 100644 --- a/src/Umbraco.Web.UI.Docs/gulpfile.js +++ b/src/Umbraco.Web.UI.Docs/gulpfile.js @@ -8,6 +8,8 @@ var connect = require('gulp-connect'); var open = require('gulp-open'); var gulpDocs = require('gulp-ngdocs'); +var documentationFiles = ['../Umbraco.Web.UI.Client/src/common/**/*.js', './src/api/**/*.ngdoc']; + /************************** * Build Backoffice UI API documentation **************************/ @@ -24,14 +26,14 @@ gulp.task('docs', [], function (cb) { return gulpDocs.sections({ api: { - glob: ['../Umbraco.Web.UI.Client/src/common/**/*.js', './src/api/**/*.ngdoc'], + glob: documentationFiles, api: true, title: 'UI API Documentation' } }) .pipe(gulpDocs.process(options)) .pipe(gulp.dest('./api')); - cb(); + }); gulp.task('connect:docs', function (cb) { @@ -44,6 +46,10 @@ gulp.task('connect:docs', function (cb) { cb(); }); +gulp.task('watch:docs', function (cb) { + return gulp.watch(documentationFiles, ['docs']); +}); + gulp.task('open:docs', function (cb) { var options = { @@ -55,5 +61,5 @@ gulp.task('open:docs', function (cb) { cb(); }); -gulp.task('watch', ['docs', 'connect:docs', 'open:docs']); +gulp.task('watch', ['docs', 'connect:docs', 'open:docs', 'watch:docs']); From 4ddd1a91edadbeb2c4b0829eaf1555af4bbb1a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Wed, 17 Jun 2020 15:41:08 +0200 Subject: [PATCH 07/11] make reload work --- src/Umbraco.Web.UI.Docs/gulpfile.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Docs/gulpfile.js b/src/Umbraco.Web.UI.Docs/gulpfile.js index 5dd4c57032..a7269ec8b7 100644 --- a/src/Umbraco.Web.UI.Docs/gulpfile.js +++ b/src/Umbraco.Web.UI.Docs/gulpfile.js @@ -32,7 +32,8 @@ gulp.task('docs', [], function (cb) { } }) .pipe(gulpDocs.process(options)) - .pipe(gulp.dest('./api')); + .pipe(gulp.dest('./api')) + .pipe(connect.reload()); }); From f0f92db3dcb00b83b5a20e17a4632318cda7e5b3 Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Wed, 17 Jun 2020 18:02:23 +0200 Subject: [PATCH 08/11] First compile all the gulp things before trying to make the docs --- build/V8-Docs-Pipeline.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/build/V8-Docs-Pipeline.yml b/build/V8-Docs-Pipeline.yml index 1df4092397..56e8fde60c 100644 --- a/build/V8-Docs-Pipeline.yml +++ b/build/V8-Docs-Pipeline.yml @@ -37,6 +37,7 @@ jobs: script: | $uenv=./build.ps1 -get -doc $uenv.SandboxNode() + $uenv.CompileBelle() $uenv.PrepareAngularDocs() $nugetsourceUmbraco = "https://api.nuget.org/v3/index.json" $uenv.PrepareCSharpDocs() From d49265f3bae2b3dcb4c19c7b95633440cbc33570 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Thu, 18 Jun 2020 09:23:57 +0200 Subject: [PATCH 09/11] removed preinstall fix. --- src/Umbraco.Web.UI.Docs/package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Docs/package.json b/src/Umbraco.Web.UI.Docs/package.json index 6e58f958cf..f216b4b129 100644 --- a/src/Umbraco.Web.UI.Docs/package.json +++ b/src/Umbraco.Web.UI.Docs/package.json @@ -1,7 +1,6 @@ { "private": true, "scripts": { - "preinstall": "npx npm-force-resolutions", "docs": "gulp docs", "start": "gulp docs", "default": "gulp docs", @@ -9,9 +8,6 @@ "serve": "gulp watch", "watch": "gulp watch" }, - "resolutions": { - "graceful-fs": "4.2.3" - }, "devDependencies": { "gulp": "^3.9.1", "gulp-connect": "5.6.1", From 95cb7e72d1a8423b4e36b7e40127e0c473c33d8a Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 18 Jun 2020 11:21:03 +0200 Subject: [PATCH 10/11] Clarify some property meanings on `IContent` --- src/Umbraco.Core/Models/IContent.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Core/Models/IContent.cs b/src/Umbraco.Core/Models/IContent.cs index 6990a7f7da..7a4fc83253 100644 --- a/src/Umbraco.Core/Models/IContent.cs +++ b/src/Umbraco.Core/Models/IContent.cs @@ -25,6 +25,7 @@ namespace Umbraco.Core.Models /// /// Gets a value indicating whether the content is published. /// + /// The property tells you which version of the content is currently published. bool Published { get; set; } PublishedState PublishedState { get; set; } @@ -32,10 +33,11 @@ namespace Umbraco.Core.Models /// /// Gets a value indicating whether the content has been edited. /// + /// Will return `true` once unpublished edits have been made after the version with has been published. bool Edited { get; set; } /// - /// Gets the published version identifier. + /// Gets the version identifier for the currently published version of the content. /// int PublishedVersionId { get; set; } @@ -129,6 +131,6 @@ namespace Umbraco.Core.Models /// /// IContent DeepCloneWithResetIdentities(); - + } } From 3b2d87950cf2a381c23e3089722c210c51c0464a Mon Sep 17 00:00:00 2001 From: Sebastiaan Janssen Date: Thu, 18 Jun 2020 11:28:31 +0200 Subject: [PATCH 11/11] Fix replacement of baseurl in UI docs --- build/build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/build.ps1 b/build/build.ps1 index 185d1b8ff6..c2c5bdd232 100644 --- a/build/build.ps1 +++ b/build/build.ps1 @@ -475,7 +475,7 @@ # change baseUrl $BaseUrl = "https://our.umbraco.com/apidocs/v8/ui/" $IndexPath = "./api/index.html" - (Get-Content $IndexPath).replace('location.href.replace(rUrl, indexFile)', "`'" + $BaseUrl + "`'") | Set-Content $IndexPath + (Get-Content $IndexPath).replace('origin + location.href.substr(origin.length).replace(rUrl, indexFile)', "`'" + $BaseUrl + "`'") | Set-Content $IndexPath # zip it & $this.BuildEnv.Zip a -tzip -r "$out\ui-docs.zip" "$src\Umbraco.Web.UI.Docs\api\*.*"