Skip to content

Commit

Permalink
workflow tweaks. completing a workflow now automatically unlocks any …
Browse files Browse the repository at this point in the history
…locked content
  • Loading branch information
yohsii committed May 25, 2020
1 parent 763c80b commit 66c511c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/Controllers/WorkflowController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public async Task<IActionResult> Complete(Guid contentId,string variant,string s
try
{
var existingItems = repo.GetPuckWorkflowItem().Where(x => x.ContentId == contentId && x.Variant == variant && !x.Complete).ToList();
existingItems.ForEach(x => { x.Complete = true; x.CompleteDate = DateTime.Now;});
existingItems.ForEach(x => { x.Complete = true; x.CompleteDate = DateTime.Now;x.LockedBy = string.Empty;x.LockedUntil = null; });

repo.SaveChanges();

Expand Down
4 changes: 2 additions & 2 deletions puckweb/Areas/puck/Views/Workflow/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{
<h6 class="card-subtitle mb-2 text-muted">Locked by - @assignedItem.LockedBy</h6>
}
<p class="card-text">@assignedItem.Message</p>
<p class="card-text">@Html.Raw(assignedItem.Message)</p>
<a href="#[email protected]&[email protected]" class="card-link view">View</a>
@if (!(!string.IsNullOrEmpty(assignedItem.LockedBy) && assignedItem.LockedUntil.HasValue && assignedItem.LockedUntil > DateTime.Now))
{
Expand All @@ -52,7 +52,7 @@
{
<h6 class="mt-2 card-subtitle mb-2 text-muted">Locked by - @groupedItem.LockedBy</h6>
}
<p class="card-text">@groupedItem.Message</p>
<p class="card-text">@Html.Raw(groupedItem.Message)</p>
<a href="#[email protected]&[email protected]" class="card-link view">View</a>
@if (!(!string.IsNullOrEmpty(groupedItem.LockedBy) && groupedItem.LockedUntil.HasValue && groupedItem.LockedUntil > DateTime.Now))
{
Expand Down
2 changes: 1 addition & 1 deletion puckweb/wwwroot/Areas/puck/assets/js/puck.actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ var displayMarkup = function (parentId, type, variant, fromVariant,contentId,con
var workflowItem = workflowItems[id + variant];
var startingState = formDatas[id + variant];
var currentState = fd;

if (!workflowComments[id + variant] && wfo.comment && isFunction(wfo.comment)) {
var commentDialogTitle = wfo.comment(workflowItem, userObject, startingState, currentState);
if (commentDialogTitle && typeof commentDialogTitle=="string") {
Expand Down

0 comments on commit 66c511c

Please sign in to comment.