Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/contentcontroller_and_related

This commit is contained in:
Bjarke Berg
2020-06-18 14:43:26 +02:00
7 changed files with 90 additions and 12 deletions

View File

@@ -25,6 +25,7 @@ namespace Umbraco.Core.Models
/// <summary>
/// Gets a value indicating whether the content is published.
/// </summary>
/// <remarks>The <see cref="PublishedVersionId"/> property tells you which version of the content is currently published.</remarks>
bool Published { get; set; }
PublishedState PublishedState { get; set; }
@@ -32,10 +33,11 @@ namespace Umbraco.Core.Models
/// <summary>
/// Gets a value indicating whether the content has been edited.
/// </summary>
/// <remarks>Will return `true` once unpublished edits have been made after the version with <see cref="PublishedVersionId"/> has been published.</remarks>
bool Edited { get; set; }
/// <summary>
/// Gets the published version identifier.
/// Gets the version identifier for the currently published version of the content.
/// </summary>
int PublishedVersionId { get; set; }
@@ -129,6 +131,6 @@ namespace Umbraco.Core.Models
/// </summary>
/// <returns></returns>
IContent DeepCloneWithResetIdentities();
}
}

View File

@@ -508,6 +508,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<ContentTypeChange<TItem>>() { new ContentTypeChange<TItem>(reference, ContentTypeChangeTypes.RefreshMain) };
// Fire change event
OnChanged(scope, changedRef.ToEventArgs());
}
// finally delete the content type
// - recursively deletes all descendants
@@ -515,7 +525,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<TItem>(x, ContentTypeChangeTypes.Remove))

View File

@@ -264,19 +264,20 @@ 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;
}
}
}
startStep();
// tour completed - final step
} else {
// tour completed - final step
scope.loadingStep = true;

View File

@@ -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,15 @@ 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();
.pipe(gulp.dest('./api'))
.pipe(connect.reload());
});
gulp.task('connect:docs', function (cb) {
@@ -44,6 +47,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 = {
@@ -54,3 +61,6 @@ gulp.task('open:docs', function (cb) {
.pipe(open(options));
cb();
});
gulp.task('watch', ['docs', 'connect:docs', 'open:docs', 'watch:docs']);

View File

@@ -3,7 +3,10 @@
"scripts": {
"docs": "gulp docs",
"start": "gulp docs",
"default": "gulp docs"
"default": "gulp docs",
"dev": "gulp watch",
"serve": "gulp watch",
"watch": "gulp watch"
},
"devDependencies": {
"gulp": "^3.9.1",