@capillarytech/creatives-library 9.0.49-alpha.1 → 9.0.50-alpha.0
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/constants/unified.js
CHANGED
|
@@ -63,7 +63,6 @@ export const ENABLE_AI_SUGGESTIONS = 'ENABLE_AI_SUGGESTIONS';
|
|
|
63
63
|
export const AI_CONTENT_BOT_DISABLED = 'AI_CONTENT_BOT_DISABLED';
|
|
64
64
|
export const AI_DOCUMENTATION_BOT_ENABLED = 'AI_DOCUMENTATION_BOT_ENABLED';
|
|
65
65
|
export const ENABLE_PRODUCT_SUPPORT_VIDEOS = 'ENABLE_PRODUCT_SUPPORT_VIDEOS';
|
|
66
|
-
export const SUPPORT_ENGAGEMENT_MODULE = 'SUPPORT_ENGAGEMENT_MODULE';
|
|
67
66
|
export const EMBEDDED = 'embedded';
|
|
68
67
|
// --- Tag/Validation Constants ---
|
|
69
68
|
export const CARD_RELATED_TAGS = [
|
package/package.json
CHANGED
package/utils/common.js
CHANGED
|
@@ -99,10 +99,6 @@ export const hasSupportCKEditor = Auth.hasFeatureAccess.bind(
|
|
|
99
99
|
null,
|
|
100
100
|
SUPPORT_CK_EDITOR,
|
|
101
101
|
);
|
|
102
|
-
export const hasSupportEngagementModule = Auth.hasFeatureAccess.bind(
|
|
103
|
-
null,
|
|
104
|
-
SUPPORT_ENGAGEMENT_MODULE,
|
|
105
|
-
);
|
|
106
102
|
|
|
107
103
|
export const hasGiftVoucherFeature = Auth.hasFeatureAccess.bind(
|
|
108
104
|
null,
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import CommunicationFlow from './CommunicationFlow';
|
|
12
|
-
import { hasSupportEngagementModule } from '../../utils/common';
|
|
13
12
|
|
|
14
13
|
const CommunicationFlowContainer = ({
|
|
15
14
|
config,
|
|
@@ -18,22 +17,16 @@ const CommunicationFlowContainer = ({
|
|
|
18
17
|
onCancel,
|
|
19
18
|
onChange,
|
|
20
19
|
...otherProps
|
|
21
|
-
}) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
onCancel={onCancel}
|
|
32
|
-
onChange={onChange}
|
|
33
|
-
{...otherProps}
|
|
34
|
-
/>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
20
|
+
}) => (
|
|
21
|
+
<CommunicationFlow
|
|
22
|
+
config={config}
|
|
23
|
+
initialData={initialData}
|
|
24
|
+
onSave={onSave}
|
|
25
|
+
onCancel={onCancel}
|
|
26
|
+
onChange={onChange}
|
|
27
|
+
{...otherProps}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
37
30
|
|
|
38
31
|
CommunicationFlowContainer.propTypes = {
|
|
39
32
|
config: PropTypes.shape({
|
|
@@ -2051,21 +2051,11 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2051
2051
|
const isCardArchiveEligible = isArchivalEnabled && this.isChannelArchiveEligible(currentChannel, cardWhatsappStatus, cardRcsStatus);
|
|
2052
2052
|
const isArchivedMode = isArchivalEnabled && get(this.props, 'Templates.isArchivedMode', false);
|
|
2053
2053
|
const isAnyArchiveInProgress = isArchivalEnabled && !!(get(this.props, 'Templates.archiveInProgress') || get(this.props, 'Templates.unarchiveInProgress') || get(this.props, 'Templates.bulkArchiveInProgress') || get(this.props, 'Templates.bulkUnarchiveInProgress'));
|
|
2054
|
-
const smsBaseForLegacyCheck = template?.versions?.base || {};
|
|
2055
|
-
const updatedSmsEditorForLegacy = smsBaseForLegacyCheck['updated-sms-editor'];
|
|
2056
|
-
const updatedSmsEditorForLegacyJoined = Array.isArray(updatedSmsEditorForLegacy)
|
|
2057
|
-
? updatedSmsEditorForLegacy.join('')
|
|
2058
|
-
: updatedSmsEditorForLegacy;
|
|
2059
|
-
const smsBodyForLegacyCheck = `${updatedSmsEditorForLegacyJoined || ''}${smsBaseForLegacyCheck['sms-editor'] || ''}`;
|
|
2060
|
-
const isDltLegacyTemplate = currentChannel === SMS
|
|
2061
|
-
&& isTraiDltFeature
|
|
2062
|
-
&& !this.props.isFullMode
|
|
2063
|
-
&& DLT_LEGACY_VAR_REGEX.test(smsBodyForLegacyCheck);
|
|
2064
2054
|
const templateData = {
|
|
2065
2055
|
key: `${currentChannel}-card-${template?.name}`,
|
|
2066
2056
|
title: (
|
|
2067
2057
|
<span className="template-card-title" title={template?.name}>
|
|
2068
|
-
{isCardArchiveEligible && this.renderCardSelectionCheckbox({ templateId: template._id, selectedIds: selectedIdsArrayForCard, isDisabled: isAnyArchiveInProgress
|
|
2058
|
+
{isCardArchiveEligible && this.renderCardSelectionCheckbox({ templateId: template._id, selectedIds: selectedIdsArrayForCard, isDisabled: isAnyArchiveInProgress })}
|
|
2069
2059
|
<CapLabel.CapLabelInline type="label1" title={template?.name} className="template-card-name">
|
|
2070
2060
|
{template?.name}
|
|
2071
2061
|
{currentChannel === INAPP && (
|
|
@@ -2125,39 +2115,20 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2125
2115
|
})()
|
|
2126
2116
|
],
|
|
2127
2117
|
hoverOption: isArchivedMode || !this.canPerform(PERMISSIONS.CREATIVE_EDIT) ? null : (
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
</CapButton>
|
|
2143
|
-
</CapLabel.CapLabelInline>
|
|
2144
|
-
</CapTooltip>
|
|
2145
|
-
) : (
|
|
2146
|
-
<CapButton
|
|
2147
|
-
className={
|
|
2148
|
-
this.props.isFullMode
|
|
2149
|
-
? `edit-${channelLowerCase}`
|
|
2150
|
-
: `select-${channelLowerCase}`
|
|
2151
|
-
}
|
|
2152
|
-
onClick={e =>
|
|
2153
|
-
handlers.handleEditClick(e, template, undefined, undefined, {
|
|
2154
|
-
account: this.state.selectedAccount
|
|
2155
|
-
})
|
|
2156
|
-
}
|
|
2157
|
-
>
|
|
2158
|
-
{hoverButtonText}
|
|
2159
|
-
</CapButton>
|
|
2160
|
-
)
|
|
2118
|
+
<CapButton
|
|
2119
|
+
className={
|
|
2120
|
+
this.props.isFullMode
|
|
2121
|
+
? `edit-${channelLowerCase}`
|
|
2122
|
+
: `select-${channelLowerCase}`
|
|
2123
|
+
}
|
|
2124
|
+
onClick={e =>
|
|
2125
|
+
handlers.handleEditClick(e, template, undefined, undefined, {
|
|
2126
|
+
account: this.state.selectedAccount
|
|
2127
|
+
})
|
|
2128
|
+
}
|
|
2129
|
+
>
|
|
2130
|
+
{hoverButtonText}
|
|
2131
|
+
</CapButton>
|
|
2161
2132
|
)
|
|
2162
2133
|
};
|
|
2163
2134
|
const {
|
|
@@ -3603,22 +3574,6 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
3603
3574
|
CapNotification.error({ message: this.props.intl.formatMessage(messages.cannotEditArchivedTemplate) });
|
|
3604
3575
|
return;
|
|
3605
3576
|
}
|
|
3606
|
-
if (!this.props.isFullMode
|
|
3607
|
-
&& this.checkDLTfeatureEnable()
|
|
3608
|
-
&& (this.state.channel || '').toLowerCase() === SMS_LOWERCASE) {
|
|
3609
|
-
const smsBase = template?.versions?.base || {};
|
|
3610
|
-
const updatedSms = smsBase['updated-sms-editor'];
|
|
3611
|
-
const updatedSmsJoined = Array.isArray(updatedSms) ? updatedSms.join('') : updatedSms;
|
|
3612
|
-
// Check BOTH candidate fields — some legacy templates keep the body only in `sms-editor`
|
|
3613
|
-
// while others have it in `updated-sms-editor`. Concatenating catches either.
|
|
3614
|
-
const smsBody = `${updatedSmsJoined || ''}${smsBase['sms-editor'] || ''}`;
|
|
3615
|
-
if (DLT_LEGACY_VAR_REGEX.test(smsBody)) {
|
|
3616
|
-
CapNotification.error({
|
|
3617
|
-
message: this.props.intl.formatMessage(messages.smsLegacyBlockedTooltip),
|
|
3618
|
-
});
|
|
3619
|
-
return;
|
|
3620
|
-
}
|
|
3621
|
-
}
|
|
3622
3577
|
if (modeType && modeType !== undefined) {
|
|
3623
3578
|
this.setState({modeType});
|
|
3624
3579
|
}
|
|
@@ -546,10 +546,6 @@ export default defineMessages({
|
|
|
546
546
|
id: `${scope}.smsLegacyFormatBadge`,
|
|
547
547
|
defaultMessage: 'Legacy format',
|
|
548
548
|
},
|
|
549
|
-
"smsLegacyBlockedTooltip": {
|
|
550
|
-
id: `${scope}.smsLegacyBlockedTooltip`,
|
|
551
|
-
defaultMessage: "This template can't be used until re-registered with typed variables on the DLT portal.",
|
|
552
|
-
},
|
|
553
549
|
"uploadTemplate": {
|
|
554
550
|
id: `${scope}.uploadTemplate`,
|
|
555
551
|
defaultMessage: 'Upload template',
|