@capillarytech/creatives-library 7.17.99 → 7.17.101
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/containers/App/constants.js +1 -0
- package/package.json +1 -1
- package/utils/common.js +6 -0
- package/v2Components/CapDeviceContent/index.js +1 -0
- package/v2Components/CapDeviceContent/index.scss +1 -1
- package/v2Components/CapDeviceContent/messages.js +1 -1
- package/v2Components/CapInAppCTA/index.js +2 -2
- package/v2Components/CapInAppCTA/index.scss +6 -0
- package/v2Containers/InApp/index.js +36 -34
- package/v2Containers/Templates/index.js +5 -2
|
@@ -14,6 +14,7 @@ export const CUSTOMER_EXTENDED_FIELD = 'Customer extended fields';
|
|
|
14
14
|
export const EXTENDED_TAG = 'ExtendedTagMessage';
|
|
15
15
|
export const BADGES_UI_ENABLED = 'BADGES_UI_ENABLED';
|
|
16
16
|
export const JP_LOCALE_HIDE_FEATURE = 'JP_LOCALE_HIDE_FEATURE';
|
|
17
|
+
export const ENABLE_WECHAT = 'ENABLE_WECHAT';
|
|
17
18
|
export const ENABLE_CUSTOMER_BARCODE_TAG = "ENABLE_CUSTOMER_BARCODE_TAG";
|
|
18
19
|
|
|
19
20
|
export const CARD_RELATED_TAGS = [
|
package/package.json
CHANGED
package/utils/common.js
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
|
18
18
|
BADGES_UI_ENABLED,
|
|
19
19
|
BADGES_ENROLL,
|
|
20
20
|
BADGES_ISSUE,
|
|
21
|
+
ENABLE_WECHAT,
|
|
21
22
|
} from '../containers/App/constants';
|
|
22
23
|
import { apiMessageFormatHandler } from './commonUtils';
|
|
23
24
|
|
|
@@ -100,6 +101,11 @@ export const hasJPLocaleHideFeatureEnabled = Auth.hasFeatureAccess.bind(
|
|
|
100
101
|
JP_LOCALE_HIDE_FEATURE,
|
|
101
102
|
);
|
|
102
103
|
|
|
104
|
+
export const hasWechatFeatureEnabled = Auth.hasFeatureAccess.bind(
|
|
105
|
+
null,
|
|
106
|
+
ENABLE_WECHAT,
|
|
107
|
+
);
|
|
108
|
+
|
|
103
109
|
export const hasCustomerBarcodeFeatureEnabled = Auth.hasFeatureAccess.bind(
|
|
104
110
|
null,
|
|
105
111
|
ENABLE_CUSTOMER_BARCODE_TAG,
|
|
@@ -73,7 +73,7 @@ export default defineMessages({
|
|
|
73
73
|
},
|
|
74
74
|
btnDesc: {
|
|
75
75
|
id: `${prefix}.btnDesc`,
|
|
76
|
-
defaultMessage: 'These will be
|
|
76
|
+
defaultMessage: 'These will be shown as clickable buttons below your message.',
|
|
77
77
|
},
|
|
78
78
|
optional: {
|
|
79
79
|
id: `${prefix}.optional`,
|
|
@@ -131,9 +131,9 @@ export const CapInAppCTA = (props) => {
|
|
|
131
131
|
>
|
|
132
132
|
<CapRow className="inapp-cta-row">
|
|
133
133
|
<CapColumn>
|
|
134
|
-
<CapIcon size="s" type={'launch'} />
|
|
134
|
+
<CapIcon size="s" type={'launch'} className="btn-icon" />
|
|
135
135
|
</CapColumn>
|
|
136
|
-
<CapColumn>
|
|
136
|
+
<CapColumn className="btn-text">
|
|
137
137
|
<CapLabel type="label2" className="inapp-saved-cta-button-text">
|
|
138
138
|
{text}
|
|
139
139
|
</CapLabel>
|
|
@@ -428,35 +428,17 @@ export const InApp = (props) => {
|
|
|
428
428
|
const createModeContent = (
|
|
429
429
|
<CapRow>
|
|
430
430
|
{/* template name */}
|
|
431
|
-
<
|
|
432
|
-
<
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
size="default"
|
|
431
|
+
<CapHeading type="h4">
|
|
432
|
+
<FormattedMessage {...messages.creativeName} />
|
|
433
|
+
</CapHeading>
|
|
434
|
+
<CapInput
|
|
435
|
+
id="inapp-template-name-input"
|
|
436
|
+
className="inapp-template-name-input"
|
|
437
|
+
onChange={onTemplateNameChange}
|
|
438
|
+
placeholder={formatMessage(globalMessages.templateNamePlaceholder)}
|
|
439
|
+
value={templateName}
|
|
440
|
+
size="default"
|
|
442
441
|
/>
|
|
443
|
-
</CapRow>
|
|
444
|
-
{/* Creative layout type*/}
|
|
445
|
-
<CapRow className="inapp-creative-layout">
|
|
446
|
-
<CapHeading type="h4">
|
|
447
|
-
<FormattedMessage {...messages.creativeLayout} />
|
|
448
|
-
</CapHeading>
|
|
449
|
-
<CapHeading type="h6" className="inapp-creative-layout-desc">
|
|
450
|
-
<FormattedMessage {...messages.creativeLayoutDesc} />
|
|
451
|
-
</CapHeading>
|
|
452
|
-
</CapRow>
|
|
453
|
-
<CapRadioGroup
|
|
454
|
-
id="inapp-layout-radio"
|
|
455
|
-
options={LAYOUT_RADIO_OPTIONS}
|
|
456
|
-
value={templateLayoutType}
|
|
457
|
-
onChange={onTemplateLayoutTypeChange}
|
|
458
|
-
className="inapp-layout-radio"
|
|
459
|
-
/>
|
|
460
442
|
</CapRow>
|
|
461
443
|
);
|
|
462
444
|
//create methods end
|
|
@@ -716,9 +698,31 @@ export const InApp = (props) => {
|
|
|
716
698
|
<CapRow className="cap-inapp-creatives">
|
|
717
699
|
<CapColumn span={14}>
|
|
718
700
|
{isFullMode && createModeContent}
|
|
701
|
+
{/* Creative layout type*/}
|
|
702
|
+
{(isFullMode || !isEditFlow) && (
|
|
703
|
+
<>
|
|
704
|
+
<CapRow className="inapp-creative-layout">
|
|
705
|
+
<CapHeading type="h4">
|
|
706
|
+
<FormattedMessage {...messages.creativeLayout} />
|
|
707
|
+
</CapHeading>
|
|
708
|
+
<CapHeading type="h6" className="inapp-creative-layout-desc">
|
|
709
|
+
<FormattedMessage {...messages.creativeLayoutDesc} />
|
|
710
|
+
</CapHeading>
|
|
711
|
+
</CapRow>
|
|
712
|
+
<CapRadioGroup
|
|
713
|
+
id="inapp-layout-radio"
|
|
714
|
+
options={LAYOUT_RADIO_OPTIONS}
|
|
715
|
+
value={templateLayoutType}
|
|
716
|
+
onChange={onTemplateLayoutTypeChange}
|
|
717
|
+
className="inapp-layout-radio"
|
|
718
|
+
/>
|
|
719
|
+
</>
|
|
720
|
+
)}
|
|
719
721
|
{/* device tab */}
|
|
720
722
|
<CapTab
|
|
721
|
-
panes={PANES.filter(
|
|
723
|
+
panes={PANES.filter(
|
|
724
|
+
(devicePane) => devicePane?.isSupported === true
|
|
725
|
+
)}
|
|
722
726
|
onChange={(value) => {
|
|
723
727
|
setPanes(value);
|
|
724
728
|
}}
|
|
@@ -746,12 +750,10 @@ export const InApp = (props) => {
|
|
|
746
750
|
) : (
|
|
747
751
|
<FormattedMessage {...globalMessages.done} />
|
|
748
752
|
)
|
|
753
|
+
) : isFullMode ? (
|
|
754
|
+
<FormattedMessage {...messages.create} />
|
|
749
755
|
) : (
|
|
750
|
-
|
|
751
|
-
<FormattedMessage {...messages.create} />
|
|
752
|
-
) : (
|
|
753
|
-
<FormattedMessage {...globalMessages.done} />
|
|
754
|
-
)
|
|
756
|
+
<FormattedMessage {...globalMessages.done} />
|
|
755
757
|
)}
|
|
756
758
|
</CapButton>
|
|
757
759
|
</>
|
|
@@ -263,7 +263,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
263
263
|
case WECHAT:
|
|
264
264
|
channel = 'wechat';
|
|
265
265
|
activeMode = ACCOUNT_SELECTION_MODE;
|
|
266
|
-
this.props.actions.getWeCrmAccounts();
|
|
266
|
+
commonUtil.hasWechatFeatureEnabled() && this.props.actions.getWeCrmAccounts();
|
|
267
267
|
break;
|
|
268
268
|
case EMAIL:
|
|
269
269
|
channel = 'Email';
|
|
@@ -373,7 +373,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
373
373
|
} else if (nextProps.route.name.toLowerCase() === 'wechat') {
|
|
374
374
|
this.setState({defaultAccount: true});
|
|
375
375
|
channel = 'wechat';
|
|
376
|
-
nextProps.actions.getWeCrmAccounts();
|
|
376
|
+
commonUtil.hasWechatFeatureEnabled() && nextProps.actions.getWeCrmAccounts();
|
|
377
377
|
} else if (nextProps.route.name.toLowerCase() === 'email') {
|
|
378
378
|
channel = 'Email';
|
|
379
379
|
} else if (nextProps.route.name.toLowerCase() === "mobilepush" || nextProps.route.name === INAPP) {
|
|
@@ -2604,6 +2604,9 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
2604
2604
|
showNoAccountHeader = true;
|
|
2605
2605
|
}
|
|
2606
2606
|
}
|
|
2607
|
+
if (channel === WECHAT && commonUtil?.hasWechatFeatureEnabled) {
|
|
2608
|
+
showNoAccountHeader = true;
|
|
2609
|
+
}
|
|
2607
2610
|
return (<CapSpin spinning={fetchingWeCrmAccounts}>
|
|
2608
2611
|
{showNoAccountHeader ? <FormattedMessage {...noAccountHeader} /> :
|
|
2609
2612
|
<div style={{ overflowX: "auto", paddingBottom: CAP_SPACE_16 }}>
|