Skip to content

Commit 16fb9c6

Browse files
committed
Add IsDirectPublishWorkflow property and update visibility logic in workflow menus
1 parent 8d6a255 commit 16fb9c6

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Items/CompleteWorkflowMenu.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class CompleteWorkflowMenu : WorkflowBaseMenuItem
3434

3535
/// <inheritdoc/>
3636
public override bool Visible() => base.Visible()
37+
&& !this.IsDirectPublishWorkflow
3738
&& (this.IsReviewOrOtherIntermediateStateWithPermissions == true
3839
|| (this.IsPriorState == true && this.IsDraftWithPermissions == true) // for Save Draft workflow
3940
|| (this.IsLastState == true && this.HasUnpublishVersion && this.HasDraftPermission == true)); // for Direct Publish workflow

Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Items/DiscardWorkflowMenu.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class DiscardWorkflowMenu : WorkflowBaseMenuItem
3434

3535
/// <inheritdoc/>
3636
public override bool Visible() => base.Visible()
37+
&& !this.IsDirectPublishWorkflow
3738
&& ((this.IsLastState == false && (this.IsDraftWithPermissions == true || this.IsReviewOrOtherIntermediateStateWithPermissions == true))
3839
|| (this.IsLastState == true && this.HasUnpublishVersion && this.HasDraftPermission)); // for Direct Publish workflow
3940
}

Dnn.AdminExperience/EditBar/Dnn.EditBar.UI/Items/WorkflowBaseMenuItem.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public abstract class WorkflowBaseMenuItem : BaseMenuItem
5252

5353
internal bool HasDraftPermission => PermissionProvider.Instance().CanAddContentToPage(TabController.CurrentPage);
5454

55+
internal bool IsDirectPublishWorkflow => this.Workflow?.WorkflowKey == SystemWorkflowManager.DirectPublishWorkflowKey;
56+
5557
private ContentItem ContentItem => Util.GetContentController().GetContentItem(TabController.CurrentPage.ContentItemId);
5658

5759
private bool IsVersioningEnabled => TabVersionSettings.Instance.IsVersioningEnabled(PortalSettings.Current.PortalId, TabController.CurrentPage.TabID);

0 commit comments

Comments
 (0)