Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 12 additions & 1 deletion public/locales/de-DE/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,18 @@
"startedAfter": "startedAfter",
"finished": "finished"
},
"manage_title": "Prozessinstanz-Filter verwalten"
"manage_title": "Prozessinstanz-Filter verwalten",
"historic-delete": {
"open": "Historie löschen",
"title": "Historische Prozessinstanzen löschen",
"reason": "Löschgrund",
"confirm": "Historie löschen",
"select-all": "Alle historischen Instanzen auswählen",
"count": "{{count}} ausgewählt",
"batch-created": "Batch erstellt:",
"view-batch": "Batch anzeigen",
"success": "Historien-Lösch-Batch gestartet."
}
},
"history-mode-na": "Live-Daten – der Verlaufsmodus gilt hier nicht.",
"filter": {
Expand Down
13 changes: 12 additions & 1 deletion public/locales/en-US/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,18 @@
"startedAfter": "startedAfter",
"finished": "finished"
},
"manage_title": "Manage process-instance filters"
"manage_title": "Manage process-instance filters",
"historic-delete": {
"open": "Delete history",
"title": "Delete historic process instances",
"reason": "Delete reason",
"confirm": "Delete history",
"select-all": "Select all historic instances",
"count": "{{count}} selected",
"batch-created": "Batch created:",
"view-batch": "View batch",
"success": "History delete batch started."
}
},
"history-mode-na": "Live data — history mode does not apply here.",
"filter": {
Expand Down
8 changes: 6 additions & 2 deletions src/api/resources/history.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GET, PAGINATED_GET } from '../helper.jsx'
import { GET, PAGINATED_GET, POST } from '../helper.jsx'

const INSTANCE_PAGE_SIZE = 20

Expand Down Expand Up @@ -49,6 +49,9 @@ const get_historic_tasks_by_instance = (state, instance_id) =>
const get_historic_called_instances = (state, instance_id) =>
GET(`/history/process-instance?superProcessInstanceId=${instance_id}`, state, state.api.history.process_instance.called)

const delete_historic_process_instances_async = (state, body) =>
POST('/history/process-instance/delete', body, state, state.api.history.process_instance.delete_async)

/**
* Task History
*/
Expand All @@ -61,6 +64,7 @@ const history = {
one: get_process_instance,
all_unfinished: get_process_instances_unfinished,
called: get_historic_called_instances,
delete_async: delete_historic_process_instances_async,
},
incident: {
by_process_definition: get_incidents_by_process_definition,
Expand All @@ -75,4 +79,4 @@ const history = {
get_user_operation
}

export default history
export default history
17 changes: 16 additions & 1 deletion src/api/resources/history.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { describe, it, vi, beforeEach, expect } from "vitest";
vi.mock("../helper.jsx", () => ({
GET: vi.fn(),
PAGINATED_GET: vi.fn(),
POST: vi.fn(),
}));

import { GET, PAGINATED_GET } from "../helper.jsx";
import { GET, PAGINATED_GET, POST } from "../helper.jsx";
import { create_mock_state, expect_api_call } from "../../test/helpers.js";
import history from "./history.js";

Expand Down Expand Up @@ -118,4 +119,18 @@ describe("api/resources/history", () => {
signal: state.api.history.process_instance.called,
});
});

it("process_instance.delete_async() POSTs selected historic instances", () => {
const body = {
historicProcessInstanceIds: ["hist-1", "hist-2"],
deleteReason: "retention",
};
history.process_instance.delete_async(state, body);
expect_api_call(POST, {
url: "/history/process-instance/delete",
body,
state,
signal: state.api.history.process_instance.delete_async,
});
});
});
43 changes: 43 additions & 0 deletions src/css/components.css
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,49 @@ div.accordion {
color: var(--text-2);
}

/* historic process instance bulk actions */

.historic-instance-delete {
margin-bottom: var(--spacing-2);
padding: var(--spacing-1);
border: var(--border);
border-radius: var(--border-radius);
background: var(--background-1);
}

.historic-instance-delete fieldset {
display: grid;
grid-template-columns: minmax(14rem, 1fr) max-content;
gap: var(--spacing-1);
align-items: end;
}

.historic-instance-delete legend {
grid-column: 1 / -1;
}

.historic-instance-delete label {
display: flex;
flex-direction: column;
gap: var(--spacing-half);
}

.historic-instance-delete .button-group {
display: flex;
gap: var(--spacing-1);
}

.historic-instance-delete .info-box {
grid-column: 1 / -1;
margin-top: var(--spacing-1);
}

@media (max-width: 720px) {
.historic-instance-delete fieldset {
grid-template-columns: 1fr;
}
}

/* task detail cards */

.task-cards {
Expand Down
Loading