Skip to content

Commit

Permalink
Revert "simplification"
Browse files Browse the repository at this point in the history
This reverts commit 69d51fd.
  • Loading branch information
kbowers-ibm committed Nov 7, 2024
1 parent 69d51fd commit d7ba0ed
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 28 deletions.
8 changes: 4 additions & 4 deletions packages/bpmn-editor/src/diagram/nodes/NodeIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ export function EndEventIcon({ variant }: { variant?: EventVariant }) {
);
}

export function TaskIcon({ variant }: { variant?: TaskVariant }) {
export function TaskIcon({ variant, isIcon }: { variant?: TaskVariant; isIcon?: boolean }) {
return (
<RoundSvg>
<TaskNodeSvg {...nodeSvgProps} variant={variant ?? "none"} isIcon={true} />
<TaskNodeSvg {...nodeSvgProps} variant={variant ?? "none"} isIcon={isIcon ?? false} />
</RoundSvg>
);
}
Expand All @@ -134,10 +134,10 @@ export function CallActivityIcon() {
);
}

export function GatewayIcon({ variant }: { variant?: GatewayVariant }) {
export function GatewayIcon({ variant, isIcon }: { variant?: GatewayVariant; isIcon?: boolean }) {
return (
<RoundSvg>
<GatewayNodeSvg {...nodeSvgProps} width={200} height={200} variant={variant ?? "none"} isIcon={true} />
<GatewayNodeSvg {...nodeSvgProps} width={200} height={200} variant={variant ?? "none"} isIcon={isIcon ?? false} />
</RoundSvg>
);
}
Expand Down
10 changes: 4 additions & 6 deletions packages/bpmn-editor/src/diagram/nodes/NodeSvgs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,11 @@ export function TaskNodeSvg(
width,
height,
strokeWidth,
props: { isIcon: _isIcon, ..._props },
props: { ..._props },
} = normalize(__props);

const { variant } = { ..._props };
const { variant, isIcon } = { ..._props };
const { markers: _markers, variant: _variant, ...props } = { ..._props };
const isIcon = _isIcon ?? false;

const markers = useMemo(() => new Set(_markers), [_markers]);
const iconSize = 200;
Expand Down Expand Up @@ -698,11 +697,10 @@ export function GatewayNodeSvg(__props: NodeSvgProps & { variant: GatewayVariant
width,
height,
strokeWidth,
props: { isIcon: _isIcon, ..._props },
props: { ..._props },
} = normalize(__props);

const { variant, ...props } = { ..._props };
const isIcon = _isIcon ?? false;
const { variant, isIcon, ...props } = { ..._props };
const iconOffset = isIcon ? 25 : 0;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,35 +67,35 @@ export function useGatewayNodeMorphingActions(gateway: Gateway) {
const morphingActions = useMemo(() => {
return [
{
icon: <GatewayIcon variant={"parallelGateway"} />,
icon: <GatewayIcon variant={"parallelGateway"} isIcon={true} />,
key: "1",
title: "Parallel",
id: "parallelGateway",
action: () => morphGateway("parallelGateway"),
} as const,
{
icon: <GatewayIcon variant={"exclusiveGateway"} />,
icon: <GatewayIcon variant={"exclusiveGateway"} isIcon={true} />,
key: "2",
title: "Exclusive",
id: "exclusiveGateway",
action: () => morphGateway("exclusiveGateway"),
} as const,
{
icon: <GatewayIcon variant={"inclusiveGateway"} />,
icon: <GatewayIcon variant={"inclusiveGateway"} isIcon={true} />,
key: "3",
title: "Inclusive",
id: "inclusiveGateway",
action: () => morphGateway("inclusiveGateway"),
} as const,
{
icon: <GatewayIcon variant={"eventBasedGateway"} />,
icon: <GatewayIcon variant={"eventBasedGateway"} isIcon={true} />,
key: "4",
title: "Event",
id: "eventBasedGateway",
action: () => morphGateway("eventBasedGateway"),
} as const,
{
icon: <GatewayIcon variant={"complexGateway"} />,
icon: <GatewayIcon variant={"complexGateway"} isIcon={true} />,
key: "5",
title: "Complex",
id: "complexGateway",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,28 @@ export function useTaskNodeMorphingActions(task: Task) {
const morphingActions = useMemo(() => {
return [
{
icon: <TaskIcon variant={"userTask"} />,
icon: <TaskIcon variant={"userTask"} isIcon={true} />,
key: "1",
title: "User task",
id: "userTask",
action: () => morphTask("userTask"),
} as const,
{
icon: <TaskIcon variant={"businessRuleTask"} />,
icon: <TaskIcon variant={"businessRuleTask"} isIcon={true} />,
key: "2",
title: "Business Rule task",
id: "businessRuleTask",
action: () => morphTask("businessRuleTask"),
} as const,
{
icon: <TaskIcon variant={"serviceTask"} />,
icon: <TaskIcon variant={"serviceTask"} isIcon={true} />,
key: "3",
title: "Service task",
id: "serviceTask",
action: () => morphTask("serviceTask"),
} as const,
{
icon: <TaskIcon variant={"scriptTask"} />,
icon: <TaskIcon variant={"scriptTask"} isIcon={true} />,
key: "4",
title: "Script task",
id: "scriptTask",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function BusinessRuleTaskProperties({
<>
<PropertiesPanelHeaderFormSection
title={businessRuleTask["@_name"] || "Business rule task"}
icon={<TaskIcon variant={businessRuleTask.__$$element} />}
icon={<TaskIcon variant={businessRuleTask.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={businessRuleTask} />
<Divider inset={{ default: "insetXs" }} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function ComplexGatewayProperties({
return (
<PropertiesPanelHeaderFormSection
title={complexGateway["@_name"] || "Complex gateway"}
icon={<GatewayIcon variant={"complexGateway"} />}
icon={<GatewayIcon variant={"complexGateway"} isIcon={true} />}
>
<NameDocumentationAndId element={complexGateway} />
</PropertiesPanelHeaderFormSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function EventBasedGatewayProperties({
return (
<PropertiesPanelHeaderFormSection
title={eventBasedGateway["@_name"] || "Event-based gateway"}
icon={<GatewayIcon variant={eventBasedGateway.__$$element} />}
icon={<GatewayIcon variant={eventBasedGateway.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={eventBasedGateway} />
</PropertiesPanelHeaderFormSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function ExclusiveGatewayProperties({
return (
<PropertiesPanelHeaderFormSection
title={exclusiveGateway["@_name"] || "Exclusive gateway"}
icon={<GatewayIcon variant={exclusiveGateway.__$$element} />}
icon={<GatewayIcon variant={exclusiveGateway.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={exclusiveGateway} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function InclusiveGatewayProperties({
return (
<PropertiesPanelHeaderFormSection
title={inclusiveGateway["@_name"] || "Inclusive gateway"}
icon={<GatewayIcon variant={inclusiveGateway.__$$element} />}
icon={<GatewayIcon variant={inclusiveGateway.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={inclusiveGateway} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function ParallelGatewayProperties({
return (
<PropertiesPanelHeaderFormSection
title={parallelGateway["@_name"] || "Parallel gateway"}
icon={<GatewayIcon variant={parallelGateway.__$$element} />}
icon={<GatewayIcon variant={parallelGateway.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={parallelGateway} />
</PropertiesPanelHeaderFormSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function ScriptTaskProperties({
<>
<PropertiesPanelHeaderFormSection
title={scriptTask["@_name"] || "Script task"}
icon={<TaskIcon variant={scriptTask.__$$element} />}
icon={<TaskIcon variant={scriptTask.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={scriptTask} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function ServiceTaskProperties({
<>
<PropertiesPanelHeaderFormSection
title={serviceTask["@_name"] || "Service task"}
icon={<TaskIcon variant={serviceTask.__$$element} />}
icon={<TaskIcon variant={serviceTask.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={serviceTask} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function UserTaskProperties({
<>
<PropertiesPanelHeaderFormSection
title={userTask["@_name"] || "User task"}
icon={<TaskIcon variant={userTask.__$$element} />}
icon={<TaskIcon variant={userTask.__$$element} isIcon={true} />}
>
<NameDocumentationAndId element={userTask} />

Expand Down

0 comments on commit d7ba0ed

Please sign in to comment.