Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export specific workflow #11939

Merged
merged 69 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 66 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
9a11bf6
graphiql 1.9.3
agriffard May 25, 2022
9b36d38
1.9.4
agriffard Jun 1, 2022
8e174ab
Merge branch 'main' into ag/graphiql1.9.3
agriffard Jun 1, 2022
daf2eb0
fix graphql UI #11831
hyzx86 Jun 8, 2022
5b7496a
remove extra space
hyzx86 Jun 9, 2022
3be2bf4
Merge branch 'main' into ag/graphiql1.9.3
agriffard Jun 19, 2022
610c224
1.9.9
agriffard Jun 19, 2022
2d7f3df
Merge branch 'main' into ag/graphiql1.9.3
agriffard Jun 24, 2022
cd23dd2
update build
hyzx86 Jun 30, 2022
40d482a
merge main
hyzx86 Jun 30, 2022
58bc7ff
rebuild graphql orchard
hyzx86 Jun 30, 2022
d6fbf96
Merge remote-tracking branch 'origin/ag/graphiql1.9.3' into fix_graph…
hyzx86 Jun 30, 2022
718ecdd
fix graphql ui 1.9.9 #11768
hyzx86 Jun 30, 2022
22d5e7a
restore code format
hyzx86 Jun 30, 2022
c1ac8f2
Merge remote-tracking branch 'origin/main' into Export_specified_Work…
hyzx86 Jul 2, 2022
ab07997
Export the specified workflow
hyzx86 Jul 2, 2022
ea0e561
fix code format
hyzx86 Jul 2, 2022
ba2353f
move private to end
hyzx86 Jul 2, 2022
44b7e3b
fix code format
hyzx86 Jul 3, 2022
54462be
fix code style
hyzx86 Jul 3, 2022
55a1458
fix code style
hyzx86 Jul 3, 2022
e98dd4c
fix format
hyzx86 Jul 3, 2022
60a1fdd
merge mainn
hyzx86 Jul 8, 2022
7469f29
Add new line before
hyzx86 Jul 8, 2022
18374c4
fix code style
hyzx86 Jul 8, 2022
58c3026
Repair indent
hyzx86 Jul 9, 2022
b676da6
limit checked items more than 1
hyzx86 Nov 27, 2022
af6bc49
merge main
hyzx86 Nov 27, 2022
da0ca43
Merge branch 'main' into Export_specified_Workflow
hyzx86 Jan 29, 2024
0953df0
fix build Errors
Jan 31, 2024
05ae3e3
add setCorrelationId function
Jan 31, 2024
4df2b22
Merge branch 'main' into Export_specified_Workflow
Piedone Feb 1, 2024
d5b4400
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hyzx86 Apr 1, 2024
a3059d4
update Export Action to post
hyzx86 Apr 1, 2024
6707813
change export to post
hyzx86 Apr 2, 2024
d435ac8
restore changes
hyzx86 Apr 2, 2024
21b7395
Merge branch 'main' into Export_specified_Workflow
hyzx86 Apr 2, 2024
0cd30c2
update archivename
hyzx86 Apr 2, 2024
a674da5
Merge branch 'Export_specified_Workflow' of https://github.com/hyzx86…
hyzx86 Apr 2, 2024
79d22f8
update Jobject to JsonObject
hyzx86 Apr 2, 2024
f137fbb
fix deplypack
hyzx86 Apr 2, 2024
7454104
fix serialiser
hyzx86 Apr 2, 2024
a583ea1
Merge branch 'main' into Export_specified_Workflow
hyzx86 Apr 3, 2024
58c0b53
restore changes
hyzx86 Apr 3, 2024
8479979
update
hyzx86 Apr 3, 2024
5d2639b
Merge branch 'main' into Export_specified_Workflow
hyzx86 Apr 5, 2024
6109ba3
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hyzx86 Apr 7, 2024
c7f92c5
fix download error
Apr 7, 2024
7b27cbe
Merge branch 'main' into Export_specified_Workflow
hyzx86 Apr 7, 2024
ec55cb4
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hyzx86 Apr 24, 2024
36bbeea
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hyzx86 Apr 24, 2024
43da408
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hyzx86 Apr 24, 2024
d5e09ff
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hyzx86 Apr 24, 2024
5a892ed
Merge branch 'main' into Export_specified_Workflow
hyzx86 Apr 24, 2024
c755ec4
Refactoring AllWorkflowTypeDeploymentSource
Apr 24, 2024
1f1e717
rename
Apr 24, 2024
1a40c63
format code
Apr 24, 2024
c82be47
fix code
hyzx86 Apr 24, 2024
4d2f4e9
Update src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWo…
hyzx86 Apr 25, 2024
d69fd8f
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hyzx86 Apr 25, 2024
e0fef27
update
Apr 25, 2024
5a4bfa1
Merge branch 'main' into Export_specified_Workflow
hyzx86 Apr 25, 2024
8c54c41
Merge branch 'main' into Export_specified_Workflow
hyzx86 Apr 25, 2024
1d04a0e
Apply suggestions from code review
hishamco Apr 25, 2024
942e63f
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hishamco Apr 25, 2024
4c04662
Merge branch 'main' into Export_specified_Workflow
hishamco Apr 25, 2024
3a8590d
Update src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/Work…
hishamco Apr 25, 2024
92ab660
Apply suggestions from code review
hishamco Apr 25, 2024
3495276
Update src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWo…
hishamco Apr 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO.Compression;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Nodes;
Expand All @@ -13,12 +14,17 @@
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using OrchardCore.Admin;
using OrchardCore.Deployment;
using OrchardCore.Deployment.Core.Services;
using OrchardCore.DisplayManagement;
using OrchardCore.DisplayManagement.ModelBinding;
using OrchardCore.DisplayManagement.Notify;
using OrchardCore.Json;
using OrchardCore.Navigation;
using OrchardCore.Recipes.Models;
using OrchardCore.Routing;
using OrchardCore.Workflows.Activities;
using OrchardCore.Workflows.Deployment;
using OrchardCore.Workflows.Helpers;
using OrchardCore.Workflows.Indexes;
using OrchardCore.Workflows.Models;
Expand All @@ -41,9 +47,9 @@
private readonly IAuthorizationService _authorizationService;
private readonly IActivityDisplayManager _activityDisplayManager;
private readonly INotifier _notifier;
private readonly ISecurityTokenService _securityTokenService;
private readonly IUpdateModelAccessor _updateModelAccessor;
private readonly IShapeFactory _shapeFactory;
private readonly JsonSerializerOptions _documentJsonSerializerOptions;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field _documentJsonSerializerOptions should be renamed to _jsonSerializerOptions to match its usage throughout the class.

- private readonly JsonSerializerOptions _documentJsonSerializerOptions;
+ private readonly JsonSerializerOptions _jsonSerializerOptions;

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
private readonly JsonSerializerOptions _documentJsonSerializerOptions;
private readonly JsonSerializerOptions _jsonSerializerOptions;


protected readonly IStringLocalizer S;
protected readonly IHtmlLocalizer H;
Expand All @@ -60,10 +66,10 @@
IActivityDisplayManager activityDisplayManager,
IShapeFactory shapeFactory,
INotifier notifier,
ISecurityTokenService securityTokenService,
IStringLocalizer<WorkflowTypeController> stringLocalizer,
IHtmlLocalizer<WorkflowTypeController> htmlLocalizer,
IUpdateModelAccessor updateModelAccessor)
IUpdateModelAccessor updateModelAccessor,
IOptions<DocumentJsonSerializerOptions> documentJsonSerializerOptions)
hishamco marked this conversation as resolved.
Show resolved Hide resolved
{
_pagerOptions = pagerOptions.Value;
_session = session;
Expand All @@ -74,11 +80,11 @@
_authorizationService = authorizationService;
_activityDisplayManager = activityDisplayManager;
_notifier = notifier;
_securityTokenService = securityTokenService;
_updateModelAccessor = updateModelAccessor;
_shapeFactory = shapeFactory;
S = stringLocalizer;
H = htmlLocalizer;
_documentJsonSerializerOptions = jsonSerializerOptions.Value.SerializerOptions;

Check failure on line 87 in src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name 'jsonSerializerOptions' does not exist in the current context

Check failure on line 87 in src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name 'jsonSerializerOptions' does not exist in the current context

Check failure on line 87 in src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name 'jsonSerializerOptions' does not exist in the current context

Check failure on line 87 in src/OrchardCore.Modules/OrchardCore.Workflows/Controllers/WorkflowTypeController.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name 'jsonSerializerOptions' does not exist in the current context
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assignment to _documentJsonSerializerOptions should use the corrected field name _jsonSerializerOptions.

- _documentJsonSerializerOptions = jsonSerializerOptions.Value.SerializerOptions;
+ _jsonSerializerOptions = documentJsonSerializerOptions.Value.SerializerOptions;

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
_documentJsonSerializerOptions = jsonSerializerOptions.Value.SerializerOptions;
_jsonSerializerOptions = documentJsonSerializerOptions.Value.SerializerOptions;

}

[Admin("Workflows/Types", "WorkflowTypes")]
Expand Down Expand Up @@ -192,6 +198,9 @@
{
case WorkflowTypeBulkAction.None:
break;
case WorkflowTypeBulkAction.Export:
return await ExportWorkflows(itemIds.ToArray());
hyzx86 marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid duplicate calls to ExportWorkflows. Ensure that the method is called only once per action to prevent performance issues.

- return await ExportWorkflows(itemIds.ToArray());

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
return await ExportWorkflows(itemIds.ToArray());


case WorkflowTypeBulkAction.Delete:
foreach (var entry in checkedEntries)
{
Expand All @@ -213,7 +222,19 @@
return RedirectToAction(nameof(Index));
}

public async Task<IActionResult> EditProperties(long? id, string returnUrl = null)
[HttpPost]
public async Task<IActionResult> Export(int id)
Piedone marked this conversation as resolved.
Show resolved Hide resolved
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageWorkflows))
{
return Forbid();
}

hyzx86 marked this conversation as resolved.
Show resolved Hide resolved
return await ExportWorkflows(id);
}
Comment on lines +226 to +234
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Export method should be decorated with the [HttpGet] attribute since it is handling a GET request, not a POST.

+ [HttpGet]
public async Task<IActionResult> Export(int id)

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
public async Task<IActionResult> Export(int id)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageWorkflows))
{
return Forbid();
}
return await ExportWorkflows(id);
}
[HttpGet]
public async Task<IActionResult> Export(int id)
{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageWorkflows))
{
return Forbid();
}
return await ExportWorkflows(id);
}


public async Task<IActionResult> EditProperties(int? id, string returnUrl = null)
hyzx86 marked this conversation as resolved.
Show resolved Hide resolved

{
if (!await _authorizationService.AuthorizeAsync(User, Permissions.ManageWorkflows))
{
Expand Down Expand Up @@ -546,5 +567,28 @@

return activityShape;
}

private async Task<IActionResult> ExportWorkflows(params long[] itemIds)
{
using var fileBuilder = new TemporaryFileBuilder();
var archiveFileName = fileBuilder.Folder + ".zip";
var recipeDescriptor = new RecipeDescriptor();
var deploymentPlanResult = new DeploymentPlanResult(fileBuilder, recipeDescriptor);
var workflowTypes = await _workflowTypeStore.GetAsync(itemIds);

AllWorkflowTypeDeploymentSource.ProcessWorkflowType(deploymentPlanResult, workflowTypes, _documentJsonSerializerOptions);
hishamco marked this conversation as resolved.
Show resolved Hide resolved

await deploymentPlanResult.FinalizeAsync();
Piedone marked this conversation as resolved.
Show resolved Hide resolved
ZipFile.CreateFromDirectory(fileBuilder.Folder, archiveFileName);

var packageName = itemIds.Length == 1
? workflowTypes.FirstOrDefault().Name
: S["Workflow Types"];

return new PhysicalFileResult(archiveFileName, "application/zip")
{
FileDownloadName = packageName + ".zip",
};
}
hishamco marked this conversation as resolved.
Show resolved Hide resolved
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using OrchardCore.Deployment;
using OrchardCore.Json;
using OrchardCore.Workflows.Models;
using OrchardCore.Workflows.Services;

namespace OrchardCore.Workflows.Deployment
Expand All @@ -28,23 +30,27 @@
return;
}

var data = new JsonArray();
result.Steps.Add(new JsonObject
{
["name"] = "WorkflowType",
["data"] = data,
});
ProcessWorkflowType(result, await _workflowTypeStore.ListAsync(), _documentJsonSerializerOptions);

Check failure on line 33 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context

Check failure on line 33 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context

Check failure on line 33 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context

Check failure on line 33 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context
hishamco marked this conversation as resolved.
Show resolved Hide resolved
hishamco marked this conversation as resolved.
Show resolved Hide resolved
}

foreach (var workflow in await _workflowTypeStore.ListAsync())
public static void ProcessWorkflowType(DeploymentPlanResult result, IEnumerable<WorkflowType> workflowTypes, JsonSerializerOptions jsonSerializerOptions)
{
var data = new JsonArray();

foreach (var workflowType in workflowTypes)
{
var objectData = JObject.FromObject(workflow, _jsonSerializerOptions);
var objectData = JObject.FromObject(workflowType, _documentJsonSerializerOptions);

Check failure on line 42 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context

Check failure on line 42 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (ubuntu-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context

Check failure on line 42 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context

Check failure on line 42 in src/OrchardCore.Modules/OrchardCore.Workflows/Deployment/AllWorkflowTypeDeploymentSource.cs

View workflow job for this annotation

GitHub Actions / Build & Test (windows-latest)

The name '_documentJsonSerializerOptions' does not exist in the current context
hishamco marked this conversation as resolved.
Show resolved Hide resolved
hishamco marked this conversation as resolved.
Show resolved Hide resolved

// Don't serialize the Id as it could be interpreted as an updated object when added back to YesSql
objectData.Remove(nameof(workflow.Id));
objectData.Remove(nameof(workflowType.Id));
data.Add(objectData);
}

return;
result.Steps.Add(new JsonObject
{
["name"] = "WorkflowType",
["data"] = data,
});
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<ProjectReference Include="..\..\OrchardCore\OrchardCore.ContentManagement.Display\OrchardCore.ContentManagement.Display.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Data.Abstractions\OrchardCore.Data.Abstractions.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Data.YesSql\OrchardCore.Data.YesSql.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Deployment.Abstractions\OrchardCore.Deployment.Abstractions.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Deployment.Core\OrchardCore.Deployment.Core.csproj" />
hishamco marked this conversation as resolved.
Show resolved Hide resolved
Piedone marked this conversation as resolved.
Show resolved Hide resolved
<ProjectReference Include="..\..\OrchardCore\OrchardCore.DisplayManagement.Liquid\OrchardCore.DisplayManagement.Liquid.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.DisplayManagement\OrchardCore.DisplayManagement.csproj" />
<ProjectReference Include="..\..\OrchardCore\OrchardCore.Navigation.Core\OrchardCore.Navigation.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public WorkflowMethodsProvider(WorkflowExecutionContext workflowContext)
_workflowIdMethod = new GlobalMethod
{
Name = "workflowId",
Method = serviceProvider => (Func<string>)(() => workflowContext.Workflow.WorkflowId),
Method = serviceProvider => () => workflowContext.Workflow.WorkflowId,
};

_inputMethod = new GlobalMethod
Expand Down Expand Up @@ -58,13 +58,13 @@ public WorkflowMethodsProvider(WorkflowExecutionContext workflowContext)
_resultMethod = new GlobalMethod
{
Name = "lastResult",
Method = serviceProvider => (Func<object>)(() => workflowContext.LastResult),
Method = serviceProvider => () => workflowContext.LastResult,
};

_correlationIdMethod = new GlobalMethod
{
Name = "correlationId",
Method = serviceProvider => (Func<string>)(() => workflowContext.Workflow.CorrelationId),
Method = serviceProvider => () => workflowContext.Workflow.CorrelationId,
};

_setCorrelationIdMethod = new GlobalMethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public enum WorkflowTypeFilter
public enum WorkflowTypeBulkAction
{
None,
Export,
Delete
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
</ol>
</nav>
</zone>

<div class="card text-bg-theme mb-3">
<div class="card-body">
<div class="d-flex justify-content-between">
Expand All @@ -23,6 +24,7 @@
</button>
</div>
<div>
<a class="btn btn-sm btn-secondary" asp-action="Export" data-url-af="UnsafeUrl" asp-route-id="@Model.WorkflowType.Id" asp-route-returnUrl="@FullRequestPath">@T["Export"]</a>
<a class="btn btn-sm btn-secondary" asp-action="EditProperties" asp-route-id="@Model.WorkflowType.Id" asp-route-returnUrl="@FullRequestPath">@T["Properties"]</a>
<a class="btn btn-sm btn-secondary" asp-action="Index" asp-controller="Workflow" asp-route-workflowtypeid="@Model.WorkflowType.Id" asp-route-returnUrl="@FullRequestPath">@T["Instances"] <span class="badge ta-badge">@Model.WorkflowCount</span></a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
@T["Actions"]
</button>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="bulk-action-menu-button">
<li><a class="dropdown-item" href="javascript:void(0)" data-action="Export" data-title="@T["Bulk Action"]">Export</a></li>
@foreach (var item in Model.Options.WorkflowTypesBulkAction)
{
<li><a class="dropdown-item" href="javascript:void(0)" data-action="@item.Value" data-title="@T["Bulk Action"]" data-message="@T["Are you sure you want to {0} these items?", @item.Text.ToLower()]">@item.Text</a></li>
Expand All @@ -63,6 +64,7 @@
<li class="list-group-item">
<div class="properties">
<div class="float-end">
<a asp-action="Export" data-url-af="UnsafeUrl" asp-route-id="@entry.WorkflowType.Id" asp-route-returnUrl="@FullRequestPath" class="btn btn-sm btn-secondary">@T["Export"]</a>
<a asp-action="Edit" asp-route-id="@entry.WorkflowType.Id" asp-route-returnUrl="@FullRequestPath" class="btn btn-primary btn-sm">@T["Edit"]</a>
<a asp-action="EditProperties" asp-route-id="@entry.WorkflowType.Id" asp-route-returnUrl="@FullRequestPath" class="btn btn-success btn-sm">@T["Properties"]</a>
<a asp-action="Delete" asp-route-id="@entry.WorkflowType.Id" class="btn btn-danger btn-sm" data-url-af="RemoveUrl UnsafeUrl">@T["Delete"]</a>
Expand Down Expand Up @@ -121,14 +123,22 @@
}).on("click", function () {
if ($(":checkbox[name='itemIds']:checked").length > 1) {
var $this = $(this);
confirmDialog({
title: $this.data('title'), message: $this.data('message'), callback: function (r) {
if (r) {
$("[name='Options.BulkAction']").val($this.data("action"));
$("[name='submit.BulkAction']").click();
}
}
});
switch ($this.data("action")) {
case "Delete":
confirmDialog({
title: $this.data('title'), message: $this.data('message'), callback: function (r) {
if (r) {
$("[name='Options.BulkAction']").val($this.data("action"));
$("[name='submit.BulkAction']").click();
}
}
});
break;
case "Export":
$("[name='Options.BulkAction']").val($this.data("action"));
$("[name='submit.BulkAction']").click();
break;
}
}
});

Expand Down
Loading