@capillarytech/creatives-library 7.17.212-alpha.0 → 7.17.212
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/index.js +52 -0
- package/entry.js +2 -0
- package/hoc/withReactRouterV3Compatibility.js +66 -0
- package/initialReducer.js +34 -0
- package/mfe-exposed-components.js +8 -0
- package/package.json +1 -1
- package/utils/checkStore.js +21 -0
- package/utils/customAuthWrapper.js +62 -0
- package/utils/customConnectedAuthWrapper.js +26 -0
- package/utils/history.js +8 -0
- package/utils/injectReducer.js +2 -0
- package/utils/injectSaga.js +2 -0
- package/utils/tagValidations.js +3 -11
- package/v2Components/FormBuilder/index.js +2 -14
- package/v2Components/NavigationBar/saga.js +18 -0
- package/v2Components/RenderRoute/RenderRoute.js +11 -0
- package/v2Components/RenderRoute/index.js +1 -0
- package/v2Containers/BeeEditor/index.js +0 -3
- package/v2Containers/CreativesContainer/SlideBoxContent.js +26 -47
- package/v2Containers/CreativesContainer/index.js +0 -3
- package/v2Containers/Email/index.js +0 -1
- package/v2Containers/EmailWrapper/index.js +0 -3
- package/v2Containers/MobilePush/Create/index.js +0 -2
- package/v2Containers/MobilePush/Edit/index.js +0 -2
- package/v2Containers/MobilepushWrapper/index.js +1 -5
- package/v2Containers/Sms/Create/index.js +0 -2
- package/v2Containers/Sms/Edit/index.js +0 -2
- package/v2Containers/SmsTrai/Edit/index.js +0 -3
- package/v2Containers/SmsWrapper/index.js +0 -2
- package/v2Containers/TagList/index.js +2 -26
- package/v2Containers/TagList/messages.js +0 -4
- package/v2Containers/Viber/index.js +0 -2
- package/v2Containers/Whatsapp/index.js +1 -4
- package/v2Containers/Zalo/index.js +0 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* App.js
|
|
4
|
+
*
|
|
5
|
+
* This component is the skeleton around the actual pages, and should only
|
|
6
|
+
* contain code that should be seen on all pages. (e.g. navigation bar)
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React, { useEffect } from 'react'; // eslint-disable-line no-unused-vars
|
|
11
|
+
import { Switch } from 'react-router';
|
|
12
|
+
import { ConnectedRouter } from 'connected-react-router/immutable';
|
|
13
|
+
import history from 'utils/history';
|
|
14
|
+
|
|
15
|
+
import Cap from '../Cap';
|
|
16
|
+
import CapV2 from '../../v2Containers/Cap';
|
|
17
|
+
import Login from '../Login';
|
|
18
|
+
import NotFoundPage from '../NotFoundPage';
|
|
19
|
+
|
|
20
|
+
import GlobalStyle from '../../global-styles';
|
|
21
|
+
import config from '../../config/app';
|
|
22
|
+
import withReactRouterV3Compatibility from '../../hoc/withReactRouterV3Compatibility';
|
|
23
|
+
import RenderRoute from '../../v2Components/RenderRoute';
|
|
24
|
+
import { updateCharCount } from '../../utils/smsCharCountV2';
|
|
25
|
+
|
|
26
|
+
const loginUrl =
|
|
27
|
+
process.env.NODE_ENV === 'production'
|
|
28
|
+
? `${config.production.login_url}`
|
|
29
|
+
: `${config.development.login_url}`;
|
|
30
|
+
|
|
31
|
+
// const Protected = userIsAuthenticatedRedir(Cap);
|
|
32
|
+
const v3CompatibleCap = withReactRouterV3Compatibility(Cap);
|
|
33
|
+
const v3CompatibleCapV2 = withReactRouterV3Compatibility(CapV2);
|
|
34
|
+
|
|
35
|
+
export default function App() {
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
updateCharCount("", false);
|
|
38
|
+
});
|
|
39
|
+
return (
|
|
40
|
+
<div>
|
|
41
|
+
<ConnectedRouter history={history}>
|
|
42
|
+
<Switch>
|
|
43
|
+
<RenderRoute exact path={loginUrl} component={Login} />
|
|
44
|
+
<RenderRoute path="/v2" component={v3CompatibleCapV2} key="/v2" />
|
|
45
|
+
<RenderRoute path="/" component={v3CompatibleCap} key="/" />
|
|
46
|
+
<RenderRoute component={NotFoundPage} />
|
|
47
|
+
</Switch>
|
|
48
|
+
</ConnectedRouter>
|
|
49
|
+
<GlobalStyle />
|
|
50
|
+
</div>
|
|
51
|
+
);
|
|
52
|
+
}
|
package/entry.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { compose } from 'redux';
|
|
4
|
+
import { withRouter } from 'react-router-dom';
|
|
5
|
+
import componentRoutes from '../routes';
|
|
6
|
+
|
|
7
|
+
function findRoute(routes, path) {
|
|
8
|
+
let match;
|
|
9
|
+
for (let i = 0; i < routes.length; i++) {
|
|
10
|
+
const route = routes[i];
|
|
11
|
+
if (route?.path === path) {
|
|
12
|
+
match = route;
|
|
13
|
+
break;
|
|
14
|
+
}
|
|
15
|
+
if (route?.routes) {
|
|
16
|
+
match = findRoute(route.routes, path);
|
|
17
|
+
if (match) {
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return match;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getParamsObject(params = []) {
|
|
26
|
+
const paramsObject = {};
|
|
27
|
+
params.forEach((value, key) => {
|
|
28
|
+
if (paramsObject[key]) {
|
|
29
|
+
// If the key already exists, convert the value to an array (to handle multiple values for the same key)
|
|
30
|
+
paramsObject[key] = Array.isArray(paramsObject[key])
|
|
31
|
+
? [...paramsObject[key], value]
|
|
32
|
+
: [paramsObject[key], value];
|
|
33
|
+
} else {
|
|
34
|
+
paramsObject[key] = value;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
return paramsObject;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function withReactRouterV3Compatibility(Component) {
|
|
41
|
+
const EnhancedComponent = (props) => {
|
|
42
|
+
const { history = {}, location = {}, match = {} } = props;
|
|
43
|
+
const matchedRoute = findRoute(componentRoutes, match.path);
|
|
44
|
+
const newProps = {
|
|
45
|
+
...props,
|
|
46
|
+
router: history,
|
|
47
|
+
params: match.params,
|
|
48
|
+
route: matchedRoute,
|
|
49
|
+
location: {
|
|
50
|
+
...location,
|
|
51
|
+
query: getParamsObject(new URLSearchParams(location.search)),
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
return <Component {...newProps} />;
|
|
55
|
+
};
|
|
56
|
+
EnhancedComponent.propTypes = {
|
|
57
|
+
router: PropTypes.object,
|
|
58
|
+
params: PropTypes.object,
|
|
59
|
+
route: PropTypes.object,
|
|
60
|
+
};
|
|
61
|
+
return compose(
|
|
62
|
+
withRouter,
|
|
63
|
+
)(EnhancedComponent);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export default withReactRouterV3Compatibility;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import languageProviderReducer from 'v2Containers/LanguageProvider/reducer';
|
|
2
|
+
import beeEditorReducer from 'v2Containers/BeeEditor/reducer';
|
|
3
|
+
import CapFacebookPreviewReducer from 'v2Containers/CapFacebookPreview/reducer';
|
|
4
|
+
|
|
5
|
+
import capReducer from 'containers/Cap/reducer';
|
|
6
|
+
import appReducer from 'containers/App/reducer';
|
|
7
|
+
import createSmsReducer from 'containers/Sms/Create/reducer';
|
|
8
|
+
import editSmsReducer from 'containers/Sms/Edit/reducer';
|
|
9
|
+
import templateReducer from 'containers/Templates/reducer';
|
|
10
|
+
import tagsReducer from 'containers/TagList/reducer';
|
|
11
|
+
import emailReducer from 'containers/Email/reducer';
|
|
12
|
+
import ebillReducer from 'containers/Ebill/reducer';
|
|
13
|
+
import ftpReducer from 'v2Containers/FTP/reducer';
|
|
14
|
+
import galleryReducer from './v2Containers/Assets/Gallery/reducer';
|
|
15
|
+
import CapCollapsibleLeftNavigationReducer from '@capillarytech/cap-ui-library/CapCollapsibleLeftNavigation/reducer';
|
|
16
|
+
import { AIRA_REDUCER_DOMAIN, askAiraReducer } from '@capillarytech/cap-ui-library/CapAskAira';
|
|
17
|
+
|
|
18
|
+
export const initialReducer = {
|
|
19
|
+
language: languageProviderReducer,
|
|
20
|
+
cap: capReducer,
|
|
21
|
+
app: appReducer,
|
|
22
|
+
create: createSmsReducer,
|
|
23
|
+
edit: editSmsReducer,
|
|
24
|
+
templates: templateReducer,
|
|
25
|
+
tagList: tagsReducer,
|
|
26
|
+
email: emailReducer,
|
|
27
|
+
ebill: ebillReducer,
|
|
28
|
+
beeEditor: beeEditorReducer,
|
|
29
|
+
facebookPreview: CapFacebookPreviewReducer,
|
|
30
|
+
FTP: ftpReducer,
|
|
31
|
+
[AIRA_REDUCER_DOMAIN]: askAiraReducer,
|
|
32
|
+
gallery: galleryReducer,
|
|
33
|
+
navigationConfig: CapCollapsibleLeftNavigationReducer,
|
|
34
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// This file is used to expose the components of the MFE to the host application
|
|
2
|
+
// Contents of this file are used in webpack config's ModuleFederationPlugin.
|
|
3
|
+
//
|
|
4
|
+
module.exports = {
|
|
5
|
+
// which exposes
|
|
6
|
+
// ADD MFE COMPONENT YOU WANT TO EXPORT example:
|
|
7
|
+
// './Home': './app/components/pages/Home',
|
|
8
|
+
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { conformsTo, isFunction, isObject } from 'lodash';
|
|
2
|
+
import invariant from 'invariant';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Validate the shape of redux store
|
|
6
|
+
*/
|
|
7
|
+
export default function checkStore(store) {
|
|
8
|
+
const shape = {
|
|
9
|
+
dispatch: isFunction,
|
|
10
|
+
subscribe: isFunction,
|
|
11
|
+
getState: isFunction,
|
|
12
|
+
replaceReducer: isFunction,
|
|
13
|
+
runSaga: isFunction,
|
|
14
|
+
injectedReducers: isObject,
|
|
15
|
+
injectedSagas: isObject,
|
|
16
|
+
};
|
|
17
|
+
invariant(
|
|
18
|
+
conformsTo(store, shape),
|
|
19
|
+
'(app/utils...) injectors: Expected a valid redux store',
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
/* eslint-disable react/no-multi-comp */
|
|
3
|
+
/* eslint-disable react/prefer-stateless-function */
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import PropTypes from 'prop-types';
|
|
6
|
+
import hoistStatics from 'hoist-non-react-statics';
|
|
7
|
+
|
|
8
|
+
const AuthenticatingComponentWithRef = React.forwardRef((props, ref) => (
|
|
9
|
+
<div ref={ref} />
|
|
10
|
+
));
|
|
11
|
+
const FailureComponentWithRef = React.forwardRef((props, ref) => (
|
|
12
|
+
<div ref={ref} />
|
|
13
|
+
));
|
|
14
|
+
const defaults = {
|
|
15
|
+
AuthenticatingComponent: AuthenticatingComponentWithRef, // dont render anything while authenticating
|
|
16
|
+
FailureComponent: FailureComponentWithRef, // dont render anything on failure of the predicate
|
|
17
|
+
wrapperDisplayName: 'AuthWrapper',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default args => {
|
|
21
|
+
const { AuthenticatingComponent, FailureComponent, wrapperDisplayName } = {
|
|
22
|
+
...defaults,
|
|
23
|
+
...args,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Wraps the component that needs the auth enforcement
|
|
27
|
+
return function wrapComponent(DecoratedComponent) {
|
|
28
|
+
const displayName =
|
|
29
|
+
DecoratedComponent.displayName || DecoratedComponent.name || 'Component';
|
|
30
|
+
|
|
31
|
+
class UserAuthWrapper extends Component {
|
|
32
|
+
static displayName = `${wrapperDisplayName}(${displayName})`;
|
|
33
|
+
|
|
34
|
+
static propTypes = {
|
|
35
|
+
isAuthenticated: PropTypes.bool,
|
|
36
|
+
isAuthenticating: PropTypes.bool,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
static defaultProps = {
|
|
40
|
+
isAuthenticating: false,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
render() {
|
|
44
|
+
const { isAuthenticated, isAuthenticating, forwardedRef } = this.props;
|
|
45
|
+
if (isAuthenticated) {
|
|
46
|
+
return <DecoratedComponent {...this.props} ref={forwardedRef} />;
|
|
47
|
+
}
|
|
48
|
+
if (isAuthenticating) {
|
|
49
|
+
return <AuthenticatingComponent {...this.props} ref={forwardedRef} />;
|
|
50
|
+
}
|
|
51
|
+
return <FailureComponent {...this.props} ref={forwardedRef} />;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** forwardRef from HOC to the Wrapped Component */
|
|
56
|
+
const UserAuthWrapperWithRef = React.forwardRef((props, ref) => (
|
|
57
|
+
<UserAuthWrapper {...props} forwardedRef={ref} />
|
|
58
|
+
));
|
|
59
|
+
|
|
60
|
+
return hoistStatics(UserAuthWrapperWithRef, DecoratedComponent);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { connect } from 'react-redux';
|
|
2
|
+
|
|
3
|
+
import authWrapper from './customAuthWrapper';
|
|
4
|
+
|
|
5
|
+
const connectedDefaults = {
|
|
6
|
+
authenticatingSelector: () => false,
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default args => {
|
|
10
|
+
const { authenticatedSelector, authenticatingSelector } = {
|
|
11
|
+
...connectedDefaults,
|
|
12
|
+
...args,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** Passed withRef option set to true for forwarding Ref to Wrapped Component */
|
|
16
|
+
return DecoratedComponent =>
|
|
17
|
+
connect(
|
|
18
|
+
(state, ownProps) => ({
|
|
19
|
+
isAuthenticated: authenticatedSelector(state, ownProps),
|
|
20
|
+
isAuthenticating: authenticatingSelector(state, ownProps),
|
|
21
|
+
}),
|
|
22
|
+
null,
|
|
23
|
+
null,
|
|
24
|
+
{ withRef: true },
|
|
25
|
+
)(authWrapper(args)(DecoratedComponent));
|
|
26
|
+
};
|
package/utils/history.js
ADDED
package/utils/tagValidations.js
CHANGED
|
@@ -17,11 +17,10 @@ const SUBTAGS = 'subtags';
|
|
|
17
17
|
* @param {Object} response - The response object to check.
|
|
18
18
|
* @param {Object} tagObject - The tagLookupMap.
|
|
19
19
|
*/
|
|
20
|
-
export const checkSupport = (response = {}, tagObject = {}
|
|
20
|
+
export const checkSupport = (response = {}, tagObject = {}) => {
|
|
21
21
|
const supportedList = [];
|
|
22
22
|
// Verifies the presence of the tag in the 'Add Labels' section.
|
|
23
|
-
|
|
24
|
-
const checkNameInTagObjectOrEventContext = (name) => !!tagObject[name] || eventContextTags?.some((tag) => tag?.tagName === name);
|
|
23
|
+
const checkNameInTagObject = (name) => !!tagObject[name];
|
|
25
24
|
|
|
26
25
|
// Verify if childTag is a valid sub-tag of parentTag from the 'Add Labels' section or if it's unsupported.
|
|
27
26
|
const checkSubtags = (parentTag, childName) => {
|
|
@@ -48,7 +47,7 @@ export const checkSupport = (response = {}, tagObject = {}, eventContextTags = [
|
|
|
48
47
|
|
|
49
48
|
//Checks if the tag is present in the Add Label Section
|
|
50
49
|
for (const item of response?.data || []) {
|
|
51
|
-
if (
|
|
50
|
+
if (checkNameInTagObject(item?.name)) {
|
|
52
51
|
supportedList?.push(item?.name);
|
|
53
52
|
}
|
|
54
53
|
//Repeat the process for subtags
|
|
@@ -94,7 +93,6 @@ export const validateTags = ({
|
|
|
94
93
|
injectedTagsParams,
|
|
95
94
|
location,
|
|
96
95
|
tagModule,
|
|
97
|
-
eventContextTags,
|
|
98
96
|
}) => {
|
|
99
97
|
const tags = tagsParam;
|
|
100
98
|
const injectedTags = transformInjectedTags(injectedTagsParams);
|
|
@@ -147,12 +145,6 @@ export const validateTags = ({
|
|
|
147
145
|
}
|
|
148
146
|
}
|
|
149
147
|
}
|
|
150
|
-
// Journey Event Context Tags support
|
|
151
|
-
eventContextTags?.forEach((tag) => {
|
|
152
|
-
if (tagValue === tag?.tagName) {
|
|
153
|
-
ifSupported = true;
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
148
|
ifSupported = ifSupported || checkIfSupportedTag(tagValue, injectedTags);
|
|
157
149
|
if (!ifSupported) {
|
|
158
150
|
response.unsupportedTags.push(tagValue);
|
|
@@ -134,7 +134,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
134
134
|
this.handleSetRadioValue = this.handleSetRadioValue.bind(this);
|
|
135
135
|
this.formElements = [];
|
|
136
136
|
// Check if the liquid flow feature is supported and the channel is in the supported list.
|
|
137
|
-
this.liquidFlow =
|
|
137
|
+
this.liquidFlow = LIQUID_SUPPORTED_CHANNELS.includes(props?.schema?.channel?.toUpperCase()) && hasLiquidSupportFeature();
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
componentWillMount() {
|
|
@@ -1120,8 +1120,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1120
1120
|
// Extracts the supported liquid tags from the given content.
|
|
1121
1121
|
const supportedLiquidTags = checkSupport(
|
|
1122
1122
|
result,
|
|
1123
|
-
this.props?.metaEntities?.tagLookupMap
|
|
1124
|
-
this.props?.eventContextTags
|
|
1123
|
+
this.props?.metaEntities?.tagLookupMap
|
|
1125
1124
|
);
|
|
1126
1125
|
const unsupportedLiquidTags = extractedLiquidTags?.filter(
|
|
1127
1126
|
(tag) => !supportedLiquidTags?.includes(tag) && !this.skipTags(tag)
|
|
@@ -1284,14 +1283,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1284
1283
|
}
|
|
1285
1284
|
}
|
|
1286
1285
|
}
|
|
1287
|
-
|
|
1288
|
-
// Event Context Tags support
|
|
1289
|
-
this.props?.eventContextTags?.forEach((tag) => {
|
|
1290
|
-
if (tagValue === tag?.tagName) {
|
|
1291
|
-
ifSupported = true;
|
|
1292
|
-
}
|
|
1293
|
-
});
|
|
1294
|
-
|
|
1295
1286
|
ifSupported = ifSupported || this.checkIfSupportedTag(tagValue, injectedTags);
|
|
1296
1287
|
if (!ifSupported && !this.liquidFlow) {
|
|
1297
1288
|
response.unsupportedTags.push(tagValue);
|
|
@@ -2619,7 +2610,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2619
2610
|
id={val.id}
|
|
2620
2611
|
userLocale={this.props.userLocale}
|
|
2621
2612
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
2622
|
-
eventContextTags={this.props.eventContextTags}
|
|
2623
2613
|
/>
|
|
2624
2614
|
</CapColumn>
|
|
2625
2615
|
);
|
|
@@ -3241,7 +3231,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3241
3231
|
userLocale={this.state.translationLang}
|
|
3242
3232
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
3243
3233
|
channel={channel}
|
|
3244
|
-
eventContextTags={this.props.eventContextTags}
|
|
3245
3234
|
/>
|
|
3246
3235
|
</CapColumn>
|
|
3247
3236
|
);
|
|
@@ -3516,7 +3505,6 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
3516
3505
|
saveBeeData={this.props.saveBeeData}
|
|
3517
3506
|
onContextChange={this.props.onContextChange}
|
|
3518
3507
|
moduleFilterEnabled={isModuleFilterEnabled}
|
|
3519
|
-
eventContextTags={this.props.eventContextTags}
|
|
3520
3508
|
/>
|
|
3521
3509
|
</CapColumn>
|
|
3522
3510
|
);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { all } from 'redux-saga/effects';
|
|
2
|
+
import CapCollapsibleLeftNavigationSagas from '@capillarytech/cap-ui-library/CapCollapsibleLeftNavigation/saga';
|
|
3
|
+
import { analyticsBotSaga } from '@capillarytech/cap-ui-library/CapAskAira';
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
key: 'navigation',
|
|
8
|
+
saga: function* navigationConfigSaga() {
|
|
9
|
+
yield all(CapCollapsibleLeftNavigationSagas.map(saga => saga.call()));
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
key: 'analyticsBotSaga',
|
|
14
|
+
saga: function* analyticsBotSagaFn() {
|
|
15
|
+
yield all(analyticsBotSaga.map(saga => saga.call()));
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Route } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
const RenderRoute = ({ Component: ComponentToRender, ...rest }) => (
|
|
5
|
+
<Route
|
|
6
|
+
{...rest}
|
|
7
|
+
render={props => <ComponentToRender {...props} />}
|
|
8
|
+
/>
|
|
9
|
+
);
|
|
10
|
+
|
|
11
|
+
export default RenderRoute;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './RenderRoute';
|
|
@@ -48,7 +48,6 @@ function BeeEditor(props) {
|
|
|
48
48
|
actions,
|
|
49
49
|
BEESelect,
|
|
50
50
|
currentOrgDetails,
|
|
51
|
-
eventContextTags,
|
|
52
51
|
} = props;
|
|
53
52
|
const { saveRowRequest } = BEESelect;
|
|
54
53
|
const {formatMessage} = intl;
|
|
@@ -281,7 +280,6 @@ function BeeEditor(props) {
|
|
|
281
280
|
className: "bee-editor-tag-list",
|
|
282
281
|
}}
|
|
283
282
|
onContextChange={onContextChange}
|
|
284
|
-
eventContextTags={eventContextTags}
|
|
285
283
|
/>
|
|
286
284
|
<CapModal
|
|
287
285
|
className="custom-row-modal"
|
|
@@ -325,7 +323,6 @@ BeeEditor.propTypes = {
|
|
|
325
323
|
injectedTags: PropTypes.object,
|
|
326
324
|
onContextChange: PropTypes.func,
|
|
327
325
|
userLocale: PropTypes.string,
|
|
328
|
-
eventContextTags: PropTypes.array,
|
|
329
326
|
};
|
|
330
327
|
|
|
331
328
|
const mapStateToProps = () => createStructuredSelector({
|
|
@@ -156,7 +156,6 @@ export function SlideBoxContent(props) {
|
|
|
156
156
|
showLiquidErrorInFooter,
|
|
157
157
|
creativesMode,
|
|
158
158
|
hostName = '',
|
|
159
|
-
eventContextTags,
|
|
160
159
|
} = props;
|
|
161
160
|
const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
|
|
162
161
|
const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
|
|
@@ -397,7 +396,6 @@ export function SlideBoxContent(props) {
|
|
|
397
396
|
onCreateComplete,
|
|
398
397
|
selectedOfferDetails,
|
|
399
398
|
getFormData,
|
|
400
|
-
eventContextTags,
|
|
401
399
|
};
|
|
402
400
|
|
|
403
401
|
return (
|
|
@@ -432,7 +430,6 @@ export function SlideBoxContent(props) {
|
|
|
432
430
|
smsRegister={smsRegister}
|
|
433
431
|
enableNewChannels={enableNewChannels}
|
|
434
432
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
435
|
-
eventContextTags={eventContextTags}
|
|
436
433
|
/>
|
|
437
434
|
)}
|
|
438
435
|
{isPreview && (
|
|
@@ -512,7 +509,6 @@ export function SlideBoxContent(props) {
|
|
|
512
509
|
handleClose={handleClose}
|
|
513
510
|
onCreateComplete={onCreateComplete}
|
|
514
511
|
smsRegister={smsRegister}
|
|
515
|
-
eventContextTags={eventContextTags}
|
|
516
512
|
/>
|
|
517
513
|
)}
|
|
518
514
|
{isEditFTP && (
|
|
@@ -549,7 +545,6 @@ export function SlideBoxContent(props) {
|
|
|
549
545
|
search: '',
|
|
550
546
|
}}
|
|
551
547
|
hostName={hostName}
|
|
552
|
-
eventContextTags={eventContextTags}
|
|
553
548
|
/>
|
|
554
549
|
}
|
|
555
550
|
{
|
|
@@ -580,7 +575,6 @@ export function SlideBoxContent(props) {
|
|
|
580
575
|
onCreateComplete={onCreateComplete}
|
|
581
576
|
smsRegister={smsRegister}
|
|
582
577
|
onShowTemplates={onShowTemplates}
|
|
583
|
-
eventContextTags={eventContextTags}
|
|
584
578
|
/>
|
|
585
579
|
)}
|
|
586
580
|
|
|
@@ -612,7 +606,6 @@ export function SlideBoxContent(props) {
|
|
|
612
606
|
getCmsTemplatesInProgress={getCmsTemplatesInProgress}
|
|
613
607
|
moduleType={moduleType}
|
|
614
608
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
615
|
-
eventContextTags={eventContextTags}
|
|
616
609
|
/>
|
|
617
610
|
)}
|
|
618
611
|
{(isEditEmailWithId || isEmailEditWithContent) && (
|
|
@@ -641,7 +634,6 @@ export function SlideBoxContent(props) {
|
|
|
641
634
|
onTestContentClicked={onTestContentClicked}
|
|
642
635
|
moduleType={moduleType}
|
|
643
636
|
showLiquidErrorInFooter={showLiquidErrorInFooter}
|
|
644
|
-
eventContextTags={eventContextTags}
|
|
645
637
|
/>
|
|
646
638
|
)}
|
|
647
639
|
{isEditMPush &&
|
|
@@ -667,38 +659,35 @@ export function SlideBoxContent(props) {
|
|
|
667
659
|
type={type}
|
|
668
660
|
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
669
661
|
creativesMode={creativesMode}
|
|
670
|
-
eventContextTags={eventContextTags}
|
|
671
662
|
/>
|
|
672
663
|
}
|
|
673
664
|
{isCreateMPush &&
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
/>
|
|
701
|
-
}
|
|
665
|
+
<MobilepushWrapper
|
|
666
|
+
key="creatives-mobilepush-wrapper"
|
|
667
|
+
date={new Date().getMilliseconds()}
|
|
668
|
+
setIsLoadingContent={setIsLoadingContent}
|
|
669
|
+
onMobilepushModeChange={onMobilepushModeChange}
|
|
670
|
+
mobilePushCreateMode={mobilePushCreateMode}
|
|
671
|
+
isGetFormData={isGetFormData}
|
|
672
|
+
getFormData={getFormData}
|
|
673
|
+
templateData={templateData}
|
|
674
|
+
type={type}
|
|
675
|
+
step={templateStep}
|
|
676
|
+
showNextStep={onCreateNextStep}
|
|
677
|
+
isFullMode={isFullMode}
|
|
678
|
+
onEnterTemplateName={onEnterTemplateName}
|
|
679
|
+
onRemoveTemplateName={onRemoveTemplateName}
|
|
680
|
+
cap={cap}
|
|
681
|
+
onResetStep={onResetStep}
|
|
682
|
+
showTemplateName={showTemplateName}
|
|
683
|
+
query={query}
|
|
684
|
+
forwardedTags={forwardedTags}
|
|
685
|
+
onValidationFail={onValidationFail}
|
|
686
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
687
|
+
onPreviewContentClicked={onPreviewContentClicked}
|
|
688
|
+
hideTestAndPreviewBtn={hideTestAndPreviewBtn}
|
|
689
|
+
onTestContentClicked={onTestContentClicked}/>
|
|
690
|
+
}
|
|
702
691
|
{
|
|
703
692
|
isCreateFacebook && (
|
|
704
693
|
<Facebook
|
|
@@ -715,7 +704,6 @@ export function SlideBoxContent(props) {
|
|
|
715
704
|
fbAdManager={fbAdManager}
|
|
716
705
|
onSelectTemplate={onSelectTemplate}
|
|
717
706
|
orgUnitId={orgUnitId}
|
|
718
|
-
eventContextTags={eventContextTags}
|
|
719
707
|
/>
|
|
720
708
|
)
|
|
721
709
|
}
|
|
@@ -735,7 +723,6 @@ export function SlideBoxContent(props) {
|
|
|
735
723
|
getFormSubscriptionData={getFormData}
|
|
736
724
|
fbAdManager={fbAdManager}
|
|
737
725
|
onSelectTemplate={onSelectTemplate}
|
|
738
|
-
eventContextTags={eventContextTags}
|
|
739
726
|
/>
|
|
740
727
|
)
|
|
741
728
|
}
|
|
@@ -757,7 +744,6 @@ export function SlideBoxContent(props) {
|
|
|
757
744
|
selectedAccount={selectedAccount}
|
|
758
745
|
handleClose={handleClose}
|
|
759
746
|
selectedOfferDetails={selectedOfferDetails}
|
|
760
|
-
eventContextTags={eventContextTags}
|
|
761
747
|
/>
|
|
762
748
|
)
|
|
763
749
|
}
|
|
@@ -776,7 +762,6 @@ export function SlideBoxContent(props) {
|
|
|
776
762
|
createNew
|
|
777
763
|
handleClose={handleClose}
|
|
778
764
|
selectedOfferDetails={selectedOfferDetails}
|
|
779
|
-
eventContextTags={eventContextTags}
|
|
780
765
|
/>
|
|
781
766
|
)
|
|
782
767
|
}
|
|
@@ -791,7 +776,6 @@ export function SlideBoxContent(props) {
|
|
|
791
776
|
onShowTemplates={onShowTemplates}
|
|
792
777
|
templateData={templateData}
|
|
793
778
|
selectedOfferDetails={selectedOfferDetails}
|
|
794
|
-
eventContextTags={eventContextTags}
|
|
795
779
|
createNew/>
|
|
796
780
|
)}
|
|
797
781
|
|
|
@@ -808,13 +792,11 @@ export function SlideBoxContent(props) {
|
|
|
808
792
|
onShowTemplates={onShowTemplates}
|
|
809
793
|
templateData={templateData}
|
|
810
794
|
selectedOfferDetails={selectedOfferDetails}
|
|
811
|
-
eventContextTags={eventContextTags}
|
|
812
795
|
createNew/> }
|
|
813
796
|
|
|
814
797
|
{isCreateWhatsapp && (<Whatsapp
|
|
815
798
|
isFullMode={isFullMode}
|
|
816
799
|
onCreateComplete={onCreateComplete}
|
|
817
|
-
eventContextTags={eventContextTags}
|
|
818
800
|
handleClose={handleClose}/>
|
|
819
801
|
)}
|
|
820
802
|
|
|
@@ -825,7 +807,6 @@ export function SlideBoxContent(props) {
|
|
|
825
807
|
getDefaultTags={type}
|
|
826
808
|
forwardedTags={forwardedTags}
|
|
827
809
|
selectedOfferDetails={selectedOfferDetails}
|
|
828
|
-
eventContextTags={eventContextTags}
|
|
829
810
|
params={{
|
|
830
811
|
id: templateData._id,
|
|
831
812
|
}}
|
|
@@ -849,7 +830,6 @@ export function SlideBoxContent(props) {
|
|
|
849
830
|
isGetFormData={isGetFormData}
|
|
850
831
|
templateData={templateData}
|
|
851
832
|
getDefaultTags={type}
|
|
852
|
-
eventContextTags={eventContextTags}
|
|
853
833
|
/>
|
|
854
834
|
)}
|
|
855
835
|
|
|
@@ -861,7 +841,6 @@ export function SlideBoxContent(props) {
|
|
|
861
841
|
forwardedTags={forwardedTags}
|
|
862
842
|
onCreateComplete={onCreateComplete}
|
|
863
843
|
selectedOfferDetails={selectedOfferDetails}
|
|
864
|
-
eventContextTags={eventContextTags}
|
|
865
844
|
params={{
|
|
866
845
|
id: templateData._id,
|
|
867
846
|
}}
|
|
@@ -1213,7 +1213,6 @@ export class Creatives extends React.Component {
|
|
|
1213
1213
|
editor,
|
|
1214
1214
|
smsRegister,
|
|
1215
1215
|
enableNewChannels,
|
|
1216
|
-
eventContextTags,
|
|
1217
1216
|
} = this.props;
|
|
1218
1217
|
const mapTemplateCreate =
|
|
1219
1218
|
slidBoxContent === "createTemplate" &&
|
|
@@ -1315,7 +1314,6 @@ export class Creatives extends React.Component {
|
|
|
1315
1314
|
showLiquidErrorInFooter={this.showLiquidErrorInFooter}
|
|
1316
1315
|
creativesMode={creativesMode} // An existing prop that we're using here. Required to ensure correct account details in Edit or Preview in case of Embedded mode.
|
|
1317
1316
|
hostName={this.props?.hostName || ''}
|
|
1318
|
-
eventContextTags={eventContextTags}
|
|
1319
1317
|
/>
|
|
1320
1318
|
}
|
|
1321
1319
|
footer={this.shouldShowFooter() &&
|
|
@@ -1375,7 +1373,6 @@ Creatives.propTypes = {
|
|
|
1375
1373
|
strategy: PropTypes.string,
|
|
1376
1374
|
orgUnitId: PropTypes.number,
|
|
1377
1375
|
hostName: PropTypes.string,
|
|
1378
|
-
eventContextTags: PropTypes.array,
|
|
1379
1376
|
};
|
|
1380
1377
|
const mapStatesToProps = () => createStructuredSelector({
|
|
1381
1378
|
isLoading: isLoadingSelector(),
|
|
@@ -2733,7 +2733,6 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
|
|
|
2733
2733
|
isEmailLoading={isLoading}
|
|
2734
2734
|
moduleType={moduleType}
|
|
2735
2735
|
showLiquidErrorInFooter={this.props.showLiquidErrorInFooter}
|
|
2736
|
-
eventContextTags={this.props?.eventContextTags}
|
|
2737
2736
|
/> : ''}
|
|
2738
2737
|
</Col>
|
|
2739
2738
|
</Row>
|
|
@@ -215,7 +215,6 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
215
215
|
currentOrgDetails,
|
|
216
216
|
moduleType,
|
|
217
217
|
showLiquidErrorInFooter,
|
|
218
|
-
eventContextTags,
|
|
219
218
|
} = this.props;
|
|
220
219
|
const {
|
|
221
220
|
templateName,
|
|
@@ -288,7 +287,6 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
|
|
|
288
287
|
onTestContentClicked={onTestContentClicked}
|
|
289
288
|
editor={editor}
|
|
290
289
|
moduleType={moduleType}
|
|
291
|
-
eventContextTags={eventContextTags}
|
|
292
290
|
/>}
|
|
293
291
|
{!isShowEmailCreate && (
|
|
294
292
|
<CmsTemplatesComponent
|
|
@@ -334,7 +332,6 @@ EmailWrapper.propTypes = {
|
|
|
334
332
|
moduleType: PropTypes.string,
|
|
335
333
|
onEnterTemplateName: PropTypes.func,
|
|
336
334
|
onRemoveTemplateName: PropTypes.func,
|
|
337
|
-
eventContextTags: PropTypes.array,
|
|
338
335
|
};
|
|
339
336
|
|
|
340
337
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1804,7 +1804,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1804
1804
|
templateData={this.props.templateData}
|
|
1805
1805
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
1806
1806
|
isFullMode={this.props.isFullMode}
|
|
1807
|
-
eventContextTags={this.props?.eventContextTags}
|
|
1808
1807
|
/>
|
|
1809
1808
|
</CapColumn>
|
|
1810
1809
|
{this.props.iosCtasData && this.state.showIosCtaTable &&
|
|
@@ -1896,7 +1895,6 @@ Create.propTypes = {
|
|
|
1896
1895
|
getFormLibraryData: PropTypes.func,
|
|
1897
1896
|
onPreviewContentClicked: PropTypes.func,
|
|
1898
1897
|
onTestContentClicked: PropTypes.func,
|
|
1899
|
-
eventContextTags: PropTypes.array,
|
|
1900
1898
|
};
|
|
1901
1899
|
|
|
1902
1900
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -1951,7 +1951,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
1951
1951
|
templateData={this.props.templateData}
|
|
1952
1952
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
1953
1953
|
isFullMode={this.props.isFullMode}
|
|
1954
|
-
eventContextTags={this.props?.eventContextTags}
|
|
1955
1954
|
/>}
|
|
1956
1955
|
</CapColumn>
|
|
1957
1956
|
{this.props.iosCtasData && this.state.showIosCtaTable &&
|
|
@@ -2047,7 +2046,6 @@ Edit.propTypes = {
|
|
|
2047
2046
|
onPreviewContentClicked: PropTypes.func,
|
|
2048
2047
|
onTestContentClicked: PropTypes.func,
|
|
2049
2048
|
creativesMode: PropTypes.string,
|
|
2050
|
-
eventContextTags: PropTypes.array,
|
|
2051
2049
|
};
|
|
2052
2050
|
|
|
2053
2051
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -72,9 +72,7 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
render() {
|
|
75
|
-
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData
|
|
76
|
-
eventContextTags,
|
|
77
|
-
} = this.props;
|
|
75
|
+
const {mobilePushCreateMode, step, getFormData, setIsLoadingContent, isGetFormData, query, isFullMode, showTemplateName, type, onValidationFail, onPreviewContentClicked, onTestContentClicked, templateData} = this.props;
|
|
78
76
|
const {templateName} = this.state;
|
|
79
77
|
const isShowMobilepushCreate = !isEmpty(mobilePushCreateMode);
|
|
80
78
|
return (
|
|
@@ -121,7 +119,6 @@ export class MobilepushWrapper extends React.Component { // eslint-disable-line
|
|
|
121
119
|
onTestContentClicked={onTestContentClicked}
|
|
122
120
|
templateData={templateData}
|
|
123
121
|
hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
|
|
124
|
-
eventContextTags={eventContextTags}
|
|
125
122
|
/>
|
|
126
123
|
|
|
127
124
|
|
|
@@ -147,7 +144,6 @@ MobilepushWrapper.propTypes = {
|
|
|
147
144
|
showTemplateName: PropTypes.func,
|
|
148
145
|
type: PropTypes.string,
|
|
149
146
|
onValidationFail: PropTypes.func,
|
|
150
|
-
eventContextTags: PropTypes.array,
|
|
151
147
|
};
|
|
152
148
|
|
|
153
149
|
|
|
@@ -989,7 +989,6 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
989
989
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
990
990
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
991
991
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
992
|
-
eventContextTags={this.props?.eventContextTags}
|
|
993
992
|
/>
|
|
994
993
|
</CapColumn>
|
|
995
994
|
</CapRow>
|
|
@@ -1016,7 +1015,6 @@ Create.propTypes = {
|
|
|
1016
1015
|
getFormSubscriptionData: PropTypes.func,
|
|
1017
1016
|
isLoadingMetaEntities: PropTypes.bool,
|
|
1018
1017
|
selectedOfferDetails: PropTypes.array,
|
|
1019
|
-
eventContextTags: PropTypes.array,
|
|
1020
1018
|
};
|
|
1021
1019
|
|
|
1022
1020
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -987,7 +987,6 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
987
987
|
selectedOfferDetails={this.props.selectedOfferDetails}
|
|
988
988
|
onPreviewContentClicked={this.props.onPreviewContentClicked}
|
|
989
989
|
onTestContentClicked={this.props.onTestContentClicked}
|
|
990
|
-
eventContextTags={this.props.eventContextTags}
|
|
991
990
|
/>
|
|
992
991
|
</CapColumn>
|
|
993
992
|
</CapRow>
|
|
@@ -1017,7 +1016,6 @@ Edit.propTypes = {
|
|
|
1017
1016
|
// route: PropTypes.object,
|
|
1018
1017
|
injectedTags: PropTypes.object,
|
|
1019
1018
|
selectedOfferDetails: PropTypes.array,
|
|
1020
|
-
eventContextTags: PropTypes.array,
|
|
1021
1019
|
};
|
|
1022
1020
|
|
|
1023
1021
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -71,7 +71,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
71
71
|
getFormSubscriptionData,
|
|
72
72
|
templateData = {},
|
|
73
73
|
selectedOfferDetails,
|
|
74
|
-
eventContextTags,
|
|
75
74
|
} = props || {};
|
|
76
75
|
const { formatMessage } = intl;
|
|
77
76
|
const [loading, updateLoading] = useState(true);
|
|
@@ -227,7 +226,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
227
226
|
injectedTagsParams: injectedTags,
|
|
228
227
|
location,
|
|
229
228
|
tagModule: getDefaultTags,
|
|
230
|
-
eventContextTags,
|
|
231
229
|
}) || {};
|
|
232
230
|
updateIsTagValidationError(
|
|
233
231
|
tagValidationResponse.unsupportedTags.length > 0,
|
|
@@ -571,7 +569,6 @@ export const SmsTraiEdit = (props) => {
|
|
|
571
569
|
injectedTags={injectedTags || {}}
|
|
572
570
|
hidePopover={disablehandler()}
|
|
573
571
|
selectedOfferDetails={selectedOfferDetails}
|
|
574
|
-
eventContextTags={eventContextTags}
|
|
575
572
|
/>
|
|
576
573
|
}
|
|
577
574
|
/>
|
|
@@ -29,7 +29,6 @@ const SmsWrapper = (props) => {
|
|
|
29
29
|
handleClose,
|
|
30
30
|
smsRegister,
|
|
31
31
|
onShowTemplates,
|
|
32
|
-
eventContextTags,
|
|
33
32
|
} = props;
|
|
34
33
|
|
|
35
34
|
const smsProps = {
|
|
@@ -45,7 +44,6 @@ const SmsWrapper = (props) => {
|
|
|
45
44
|
selectedOfferDetails,
|
|
46
45
|
onPreviewContentClicked,
|
|
47
46
|
onTestContentClicked,
|
|
48
|
-
eventContextTags,
|
|
49
47
|
};
|
|
50
48
|
const isTraiDlt = isTraiDLTEnable(isFullMode, smsRegister);
|
|
51
49
|
return <>
|
|
@@ -22,7 +22,6 @@ import './_tagList.scss';
|
|
|
22
22
|
import { selectCurrentOrgDetails, makeSelectFetchingSchemaError } from '../Cap/selectors';
|
|
23
23
|
import { injectIntl } from 'react-intl';
|
|
24
24
|
import { scope } from './messages';
|
|
25
|
-
import messages from './messages';
|
|
26
25
|
import { handleInjectedData, hasGiftVoucherFeature, hasPromoFeature, hasBadgesFeature, transformBadgeTags } from '../../utils/common';
|
|
27
26
|
import { GIFT_VOUCHER_RELATED_TAGS, PROMO_ENGINE_RELATED_TAGS, BADGES_RELATED_TAGS, BADGES_ENROLL, BADGES_ISSUE } from '../../containers/App/constants';
|
|
28
27
|
|
|
@@ -84,9 +83,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
84
83
|
generateTags = (props) => {
|
|
85
84
|
let tags = {};
|
|
86
85
|
let injectedTags = {};
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
const {selectedOfferDetails, eventContextTags } = props;
|
|
86
|
+
const {selectedOfferDetails } = props;
|
|
90
87
|
if (props.injectedTags && !_.isEmpty(props.injectedTags)) {
|
|
91
88
|
const formattedInjectedTags = handleInjectedData(
|
|
92
89
|
props.injectedTags,
|
|
@@ -104,27 +101,7 @@ export class TagList extends React.Component { // eslint-disable-line react/pref
|
|
|
104
101
|
this.transformCouponTags(selectedOfferDetails, tags);
|
|
105
102
|
}
|
|
106
103
|
}
|
|
107
|
-
|
|
108
|
-
const TAG_HEADER_MSG_LABEL = this.props.intl.formatMessage(messages.tagsBasedOnEntryTriggerEvent);
|
|
109
|
-
eventContextTagsObj.EventContextTags = {
|
|
110
|
-
name: TAG_HEADER_MSG_LABEL,
|
|
111
|
-
desc: TAG_HEADER_MSG_LABEL,
|
|
112
|
-
resolved: true,
|
|
113
|
-
'tag-header': true,
|
|
114
|
-
subtags: {},
|
|
115
|
-
};
|
|
116
|
-
// Journey event context tags also should be displayed in the Add Labels.
|
|
117
|
-
eventContextTags.forEach((tag) => {
|
|
118
|
-
if (tag?.tagName) {
|
|
119
|
-
eventContextTagsObj.EventContextTags.subtags[tag?.tagName] = {
|
|
120
|
-
name: tag?.tagName,
|
|
121
|
-
desc: tag?.tagName,
|
|
122
|
-
resolved: true
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
this.setState({tags: _.merge( {}, tags, injectedTags, eventContextTagsObj )});
|
|
104
|
+
this.setState({tags: _.merge( {}, tags, injectedTags)});
|
|
128
105
|
}
|
|
129
106
|
populateTags(tagsList) {
|
|
130
107
|
const mainTags = {};
|
|
@@ -341,7 +318,6 @@ TagList.propTypes = {
|
|
|
341
318
|
channel: PropTypes.string,
|
|
342
319
|
disabled: PropTypes.bool,
|
|
343
320
|
fetchingSchemaError: PropTypes.bool,
|
|
344
|
-
eventContextTags: PropTypes.array,
|
|
345
321
|
};
|
|
346
322
|
|
|
347
323
|
const mapStateToProps = createStructuredSelector({
|
|
@@ -11,8 +11,4 @@ export default defineMessages({
|
|
|
11
11
|
id: `${scope}.header`,
|
|
12
12
|
defaultMessage: 'This is TagList container !',
|
|
13
13
|
},
|
|
14
|
-
tagsBasedOnEntryTriggerEvent: {
|
|
15
|
-
id: `${scope}.tagsBasedOnEntryTriggerEvent`,
|
|
16
|
-
defaultMessage: 'Tags based on entry trigger event',
|
|
17
|
-
},
|
|
18
14
|
});
|
|
@@ -71,7 +71,6 @@ export const Viber = (props) => {
|
|
|
71
71
|
viberData = {},
|
|
72
72
|
selectedOfferDetails = [],
|
|
73
73
|
currentOrgDetails,
|
|
74
|
-
eventContextTags,
|
|
75
74
|
} = props || {};
|
|
76
75
|
|
|
77
76
|
const { formatMessage } = intl;
|
|
@@ -271,7 +270,6 @@ export const Viber = (props) => {
|
|
|
271
270
|
id={"viber_tags"}
|
|
272
271
|
userLocale={localStorage.getItem("jlocale") || "en"}
|
|
273
272
|
selectedOfferDetails={selectedOfferDetails}
|
|
274
|
-
eventContextTags={eventContextTags}
|
|
275
273
|
/>
|
|
276
274
|
</CapColumn>
|
|
277
275
|
<div className="viber-textarea-wrapper">
|
|
@@ -128,8 +128,7 @@ export const Whatsapp = (props) => {
|
|
|
128
128
|
loadingTags,
|
|
129
129
|
getFormData,
|
|
130
130
|
selectedOfferDetails,
|
|
131
|
-
currentOrgDetails
|
|
132
|
-
eventContextTags,
|
|
131
|
+
currentOrgDetails
|
|
133
132
|
} = props || {};
|
|
134
133
|
const { formatMessage } = intl;
|
|
135
134
|
const { TextArea } = CapInput;
|
|
@@ -502,7 +501,6 @@ export const Whatsapp = (props) => {
|
|
|
502
501
|
injectedTagsParams: injectedTags,
|
|
503
502
|
location,
|
|
504
503
|
tagModule: getDefaultTags,
|
|
505
|
-
eventContextTags,
|
|
506
504
|
}) || {};
|
|
507
505
|
const unsupportedTagsLengthCheck =
|
|
508
506
|
validationResponse?.unsupportedTags?.length > 0;
|
|
@@ -2053,7 +2051,6 @@ const isAuthenticationTemplate = isEqual(templateCategory, WHATSAPP_CATEGORIES.a
|
|
|
2053
2051
|
onContextChange={handleOnTagsContextChange}
|
|
2054
2052
|
injectedTags={injectedTags || {}}
|
|
2055
2053
|
selectedOfferDetails={selectedOfferDetails}
|
|
2056
|
-
eventContextTags={eventContextTags}
|
|
2057
2054
|
/>
|
|
2058
2055
|
)
|
|
2059
2056
|
}
|
|
@@ -66,7 +66,6 @@ export const Zalo = (props) => {
|
|
|
66
66
|
getFormData,
|
|
67
67
|
selectedOfferDetails,
|
|
68
68
|
hostName: zaloHostName = '',
|
|
69
|
-
eventContextTags,
|
|
70
69
|
} = props || {};
|
|
71
70
|
const {hostName = zaloHostName || ''} = senderDetails;
|
|
72
71
|
const { formatMessage } = intl;
|
|
@@ -257,7 +256,6 @@ export const Zalo = (props) => {
|
|
|
257
256
|
injectedTagsParams: injectedTags,
|
|
258
257
|
location,
|
|
259
258
|
tagModule: getDefaultTags,
|
|
260
|
-
eventContextTags,
|
|
261
259
|
}) || {};
|
|
262
260
|
const { unsupportedTags = [], isBraceError } = tagValidationResponse;
|
|
263
261
|
let tagError = '';
|
|
@@ -447,7 +445,6 @@ export const Zalo = (props) => {
|
|
|
447
445
|
injectedTags={injectedTags || {}}
|
|
448
446
|
selectedOfferDetails={selectedOfferDetails}
|
|
449
447
|
disabled={isFullMode}
|
|
450
|
-
eventContextTags={eventContextTags}
|
|
451
448
|
/>
|
|
452
449
|
}
|
|
453
450
|
/>
|