Skip to content

Commit 85941e7

Browse files
committed
wip:1 (it1w0)
1 parent 9b1b93b commit 85941e7

2 files changed

Lines changed: 5 additions & 48 deletions

File tree

extensions/funnel-builder/6.1.x/extensions/funnelBuilder/pageEditor/elementInputs/ContainerElementInputs.tsx

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,21 @@
11
import React from "react";
2-
import { Button, Text, useDisclosure } from "webiny/admin/ui";
3-
import { ElementInputs, useElementInputs } from "webiny/admin/website-builder/page/editor";
4-
import { ConditionRulesDialog } from "../components/ConditionRulesDialog";
2+
import { ElementInputs } from "webiny/admin/website-builder/page/editor";
53
import { StepsList } from "../stepper/StepsList.js";
6-
import type { FunnelModelDto } from "../../models/FunnelModel";
7-
import type { FunnelContainerInputs } from "../types";
84

95
export const ContainerElementInputsDecorator = ElementInputs.createDecorator(Original => {
106
return function ContainerElementSettings(props) {
117
const { element } = props;
12-
const { inputs, updateInputs } = useElementInputs(element.id);
13-
14-
const {
15-
open: showConditionRulesDialog,
16-
close: hideConditionRulesDialog,
17-
isOpen: isConditionRulesDialogOpen,
18-
data: conditionRulesData
19-
} = useDisclosure<FunnelModelDto>();
208

219
if (element.component.name !== "Fub/Container") {
2210
return <Original {...props} />;
2311
}
2412

25-
/* Container element: open condition rules using the current containerData. */
26-
const handleClick = () => {
27-
const { containerData } = inputs as unknown as FunnelContainerInputs;
28-
showConditionRulesDialog(containerData);
29-
};
30-
31-
const handleSubmit = (data: FunnelModelDto) => {
32-
updateInputs(current => {
33-
(current as unknown as FunnelContainerInputs).containerData = data;
34-
});
35-
hideConditionRulesDialog();
36-
};
37-
3813
return (
3914
<div className={"flex flex-col gap-xl"}>
4015
<div className={"flex flex-col gap-sm"}>
4116
<div className={"font-bold text-sm text-neutral-primary"}>Steps</div>
4217
<StepsList />
4318
</div>
44-
<div className={"flex flex-col gap-sm"}>
45-
<div className={"font-bold text-sm mb-sm text-neutral-primary"}>
46-
Condition Rules
47-
</div>
48-
<Button
49-
variant={"primary"}
50-
text={"Edit Condition Rules"}
51-
className={"w-full"}
52-
onClick={handleClick}
53-
/>
54-
</div>
55-
<ConditionRulesDialog
56-
open={isConditionRulesDialogOpen}
57-
data={conditionRulesData!}
58-
onClose={hideConditionRulesDialog}
59-
onSubmit={handleSubmit}
60-
/>
6119
</div>
6220
);
6321
};

extensions/funnel-builder/6.1.x/extensions/funnelBuilder/pageEditor/stepper/Stepper.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
useCreateElement,
99
useDeleteElement,
1010
useDocumentEditor,
11-
$selectElement,
11+
// $selectElement,
1212
$deselectElement,
1313
Commands
1414
} from "webiny/admin/website-builder/page/editor";
@@ -96,10 +96,9 @@ export const Stepper = () => {
9696
payload: { stepId }
9797
});
9898

99-
// Added timeout just so the auto-select looks more visually appealing. Otherwise, it looks glitchy.
100-
setTimeout(() => {
101-
$selectElement(editor, stepId);
102-
}, 350);
99+
// setTimeout(() => {
100+
// $selectElement(editor, stepId);
101+
// }, 350);
103102
};
104103

105104
const deleteStep = (stepElementId: string) => {

0 commit comments

Comments
 (0)