@capillarytech/creatives-library 9.0.36 → 9.0.37-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.
Files changed (70) hide show
  1. package/AppRoot.js +124 -0
  2. package/app-config.js +61 -0
  3. package/app.js +10 -175
  4. package/bootstrap.js +185 -0
  5. package/entry.js +67 -1
  6. package/mfe-exposed-components.js +2 -4
  7. package/package.json +2 -2
  8. package/services/api.js +9 -1
  9. package/styles/containers/layout/_layoutPage.scss +8 -6
  10. package/translations/en.json +2 -2
  11. package/utils/getDataLayer.js +15 -0
  12. package/utils/gtmTrackers/gtmEvents/creativeDetails.js +2 -1
  13. package/utils/mfeDetect.js +1 -0
  14. package/utils/mfeFirstPaintReady.js +29 -0
  15. package/utils/mfeHistory.js +62 -0
  16. package/utils/permissions.js +59 -0
  17. package/utils/rcsPayloadUtils.js +5 -2
  18. package/utils/tests/permissions.test.js +116 -0
  19. package/utils/tests/rcsPayloadUtils.test.js +54 -2
  20. package/v2Components/AccessForbidden/_accessForbidden.scss +14 -0
  21. package/v2Components/AccessForbidden/index.js +5 -3
  22. package/v2Components/AccessForbidden/messages.js +3 -2
  23. package/v2Components/CapActionButton/constants.js +1 -0
  24. package/v2Components/CapActionButton/index.js +77 -9
  25. package/v2Components/CapActionButton/index.scss +13 -0
  26. package/v2Components/CapActionButton/messages.js +13 -0
  27. package/v2Components/CapActionButton/tests/index.test.js +32 -1
  28. package/v2Components/CommonTestAndPreview/index.js +44 -15
  29. package/v2Components/CommonTestAndPreview/tests/index.test.js +78 -0
  30. package/v2Components/CommonTestAndPreview/utils.js +34 -0
  31. package/v2Components/NavigationBar/index.js +9 -7
  32. package/v2Components/NavigationBar/mfeModuleHeader.config.js +16 -0
  33. package/v2Components/NavigationBar/tests/index.test.js +39 -19
  34. package/v2Components/NoPermissionWrapper/_noPermissionWrapper.scss +12 -0
  35. package/v2Components/NoPermissionWrapper/index.js +26 -0
  36. package/v2Components/SmsFallback/index.js +6 -0
  37. package/v2Containers/App/constants.js +5 -0
  38. package/v2Containers/Assets/Gallery/_gallery.scss +6 -0
  39. package/v2Containers/Assets/Gallery/index.js +34 -10
  40. package/v2Containers/Cap/constants.js +1 -0
  41. package/v2Containers/Cap/index.js +62 -29
  42. package/v2Containers/Cap/messages.js +4 -0
  43. package/v2Containers/Cap/tests/__snapshots__/index.test.js.snap +2 -2
  44. package/v2Containers/CreativesContainer/index.js +11 -8
  45. package/v2Containers/CreativesContainer/tests/index.test.js +53 -0
  46. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +6 -6
  47. package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +4 -4
  48. package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +32 -32
  49. package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +36 -36
  50. package/v2Containers/Rcs/components/CarouselCard.js +5 -0
  51. package/v2Containers/Rcs/components/CarouselCardButtons.js +20 -0
  52. package/v2Containers/Rcs/index.js +154 -79
  53. package/v2Containers/Rcs/rcsLibraryHydrationUtils.js +55 -4
  54. package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +404 -118
  55. package/v2Containers/Rcs/tests/carouselUtils.test.js +13 -17
  56. package/v2Containers/Rcs/tests/index.test.js +141 -6
  57. package/v2Containers/Rcs/tests/rcsLibraryHydrationUtils.test.js +110 -0
  58. package/v2Containers/Rcs/tests/utils.test.js +36 -0
  59. package/v2Containers/Rcs/utils.js +16 -4
  60. package/v2Containers/SmsTrai/Create/tests/__snapshots__/index.test.js.snap +8 -8
  61. package/v2Containers/SmsTrai/Edit/index.js +35 -24
  62. package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +18 -18
  63. package/v2Containers/Templates/ChannelTypeIllustration.js +10 -1
  64. package/v2Containers/Templates/_templates.scss +7 -1
  65. package/v2Containers/Templates/index.js +141 -99
  66. package/v2Containers/Templates/tests/ChannelTypeIllustration.test.js +7 -0
  67. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +173 -115
  68. package/v2Containers/TemplatesV2/TemplatesV2.style.js +8 -3
  69. package/v2Containers/TemplatesV2/index.js +38 -14
  70. package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +268 -268
@@ -236,14 +236,18 @@ exports[`Test Templates container Should render sms illustration when no templat
236
236
  <div
237
237
  className="action-container__create-row"
238
238
  >
239
- <CapButton
240
- className="create-new-sms margin-l-8 margin-b-12"
241
- disabled={false}
242
- onClick={[Function]}
243
- type="primary"
239
+ <NoPermissionWrapper
240
+ allowed={false}
244
241
  >
245
- Create new
246
- </CapButton>
242
+ <CapButton
243
+ className="create-new-sms margin-l-8 margin-b-12"
244
+ disabled={false}
245
+ onClick={[Function]}
246
+ type="primary"
247
+ >
248
+ Create new
249
+ </CapButton>
250
+ </NoPermissionWrapper>
247
251
  </div>
248
252
  </div>
249
253
  </div>
@@ -251,6 +255,7 @@ exports[`Test Templates container Should render sms illustration when no templat
251
255
  </CapRow>
252
256
  <div>
253
257
  <ChannelTypeIllustration
258
+ canCreate={false}
254
259
  createTemplate={[Function]}
255
260
  currentChannel="SMS"
256
261
  hostName=""
@@ -503,17 +508,21 @@ exports[`Test Templates container Should render temlates when whatsapp templates
503
508
  <div
504
509
  className="action-container__create-row"
505
510
  >
506
- <CapLink
507
- className="create-new-link"
508
- onClick={[Function]}
509
- suffix={
510
- <CapIcon
511
- size="s"
512
- type="open-in-new"
513
- />
514
- }
515
- title="Create new template"
516
- />
511
+ <NoPermissionWrapper
512
+ allowed={false}
513
+ >
514
+ <CapLink
515
+ className="create-new-link"
516
+ onClick={[Function]}
517
+ suffix={
518
+ <CapIcon
519
+ size="s"
520
+ type="open-in-new"
521
+ />
522
+ }
523
+ title="Create new template"
524
+ />
525
+ </NoPermissionWrapper>
517
526
  </div>
518
527
  </div>
519
528
  </div>
@@ -810,14 +819,18 @@ exports[`Test Templates container Should render temlates when whatsapp templates
810
819
  <div
811
820
  className="action-container__create-row"
812
821
  >
813
- <CapButton
814
- className="create-new-whatsapp margin-l-8 margin-b-12"
815
- disabled={false}
816
- onClick={[Function]}
817
- type="primary"
822
+ <NoPermissionWrapper
823
+ allowed={false}
818
824
  >
819
- Create new
820
- </CapButton>
825
+ <CapButton
826
+ className="create-new-whatsapp margin-l-8 margin-b-12"
827
+ disabled={false}
828
+ onClick={[Function]}
829
+ type="primary"
830
+ >
831
+ Create new
832
+ </CapButton>
833
+ </NoPermissionWrapper>
821
834
  </div>
822
835
  </div>
823
836
  </div>
@@ -1220,14 +1233,18 @@ exports[`Test Templates container Test max templates exceeded 1`] = `
1220
1233
  <div
1221
1234
  className="action-container__create-row"
1222
1235
  >
1223
- <CapButton
1224
- className="create-new-whatsapp margin-l-8 margin-b-12"
1225
- disabled={false}
1226
- onClick={[Function]}
1227
- type="primary"
1236
+ <NoPermissionWrapper
1237
+ allowed={false}
1228
1238
  >
1229
- Create new
1230
- </CapButton>
1239
+ <CapButton
1240
+ className="create-new-whatsapp margin-l-8 margin-b-12"
1241
+ disabled={false}
1242
+ onClick={[Function]}
1243
+ type="primary"
1244
+ >
1245
+ Create new
1246
+ </CapButton>
1247
+ </NoPermissionWrapper>
1231
1248
  </div>
1232
1249
  </div>
1233
1250
  </div>
@@ -1324,14 +1341,26 @@ Click {{unsubscribe}} to unsubscribe
1324
1341
  overlay={
1325
1342
  <CapMenuComponent>
1326
1343
  <withItemHOC
1327
- className="delete-whatsapp"
1344
+ className="delete-whatsapp rbac-disabled"
1328
1345
  onClick={[Function]}
1329
1346
  >
1330
- <FormattedMessage
1331
- defaultMessage="Delete"
1332
- id="creatives.containersV2.Templates.deleteButton"
1333
- values={Object {}}
1334
- />
1347
+ <CapTooltip
1348
+ title={
1349
+ <FormattedMessage
1350
+ defaultMessage="You don't have permission to perform this action."
1351
+ id="creatives.componentsV2.noPermissionAction"
1352
+ values={Object {}}
1353
+ />
1354
+ }
1355
+ >
1356
+ <span>
1357
+ <FormattedMessage
1358
+ defaultMessage="Delete"
1359
+ id="creatives.containersV2.Templates.deleteButton"
1360
+ values={Object {}}
1361
+ />
1362
+ </span>
1363
+ </CapTooltip>
1335
1364
  </withItemHOC>
1336
1365
  </CapMenuComponent>
1337
1366
  }
@@ -1341,12 +1370,7 @@ Click {{unsubscribe}} to unsubscribe
1341
1370
  />
1342
1371
  </CapDropdownComponent>,
1343
1372
  ],
1344
- "hoverOption": <CapButton
1345
- className="edit-whatsapp"
1346
- onClick={[Function]}
1347
- >
1348
- Overview
1349
- </CapButton>,
1373
+ "hoverOption": null,
1350
1374
  "key": "WHATSAPP-card-creatives_whatsapp6",
1351
1375
  "title": <CapRow
1352
1376
  align="middle"
@@ -1693,14 +1717,18 @@ exports[`Test Templates container Test max templates not exceeded 1`] = `
1693
1717
  <div
1694
1718
  className="action-container__create-row"
1695
1719
  >
1696
- <CapButton
1697
- className="create-new-whatsapp margin-l-8 margin-b-12"
1698
- disabled={false}
1699
- onClick={[Function]}
1700
- type="primary"
1720
+ <NoPermissionWrapper
1721
+ allowed={false}
1701
1722
  >
1702
- Create new
1703
- </CapButton>
1723
+ <CapButton
1724
+ className="create-new-whatsapp margin-l-8 margin-b-12"
1725
+ disabled={false}
1726
+ onClick={[Function]}
1727
+ type="primary"
1728
+ >
1729
+ Create new
1730
+ </CapButton>
1731
+ </NoPermissionWrapper>
1704
1732
  </div>
1705
1733
  </div>
1706
1734
  </div>
@@ -1797,14 +1825,26 @@ Click {{unsubscribe}} to unsubscribe
1797
1825
  overlay={
1798
1826
  <CapMenuComponent>
1799
1827
  <withItemHOC
1800
- className="delete-whatsapp"
1828
+ className="delete-whatsapp rbac-disabled"
1801
1829
  onClick={[Function]}
1802
1830
  >
1803
- <FormattedMessage
1804
- defaultMessage="Delete"
1805
- id="creatives.containersV2.Templates.deleteButton"
1806
- values={Object {}}
1807
- />
1831
+ <CapTooltip
1832
+ title={
1833
+ <FormattedMessage
1834
+ defaultMessage="You don't have permission to perform this action."
1835
+ id="creatives.componentsV2.noPermissionAction"
1836
+ values={Object {}}
1837
+ />
1838
+ }
1839
+ >
1840
+ <span>
1841
+ <FormattedMessage
1842
+ defaultMessage="Delete"
1843
+ id="creatives.containersV2.Templates.deleteButton"
1844
+ values={Object {}}
1845
+ />
1846
+ </span>
1847
+ </CapTooltip>
1808
1848
  </withItemHOC>
1809
1849
  </CapMenuComponent>
1810
1850
  }
@@ -1814,12 +1854,7 @@ Click {{unsubscribe}} to unsubscribe
1814
1854
  />
1815
1855
  </CapDropdownComponent>,
1816
1856
  ],
1817
- "hoverOption": <CapButton
1818
- className="edit-whatsapp"
1819
- onClick={[Function]}
1820
- >
1821
- Overview
1822
- </CapButton>,
1857
+ "hoverOption": null,
1823
1858
  "key": "WHATSAPP-card-creatives_whatsapp6",
1824
1859
  "title": <CapRow
1825
1860
  align="middle"
@@ -2166,14 +2201,18 @@ exports[`Test Templates container Test max templates warning 1`] = `
2166
2201
  <div
2167
2202
  className="action-container__create-row"
2168
2203
  >
2169
- <CapButton
2170
- className="create-new-whatsapp margin-l-8 margin-b-12"
2171
- disabled={false}
2172
- onClick={[Function]}
2173
- type="primary"
2204
+ <NoPermissionWrapper
2205
+ allowed={false}
2174
2206
  >
2175
- Create new
2176
- </CapButton>
2207
+ <CapButton
2208
+ className="create-new-whatsapp margin-l-8 margin-b-12"
2209
+ disabled={false}
2210
+ onClick={[Function]}
2211
+ type="primary"
2212
+ >
2213
+ Create new
2214
+ </CapButton>
2215
+ </NoPermissionWrapper>
2177
2216
  </div>
2178
2217
  </div>
2179
2218
  </div>
@@ -2270,14 +2309,26 @@ Click {{unsubscribe}} to unsubscribe
2270
2309
  overlay={
2271
2310
  <CapMenuComponent>
2272
2311
  <withItemHOC
2273
- className="delete-whatsapp"
2312
+ className="delete-whatsapp rbac-disabled"
2274
2313
  onClick={[Function]}
2275
2314
  >
2276
- <FormattedMessage
2277
- defaultMessage="Delete"
2278
- id="creatives.containersV2.Templates.deleteButton"
2279
- values={Object {}}
2280
- />
2315
+ <CapTooltip
2316
+ title={
2317
+ <FormattedMessage
2318
+ defaultMessage="You don't have permission to perform this action."
2319
+ id="creatives.componentsV2.noPermissionAction"
2320
+ values={Object {}}
2321
+ />
2322
+ }
2323
+ >
2324
+ <span>
2325
+ <FormattedMessage
2326
+ defaultMessage="Delete"
2327
+ id="creatives.containersV2.Templates.deleteButton"
2328
+ values={Object {}}
2329
+ />
2330
+ </span>
2331
+ </CapTooltip>
2281
2332
  </withItemHOC>
2282
2333
  </CapMenuComponent>
2283
2334
  }
@@ -2287,12 +2338,7 @@ Click {{unsubscribe}} to unsubscribe
2287
2338
  />
2288
2339
  </CapDropdownComponent>,
2289
2340
  ],
2290
- "hoverOption": <CapButton
2291
- className="edit-whatsapp"
2292
- onClick={[Function]}
2293
- >
2294
- Overview
2295
- </CapButton>,
2341
+ "hoverOption": null,
2296
2342
  "key": "WHATSAPP-card-creatives_whatsapp6",
2297
2343
  "title": <CapRow
2298
2344
  align="middle"
@@ -2582,17 +2628,21 @@ exports[`Test Templates container Test removing all whatsapp filterss 1`] = `
2582
2628
  <div
2583
2629
  className="action-container__create-row"
2584
2630
  >
2585
- <CapLink
2586
- className="create-new-link"
2587
- onClick={[Function]}
2588
- suffix={
2589
- <CapIcon
2590
- size="s"
2591
- type="open-in-new"
2592
- />
2593
- }
2594
- title="Create new template"
2595
- />
2631
+ <NoPermissionWrapper
2632
+ allowed={false}
2633
+ >
2634
+ <CapLink
2635
+ className="create-new-link"
2636
+ onClick={[Function]}
2637
+ suffix={
2638
+ <CapIcon
2639
+ size="s"
2640
+ type="open-in-new"
2641
+ />
2642
+ }
2643
+ title="Create new template"
2644
+ />
2645
+ </NoPermissionWrapper>
2596
2646
  </div>
2597
2647
  </div>
2598
2648
  </div>
@@ -2857,17 +2907,21 @@ exports[`Test Templates container Test removing all whatsapp filterss 2`] = `
2857
2907
  <div
2858
2908
  className="action-container__create-row"
2859
2909
  >
2860
- <CapLink
2861
- className="create-new-link"
2862
- onClick={[Function]}
2863
- suffix={
2864
- <CapIcon
2865
- size="s"
2866
- type="open-in-new"
2867
- />
2868
- }
2869
- title="Create new template"
2870
- />
2910
+ <NoPermissionWrapper
2911
+ allowed={false}
2912
+ >
2913
+ <CapLink
2914
+ className="create-new-link"
2915
+ onClick={[Function]}
2916
+ suffix={
2917
+ <CapIcon
2918
+ size="s"
2919
+ type="open-in-new"
2920
+ />
2921
+ }
2922
+ title="Create new template"
2923
+ />
2924
+ </NoPermissionWrapper>
2871
2925
  </div>
2872
2926
  </div>
2873
2927
  </div>
@@ -3107,17 +3161,21 @@ exports[`Test Templates container Test removing single filter 1`] = `
3107
3161
  <div
3108
3162
  className="action-container__create-row"
3109
3163
  >
3110
- <CapLink
3111
- className="create-new-link"
3112
- onClick={[Function]}
3113
- suffix={
3114
- <CapIcon
3115
- size="s"
3116
- type="open-in-new"
3117
- />
3118
- }
3119
- title="Create new template"
3120
- />
3164
+ <NoPermissionWrapper
3165
+ allowed={false}
3166
+ >
3167
+ <CapLink
3168
+ className="create-new-link"
3169
+ onClick={[Function]}
3170
+ suffix={
3171
+ <CapIcon
3172
+ size="s"
3173
+ type="open-in-new"
3174
+ />
3175
+ }
3176
+ title="Create new template"
3177
+ />
3178
+ </NoPermissionWrapper>
3121
3179
  </div>
3122
3180
  </div>
3123
3181
  </div>
@@ -10,10 +10,9 @@ export default css`
10
10
 
11
11
  .component-wrapper {
12
12
  ${(props) => props.isFullMode ? `
13
- max-width: 71.25rem;
14
13
  margin: 0 auto;
15
14
  width: 100%;
16
- padding: 0.714rem 0;
15
+ padding: 0;
17
16
  /* Only main channel tabs content, not HTML Editor validation panel tabs */
18
17
  > .cap-tab-v2 > .ant-tabs-content-holder > .ant-tabs-content,
19
18
  > .cap-tab-v2 > .ant-tabs-content {
@@ -97,6 +96,12 @@ export default css`
97
96
  `;
98
97
 
99
98
  export const CapTabStyle = css`
100
- ${(props) => props.isFullMode ? `margin-top: ${CAP_SPACE_24}` : ``
99
+ ${(props) => props.isFullMode ? `margin-top: ${CAP_SPACE_24};` : ``
100
+ }
101
+ .ant-tabs-nav-list {
102
+ gap: 2rem;
103
+ }
104
+ .ant-tabs-tab + .ant-tabs-tab {
105
+ margin: 0 !important;
101
106
  }
102
107
  `;
@@ -10,7 +10,7 @@ import { connect } from 'react-redux';
10
10
  import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
11
11
  import { createStructuredSelector } from 'reselect';
12
12
  import { bindActionCreators, compose } from 'redux';
13
- import { CapTab, CapCustomCard, CapButton, CapHeader, CapIcon, CapSpin, CapTooltip } from '@capillarytech/cap-ui-library';
13
+ import { CapTab, CapCustomCard, CapButton, CapIcon, CapSpin, CapTooltip } from '@capillarytech/cap-ui-library';
14
14
  import { find, get, pick } from 'lodash';
15
15
  import Helmet from 'react-helmet';
16
16
 
@@ -34,7 +34,8 @@ import FTP from '../FTP';
34
34
  import Gallery from '../Assets/Gallery';
35
35
  import withStyles from '../../hoc/withStyles';
36
36
  import styles, { CapTabStyle } from './TemplatesV2.style';
37
- import { CREATIVES_UI_VIEW, FTP as FTP_CHANNEL, LOYALTY, WHATSAPP, RCS, LINE, EMAIL, ASSETS, JP_LOCALE_HIDE_FEATURE, ZALO, INAPP, WEBPUSH } from '../App/constants';
37
+ import { CREATIVES_UI_VIEW, CREATIVE_VIEW, FTP as FTP_CHANNEL, LOYALTY, WHATSAPP, RCS, LINE, EMAIL, ASSETS, JP_LOCALE_HIDE_FEATURE, ZALO, INAPP, WEBPUSH } from '../App/constants';
38
+ import { getUserAccess, hasPermission, PERMISSIONS } from '../../utils/permissions';
38
39
  import AccessForbidden from '../../v2Components/AccessForbidden';
39
40
  import { getObjFromQueryParams } from '../../utils/v2common';
40
41
  import { makeSelectAuthenticated, selectCurrentOrgDetails } from "../../v2Containers/Cap/selectors";
@@ -47,6 +48,9 @@ import {
47
48
  NORMALIZED_CHANNEL_ALIASES,
48
49
  SMS,
49
50
  } from "../CreativesContainer/constants";
51
+ import { MFEEventBus } from '@capillarytech/cap-ui-utils';
52
+ import { isMFEMode } from '../../utils/mfeDetect';
53
+ import appConfig from '../../app-config';
50
54
 
51
55
  const { CapCustomCardList } = CapCustomCard;
52
56
 
@@ -54,6 +58,7 @@ const StyledCapTab = withStyles(CapTab, CapTabStyle);
54
58
  export class TemplatesV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
55
59
  constructor(props) {
56
60
  super(props);
61
+ this.lcpReported = false;
57
62
  let defaultChannel = get(this, 'props.channel') || get(this, 'props.params.channel') || 'sms';
58
63
  if (defaultChannel === LOYALTY) {
59
64
  defaultChannel = 'sms';
@@ -222,6 +227,23 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
222
227
  }
223
228
  }
224
229
 
230
+ componentDidUpdate(prevProps) {
231
+ if (
232
+ isMFEMode() &&
233
+ !this.lcpReported &&
234
+ !this.props.Templates.getAllTemplatesInProgress &&
235
+ prevProps.Templates.getAllTemplatesInProgress
236
+ ) {
237
+ this.lcpReported = true;
238
+ MFEEventBus.emit('mfe:segment', {
239
+ action: 'stop',
240
+ appId: appConfig.appName,
241
+ type: 'lcp',
242
+ timestamp: performance.now(),
243
+ });
244
+ }
245
+ }
246
+
225
247
  componentWillReceiveProps(nextProps) {
226
248
  if (this.props.channel !== nextProps.channel) {
227
249
  const panes = this.setChannelContent(nextProps.channel, this.state.panes);
@@ -255,9 +277,16 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
255
277
  </CapSpin>
256
278
 
257
279
  </div>);
258
- };
259
-
260
- getGalleryComponent = (location) => <Gallery location={location} isFullMode={this.props.isFullMode}/>
280
+ }
281
+ getGalleryComponent = (location) => {
282
+ const userAccess = getUserAccess(this.props);
283
+ return (<Gallery
284
+ location={location}
285
+ isFullMode={this.props.isFullMode}
286
+ canCreate={hasPermission(userAccess, PERMISSIONS.CREATIVE_CREATE)}
287
+ canDelete={hasPermission(userAccess, PERMISSIONS.CREATIVE_DELETE)}
288
+ />);
289
+ }
261
290
  getCallTaskComponent = () => (
262
291
  <CallTask
263
292
  onCreateNew={this.props.createNew}
@@ -395,7 +424,10 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
395
424
  const useLocalTemplates = get(this.props, 'localTemplatesConfig.useLocalTemplates', false);
396
425
  const { accessiblePermissions = []} = cap.user || Global.user || {};
397
426
  let isCreativeAccessible = true;
398
- if (!accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
427
+ if (
428
+ !accessiblePermissions.includes(CREATIVES_UI_VIEW) &&
429
+ !accessiblePermissions.includes(CREATIVE_VIEW)
430
+ ) {
399
431
  isCreativeAccessible = false;
400
432
  }
401
433
  // Recompute active pane content every render so local-list mode updates
@@ -422,14 +454,6 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
422
454
  />
423
455
  )}
424
456
  <section className="component-wrapper">
425
- {isFullMode && (
426
- <CapHeader
427
- title={<FormattedMessage {...messages.creatives} />}
428
- {...(!useLocalTemplates && {
429
- description: <FormattedMessage {...messages.creativesDesc} />,
430
- })}
431
- />
432
- )}
433
457
  {hideChannelTabsForLocalSms ? (
434
458
  <section className="templates-v2-local-sms-pane">{activeLocalPane?.content}</section>
435
459
  ) : (