Skip to content

Commit 66c511c

Browse files
committed
workflow tweaks. completing a workflow now automatically unlocks any locked content
1 parent 763c80b commit 66c511c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

core/Controllers/WorkflowController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public async Task<IActionResult> Complete(Guid contentId,string variant,string s
146146
try
147147
{
148148
var existingItems = repo.GetPuckWorkflowItem().Where(x => x.ContentId == contentId && x.Variant == variant && !x.Complete).ToList();
149-
existingItems.ForEach(x => { x.Complete = true; x.CompleteDate = DateTime.Now;});
149+
existingItems.ForEach(x => { x.Complete = true; x.CompleteDate = DateTime.Now;x.LockedBy = string.Empty;x.LockedUntil = null; });
150150

151151
repo.SaveChanges();
152152

puckweb/Areas/puck/Views/Workflow/Index.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{
2828
<h6 class="card-subtitle mb-2 text-muted">Locked by - @assignedItem.LockedBy</h6>
2929
}
30-
<p class="card-text">@assignedItem.Message</p>
30+
<p class="card-text">@Html.Raw(assignedItem.Message)</p>
3131
<a href="#content?id=@assignedItem.ContentId&variant=@assignedItem.Variant" class="card-link view">View</a>
3232
@if (!(!string.IsNullOrEmpty(assignedItem.LockedBy) && assignedItem.LockedUntil.HasValue && assignedItem.LockedUntil > DateTime.Now))
3333
{
@@ -52,7 +52,7 @@
5252
{
5353
<h6 class="mt-2 card-subtitle mb-2 text-muted">Locked by - @groupedItem.LockedBy</h6>
5454
}
55-
<p class="card-text">@groupedItem.Message</p>
55+
<p class="card-text">@Html.Raw(groupedItem.Message)</p>
5656
<a href="#content?id=@groupedItem.ContentId&variant=@groupedItem.Variant" class="card-link view">View</a>
5757
@if (!(!string.IsNullOrEmpty(groupedItem.LockedBy) && groupedItem.LockedUntil.HasValue && groupedItem.LockedUntil > DateTime.Now))
5858
{

puckweb/wwwroot/Areas/puck/assets/js/puck.actions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ var displayMarkup = function (parentId, type, variant, fromVariant,contentId,con
12831283
var workflowItem = workflowItems[id + variant];
12841284
var startingState = formDatas[id + variant];
12851285
var currentState = fd;
1286-
1286+
12871287
if (!workflowComments[id + variant] && wfo.comment && isFunction(wfo.comment)) {
12881288
var commentDialogTitle = wfo.comment(workflowItem, userObject, startingState, currentState);
12891289
if (commentDialogTitle && typeof commentDialogTitle=="string") {

0 commit comments

Comments
 (0)