@capillarytech/creatives-library 7.17.5 → 7.17.6-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.5",
4
+ "version": "7.17.6-alpha.0",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -32,6 +32,7 @@ import styles, { CapTabStyle } from './TemplatesV2.style';
32
32
  import { CREATIVES_UI_VIEW, LOYALTY, WHATSAPP, RCS } from '../App/constants';
33
33
  import AccessForbidden from '../../v2Components/AccessForbidden';
34
34
  import { getObjFromQueryParams } from '../../utils/v2common';
35
+ import { selectCurrentOrgDetails } from "../../v2Containers/Cap/selectors";
35
36
 
36
37
  const {CapCustomCardList} = CapCustomCard;
37
38
 
@@ -51,6 +52,8 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
51
52
  onChannelChange,
52
53
  showDisabledFBInfo,
53
54
  enableNewChannels = [],
55
+ currentOrgDetails = {},
56
+ cap = {},
54
57
  } = props;
55
58
 
56
59
  const defaultPanes = {
@@ -112,6 +115,14 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
112
115
  return pane;
113
116
  });
114
117
 
118
+ const { accessibleFeatures = [] } = currentOrgDetails || {};
119
+ const { currentOrgDetails: { accessibleFeatures: libModeAccessibleFeatures = [] } = {} } = cap || {};
120
+ const hideEngagementChannel = (accessibleFeatures || libModeAccessibleFeatures).includes("HIDE_ENGAGEMENT_CHANNELS");
121
+ // Show only line and email channel content with both channel tabs if the HIDE_ENGAGEMENT_CHANNELS feature is enabled;
122
+ filteredPanes = hideEngagementChannel ? filteredPanes?.filter((pane) => ['email', 'line', ].includes(pane?.key) && pane) : filteredPanes;
123
+ defaultChannel = hideEngagementChannel ? 'email' : defaultChannel;
124
+ // console.log("Test ### filter ", filteredPanes)
125
+
115
126
  const channel = ['sms', 'email', 'mobilepush', 'line', 'call_task'];
116
127
  if (!isEmpty(channelsToDisable)) {
117
128
  channel.some((ch) => {
@@ -140,7 +151,7 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
140
151
  if (queryItems.channel === WHATSAPP) {
141
152
  this.channelChange(WHATSAPP);
142
153
  }
143
- if(this.props?.isFullMode){
154
+ if (this.props?.isFullMode) {
144
155
  this.props.templateActions.getCdnTransformationConfig();
145
156
  }
146
157
  }
@@ -295,6 +306,9 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
295
306
  if (!accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
296
307
  isCreativeAccessible = false;
297
308
  }
309
+
310
+ console.log("Test ### panes ", { pane: this.state.panes, activeKey: this.state.selectedChannel});
311
+
298
312
  return (
299
313
  !isCreativeAccessible ? <AccessForbidden /> : (
300
314
  <div className={`${className} creatives-templates-container ${isFullMode ? 'fullmode' : 'library-mode'}`} data-testid="cap-wrapper">
@@ -341,15 +355,18 @@ TemplatesV2.propTypes = {
341
355
  authData: PropTypes.object,
342
356
  FTPMode: PropTypes.string,
343
357
  messageStrategy: PropTypes.string,
358
+ currentOrgDetails: PropTypes.object,
344
359
  };
345
360
 
346
361
  TemplatesV2.defaultProps = {
347
362
  isFullMode: true,
363
+ currentOrgDetails: {},
348
364
  };
349
365
 
350
366
  const mapStateToProps = createStructuredSelector({
351
367
  Templates: makeSelectTemplates(),
352
368
  TemplatesList: makeSelectTemplatesResponse(),
369
+ currentOrgDetails: selectCurrentOrgDetails(),
353
370
  });
354
371
 
355
372
  function mapDispatchToProps(dispatch) {