Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
2c4e0ee
chore: fieldlocation fetch completed
SahilCs15 Jun 29, 2025
26a70f4
chore: rendered the fieldmodifier apps added an event listner to send…
SahilCs15 Jun 30, 2025
c394b1f
chore: added test cases for the field location data
SahilCs15 Jul 1, 2025
bf2cc68
fix: undo unneccsary changes
SahilCs15 Jul 1, 2025
a0ff5b0
fix: resolved the issues
SahilCs15 Jul 3, 2025
000168e
feat: hovertoolbar component and rendering
csAyushDubey Jul 4, 2025
d9a0d09
chore: talismanrc update
csAyushDubey Jul 4, 2025
bc21aae
test: fieldlabelwrapper
csAyushDubey Jul 4, 2025
d2c1c70
Merge pull request #449 from contentstack/Field-modifiers-in-canvas
sairaj-cs Jul 7, 2025
88a81a4
redner the app on dom
SahilCs15 Jul 9, 2025
19f865a
Merge pull request #450 from contentstack/VE-6701-Hover-Toolbar-Support
csAyushDubey Jul 9, 2025
1cae0c3
fix: disable scroll when field modifer is active
SahilCs15 Jul 9, 2025
42c1576
feat: fieldLabelWrapper changes
csAyushDubey Jul 9, 2025
bab4171
fix: tooltip arrow change
csAyushDubey Jul 10, 2025
bfd84b7
Merge pull request #453 from contentstack/VE-6698-reference-map-sync
csAyushDubey Jul 10, 2025
8478bbc
fix: missed rendering case
csAyushDubey Jul 10, 2025
14ba432
fix:removed uncessary changes
SahilCs15 Jul 11, 2025
764fc0b
Merge branch 'render-field-modifier-in-canvas' into disable-scroll-wh…
SahilCs15 Jul 11, 2025
12be298
fix: addresed the requested cahnges
SahilCs15 Jul 14, 2025
51204af
chore: cleanup commit
csAyushDubey Jul 15, 2025
71f24d8
fix: tests
csAyushDubey Jul 15, 2025
8830f3c
chore: increased test timeout for CI
csAyushDubey Jul 15, 2025
eb2d72f
chore: incresed hook timeout for CI
csAyushDubey Jul 15, 2025
abfd640
chore: added retry to vitest
csAyushDubey Jul 15, 2025
da638dd
chore: increased timeout further
csAyushDubey Jul 15, 2025
cd63458
Merge pull request #458 from contentstack/disable-scroll-when-field-m…
SahilCs15 Jul 15, 2025
0d36fbc
Merge pull request #455 from contentstack/VE-6600-Hover-Toolbar-Support
csAyushDubey Jul 16, 2025
aa16fa2
Merge branch 'develop_v3' into VE-5474-Field-Modifier-support-for-can…
SahilCs15 Jul 16, 2025
c8e3a35
fix: fixed conficts
SahilCs15 Jul 16, 2025
435a028
fix: fixed the required changes
SahilCs15 Jul 16, 2025
37dccb8
fix: removed not requied changes
SahilCs15 Jul 16, 2025
366fc87
Merge pull request #460 from contentstack/VE-5474-Field-Modifier-supp…
SahilCs15 Jul 16, 2025
a80d08d
fix: no hovertoolbar when focussed
csAyushDubey Jul 16, 2025
69328d4
Merge pull request #461 from contentstack/VE-6600-Hover-Toolbar-Support
csAyushDubey Jul 16, 2025
cc71759
fix: changed order in tooltip and customcursor hiding
csAyushDubey Jul 18, 2025
565d56d
Merge pull request #464 from contentstack/VE-6600-Hover-Toolbar-Support
csAyushDubey Jul 18, 2025
b43682d
fix: modified the way we were handling fieldlocation data fetch (#462)
SahilCs15 Jul 18, 2025
ac4fdb3
fix: field parent clickability
csAyushDubey Jul 22, 2025
3b897a4
Merge pull request #467 from contentstack/VE-7005-hover-toolbar-click…
csAyushDubey Jul 22, 2025
6b83664
chore(VE-6918/error-text): warning message improved
csAdityaPachauri Jul 15, 2025
ec3ccab
chore(VE-6918/error-text): component name changed to title case
csAdityaPachauri Jul 23, 2025
7ecfb19
chore(VE-6918/error-text): unit test file added
csAdityaPachauri Jul 25, 2025
3d5afdc
Merge branch 'main' of https://github.com/contentstack/live-preview-s…
csAdityaPachauri Jul 30, 2025
baea843
Merge pull request #475 from contentstack/VE-6918/error-text-main
csAdityaPachauri Jul 30, 2025
13ace62
fix: removed edit icon when the click is on the container (#478)
SahilCs15 Aug 4, 2025
1aa9ca9
fix: adding outset value of -2px
karancs06 Aug 5, 2025
7682fc4
Merge pull request #479 from contentstack/VE_6673
contentstackMridul Aug 5, 2025
7aeeb63
feat: disable editing when workflow stage rules restrict the same
faraazb-contentstack Aug 6, 2025
3bcf72d
Merge pull request #488 from contentstack/stage_v3
karancs06 Aug 7, 2025
790875a
test: fix tests
faraazb-contentstack Aug 7, 2025
5de0102
Merge branch 'stage_v3' into develop_v3
faraazb-contentstack Aug 7, 2025
1af5522
Merge branch 'main' into VE-7062-disable-entry-edit-workflow-stage
faraazb-contentstack Aug 7, 2025
ce60715
Merge branch 'develop_v3' into dev-VE-7062-disable-entry-edit-workflo…
faraazb-contentstack Aug 7, 2025
81c84bc
Merge branch 'main' into develop_v3
faraazb-contentstack Aug 7, 2025
0bbf435
Merge branch 'develop_v3' into dev-VE-7062-disable-entry-edit-workflo…
faraazb-contentstack Aug 7, 2025
07f3c96
chore: remove sequential from unit tests
faraazb-contentstack Aug 7, 2025
2e5044e
Merge branch 'VE-7062-disable-entry-edit-workflow-stage' into dev-VE-…
faraazb-contentstack Aug 7, 2025
10c763d
test: add cases for isFieldDisabled
faraazb-contentstack Aug 8, 2025
b26c4ac
Merge branch 'VE-7062-disable-entry-edit-workflow-stage' into dev-VE-…
faraazb-contentstack Aug 8, 2025
472e2e6
fix: handle empty stage name correctly
faraazb-contentstack Aug 11, 2025
5e216ea
chore: replace ifs with switch
faraazb-contentstack Aug 11, 2025
289c505
Merge branch 'VE-7062-disable-entry-edit-workflow-stage' into dev-VE-…
faraazb-contentstack Aug 11, 2025
fb85e53
Merge pull request #489 from contentstack/dev-VE-7062-disable-entry-e…
faraazb Aug 13, 2025
e1500a9
Merge branch 'develop_v3' into VE-7071-apply-outline-offset-highlight…
karancs06 Aug 14, 2025
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
78 changes: 49 additions & 29 deletions src/visualBuilder/__test__/click/fields/multi-line.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { VisualBuilderPostMessageEvents } from "../../../utils/types/postMessage
import { VisualBuilder } from "../../../index";
import { triggerAndWaitForClickAction } from "../../../../__test__/utils";

const EXAMPLE_STAGE_NAME = "Example Stage";

vi.mock("../../../components/FieldToolbar", () => {
return {
default: () => {
Expand Down Expand Up @@ -94,23 +96,28 @@ describe("When an element is clicked in visual builder mode", () => {
beforeAll(async () => {
(visualBuilderPostMessage?.send as Mock).mockImplementation(
(eventName: string, args) => {
if (
eventName ===
VisualBuilderPostMessageEvents.GET_FIELD_DATA
) {
return Promise.resolve({
fieldData: "Hello world",
});
} else if (
eventName ===
VisualBuilderPostMessageEvents.GET_FIELD_DISPLAY_NAMES
) {
return Promise.resolve({
"all_fields.bltapikey.en-us.single_line":
"Single Line",
});
switch (eventName) {
case VisualBuilderPostMessageEvents.GET_FIELD_DATA:
return Promise.resolve({
fieldData: "Hello world",
});
case VisualBuilderPostMessageEvents.GET_FIELD_DISPLAY_NAMES:
return Promise.resolve({
"all_fields.bltapikey.en-us.single_line":
"Single Line",
});
case VisualBuilderPostMessageEvents.GET_WORKFLOW_STAGE_DETAILS:
return Promise.resolve({
stage: { name: EXAMPLE_STAGE_NAME },
permissions: {
entry: {
update: true,
},
},
});
default:
return Promise.resolve({});
}
return Promise.resolve({});
}
);

Expand Down Expand Up @@ -185,20 +192,33 @@ describe("When an element is clicked in visual builder mode", () => {
beforeAll(async () => {
(visualBuilderPostMessage?.send as Mock).mockImplementation(
(eventName: string, args) => {
if (
eventName ===
VisualBuilderPostMessageEvents.GET_FIELD_DATA
) {
const values: Record<string, any> = {
multi_line_textbox_multiple_: ["Hello", "world"],
"multi_line_textbox_multiple_.0": "Hello",
"multi_line_textbox_multiple_.1": "world",
};
return Promise.resolve({
fieldData: values[args.entryPath],
});
switch (eventName) {
case VisualBuilderPostMessageEvents.GET_FIELD_DATA: {
const values: Record<string, any> = {
multi_line_textbox_multiple_: [
"Hello",
"world",
],
"multi_line_textbox_multiple_.0": "Hello",
"multi_line_textbox_multiple_.1": "world",
};
return Promise.resolve({
fieldData: values[args.entryPath],
});
}
case VisualBuilderPostMessageEvents.GET_WORKFLOW_STAGE_DETAILS: {
return Promise.resolve({
stage: { name: EXAMPLE_STAGE_NAME },
permissions: {
entry: {
update: true,
},
},
});
}
default:
return Promise.resolve({});
}
return Promise.resolve({});
}
);

Expand Down
26 changes: 26 additions & 0 deletions src/visualBuilder/__test__/click/fields/number.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { VisualBuilderPostMessageEvents } from "../../../utils/types/postMessage
import { VisualBuilder } from "../../../index";
import { triggerAndWaitForClickAction } from "../../../../__test__/utils";

const EXAMPLE_STAGE_NAME = "Example Stage";

const VALUES = {
number: "10.5",
};
Expand Down Expand Up @@ -112,6 +114,18 @@ describe("When an element is clicked in visual builder mode", () => {
return Promise.resolve({
"all_fields.bltapikey.en-us.number": "Number",
});
} else if (
eventName ===
VisualBuilderPostMessageEvents.GET_WORKFLOW_STAGE_DETAILS
) {
return Promise.resolve({
stage: { name: EXAMPLE_STAGE_NAME },
permissions: {
entry: {
update: true,
},
},
});
}
return Promise.resolve({});
}
Expand Down Expand Up @@ -196,6 +210,18 @@ describe("When an element is clicked in visual builder mode", () => {
return Promise.resolve({
fieldData: values[args.entryPath],
});
} else if (
eventName ===
VisualBuilderPostMessageEvents.GET_WORKFLOW_STAGE_DETAILS
) {
return Promise.resolve({
stage: { name: EXAMPLE_STAGE_NAME },
permissions: {
entry: {
update: true,
},
},
});
}
return Promise.resolve({});
}
Expand Down
78 changes: 48 additions & 30 deletions src/visualBuilder/__test__/click/fields/single-line.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import { Mock, vi } from "vitest";
import { VisualBuilderPostMessageEvents } from "../../../utils/types/postMessage.types";
import { VisualBuilder } from "../../../index";
import { triggerAndWaitForClickAction } from "../../../../__test__/utils";
import { act } from "preact/test-utils";

const EXAMPLE_STAGE_NAME = "Example Stage";

const VALUES = {
singleLine: "Single line",
Expand Down Expand Up @@ -99,23 +100,28 @@ describe("When an element is clicked in visual builder mode", () => {
beforeAll(async () => {
(visualBuilderPostMessage?.send as Mock).mockImplementation(
(eventName: string) => {
if (
eventName ===
VisualBuilderPostMessageEvents.GET_FIELD_DATA
) {
return Promise.resolve({
fieldData: VALUES.singleLine,
});
} else if (
eventName ===
VisualBuilderPostMessageEvents.GET_FIELD_DISPLAY_NAMES
) {
return Promise.resolve({
"all_fields.bltapikey.en-us.single_line":
"Single Line",
});
switch (eventName) {
case VisualBuilderPostMessageEvents.GET_FIELD_DATA:
return Promise.resolve({
fieldData: VALUES.singleLine,
});
case VisualBuilderPostMessageEvents.GET_FIELD_DISPLAY_NAMES:
return Promise.resolve({
"all_fields.bltapikey.en-us.single_line":
"Single Line",
});
case VisualBuilderPostMessageEvents.GET_WORKFLOW_STAGE_DETAILS:
return Promise.resolve({
stage: { name: EXAMPLE_STAGE_NAME },
permissions: {
entry: {
update: true,
},
},
});
default:
return Promise.resolve({});
}
return Promise.resolve({});
}
);

Expand Down Expand Up @@ -205,20 +211,32 @@ describe("When an element is clicked in visual builder mode", () => {
beforeAll(async () => {
(visualBuilderPostMessage?.send as Mock).mockImplementation(
(eventName: string, args) => {
if (
eventName ===
VisualBuilderPostMessageEvents.GET_FIELD_DATA
) {
const values: Record<string, any> = {
single_line_textbox_multiple_: ["Hello", "world"],
"single_line_textbox_multiple_.0": "Hello",
"single_line_textbox_multiple_.1": "world",
};
return Promise.resolve({
fieldData: values[args.entryPath],
});
switch (eventName) {
case VisualBuilderPostMessageEvents.GET_FIELD_DATA: {
const values: Record<string, any> = {
single_line_textbox_multiple_: [
"Hello",
"world",
],
"single_line_textbox_multiple_.0": "Hello",
"single_line_textbox_multiple_.1": "world",
};
return Promise.resolve({
fieldData: values[args.entryPath],
});
}
case VisualBuilderPostMessageEvents.GET_WORKFLOW_STAGE_DETAILS:
return Promise.resolve({
stage: { name: EXAMPLE_STAGE_NAME },
permissions: {
entry: {
update: true,
},
},
});
default:
return Promise.resolve({});
}
return Promise.resolve({});
}
);

Expand Down
15 changes: 6 additions & 9 deletions src/visualBuilder/components/FieldToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import getChildrenDirection from "../utils/getChildrenDirection";
import {
ALLOWED_MODAL_EDITABLE_FIELD,
ALLOWED_REPLACE_FIELDS,
DEFAULT_MULTIPLE_FIELDS,
} from "../utils/constants";
import { getFieldType } from "../utils/getFieldType";
import {
Expand All @@ -20,7 +19,6 @@ import {
MoveLeftIcon,
MoveRightIcon,
ReplaceAssetIcon,
MoreIcon,
} from "./icons";
import { fieldIcons } from "./icons/fields";
import classNames from "classnames";
Expand All @@ -42,10 +40,9 @@ import {
} from "./FieldRevert/FieldRevertComponent";
import { LoadingIcon } from "./icons/loading";
import { EntryPermissions } from "../utils/getEntryPermissions";
import { EmptyAppIcon } from "./icons/EmptyAppIcon";
import { FieldLocationAppList } from "./FieldLocationAppList";
import { FieldLocationIcon } from "./FieldLocationIcon";

import { WorkflowStageDetails } from "../utils/getWorkflowStageDetails";

export type FieldDetails = Pick<
VisualBuilderCslpEventDetails,
Expand All @@ -58,7 +55,8 @@ interface MultipleFieldToolbarProps {
eventDetails: VisualBuilderCslpEventDetails;
hideOverlay: () => void;
isVariant?: boolean;
entryPermissions?: EntryPermissions;
entryPermissions?: EntryPermissions | undefined;
entryWorkflowStageDetails?: WorkflowStageDetails | undefined;
}

function handleReplaceAsset(fieldMetadata: CslpData) {
Expand Down Expand Up @@ -118,6 +116,7 @@ function FieldToolbarComponent(
eventDetails,
isVariant: isVariantOrParentOfVariant,
entryPermissions,
entryWorkflowStageDetails,
} = props;
const { fieldMetadata, editableElement: targetElement } = eventDetails;
const [isFormLoading, setIsFormLoading] = useState(false);
Expand Down Expand Up @@ -158,12 +157,12 @@ function FieldToolbarComponent(
editableElement: targetElement,
fieldMetadata,
},
entryPermissions
entryPermissions,
entryWorkflowStageDetails
);
disableFieldActions = isDisabled;

fieldType = getFieldType(fieldSchema);


Icon = fieldIcons[fieldType];

Expand Down Expand Up @@ -394,8 +393,6 @@ function FieldToolbarComponent(
};
}, []);



useEffect(() => {
const fetchFieldLocationData = async () => {
try {
Expand Down
Loading
Loading