@capillarytech/creatives-library 8.0.343-beta.1 → 8.0.344
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +10 -3
- package/v2Containers/CreativesContainer/tests/__snapshots__/SlideBoxContent.test.js.snap +2 -4
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +4 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.edgeCases.test.js +1 -0
- package/v2Containers/EmailWrapper/tests/useEmailWrapper.test.js +7 -0
package/package.json
CHANGED
|
@@ -698,9 +698,16 @@ export function SlideBoxContent(props) {
|
|
|
698
698
|
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
699
699
|
(() => {
|
|
700
700
|
const supportCKEditor = commonUtil.hasSupportCKEditor();
|
|
701
|
-
//
|
|
702
|
-
//
|
|
703
|
-
|
|
701
|
+
// BEE templates always use the <Email> component directly (the same
|
|
702
|
+
// path the SUPPORT_CK_EDITOR=true branch uses). EmailWrapper's
|
|
703
|
+
// useEmailWrapper strips templateData from props, so library-mode
|
|
704
|
+
// pencil-edit on a BEE template would never reach startTemplateCreation
|
|
705
|
+
// and getDetails?type=BEE_PLUGIN would never fire. Routing BEE
|
|
706
|
+
// templates through the direct <Email> path — which is already
|
|
707
|
+
// battle-tested for the CKEditor flow — sidesteps that entirely.
|
|
708
|
+
const isBEETemplate = templateData?.base?.is_drag_drop === true
|
|
709
|
+
|| templateData?.base?.is_drag_drop === 1;
|
|
710
|
+
if (supportCKEditor || isBEETemplate) {
|
|
704
711
|
return (
|
|
705
712
|
<Email
|
|
706
713
|
key="cretives-container-email-edit"
|
|
@@ -120,9 +120,8 @@ exports[`Test SlideBoxContent container Email component isTestAndPreviewMode IIF
|
|
|
120
120
|
key="cretives-container-email-edit-wrapper"
|
|
121
121
|
location={
|
|
122
122
|
Object {
|
|
123
|
-
"pathname": "/email/edit/
|
|
123
|
+
"pathname": "/email/edit/",
|
|
124
124
|
"query": Object {
|
|
125
|
-
"id": undefined,
|
|
126
125
|
"module": "library",
|
|
127
126
|
"type": "embedded",
|
|
128
127
|
},
|
|
@@ -171,9 +170,8 @@ exports[`Test SlideBoxContent container Email component isTestAndPreviewMode IIF
|
|
|
171
170
|
key="cretives-container-email-edit-wrapper"
|
|
172
171
|
location={
|
|
173
172
|
Object {
|
|
174
|
-
"pathname": "/email/edit/
|
|
173
|
+
"pathname": "/email/edit/",
|
|
175
174
|
"query": Object {
|
|
176
|
-
"id": undefined,
|
|
177
175
|
"module": "library",
|
|
178
176
|
"type": "embedded",
|
|
179
177
|
},
|
|
@@ -102,6 +102,10 @@ const useEmailWrapper = ({
|
|
|
102
102
|
}
|
|
103
103
|
}, [onEnterTemplateName, onRemoveTemplateName]);
|
|
104
104
|
|
|
105
|
+
useEffect(() => () => {
|
|
106
|
+
emailActions.clearStoreValues();
|
|
107
|
+
}, []);
|
|
108
|
+
|
|
105
109
|
// Check BEE enabled status from API response
|
|
106
110
|
// BEE is enabled if isDragDrop is true in the API response
|
|
107
111
|
// This should work for both full mode and library mode
|
|
@@ -79,6 +79,12 @@ describe('useEmailWrapper', () => {
|
|
|
79
79
|
setEdmTemplate: jest.fn(),
|
|
80
80
|
setBEETemplate: jest.fn(),
|
|
81
81
|
},
|
|
82
|
+
emailActions: {
|
|
83
|
+
getCmsAccounts: jest.fn(),
|
|
84
|
+
getTemplateDetails: jest.fn(),
|
|
85
|
+
getCmsSetting: jest.fn(),
|
|
86
|
+
clearStoreValues: jest.fn(),
|
|
87
|
+
},
|
|
82
88
|
EmailLayout: null,
|
|
83
89
|
CmsTemplates: null,
|
|
84
90
|
SelectedEdmDefaultTemplate: null,
|
|
@@ -650,6 +656,7 @@ describe('useEmailWrapper', () => {
|
|
|
650
656
|
mockEmailActions = {
|
|
651
657
|
getTemplateDetails: jest.fn(),
|
|
652
658
|
getCmsAccounts: jest.fn(),
|
|
659
|
+
clearStoreValues: jest.fn(),
|
|
653
660
|
};
|
|
654
661
|
|
|
655
662
|
newFlowMockProps = {
|