Fixed toobar shown in graph mode (#2720)

This commit is contained in:
Erik Jan de Wit 2022-06-01 11:19:39 +02:00 committed by GitHub
parent a7719d1ace
commit 8202f363c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -317,7 +317,7 @@ export default function FlowDetails() {
dropdownItems={dropdownItems} dropdownItems={dropdownItems}
/> />
<PageSection variant="light"> <PageSection variant="light">
{tableView && executionList && hasExecutions && ( {executionList && hasExecutions && (
<> <>
<Toolbar id="toolbar"> <Toolbar id="toolbar">
<ToolbarContent> <ToolbarContent>
@ -360,65 +360,69 @@ export default function FlowDetails() {
</ToolbarContent> </ToolbarContent>
</Toolbar> </Toolbar>
<DeleteConfirm /> <DeleteConfirm />
<DataList {tableView && (
aria-label="flows" <DataList
onDragFinish={(order) => { aria-label={t("flows")}
const withoutHeaderId = order.slice(1); onDragFinish={(order) => {
setLiveText( const withoutHeaderId = order.slice(1);
t("common:onDragFinish", { list: dragged?.displayName }) setLiveText(
); t("common:onDragFinish", { list: dragged?.displayName })
const change = executionList.getChange( );
dragged!, const change = executionList.getChange(
withoutHeaderId dragged!,
); withoutHeaderId
executeChange(dragged!, change); );
}} executeChange(dragged!, change);
onDragStart={(id) => { }}
const item = executionList.findExecution(id)!; onDragStart={(id) => {
setLiveText( const item = executionList.findExecution(id)!;
t("common:onDragStart", { item: item.displayName }) setLiveText(
); t("common:onDragStart", { item: item.displayName })
setDragged(item); );
if (!item.isCollapsed) { setDragged(item);
item.isCollapsed = true; if (!item.isCollapsed) {
setExecutionList(executionList.clone()); item.isCollapsed = true;
setExecutionList(executionList.clone());
}
}}
onDragMove={() =>
setLiveText(
t("common:onDragMove", { item: dragged?.displayName })
)
} }
}} onDragCancel={() => setLiveText(t("common:onDragCancel"))}
onDragMove={() => itemOrder={[
setLiveText( "header",
t("common:onDragMove", { item: dragged?.displayName }) ...executionList.order().map((ex) => ex.id!),
) ]}
} >
onDragCancel={() => setLiveText(t("common:onDragCancel"))} <FlowHeader />
itemOrder={[ <>
"header", {executionList.expandableList.map((execution) => (
...executionList.order().map((ex) => ex.id!), <FlowRow
]} builtIn={!!builtIn}
> key={execution.id}
<FlowHeader /> execution={execution}
<> onRowClick={(execution) => {
{executionList.expandableList.map((execution) => ( execution.isCollapsed = !execution.isCollapsed;
<FlowRow setExecutionList(executionList.clone());
builtIn={!!builtIn} }}
key={execution.id} onRowChange={update}
execution={execution} onAddExecution={(execution, type) =>
onRowClick={(execution) => { addExecution(execution.displayName!, type)
execution.isCollapsed = !execution.isCollapsed; }
setExecutionList(executionList.clone()); onAddFlow={(flow) =>
}} addFlow(execution.displayName!, flow)
onRowChange={update} }
onAddExecution={(execution, type) => onDelete={(execution) => {
addExecution(execution.displayName!, type) setSelectedExecution(execution);
} toggleDeleteDialog();
onAddFlow={(flow) => addFlow(execution.displayName!, flow)} }}
onDelete={(execution) => { />
setSelectedExecution(execution); ))}
toggleDeleteDialog(); </>
}} </DataList>
/> )}
))}
</>
</DataList>
{flow && ( {flow && (
<> <>
{showAddExecutionDialog && ( {showAddExecutionDialog && (