@capillarytech/creatives-library 7.17.117 → 7.17.118

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.117",
4
+ "version": "7.17.118",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -1,2 +1,3 @@
1
1
  export const AI_SUGGESTION_API_URL = `wss://${window.location.host}/arya/api/v1/ask-aira-service/content_gen/get_ai_suggestions`;
2
2
  export const CONTENT_RECOMMENDATION_BOT = "CONTENT_RECOMMENDATION_BOT";
3
+ export const OUTBOUND = 'OUTBOUND';
@@ -51,7 +51,7 @@ import { SMS, MOBILE_PUSH, LINE, ENABLE_AI_SUGGESTIONS } from '../../v2Container
51
51
  import { validateIfTagClosed } from '../../utils/tagValidations';
52
52
  import globalMessages from '../../v2Containers/Cap/messages';
53
53
  import { convert } from 'html-to-text';
54
- import { AI_SUGGESTION_API_URL, CONTENT_RECOMMENDATION_BOT } from './constants';
54
+ import { AI_SUGGESTION_API_URL, CONTENT_RECOMMENDATION_BOT, OUTBOUND } from './constants';
55
55
  import { GET_TRANSLATION_MAPPED } from '../../containers/TagList/constants';
56
56
  import moment from 'moment';
57
57
  import { CUSTOMER_BARCODE_TAG , COPY_OF} from '../../containers/App/constants';
@@ -1152,7 +1152,7 @@ class FormBuilder extends React.Component { // eslint-disable-line react/prefer-
1152
1152
  let matchCustomerBarcode = regexCustomerBarcode.exec(content);
1153
1153
  // \S matches anything other than a space, a tab, a newline, or a carriage return.
1154
1154
  const validString= /\S/.test(contentForValidation);
1155
- if (isEmailUnsubscribeTagMandatory() && isEmail) {
1155
+ if (isEmailUnsubscribeTagMandatory() && isEmail && this.props?.moduleType === OUTBOUND) {
1156
1156
  const missingTagIndex = response?.missingTags?.indexOf("unsubscribe");
1157
1157
  if(missingTagIndex != -1) { //skip regex tags for mandatory tags also
1158
1158
  response?.missingTags?.splice(missingTagIndex, 1);
@@ -151,6 +151,7 @@ export function SlideBoxContent(props) {
151
151
  enableNewChannels,
152
152
  hideTestAndPreviewBtn,
153
153
  getCmsTemplatesInProgress = false,
154
+ moduleType,
154
155
  } = props;
155
156
  const type = (messageDetails.type || '').toLowerCase(); // type is context in get tags values : outbound | dvs | referral | loyalty | coupons
156
157
  const query = { type: !isFullMode && 'embedded', module: isFullMode ? 'default' : 'library', isEditFromCampaigns: (templateData || {}).isEditFromCampaigns};
@@ -591,6 +592,7 @@ export function SlideBoxContent(props) {
591
592
  onPreviewContentClicked={onPreviewContentClicked}
592
593
  onTestContentClicked={onTestContentClicked}
593
594
  getCmsTemplatesInProgress={getCmsTemplatesInProgress}
595
+ moduleType={moduleType}
594
596
  />
595
597
  )}
596
598
  {(isEditEmailWithId || isEmailEditWithContent) && (
@@ -617,6 +619,7 @@ export function SlideBoxContent(props) {
617
619
  selectedOfferDetails={selectedOfferDetails}
618
620
  onPreviewContentClicked={onPreviewContentClicked}
619
621
  onTestContentClicked={onTestContentClicked}
622
+ moduleType={moduleType}
620
623
  />
621
624
  )}
622
625
  {isEditMPush &&
@@ -905,5 +908,6 @@ SlideBoxContent.propTypes = {
905
908
  orgUnitId: PropTypes.any,
906
909
  smsRegister: PropTypes.any,
907
910
  getCmsTemplatesInProgress: PropTypes.bool,
911
+ moduleType: PropTypes.string,
908
912
  };
909
913
  export default SlideBoxContent;
@@ -1260,6 +1260,7 @@ export class Creatives extends React.Component {
1260
1260
  enableNewChannels={enableNewChannels}
1261
1261
  hideTestAndPreviewBtn={this.props.hideTestAndPreviewBtn}
1262
1262
  getCmsTemplatesInProgress={this.props.Templates?.getCmsTemplatesInProgress}
1263
+ moduleType={this.props.messageDetails?.type}
1263
1264
  />
1264
1265
  }
1265
1266
  footer={this.shouldShowFooter() &&
@@ -2653,7 +2653,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2653
2653
  const previewHeader = (<h3>{this.props.intl.formatMessage(messages.h3emailPreview)}</h3>);
2654
2654
  const imagePreviewHeader = (<h3>{this.props.intl.formatMessage(messages.h3imageSelection)}</h3>);
2655
2655
  const imagePreviewContent = this.getImagePreviewContent();
2656
- const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {} } = this.props;
2656
+ const { selectedOfferDetails, getDefaultTags, Email: { CmsSettings = {} } = {}, moduleType = '' } = this.props;
2657
2657
  if (!this.props.currentOrgDetails || !this.props.currentOrgDetails.basic_details) {
2658
2658
  return (<div>Loading...</div>);
2659
2659
  }
@@ -2721,6 +2721,7 @@ export class Email extends React.Component { // eslint-disable-line react/prefer
2721
2721
  uuid={CmsSettings.uuid}
2722
2722
  type={CmsSettings.type}
2723
2723
  isEmailLoading={isLoading}
2724
+ moduleType={moduleType}
2724
2725
  /> : ''}
2725
2726
  </Col>
2726
2727
  </Row>
@@ -2776,6 +2777,7 @@ Email.propTypes = {
2776
2777
  selectedOfferDetails: PropTypes.array,
2777
2778
  onPreviewContentClicked: PropTypes.func,
2778
2779
  onTestContentClicked: PropTypes.func,
2780
+ moduleType: PropTypes.string,
2779
2781
  };
2780
2782
 
2781
2783
  const mapStateToProps = (state, props) => createStructuredSelector({
@@ -208,6 +208,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
208
208
  cmsTemplatesLoader,
209
209
  editor,
210
210
  currentOrgDetails,
211
+ moduleType,
211
212
  } = this.props;
212
213
  const {
213
214
  templateName,
@@ -278,6 +279,7 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
278
279
  onPreviewContentClicked={onPreviewContentClicked}
279
280
  onTestContentClicked={onTestContentClicked}
280
281
  editor={editor}
282
+ moduleType={moduleType}
281
283
  />}
282
284
  {!isShowEmailCreate && (
283
285
  <CmsTemplatesComponent
@@ -319,6 +321,7 @@ EmailWrapper.propTypes = {
319
321
  selectedOfferDetails: PropTypes.array,
320
322
  getCmsTemplatesInProgress: PropTypes.bool,
321
323
  currentOrgDetails: PropTypes.object,
324
+ moduleType: PropTypes.string,
322
325
  };
323
326
 
324
327
  const mapStateToProps = createStructuredSelector({