@capillarytech/creatives-library 7.7.26 → 7.8.1
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/app.js +1 -5
- package/components/FormBuilder/index.js +2 -2
- package/containers/Email/index.js +3 -8
- package/containers/MobilePush/Create/index.js +2 -2
- package/containers/MobilePush/Edit/index.js +2 -2
- package/containers/WeChat/MapTemplates/index.js +3 -15
- package/package.json +1 -1
- package/services/api.js +5 -20
- package/translations/en.json +2 -113
- package/translations/zh.json +1 -112
- package/utils/gtmTrackers/gtmEvents/creativeDetails.js +2 -6
- package/utils/gtmTrackers/index.js +4 -8
- package/v2Components/CapImageUpload/index.js +8 -14
- package/v2Components/FormBuilder/index.js +1 -10
- package/v2Components/NavigationBar/index.js +29 -63
- package/v2Components/NavigationBar/messages.js +0 -5
- package/v2Containers/App/constants.js +3 -23
- package/v2Containers/Cap/actions.js +2 -2
- package/v2Containers/Cap/constants.js +2 -3
- package/v2Containers/Cap/index.js +18 -18
- package/v2Containers/Cap/messages.js +0 -8
- package/v2Containers/Cap/sagas.js +6 -18
- package/v2Containers/CapFacebookPreview/constants.js +0 -4
- package/v2Containers/CapFacebookPreview/index.js +67 -92
- package/v2Containers/CapFacebookPreview/reducer.js +10 -19
- package/v2Containers/CreativesContainer/SlideBoxContent.js +0 -2
- package/v2Containers/CreativesContainer/index.js +1 -1
- package/v2Containers/Facebook/Advertisement/index.js +2 -2
- package/v2Containers/Facebook/Advertisement/index.scss +1 -1
- package/v2Containers/Facebook/index.js +4 -15
- package/v2Containers/Line/Container/Drawer/index.js +1 -1
- package/v2Containers/MobilePush/Edit/index.js +2 -2
- package/v2Containers/MobilepushWrapper/index.js +1 -1
- package/v2Containers/Templates/_templates.scss +2 -4
- package/v2Containers/Templates/index.js +2 -5
- package/v2Containers/TemplatesV2/index.js +3 -11
- package/v2Containers/WeChat/MapTemplates/index.js +2 -12
|
@@ -5,17 +5,13 @@ const gtmEvents = require.context('./gtmEvents', true, /\.js$/, 'lazy');
|
|
|
5
5
|
export const gtmPush = (eventType, eventObject) => {
|
|
6
6
|
try {
|
|
7
7
|
gtmEvents(`./${eventType}.js`)
|
|
8
|
-
.then(
|
|
8
|
+
.then(event => {
|
|
9
9
|
event.default(eventObject);
|
|
10
10
|
})
|
|
11
|
-
.catch(
|
|
12
|
-
|
|
13
|
-
Bugsnag.notify(err);
|
|
14
|
-
}
|
|
11
|
+
.catch(err => {
|
|
12
|
+
Bugsnag.notify(err);
|
|
15
13
|
});
|
|
16
14
|
} catch (e) {
|
|
17
|
-
|
|
18
|
-
Bugsnag.notify(e);
|
|
19
|
-
}
|
|
15
|
+
Bugsnag.notify(e);
|
|
20
16
|
}
|
|
21
17
|
};
|
|
@@ -85,12 +85,6 @@ function CapImageUpload(props) {
|
|
|
85
85
|
};
|
|
86
86
|
submitAction({file, type: 'image', fileParams}, incorrectFile);
|
|
87
87
|
};
|
|
88
|
-
img.onerror = () => {
|
|
89
|
-
const fileParams = {
|
|
90
|
-
error: true,
|
|
91
|
-
};
|
|
92
|
-
submitAction({fileParams}, incorrectFile);
|
|
93
|
-
}
|
|
94
88
|
if (e) {
|
|
95
89
|
const event = e;
|
|
96
90
|
event.target.value = null;
|
|
@@ -99,12 +93,13 @@ function CapImageUpload(props) {
|
|
|
99
93
|
|
|
100
94
|
const submitAction = useCallback((data, incorrectFile) => {
|
|
101
95
|
const {
|
|
102
|
-
file,
|
|
103
|
-
fileParams
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
file: {size},
|
|
97
|
+
fileParams: {
|
|
98
|
+
height,
|
|
99
|
+
width,
|
|
100
|
+
},
|
|
101
|
+
} = data;
|
|
102
|
+
if (incorrectFile || size > imgSize || height > imgHeight || width > imgWidth) {
|
|
108
103
|
updateImageErrorMessage(formatMessage(messages.imageIncorrectSize));
|
|
109
104
|
} else {
|
|
110
105
|
updateImageErrorMessage('');
|
|
@@ -171,7 +166,6 @@ function CapImageUpload(props) {
|
|
|
171
166
|
<CapUploader.CapDragger
|
|
172
167
|
customRequest={capUploaderCustomRequest}
|
|
173
168
|
className="form-builder-dragger"
|
|
174
|
-
showUploadList={!isImageError}
|
|
175
169
|
>
|
|
176
170
|
<CapHeading className="dragger-title" type="h7">
|
|
177
171
|
<FormattedMessage {...messages.dragAndDrop} />
|
|
@@ -204,7 +198,7 @@ function CapImageUpload(props) {
|
|
|
204
198
|
<FormattedMessage {...messages.imageReUpload} />
|
|
205
199
|
</CapButton>
|
|
206
200
|
);
|
|
207
|
-
}, [
|
|
201
|
+
}, []);
|
|
208
202
|
|
|
209
203
|
return (
|
|
210
204
|
<div style={style} className="cap-custom-image-upload">
|
|
@@ -2854,16 +2854,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
|
|
|
2854
2854
|
name={val.name ? val.name : `${val.id}-name`}
|
|
2855
2855
|
disabled={val.disabled}
|
|
2856
2856
|
>
|
|
2857
|
-
{val.options.map((option, index) => {
|
|
2858
|
-
const isMappedTemplateWechat = val.id === "template-redirect-options-radio";
|
|
2859
|
-
return (
|
|
2860
|
-
<CapRadio
|
|
2861
|
-
value={ isMappedTemplateWechat ? option.value : option }
|
|
2862
|
-
inductiveText={val.inductiveText && val.inductiveText[index]}>{ isMappedTemplateWechat ? option.label : option }
|
|
2863
|
-
</CapRadio>
|
|
2864
|
-
)
|
|
2865
|
-
}
|
|
2866
|
-
)}
|
|
2857
|
+
{val.options.map((option, index) => <CapRadio value={option} inductiveText={val.inductiveText && val.inductiveText[index]}>{option}</CapRadio>) }
|
|
2867
2858
|
|
|
2868
2859
|
</CapRadioGroup>
|
|
2869
2860
|
{/*{ifError ?*/}
|
|
@@ -10,23 +10,11 @@ import styled from 'styled-components';
|
|
|
10
10
|
import { isEmpty, forEach } from 'lodash';
|
|
11
11
|
import { loadItem } from 'services/localStorageApi';
|
|
12
12
|
import { intlShape, injectIntl } from 'react-intl';
|
|
13
|
-
import { FONT_COLOR_04 } from '@capillarytech/cap-ui-library/styled/variables';
|
|
14
13
|
import TopBar from '../TopBar';
|
|
15
14
|
import messages from './messages';
|
|
16
|
-
import { LOYALTY } from '../../v2Containers/App/constants';
|
|
17
|
-
import {
|
|
18
|
-
HELP_URL,
|
|
19
|
-
LOYALTY_HELP_URL,
|
|
20
|
-
} from '../../v2Containers/Cap/constants';
|
|
21
15
|
const PRODUCT_MASTERS = 'masters';
|
|
22
16
|
const EMBEDDED = 'embedded';
|
|
23
17
|
|
|
24
|
-
const AppWrapper = styled.div`
|
|
25
|
-
.navigation-setting-icon {
|
|
26
|
-
color: ${FONT_COLOR_04};
|
|
27
|
-
}
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
18
|
const CapWrapper = styled.div`
|
|
31
19
|
position: absolute;
|
|
32
20
|
padding: 0;
|
|
@@ -46,37 +34,9 @@ const ComponentWrapper = styled.div`
|
|
|
46
34
|
class NavigationBar extends React.Component {
|
|
47
35
|
constructor(props) {
|
|
48
36
|
super(props);
|
|
49
|
-
this.state =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
initializeSelectedProduct = () => {
|
|
53
|
-
const {location, intl: {formatMessage}} = this.props;
|
|
54
|
-
const { pathname } = location;
|
|
55
|
-
const parentModule = pathname.substring(pathname.lastIndexOf('/') + 1);
|
|
56
|
-
switch (parentModule) {
|
|
57
|
-
case LOYALTY:
|
|
58
|
-
return {
|
|
59
|
-
selectedProduct: formatMessage(messages.loyaltyProgram),
|
|
60
|
-
helpUrl: LOYALTY_HELP_URL,
|
|
61
|
-
settingsIcon: {
|
|
62
|
-
iconType: 'settings',
|
|
63
|
-
key: 'settings',
|
|
64
|
-
placement: 'bottomRight',
|
|
65
|
-
className: 'navigation-setting-icon',
|
|
66
|
-
toolTip: formatMessage(messages.noProductSetting),
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
default:
|
|
70
|
-
return {
|
|
71
|
-
selectedProduct: formatMessage(messages.selectedProductDefault),
|
|
72
|
-
helpUrl: HELP_URL,
|
|
73
|
-
settingsIcon: {
|
|
74
|
-
iconType: 'settings',
|
|
75
|
-
key: 'settings',
|
|
76
|
-
onClickHandler: this.onSettingsIconClick,
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
}
|
|
37
|
+
this.state = {
|
|
38
|
+
selectedProduct: '',
|
|
39
|
+
};
|
|
80
40
|
}
|
|
81
41
|
|
|
82
42
|
onOrgSettingsClick = () => {
|
|
@@ -97,7 +57,7 @@ class NavigationBar extends React.Component {
|
|
|
97
57
|
};
|
|
98
58
|
|
|
99
59
|
onHelpIconClick = () => {
|
|
100
|
-
const {helpUrl} = this.
|
|
60
|
+
const { helpUrl } = this.props;
|
|
101
61
|
if (helpUrl) {
|
|
102
62
|
window.open(helpUrl, '_blank');
|
|
103
63
|
}
|
|
@@ -153,17 +113,18 @@ class NavigationBar extends React.Component {
|
|
|
153
113
|
return productsList;
|
|
154
114
|
};
|
|
155
115
|
|
|
156
|
-
getTopbarIcons = () =>
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
116
|
+
getTopbarIcons = () => [
|
|
117
|
+
{
|
|
118
|
+
iconType: 'help',
|
|
119
|
+
key: 'help',
|
|
120
|
+
onClickHandler: this.onHelpIconClick,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
iconType: 'settings',
|
|
124
|
+
key: 'settings',
|
|
125
|
+
onClickHandler: this.onSettingsIconClick,
|
|
126
|
+
},
|
|
127
|
+
];
|
|
167
128
|
|
|
168
129
|
getDropdownMenu = () => {
|
|
169
130
|
const { formatMessage } = this.props.intl;
|
|
@@ -207,6 +168,7 @@ class NavigationBar extends React.Component {
|
|
|
207
168
|
topbarMenuData,
|
|
208
169
|
loggedIn,
|
|
209
170
|
type,
|
|
171
|
+
intl,
|
|
210
172
|
} = this.props;
|
|
211
173
|
const productsList = this.getProductsList();
|
|
212
174
|
const proxyOrgList = this.getProxyOrgList();
|
|
@@ -216,11 +178,14 @@ class NavigationBar extends React.Component {
|
|
|
216
178
|
const { selectedProduct } = this.state;
|
|
217
179
|
const customTopBarProps = {};
|
|
218
180
|
return (
|
|
219
|
-
<
|
|
181
|
+
<div>
|
|
220
182
|
{loggedIn && type !== EMBEDDED &&
|
|
221
183
|
<TopBar
|
|
222
184
|
productsList={productsList}
|
|
223
|
-
selectedProduct={
|
|
185
|
+
selectedProduct={
|
|
186
|
+
selectedProduct ||
|
|
187
|
+
intl.formatMessage(messages.selectedProductDefault)
|
|
188
|
+
}
|
|
224
189
|
handleProductChange={this.handleProductChange}
|
|
225
190
|
proxyOrgList={proxyOrgList}
|
|
226
191
|
selectedOrg={selectedOrg}
|
|
@@ -232,12 +197,12 @@ class NavigationBar extends React.Component {
|
|
|
232
197
|
{...customTopBarProps}
|
|
233
198
|
/>
|
|
234
199
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
</
|
|
200
|
+
<CapWrapper isEmbedded={type === EMBEDDED}>
|
|
201
|
+
<ComponentWrapper>
|
|
202
|
+
{React.Children.toArray(this.props.children)}
|
|
203
|
+
</ComponentWrapper>
|
|
204
|
+
</CapWrapper>
|
|
205
|
+
</div>
|
|
241
206
|
);
|
|
242
207
|
}
|
|
243
208
|
}
|
|
@@ -249,6 +214,7 @@ NavigationBar.propTypes = {
|
|
|
249
214
|
changeOrg: PropTypes.func,
|
|
250
215
|
settingsUrl: PropTypes.string,
|
|
251
216
|
children: PropTypes.node,
|
|
217
|
+
helpUrl: PropTypes.string,
|
|
252
218
|
orgSettingsUrl: PropTypes.string,
|
|
253
219
|
loggedIn: PropTypes.bool,
|
|
254
220
|
intl: intlShape.isRequired,
|
|
@@ -57,9 +57,4 @@ export default defineMessages({
|
|
|
57
57
|
id: `${scope}.storeCare`,
|
|
58
58
|
defaultMessage: 'Store Care',
|
|
59
59
|
},
|
|
60
|
-
"noProductSetting": {
|
|
61
|
-
id: `${scope}.noProductSetting`,
|
|
62
|
-
defaultMessage:
|
|
63
|
-
'There are no product settings. Organisation settings are available under profile on the right.',
|
|
64
|
-
},
|
|
65
60
|
});
|
|
@@ -13,25 +13,6 @@ export const getTopbarMenuDataValue = () => ([
|
|
|
13
13
|
{ label: <FormattedMessage {...globalMessages.creatives} />, link: '/creatives/ui/v2', key: 'creatives' },
|
|
14
14
|
]);
|
|
15
15
|
|
|
16
|
-
export const getLoyaltyTopbarMenuDataValue = () => [
|
|
17
|
-
{
|
|
18
|
-
label: <FormattedMessage {...globalMessages.programs} />,
|
|
19
|
-
link: 'loyalty/ui/',
|
|
20
|
-
key: 'programs',
|
|
21
|
-
},
|
|
22
|
-
//commented as promotions are not supported in loyalty v2 flow
|
|
23
|
-
// {
|
|
24
|
-
// label: <FormattedMessage {...globalMessages.promotions} />,
|
|
25
|
-
// link: 'loyalty/ui/promotions/',
|
|
26
|
-
// key: 'promotions',
|
|
27
|
-
// },
|
|
28
|
-
{
|
|
29
|
-
label: <FormattedMessage {...globalMessages.creatives} />,
|
|
30
|
-
link: '/creatives/ui/v2/loyalty',
|
|
31
|
-
key: 'creatives',
|
|
32
|
-
},
|
|
33
|
-
];
|
|
34
|
-
|
|
35
16
|
export const TRACK_CREATE_SMS = 'createSms';
|
|
36
17
|
export const TRACK_CREATE_EMAIL = 'createEmail';
|
|
37
18
|
export const TRACK_CREATE_MPUSH = 'createMpush';
|
|
@@ -65,7 +46,7 @@ export const CHANNEL_CREATE_TRACK_MAPPING = {
|
|
|
65
46
|
gallery: TRACK_CREATE_IMAGE,
|
|
66
47
|
line: TRACK_CREATE_LINE,
|
|
67
48
|
viber: TRACK_CREATE_VIBER,
|
|
68
|
-
facebook: TRACK_CREATE_FACEBOOK
|
|
49
|
+
facebook: TRACK_CREATE_FACEBOOK
|
|
69
50
|
};
|
|
70
51
|
|
|
71
52
|
export const CHANNEL_EDIT_TRACK_MAPPING = {
|
|
@@ -76,7 +57,7 @@ export const CHANNEL_EDIT_TRACK_MAPPING = {
|
|
|
76
57
|
gallery: TRACK_EDIT_IMAGE,
|
|
77
58
|
line: TRACK_EDIT_LINE,
|
|
78
59
|
viber: TRACK_EDIT_VIBER,
|
|
79
|
-
facebook: TRACK_EDIT_FACEBOOK
|
|
60
|
+
facebook: TRACK_EDIT_FACEBOOK
|
|
80
61
|
};
|
|
81
62
|
export const GTM_TRACKING_ID = 'UA-110024621-2';
|
|
82
63
|
export const BEE_PLUGIN = 'BEE_PLUGIN';
|
|
@@ -104,5 +85,4 @@ export const FB_AD_CALL_TO_ACTION = {
|
|
|
104
85
|
};
|
|
105
86
|
|
|
106
87
|
|
|
107
|
-
export const CREATIVES = 'creatives';
|
|
108
|
-
export const LOYALTY = 'loyalty';
|
|
88
|
+
export const CREATIVES = 'creatives';
|
|
@@ -45,6 +45,7 @@ export function getUserData(callback) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
export function fetchSchemaForEntity(queryParams) {
|
|
48
|
+
|
|
48
49
|
return {
|
|
49
50
|
type: types.GET_SCHEMA_FOR_ENTITY_REQUEST, queryParams,
|
|
50
51
|
};
|
|
@@ -61,9 +62,8 @@ export function setInjectedTags(injectedTags) {
|
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
export function getTopbarMenuData(
|
|
65
|
+
export function getTopbarMenuData() {
|
|
65
66
|
return {
|
|
66
|
-
parentModule,
|
|
67
67
|
type: types.GET_TOPBAR_MENU_DATA_REQUEST,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
@@ -31,8 +31,7 @@ export const CLEAR_TOPBAR_MENU_DATA = 'creatives/cap/CLEAR_TOPBAR_MENU_DATA';
|
|
|
31
31
|
export const CAMPAIGN_SETTINGS_URL = '/creatives/settings/message';
|
|
32
32
|
export const ORG_SETTINGS_URL = '/org/index';
|
|
33
33
|
export const HELP_URL = 'https://support.capillarytech.com/en/support/solutions/4000007853';
|
|
34
|
-
export const LOYALTY_HELP_URL = 'https://support.capillarytech.com/en/support/solutions/97443';
|
|
35
34
|
|
|
36
|
-
export const ORG_REFRESH_SEC = 10;
|
|
37
|
-
export const ORG_CHANGED = 'ORG_CHANGED';
|
|
35
|
+
export const ORG_REFRESH_SEC = 10;
|
|
36
|
+
export const ORG_CHANGED = 'ORG_CHANGED';
|
|
38
37
|
|
|
@@ -22,10 +22,11 @@ import { engagePlusPublicPath } from '../../config/path';
|
|
|
22
22
|
import { GTM_TRACKING_ID, CREATIVES_UI_VIEW } from '../App/constants';
|
|
23
23
|
import { makeSelectLocale } from '../../v2Containers/LanguageProvider/selectors';
|
|
24
24
|
import {
|
|
25
|
+
HELP_URL,
|
|
25
26
|
ORG_SETTINGS_URL,
|
|
26
27
|
CAMPAIGN_SETTINGS_URL,
|
|
27
28
|
ORG_REFRESH_SEC,
|
|
28
|
-
ORG_CHANGED
|
|
29
|
+
ORG_CHANGED
|
|
29
30
|
} from './constants';
|
|
30
31
|
import './_cap.scss';
|
|
31
32
|
|
|
@@ -72,8 +73,6 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
componentWillMount() {
|
|
75
|
-
const { pathname } = this.props.location;
|
|
76
|
-
const parentModule = pathname.substring(pathname.lastIndexOf('/') + 1);
|
|
77
76
|
this.props.actions.getUserData((userData) => {
|
|
78
77
|
if (!userData.accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
|
|
79
78
|
this.setState({ isCreativesAccessible: false });
|
|
@@ -82,7 +81,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
82
81
|
this.setDimensionData(userGtmData);
|
|
83
82
|
gtm.push({...userGtmData, event: 'userAuthenticated'});
|
|
84
83
|
});
|
|
85
|
-
this.props.actions.getTopbarMenuData(
|
|
84
|
+
this.props.actions.getTopbarMenuData();
|
|
86
85
|
if (this.props.Global.orgID !== undefined) {
|
|
87
86
|
gtm.push({orgId: this.props.Global.orgID});
|
|
88
87
|
}
|
|
@@ -102,7 +101,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
102
101
|
}
|
|
103
102
|
locale = this.getMappedLocale(locale);
|
|
104
103
|
//locale = 'zh';
|
|
105
|
-
|
|
104
|
+
|
|
106
105
|
moment.locale(locale);
|
|
107
106
|
window.addEventListener('storage', this.handleStorageChange, false);
|
|
108
107
|
document.addEventListener(
|
|
@@ -168,7 +167,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
168
167
|
tabOnloadEventHandler = () => {
|
|
169
168
|
logNewTab();
|
|
170
169
|
}
|
|
171
|
-
|
|
170
|
+
|
|
172
171
|
setDimensionData(userGtmData) {
|
|
173
172
|
Object.values(userGtmData).forEach((value, index) => {
|
|
174
173
|
GA.setCustomDimension({ [`dimension${index + 1}`]: value });
|
|
@@ -176,23 +175,23 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
176
175
|
}
|
|
177
176
|
getUserGtmData(props) {
|
|
178
177
|
const selectedProps = props || this.props;
|
|
179
|
-
const { user: userData,
|
|
178
|
+
const { user: userData, orgID} = selectedProps?.Global || {};
|
|
180
179
|
if (userData) {
|
|
181
180
|
const {
|
|
182
181
|
attributes: {
|
|
183
|
-
USERNAME: userName,
|
|
184
|
-
EMAIL: userEmail
|
|
182
|
+
USERNAME : userName,
|
|
183
|
+
EMAIL : userEmail
|
|
185
184
|
} = {},
|
|
186
|
-
proxyOrgList =
|
|
185
|
+
proxyOrgList =[],
|
|
187
186
|
isCapUser,
|
|
188
187
|
refID,
|
|
189
188
|
orgName: userOrgName,
|
|
190
189
|
} = userData;
|
|
191
|
-
const { orgName } = _.find(proxyOrgList, { orgID }) || {
|
|
190
|
+
const { orgName } = _.find(proxyOrgList, { orgID: orgID }) || {
|
|
192
191
|
orgName: userOrgName,
|
|
193
192
|
};
|
|
194
193
|
const gtmData = {
|
|
195
|
-
isCapUser,
|
|
194
|
+
isCapUser: isCapUser,
|
|
196
195
|
orgId: orgID,
|
|
197
196
|
orgName,
|
|
198
197
|
userId: refID,
|
|
@@ -273,7 +272,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
273
272
|
refreshSeconds === ORG_REFRESH_SEC
|
|
274
273
|
) {
|
|
275
274
|
const timer = setInterval(() => {
|
|
276
|
-
this.setState(
|
|
275
|
+
this.setState(prevState => ({
|
|
277
276
|
refreshSeconds: prevState.refreshSeconds - 1,
|
|
278
277
|
}));
|
|
279
278
|
}, 1000);
|
|
@@ -287,13 +286,13 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
287
286
|
|
|
288
287
|
handleStorageChange = (e) => {
|
|
289
288
|
const { oldValue, newValue } = e;
|
|
290
|
-
|
|
289
|
+
if (utilsHandleStorageChange(e, 'orgID')) {
|
|
291
290
|
const localStorageOrgInfo = { oldValue, newValue };
|
|
292
291
|
this.setState({ showRefreshModal: true, localStorageOrgInfo });
|
|
293
292
|
}
|
|
294
293
|
};
|
|
295
294
|
|
|
296
|
-
getOrgNameFromId =
|
|
295
|
+
getOrgNameFromId = orgId => {
|
|
297
296
|
const {
|
|
298
297
|
Global: {
|
|
299
298
|
user: {
|
|
@@ -353,11 +352,11 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
353
352
|
renderOrgChangeModal = () => {
|
|
354
353
|
const { selectedOrgId, showOrgChangeModal } = this.state;
|
|
355
354
|
const {
|
|
356
|
-
Global: {
|
|
355
|
+
Global: {
|
|
357
356
|
currentOrgDetails: { basic_details: { name: oldOrgName } = {} } = {},
|
|
358
357
|
},
|
|
359
358
|
intl: { formatMessage } = {},
|
|
360
|
-
} = this.props;
|
|
359
|
+
} = this.props;
|
|
361
360
|
const newOrgName = this.getOrgNameFromId(selectedOrgId);
|
|
362
361
|
// some users do not have entry for their default org in proxyOrgList.
|
|
363
362
|
// getOrgNameFromId returns back orgID if no matching entry is present in proxyOrgList
|
|
@@ -400,7 +399,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
400
399
|
const type = this.props.location.query.type;
|
|
401
400
|
const toastMessages = this.props.Global.messages;
|
|
402
401
|
const { isCreativesAccessible, showOrgChangeModal, showRefreshModal } = this.state;
|
|
403
|
-
|
|
402
|
+
|
|
404
403
|
return (
|
|
405
404
|
<CapWrapper>
|
|
406
405
|
{ this.props.loader.localeLoading || this.props.Global.fetching_userdata ?
|
|
@@ -426,6 +425,7 @@ export class Cap extends React.Component { // eslint-disable-line react/prefer-s
|
|
|
426
425
|
logout={this.logout}
|
|
427
426
|
settingsUrl={`${engagePlusPublicPath}${CAMPAIGN_SETTINGS_URL}`}
|
|
428
427
|
orgSettingsUrl={ORG_SETTINGS_URL}
|
|
428
|
+
helpUrl={HELP_URL}
|
|
429
429
|
loggedIn={isLoggedIn}
|
|
430
430
|
topbarMenuData={topbarMenuDataOptions}
|
|
431
431
|
location={location}
|
|
@@ -72,14 +72,6 @@ export default defineMessages({
|
|
|
72
72
|
id: 'creatives.containersV2.incentive',
|
|
73
73
|
defaultMessage: 'Incentive',
|
|
74
74
|
},
|
|
75
|
-
"programs": {
|
|
76
|
-
id: `creatives.containersV2.programs`,
|
|
77
|
-
defaultMessage: 'Programs',
|
|
78
|
-
},
|
|
79
|
-
"promotions": {
|
|
80
|
-
id: `creatives.containersV2.promotions`,
|
|
81
|
-
defaultMessage: 'Promotions',
|
|
82
|
-
},
|
|
83
75
|
|
|
84
76
|
//refresh due to org change messages
|
|
85
77
|
|
|
@@ -6,11 +6,7 @@ import * as LocalStorage from '../../services/localStorageApi';
|
|
|
6
6
|
import * as types from './constants';
|
|
7
7
|
import config from '../../config/app';
|
|
8
8
|
//import pathConfig from '../../config/path';
|
|
9
|
-
import {
|
|
10
|
-
getTopbarMenuDataValue,
|
|
11
|
-
getLoyaltyTopbarMenuDataValue,
|
|
12
|
-
LOYALTY,
|
|
13
|
-
} from '../../v2Containers/App/constants';
|
|
9
|
+
import { getTopbarMenuDataValue } from '../../v2Containers/App/constants';
|
|
14
10
|
// import {makeSelectOrgId} from './selectors';
|
|
15
11
|
|
|
16
12
|
function* authorize(user) {
|
|
@@ -110,8 +106,9 @@ export function* fetchUserInfo(option) {
|
|
|
110
106
|
|
|
111
107
|
export function* fetchSchemaForEntity(queryParams) {
|
|
112
108
|
try {
|
|
109
|
+
|
|
113
110
|
const result = yield call(Api.fetchSchemaForEntity, queryParams);
|
|
114
|
-
|
|
111
|
+
|
|
115
112
|
// const sidebar = result.response.sidebar;
|
|
116
113
|
yield put({ type: types.GET_SCHEMA_FOR_ENTITY_SUCCESS, data: result.response, statusCode: result.status ? result.status.code : '', entityType: queryParams.queryParams.type });
|
|
117
114
|
} catch (error) {
|
|
@@ -119,21 +116,11 @@ export function* fetchSchemaForEntity(queryParams) {
|
|
|
119
116
|
}
|
|
120
117
|
}
|
|
121
118
|
|
|
122
|
-
|
|
123
|
-
switch (parentModule) {
|
|
124
|
-
case LOYALTY:
|
|
125
|
-
return getLoyaltyTopbarMenuDataValue();
|
|
126
|
-
default:
|
|
127
|
-
return getTopbarMenuDataValue();
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
function* getTopbarMenuData(params) {
|
|
132
|
-
const {parentModule} = params;
|
|
119
|
+
function* getTopbarMenuData() {
|
|
133
120
|
try {
|
|
134
121
|
yield put({
|
|
135
122
|
type: types.GET_TOPBAR_MENU_DATA_SUCCESS,
|
|
136
|
-
data:
|
|
123
|
+
data: getTopbarMenuDataValue(),
|
|
137
124
|
});
|
|
138
125
|
} catch (error) {
|
|
139
126
|
yield put({ type: types.GET_TOPBAR_MENU_DATA_FAILURE, error });
|
|
@@ -142,6 +129,7 @@ function* getTopbarMenuData(params) {
|
|
|
142
129
|
|
|
143
130
|
|
|
144
131
|
function* watchFetchSchemaForEntity() {
|
|
132
|
+
|
|
145
133
|
const watcher = yield takeLatest(types.GET_SCHEMA_FOR_ENTITY_REQUEST, fetchSchemaForEntity);
|
|
146
134
|
yield take(LOCATION_CHANGE);
|
|
147
135
|
yield cancel(watcher);
|
|
@@ -11,7 +11,3 @@ export const GENERATE_PREVIEW_FAILURE = 'app/CapFacebookPreview/GET_PREVIEW_FAIL
|
|
|
11
11
|
|
|
12
12
|
export const CLEAR_PREVIEW = 'app/CapFacebookPreview/CLEAR_PREVIEW';
|
|
13
13
|
|
|
14
|
-
export const PREVIEW_NOT_REQUESTED = "PreviewNotRequested";
|
|
15
|
-
export const FETCH_PREVIEW_REQUESTED = "PreviewRequested";
|
|
16
|
-
export const FETCH_PREVIEW_SUCCESS = "PreviewRequestSuccess";
|
|
17
|
-
export const FETCH_PREVIEW_FAILURE = "PreviewRequestFailure";
|