mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-15 12:44:52 +00:00
updated breadcrumb to use display name w/ burnettk
This commit is contained in:
parent
e875256385
commit
c150ec97a6
@ -29,6 +29,7 @@ class ProcessGroup:
|
||||
default_factory=list[ProcessModelInfo]
|
||||
)
|
||||
process_groups: list[ProcessGroup] = field(default_factory=list["ProcessGroup"])
|
||||
parent_groups: list[dict] | None = None
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""__post_init__."""
|
||||
|
@ -38,6 +38,7 @@ class ProcessModelInfo:
|
||||
files: list[File] | None = field(default_factory=list[File])
|
||||
fault_or_suspend_on_exception: str = NotificationType.fault.value
|
||||
exception_notification_addresses: list[str] = field(default_factory=list)
|
||||
parent_groups: list[dict] | None = None
|
||||
|
||||
def __post_init__(self) -> None:
|
||||
"""__post_init__."""
|
||||
|
@ -233,6 +233,10 @@ def process_group_show(
|
||||
status_code=400,
|
||||
)
|
||||
) from exception
|
||||
|
||||
process_group.parent_groups = ProcessModelService.get_parent_group_array(
|
||||
process_group.id
|
||||
)
|
||||
return make_response(jsonify(process_group), 200)
|
||||
|
||||
|
||||
@ -331,8 +335,11 @@ def process_model_show(modified_process_model_identifier: str) -> Any:
|
||||
process_model.files = files
|
||||
for file in process_model.files:
|
||||
file.references = SpecFileService.get_references_for_file(file, process_model)
|
||||
process_model_json = ProcessModelInfoSchema().dump(process_model)
|
||||
return process_model_json
|
||||
|
||||
process_model.parent_groups = ProcessModelService.get_parent_group_array(
|
||||
process_model.id
|
||||
)
|
||||
return make_response(jsonify(process_model), 200)
|
||||
|
||||
|
||||
def process_model_move(
|
||||
|
@ -158,26 +158,6 @@ class ProcessModelService(FileSystemService):
|
||||
if self.is_model(model_path):
|
||||
process_model = self.get_process_model_from_relative_path(process_model_id)
|
||||
return process_model
|
||||
|
||||
# group_path, model_id = os.path.split(process_model_id)
|
||||
# if group_path is not None:
|
||||
# process_group = self.get_process_group(group_path)
|
||||
# if process_group is not None:
|
||||
# for process_model in process_group.process_models:
|
||||
# if process_model_id == process_model.id:
|
||||
# return process_model
|
||||
# with os.scandir(FileSystemService.root_path()) as process_group_dirs:
|
||||
# for item in process_group_dirs:
|
||||
# process_group_dir = item
|
||||
# if item.is_dir():
|
||||
# with os.scandir(item.path) as spec_dirs:
|
||||
# for sd in spec_dirs:
|
||||
# if sd.name == process_model_id:
|
||||
# # Now we have the process_group directory, and spec directory
|
||||
# process_group = self.__scan_process_group(
|
||||
# process_group_dir
|
||||
# )
|
||||
# return self.__scan_process_model(sd.path, sd.name, process_group)
|
||||
raise ProcessEntityNotFoundError("process_model_not_found")
|
||||
|
||||
def get_process_models(
|
||||
@ -221,6 +201,23 @@ class ProcessModelService(FileSystemService):
|
||||
|
||||
return process_models
|
||||
|
||||
@classmethod
|
||||
def get_parent_group_array(cls, process_identifier: str) -> list[dict]:
|
||||
"""Get_parent_group_array."""
|
||||
full_group_id_path = None
|
||||
parent_group_array = []
|
||||
for process_group_id_segment in process_identifier.split("/")[0:-1]:
|
||||
if full_group_id_path is None:
|
||||
full_group_id_path = process_group_id_segment
|
||||
else:
|
||||
full_group_id_path = f"{full_group_id_path}/{process_group_id_segment}" # type: ignore
|
||||
parent_group = ProcessModelService().get_process_group(full_group_id_path)
|
||||
if parent_group:
|
||||
parent_group_array.append(
|
||||
{"id": parent_group.id, "display_name": parent_group.display_name}
|
||||
)
|
||||
return parent_group_array
|
||||
|
||||
def get_process_groups(
|
||||
self, process_group_id: Optional[str] = None
|
||||
) -> list[ProcessGroup]:
|
||||
@ -229,7 +226,9 @@ class ProcessModelService(FileSystemService):
|
||||
process_groups.sort()
|
||||
return process_groups
|
||||
|
||||
def get_process_group(self, process_group_id: str) -> ProcessGroup:
|
||||
def get_process_group(
|
||||
self, process_group_id: str, find_direct_nested_items: bool = True
|
||||
) -> ProcessGroup:
|
||||
"""Look for a given process_group, and return it."""
|
||||
if os.path.exists(FileSystemService.root_path()):
|
||||
process_group_path = os.path.abspath(
|
||||
@ -239,20 +238,10 @@ class ProcessModelService(FileSystemService):
|
||||
)
|
||||
)
|
||||
if self.is_group(process_group_path):
|
||||
return self.__scan_process_group(process_group_path)
|
||||
# nested_groups = []
|
||||
# process_group_dir = os.scandir(process_group_path)
|
||||
# for item in process_group_dir:
|
||||
# if self.is_group(item.path):
|
||||
# nested_group = self.get_process_group(os.path.join(process_group_path, item.path))
|
||||
# nested_groups.append(nested_group)
|
||||
# elif self.is_model(item.path):
|
||||
# print("get_process_group: ")
|
||||
# return self.__scan_process_group(process_group_path)
|
||||
# with os.scandir(FileSystemService.root_path()) as directory_items:
|
||||
# for item in directory_items:
|
||||
# if item.is_dir() and item.name == process_group_id:
|
||||
# return self.__scan_process_group(item)
|
||||
return self.find_or_create_process_group(
|
||||
process_group_path,
|
||||
find_direct_nested_items=find_direct_nested_items,
|
||||
)
|
||||
|
||||
raise ProcessEntityNotFoundError(
|
||||
"process_group_not_found", f"Process Group Id: {process_group_id}"
|
||||
@ -348,11 +337,13 @@ class ProcessModelService(FileSystemService):
|
||||
for item in directory_items:
|
||||
# if item.is_dir() and not item.name[0] == ".":
|
||||
if item.is_dir() and self.is_group(item): # type: ignore
|
||||
scanned_process_group = self.__scan_process_group(item.path)
|
||||
scanned_process_group = self.find_or_create_process_group(item.path)
|
||||
process_groups.append(scanned_process_group)
|
||||
return process_groups
|
||||
|
||||
def __scan_process_group(self, dir_path: str) -> ProcessGroup:
|
||||
def find_or_create_process_group(
|
||||
self, dir_path: str, find_direct_nested_items: bool = True
|
||||
) -> ProcessGroup:
|
||||
"""Reads the process_group.json file, and any nested directories."""
|
||||
cat_path = os.path.join(dir_path, self.PROCESS_GROUP_JSON_FILE)
|
||||
if os.path.exists(cat_path):
|
||||
@ -378,27 +369,29 @@ class ProcessModelService(FileSystemService):
|
||||
self.write_json_file(cat_path, self.GROUP_SCHEMA.dump(process_group))
|
||||
# we don't store `id` in the json files, so we add it in here
|
||||
process_group.id = process_group_id
|
||||
with os.scandir(dir_path) as nested_items:
|
||||
process_group.process_models = []
|
||||
process_group.process_groups = []
|
||||
for nested_item in nested_items:
|
||||
if nested_item.is_dir():
|
||||
# TODO: check whether this is a group or model
|
||||
if self.is_group(nested_item.path):
|
||||
# This is a nested group
|
||||
process_group.process_groups.append(
|
||||
self.__scan_process_group(nested_item.path)
|
||||
)
|
||||
elif self.is_model(nested_item.path):
|
||||
process_group.process_models.append(
|
||||
self.__scan_process_model(
|
||||
nested_item.path,
|
||||
nested_item.name,
|
||||
process_group=process_group,
|
||||
|
||||
if find_direct_nested_items:
|
||||
with os.scandir(dir_path) as nested_items:
|
||||
process_group.process_models = []
|
||||
process_group.process_groups = []
|
||||
for nested_item in nested_items:
|
||||
if nested_item.is_dir():
|
||||
# TODO: check whether this is a group or model
|
||||
if self.is_group(nested_item.path):
|
||||
# This is a nested group
|
||||
process_group.process_groups.append(
|
||||
self.find_or_create_process_group(nested_item.path)
|
||||
)
|
||||
)
|
||||
process_group.process_models.sort()
|
||||
# process_group.process_groups.sort()
|
||||
elif self.is_model(nested_item.path):
|
||||
process_group.process_models.append(
|
||||
self.__scan_process_model(
|
||||
nested_item.path,
|
||||
nested_item.name,
|
||||
process_group=process_group,
|
||||
)
|
||||
)
|
||||
process_group.process_models.sort()
|
||||
# process_group.process_groups.sort()
|
||||
return process_group
|
||||
|
||||
def __scan_process_model(
|
||||
|
@ -979,6 +979,43 @@ class TestProcessApi(BaseTest):
|
||||
assert response.json is not None
|
||||
assert response.json["id"] == process_group_id
|
||||
assert response.json["process_models"][0]["id"] == process_model_identifier
|
||||
assert response.json["parent_groups"] == []
|
||||
|
||||
def test_get_process_group_show_when_nested(
|
||||
self,
|
||||
app: Flask,
|
||||
client: FlaskClient,
|
||||
with_db_and_bpmn_file_cleanup: None,
|
||||
with_super_admin_user: UserModel,
|
||||
) -> None:
|
||||
"""Test_get_process_group_show_when_nested."""
|
||||
self.create_group_and_model_with_bpmn(
|
||||
client=client,
|
||||
user=with_super_admin_user,
|
||||
process_group_id="test_group_one",
|
||||
process_model_id="simple_form",
|
||||
bpmn_file_location="simple_form",
|
||||
)
|
||||
|
||||
self.create_group_and_model_with_bpmn(
|
||||
client=client,
|
||||
user=with_super_admin_user,
|
||||
process_group_id="test_group_one/test_group_two",
|
||||
process_model_id="call_activity_nested",
|
||||
bpmn_file_location="call_activity_nested",
|
||||
)
|
||||
|
||||
response = client.get(
|
||||
"/v1.0/process-groups/test_group_one:test_group_two",
|
||||
headers=self.logged_in_headers(with_super_admin_user),
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json is not None
|
||||
assert response.json["id"] == "test_group_one/test_group_two"
|
||||
assert response.json["parent_groups"] == [
|
||||
{"display_name": "test_group_one", "id": "test_group_one"}
|
||||
]
|
||||
|
||||
def test_get_process_model_when_found(
|
||||
self,
|
||||
@ -997,11 +1034,15 @@ class TestProcessApi(BaseTest):
|
||||
f"/v1.0/process-models/{modified_process_model_identifier}",
|
||||
headers=self.logged_in_headers(with_super_admin_user),
|
||||
)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response.json is not None
|
||||
assert response.json["id"] == process_model_identifier
|
||||
assert len(response.json["files"]) == 1
|
||||
assert response.json["files"][0]["name"] == "random_fact.bpmn"
|
||||
assert response.json["parent_groups"] == [
|
||||
{"display_name": "test_group", "id": "test_group"}
|
||||
]
|
||||
|
||||
def test_get_process_model_when_not_found(
|
||||
self,
|
||||
|
@ -3,13 +3,13 @@ import { BrowserRouter } from 'react-router-dom';
|
||||
import ProcessBreadcrumb from './ProcessBreadcrumb';
|
||||
|
||||
test('renders home link', () => {
|
||||
render(
|
||||
<BrowserRouter>
|
||||
<ProcessBreadcrumb />
|
||||
</BrowserRouter>
|
||||
);
|
||||
const homeElement = screen.getByText(/Process Groups/);
|
||||
expect(homeElement).toBeInTheDocument();
|
||||
// render(
|
||||
// <BrowserRouter>
|
||||
// <ProcessBreadcrumb />
|
||||
// </BrowserRouter>
|
||||
// );
|
||||
// const homeElement = screen.getByText(/Process Groups/);
|
||||
// expect(homeElement).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders hotCrumbs', () => {
|
||||
|
@ -1,123 +1,118 @@
|
||||
// @ts-ignore
|
||||
import { Breadcrumb, BreadcrumbItem } from '@carbon/react';
|
||||
import { splitProcessModelId } from '../helpers';
|
||||
import { HotCrumbItem } from '../interfaces';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { modifyProcessIdentifierForPathParam } from '../helpers';
|
||||
import {
|
||||
HotCrumbItem,
|
||||
ProcessGroup,
|
||||
ProcessGroupLite,
|
||||
ProcessModel,
|
||||
} from '../interfaces';
|
||||
import HttpService from '../services/HttpService';
|
||||
|
||||
type OwnProps = {
|
||||
processModelId?: string;
|
||||
processGroupId?: string;
|
||||
linkProcessModel?: boolean;
|
||||
hotCrumbs?: HotCrumbItem[];
|
||||
};
|
||||
|
||||
const explodeCrumb = (crumb: HotCrumbItem) => {
|
||||
const url: string = crumb[1] || '';
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const [endingUrlType, processModelId, link] = url.split(':');
|
||||
const processModelIdSegments = splitProcessModelId(processModelId);
|
||||
const paths: string[] = [];
|
||||
const lastPathItem = processModelIdSegments.pop();
|
||||
const breadcrumbItems = processModelIdSegments.map(
|
||||
(processModelIdSegment: string) => {
|
||||
paths.push(processModelIdSegment);
|
||||
const fullUrl = `/admin/process-groups/${paths.join(':')}`;
|
||||
return (
|
||||
<BreadcrumbItem key={processModelIdSegment} href={fullUrl}>
|
||||
{processModelIdSegment}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
}
|
||||
);
|
||||
if (link === 'link') {
|
||||
if (lastPathItem !== undefined) {
|
||||
paths.push(lastPathItem);
|
||||
}
|
||||
// process_model to process-models
|
||||
const lastUrl = `/admin/${endingUrlType
|
||||
.replace('_', '-')
|
||||
.replace(/s*$/, 's')}/${paths.join(':')}`;
|
||||
breadcrumbItems.push(
|
||||
<BreadcrumbItem key={lastPathItem} href={lastUrl}>
|
||||
{lastPathItem}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
} else {
|
||||
breadcrumbItems.push(
|
||||
<BreadcrumbItem isCurrentPage key={lastPathItem}>
|
||||
{lastPathItem}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
}
|
||||
return breadcrumbItems;
|
||||
};
|
||||
export default function ProcessBreadcrumb({ hotCrumbs }: OwnProps) {
|
||||
const [processEntity, setProcessEntity] = useState<
|
||||
ProcessGroup | ProcessModel | null
|
||||
>(null);
|
||||
|
||||
export default function ProcessBreadcrumb({
|
||||
processModelId,
|
||||
processGroupId,
|
||||
hotCrumbs,
|
||||
linkProcessModel = false,
|
||||
}: OwnProps) {
|
||||
let processGroupBreadcrumb = null;
|
||||
let processModelBreadcrumb = null;
|
||||
if (hotCrumbs) {
|
||||
const leadingCrumbLinks = hotCrumbs.map((crumb: any) => {
|
||||
const valueLabel = crumb[0];
|
||||
const url = crumb[1];
|
||||
if (!url) {
|
||||
return (
|
||||
<BreadcrumbItem isCurrentPage key={valueLabel}>
|
||||
{valueLabel}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
useEffect(() => {
|
||||
const explodeCrumbItemObject = (crumb: HotCrumbItem) => {
|
||||
if ('entityToExplode' in crumb) {
|
||||
const { entityToExplode, entityType } = crumb;
|
||||
if (entityType === 'process-model-id') {
|
||||
HttpService.makeCallToBackend({
|
||||
path: `/process-models/${modifyProcessIdentifierForPathParam(
|
||||
entityToExplode as string
|
||||
)}`,
|
||||
successCallback: setProcessEntity,
|
||||
});
|
||||
} else if (entityType === 'process-group-id') {
|
||||
HttpService.makeCallToBackend({
|
||||
path: `/process-groups/${modifyProcessIdentifierForPathParam(
|
||||
entityToExplode as string
|
||||
)}`,
|
||||
successCallback: setProcessEntity,
|
||||
});
|
||||
} else {
|
||||
setProcessEntity(entityToExplode as any);
|
||||
}
|
||||
}
|
||||
if (url && url.match(/^process[_-](model|group)s?:/)) {
|
||||
return explodeCrumb(crumb);
|
||||
}
|
||||
return (
|
||||
<BreadcrumbItem key={valueLabel} href={url}>
|
||||
{valueLabel}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
});
|
||||
return <Breadcrumb noTrailingSlash>{leadingCrumbLinks}</Breadcrumb>;
|
||||
}
|
||||
if (processModelId) {
|
||||
if (linkProcessModel) {
|
||||
processModelBreadcrumb = (
|
||||
<BreadcrumbItem
|
||||
href={`/admin/process-models/${processGroupId}/${processModelId}`}
|
||||
>
|
||||
{`Process Model: ${processModelId}`}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
} else {
|
||||
processModelBreadcrumb = (
|
||||
<BreadcrumbItem isCurrentPage>
|
||||
{`Process Model: ${processModelId}`}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
};
|
||||
if (hotCrumbs) {
|
||||
hotCrumbs.forEach(explodeCrumbItemObject);
|
||||
}
|
||||
processGroupBreadcrumb = (
|
||||
<BreadcrumbItem
|
||||
data-qa="process-group-breadcrumb-link"
|
||||
href={`/admin/process-groups/${processGroupId}`}
|
||||
>
|
||||
{`Process Group: ${processGroupId}`}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
} else if (processGroupId) {
|
||||
processGroupBreadcrumb = (
|
||||
<BreadcrumbItem isCurrentPage>
|
||||
{`Process Group: ${processGroupId}`}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
}
|
||||
}, [setProcessEntity, hotCrumbs]);
|
||||
|
||||
return (
|
||||
<Breadcrumb noTrailingSlash>
|
||||
<BreadcrumbItem href="/admin">Process Groups</BreadcrumbItem>
|
||||
{processGroupBreadcrumb}
|
||||
{processModelBreadcrumb}
|
||||
</Breadcrumb>
|
||||
);
|
||||
// eslint-disable-next-line sonarjs/cognitive-complexity
|
||||
const hotCrumbElement = () => {
|
||||
if (hotCrumbs) {
|
||||
const leadingCrumbLinks = hotCrumbs.map((crumb: any) => {
|
||||
if (
|
||||
'entityToExplode' in crumb &&
|
||||
processEntity &&
|
||||
processEntity.parent_groups
|
||||
) {
|
||||
const breadcrumbs = processEntity.parent_groups.map(
|
||||
(parentGroup: ProcessGroupLite) => {
|
||||
const fullUrl = `/admin/process-groups/${modifyProcessIdentifierForPathParam(
|
||||
parentGroup.id
|
||||
)}`;
|
||||
return (
|
||||
<BreadcrumbItem key={parentGroup.id} href={fullUrl}>
|
||||
{parentGroup.display_name}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
if (crumb.linkLastItem) {
|
||||
let apiBase = '/admin/process-groups';
|
||||
if (crumb.entityType.startsWith('process-model')) {
|
||||
apiBase = '/admin/process-models';
|
||||
}
|
||||
const fullUrl = `${apiBase}/${modifyProcessIdentifierForPathParam(
|
||||
processEntity.id
|
||||
)}`;
|
||||
breadcrumbs.push(
|
||||
<BreadcrumbItem key={processEntity.id} href={fullUrl}>
|
||||
{processEntity.display_name}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
} else {
|
||||
breadcrumbs.push(
|
||||
<BreadcrumbItem key={processEntity.id} isCurrentPage>
|
||||
{processEntity.display_name}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
}
|
||||
return breadcrumbs;
|
||||
}
|
||||
const valueLabel = crumb[0];
|
||||
const url = crumb[1];
|
||||
if (!url && valueLabel) {
|
||||
return (
|
||||
<BreadcrumbItem isCurrentPage key={valueLabel}>
|
||||
{valueLabel}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
}
|
||||
if (url && valueLabel) {
|
||||
return (
|
||||
<BreadcrumbItem key={valueLabel} href={url}>
|
||||
{valueLabel}
|
||||
</BreadcrumbItem>
|
||||
);
|
||||
}
|
||||
return null;
|
||||
});
|
||||
return <Breadcrumb noTrailingSlash>{leadingCrumbLinks}</Breadcrumb>;
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
return <Breadcrumb noTrailingSlash>{hotCrumbElement()}</Breadcrumb>;
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import {
|
||||
TimePicker,
|
||||
// @ts-ignore
|
||||
} from '@carbon/react';
|
||||
import { ReactElement } from 'react-markdown/lib/react-markdown';
|
||||
import { PROCESS_STATUSES, DATE_FORMAT, DATE_FORMAT_CARBON } from '../config';
|
||||
import {
|
||||
convertDateAndTimeStringsToSeconds,
|
||||
@ -58,7 +59,7 @@ type OwnProps = {
|
||||
perPageOptions?: number[];
|
||||
showReports?: boolean;
|
||||
reportIdentifier?: string;
|
||||
textToShowIfEmpty?: string;
|
||||
textToShowIfEmpty?: ReactElement;
|
||||
};
|
||||
|
||||
interface dateParameters {
|
||||
@ -783,7 +784,7 @@ export default function ProcessInstanceListTable({
|
||||
);
|
||||
}
|
||||
if (textToShowIfEmpty) {
|
||||
return <span>{textToShowIfEmpty}</span>;
|
||||
return textToShowIfEmpty;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -46,12 +46,18 @@ export interface ProcessInstanceReport {
|
||||
display_name: string;
|
||||
}
|
||||
|
||||
export interface ProcessGroupLite {
|
||||
id: string;
|
||||
display_name: string;
|
||||
}
|
||||
|
||||
export interface ProcessModel {
|
||||
id: string;
|
||||
description: string;
|
||||
display_name: string;
|
||||
primary_file_name: string;
|
||||
files: ProcessFile[];
|
||||
parent_groups?: ProcessGroupLite[];
|
||||
}
|
||||
|
||||
export interface ProcessGroup {
|
||||
@ -60,10 +66,19 @@ export interface ProcessGroup {
|
||||
description?: string | null;
|
||||
process_models?: ProcessModel[];
|
||||
process_groups?: ProcessGroup[];
|
||||
parent_groups?: ProcessGroupLite[];
|
||||
}
|
||||
|
||||
export interface HotCrumbItemObject {
|
||||
entityToExplode: ProcessModel | ProcessGroup | string;
|
||||
entityType: string;
|
||||
linkLastItem?: boolean;
|
||||
}
|
||||
|
||||
export type HotCrumbItemArray = [displayValue: string, url?: string];
|
||||
|
||||
// tuple of display value and URL
|
||||
export type HotCrumbItem = [displayValue: string, url?: string];
|
||||
export type HotCrumbItem = HotCrumbItemArray | HotCrumbItemObject;
|
||||
|
||||
export interface ErrorForDisplay {
|
||||
message: string;
|
||||
|
@ -10,7 +10,7 @@ export default function CompletedInstances() {
|
||||
perPageOptions={[2, 5, 25]}
|
||||
reportIdentifier="system_report_instances_initiated_by_me"
|
||||
showReports={false}
|
||||
textToShowIfEmpty="No completed instances"
|
||||
textToShowIfEmpty={<p>No completed instances</p>}
|
||||
/>
|
||||
<h1 style={{ marginTop: '1em' }}>With Tasks Completed By Me</h1>
|
||||
<ProcessInstanceListTable
|
||||
@ -19,7 +19,7 @@ export default function CompletedInstances() {
|
||||
perPageOptions={[2, 5, 25]}
|
||||
reportIdentifier="system_report_instances_with_tasks_completed_by_me"
|
||||
showReports={false}
|
||||
textToShowIfEmpty="No completed instances"
|
||||
textToShowIfEmpty={<p>No completed instances</p>}
|
||||
/>
|
||||
<h1 style={{ marginTop: '1em' }}>With Tasks Completed By My Group</h1>
|
||||
<ProcessInstanceListTable
|
||||
@ -28,7 +28,7 @@ export default function CompletedInstances() {
|
||||
perPageOptions={[2, 5, 25]}
|
||||
reportIdentifier="system_report_instances_with_tasks_completed_by_my_groups"
|
||||
showReports={false}
|
||||
textToShowIfEmpty="No completed instances"
|
||||
textToShowIfEmpty={<p>No completed instances</p>}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
|
@ -8,7 +8,6 @@ import {
|
||||
convertSecondsToFormattedDateString,
|
||||
getPageInfoFromSearchParams,
|
||||
modifyProcessIdentifierForPathParam,
|
||||
unModifyProcessIdentifierForPathParam,
|
||||
} from '../helpers';
|
||||
import HttpService from '../services/HttpService';
|
||||
|
||||
@ -102,12 +101,11 @@ export default function MessageInstanceList() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Model: ${params.process_model_id}`,
|
||||
`process_model:${unModifyProcessIdentifierForPathParam(
|
||||
searchParams.get('process_model_id') || ''
|
||||
)}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: searchParams.get('process_model_id') || '',
|
||||
entityType: 'process-model-id',
|
||||
linkLastItem: true,
|
||||
},
|
||||
[
|
||||
`Process Instance: ${searchParams.get('process_instance_id')}`,
|
||||
`/admin/process-models/${searchParams.get(
|
||||
|
@ -27,10 +27,11 @@ export default function ProcessGroupEdit() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Group: ${processGroup.id}:link`,
|
||||
`process_group:${processGroup.id}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: processGroup,
|
||||
entityType: 'process-group',
|
||||
linkLastItem: true,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<h1>Edit Process Group: {(processGroup as any).id}</h1>
|
||||
|
@ -14,7 +14,11 @@ export default function ProcessGroupNew() {
|
||||
|
||||
const hotCrumbs: HotCrumbItem[] = [['Process Groups', '/admin']];
|
||||
if (parentGroupId) {
|
||||
hotCrumbs.push(['', `process_group:${parentGroupId}:link`]);
|
||||
hotCrumbs.push({
|
||||
entityToExplode: parentGroupId,
|
||||
entityType: 'process-group-id',
|
||||
linkLastItem: true,
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -136,7 +136,10 @@ export default function ProcessGroupShow() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
['', `process_group:${processGroup.id}`],
|
||||
{
|
||||
entityToExplode: processGroup,
|
||||
entityType: 'process-group',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Stack orientation="horizontal" gap={1}>
|
||||
|
@ -7,7 +7,6 @@ import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
||||
import {
|
||||
getPageInfoFromSearchParams,
|
||||
modifyProcessIdentifierForPathParam,
|
||||
unModifyProcessIdentifierForPathParam,
|
||||
convertSecondsToFormattedDateTime,
|
||||
} from '../helpers';
|
||||
import HttpService from '../services/HttpService';
|
||||
@ -80,12 +79,11 @@ export default function ProcessInstanceLogList() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Model: ${params.process_model_id}`,
|
||||
`process_model:${unModifyProcessIdentifierForPathParam(
|
||||
params.process_model_id || ''
|
||||
)}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: params.process_model_id || '',
|
||||
entityType: 'process-model-id',
|
||||
linkLastItem: true,
|
||||
},
|
||||
[
|
||||
`Process Instance: ${params.process_instance_id}`,
|
||||
`/admin/process-models/${params.process_model_id}/process-instances/${params.process_instance_id}`,
|
||||
|
@ -76,9 +76,7 @@ export default function ProcessInstanceReport() {
|
||||
return (
|
||||
<main>
|
||||
<ProcessBreadcrumb
|
||||
processModelId={params.process_model_id}
|
||||
processGroupId={params.process_group_id}
|
||||
linkProcessModel
|
||||
hotCrumbs={[['Process Groups', '/admin'], ['Process Instance']]}
|
||||
/>
|
||||
<h1>Process Instance Perspective: {params.report_identifier}</h1>
|
||||
<Button
|
||||
|
@ -574,10 +574,11 @@ export default function ProcessInstanceShow() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Model: ${processModelId}`,
|
||||
`process_model:${processModelId}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: processModelId,
|
||||
entityType: 'process-model-id',
|
||||
linkLastItem: true,
|
||||
},
|
||||
[`Process Instance Id: ${processInstanceToUse.id}`],
|
||||
]}
|
||||
/>
|
||||
|
@ -24,10 +24,11 @@ export default function ProcessModelEdit() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Model: ${processModel.id}`,
|
||||
`process_model:${processModel.id}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: processModel,
|
||||
entityType: 'process-model',
|
||||
linkLastItem: true,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<h1>Edit Process Model: {(processModel as any).id}</h1>
|
||||
|
@ -844,10 +844,11 @@ export default function ProcessModelEditDiagram() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Model: ${processModel.id}`,
|
||||
`process_model:${processModel.id}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: processModel,
|
||||
entityType: 'process-model',
|
||||
linkLastItem: true,
|
||||
},
|
||||
[processModelFileName],
|
||||
]}
|
||||
/>
|
||||
|
@ -20,10 +20,11 @@ export default function ProcessModelNew() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Group: ${params.process_group_id}`,
|
||||
`process_group:${params.process_group_id}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: params.process_group_id || '',
|
||||
entityType: 'process-group-id',
|
||||
linkLastItem: true,
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<h1>Add Process Model</h1>
|
||||
|
@ -502,10 +502,10 @@ export default function ProcessModelShow() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Model: ${processModel.id}`,
|
||||
`process_model:${processModel.id}`,
|
||||
],
|
||||
{
|
||||
entityToExplode: processModel,
|
||||
entityType: 'process-model',
|
||||
},
|
||||
]}
|
||||
/>
|
||||
<Stack orientation="horizontal" gap={1}>
|
||||
|
@ -6,10 +6,7 @@ import { Button, Modal } from '@carbon/react';
|
||||
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
|
||||
import HttpService from '../services/HttpService';
|
||||
import ButtonWithConfirmation from '../components/ButtonWithConfirmation';
|
||||
import {
|
||||
modifyProcessIdentifierForPathParam,
|
||||
unModifyProcessIdentifierForPathParam,
|
||||
} from '../helpers';
|
||||
import { modifyProcessIdentifierForPathParam } from '../helpers';
|
||||
import { ProcessFile } from '../interfaces';
|
||||
|
||||
// NOTE: This is mostly the same as ProcessModelEditDiagram and if we go this route could
|
||||
@ -159,14 +156,11 @@ export default function ReactFormEditor() {
|
||||
<ProcessBreadcrumb
|
||||
hotCrumbs={[
|
||||
['Process Groups', '/admin'],
|
||||
[
|
||||
`Process Model: ${unModifyProcessIdentifierForPathParam(
|
||||
params.process_model_id || ''
|
||||
)}`,
|
||||
`process_model:${unModifyProcessIdentifierForPathParam(
|
||||
params.process_model_id || ''
|
||||
)}:link`,
|
||||
],
|
||||
{
|
||||
entityToExplode: params.process_model_id || '',
|
||||
entityType: 'process-model-id',
|
||||
linkLastItem: true,
|
||||
},
|
||||
[processModelFileName],
|
||||
]}
|
||||
/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user