@capillarytech/creatives-library 7.17.4 → 7.17.5
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
CHANGED
|
@@ -13,7 +13,7 @@ import messages from './messages';
|
|
|
13
13
|
import { START_FROM_SCRATCH, HIDE_DEFAULT_EMAIL_TEMPLATES } from './constants';
|
|
14
14
|
const {CapCustomCardList} = CapCustomCard;
|
|
15
15
|
function CmsTemplatesComponent(props) {
|
|
16
|
-
const { accessibleFeatures = [] } = props
|
|
16
|
+
const { accessibleFeatures = [] } = props?.currentOrgDetails || {};
|
|
17
17
|
const hideDefaultEmailTemplates = accessibleFeatures.includes(HIDE_DEFAULT_EMAIL_TEMPLATES);
|
|
18
18
|
|
|
19
19
|
const cardDataList = props.cmsTemplates?.reduce((result, template) => {
|
|
@@ -22,14 +22,16 @@ function CmsTemplatesComponent(props) {
|
|
|
22
22
|
key: _id,
|
|
23
23
|
title: name,
|
|
24
24
|
url: base?.preview_http_url,
|
|
25
|
-
hoverOption: <CapButton onClick={() => props
|
|
25
|
+
hoverOption: <CapButton onClick={() => props?.handleEdmDefaultTemplateSelection(_id)}><FormattedMessage {...messages.select}/></CapButton>,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
// Determine if default email templates should be hidden based on feature control
|
|
28
29
|
if (hideDefaultEmailTemplates) {
|
|
29
30
|
if (name === START_FROM_SCRATCH) {
|
|
30
31
|
result.push(commonProperties);
|
|
31
32
|
}
|
|
32
33
|
} else {
|
|
34
|
+
// If hideDefaultEmailTemplates is false then show all the default templates
|
|
33
35
|
result.push(commonProperties);
|
|
34
36
|
}
|
|
35
37
|
|
|
@@ -43,9 +45,13 @@ function CmsTemplatesComponent(props) {
|
|
|
43
45
|
</CapSpin>);
|
|
44
46
|
}
|
|
45
47
|
|
|
48
|
+
CmsTemplatesComponent.defaultProps = {
|
|
49
|
+
cmsTemplates: [],
|
|
50
|
+
currentOrgDetails: {},
|
|
51
|
+
};
|
|
52
|
+
|
|
46
53
|
CmsTemplatesComponent.propTypes = {
|
|
47
54
|
cmsTemplates: PropTypes.array,
|
|
48
|
-
currentOrgDetails: PropTypes.object,
|
|
49
55
|
cmsTemplatesLoader: PropTypes.any,
|
|
50
56
|
};
|
|
51
57
|
|
|
@@ -284,7 +284,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
284
284
|
cmsTemplates={CmsTemplates}
|
|
285
285
|
handleEdmDefaultTemplateSelection={this.useEditor}
|
|
286
286
|
cmsTemplatesLoader={cmsTemplatesLoader}
|
|
287
|
-
currentOrgDetails={currentOrgDetails}
|
|
287
|
+
currentOrgDetails={currentOrgDetails || cap?.currentOrgDetails}
|
|
288
288
|
/>
|
|
289
289
|
)}
|
|
290
290
|
</div>
|