Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VE-3355 send additional data for field revert #269

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { visualBuilderStyles } from "../../visualBuilder.style";
import { VariantIcon } from "../icons/variant";
import { CaretIcon } from "../icons";
import visualBuilderPostMessage from "../../utils/visualBuilderPostMessage";
import { CslpData } from "../../../cslp/types/cslp.types";

export interface IVariantStatus {
fieldLevelCustomizations: boolean;
Expand All @@ -22,7 +23,7 @@ export type TFieldRevertActionCallback =

interface FieldRevertComponentProps {
fieldDataName: string;
// actionCallback: (callbackType: TFieldRevertActionCallback) => void;
fieldMetadata: CslpData;
variantStatus?: IVariantStatus;
}

Expand Down Expand Up @@ -58,6 +59,7 @@ export async function getFieldVariantStatus(

export const FieldRevertComponent = ({
fieldDataName,
fieldMetadata,
variantStatus = BASE_VARIANT_STATUS,
}: FieldRevertComponentProps) => {
const [isOpen, setIsOpen] = useState(false);
Expand Down Expand Up @@ -154,6 +156,9 @@ export const FieldRevertComponent = ({
visualBuilderPostMessage?.send("send-variant-revert-action-trigger", {
fieldDataName,
action,
euid: fieldMetadata.entry_uid,
ct_uid: fieldMetadata.content_type_uid,
locale: fieldMetadata.locale,
});
}

Expand Down
7 changes: 5 additions & 2 deletions src/visualBuilder/components/fieldLabelWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ function FieldLabelWrapperComponent(
icon: fieldDisabled ? (
<div
className={classNames(
visualBuilderStyles()["visual-builder__tooltip--persistent"]
visualBuilderStyles()[
"visual-builder__tooltip--persistent"
]
)}
data-tooltip={reason}
>
Expand Down Expand Up @@ -285,11 +287,12 @@ function FieldLabelWrapperComponent(
{currentField.isVariant ? (
<FieldRevertComponent
fieldDataName={currentField.fieldDataName}
fieldMetadata={props.fieldMetadata}
variantStatus={currentField.fieldVariantStatus}
/>
) : null}
</div>
);
}

export default FieldLabelWrapperComponent;
export default FieldLabelWrapperComponent;
Loading