U4-8530 Make it possbile to hide preview button by DocumentType or ContentItem
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
</umb-button>
|
||||
|
||||
<umb-button
|
||||
ng-if="!page.isNew && content.preview"
|
||||
ng-if="!page.isNew && content.allowPreview"
|
||||
type="button"
|
||||
action="preview(content)"
|
||||
label="Preview page"
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
{
|
||||
public ContentItemDisplay()
|
||||
{
|
||||
Preview = true;
|
||||
AllowPreview = true;
|
||||
}
|
||||
|
||||
[DataMember(Name = "publishDate")]
|
||||
@@ -40,8 +40,14 @@ namespace Umbraco.Web.Models.ContentEditing
|
||||
[DataMember(Name = "urls")]
|
||||
public string[] Urls { get; set; }
|
||||
|
||||
[DataMember( Name = "preview" )]
|
||||
public bool Preview { get; set; }
|
||||
/// <summary>
|
||||
/// Determines whether previewing is allowed for this node
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// By default this is true but by using events developers can toggle this off for certain documents if there is nothing to preview
|
||||
/// </remarks>
|
||||
[DataMember( Name = "allowPreview" )]
|
||||
public bool AllowPreview { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The allowed 'actions' based on the user's permissions - Create, Update, Publish, Send to publish
|
||||
|
||||
@@ -66,6 +66,7 @@ namespace Umbraco.Web.Models.Mapping
|
||||
? new[] {"Cannot generate urls without a current Umbraco Context"}
|
||||
: content.GetContentUrls(UmbracoContext.Current)))
|
||||
.ForMember(display => display.Properties, expression => expression.Ignore())
|
||||
.ForMember(display => display.AllowPreview, expression => expression.Ignore())
|
||||
.ForMember(display => display.TreeNodeUrl, expression => expression.Ignore())
|
||||
.ForMember(display => display.Notifications, expression => expression.Ignore())
|
||||
.ForMember(display => display.Errors, expression => expression.Ignore())
|
||||
|
||||
Reference in New Issue
Block a user