@capillarytech/creatives-library 7.12.16 → 7.12.17

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.12.16",
4
+ "version": "7.12.17",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -40,6 +40,7 @@ function CapImageUpload(props) {
40
40
  className,
41
41
  imageData,
42
42
  channel,
43
+ channelSpecificStyle,
43
44
  } = props;
44
45
  const {
45
46
  formatMessage,
@@ -205,6 +206,7 @@ function CapImageUpload(props) {
205
206
  className="dragger-button re-upload"
206
207
  type="flat"
207
208
  onClick={onReUpload}
209
+ style={ channelSpecificStyle ? { marginTop:'-16px'} : {}}
208
210
  >
209
211
  <FormattedMessage {...messages.imageReUpload} />
210
212
  </CapButton>
@@ -274,6 +276,7 @@ CapImageUpload.propTypes = {
274
276
  imageData: PropTypes.object,
275
277
  index: PropTypes.number,
276
278
  channel: PropTypes.string,
279
+ channelSpecificStyle: PropTypes.bool,
277
280
  };
278
281
 
279
282
  export default injectIntl(CapImageUpload);
@@ -731,6 +731,7 @@ export function SlideBoxContent(props) {
731
731
  getFormData={getFormData}
732
732
  getDefaultTags={type}
733
733
  forwardedTags={forwardedTags}
734
+ selectedOfferDetails={selectedOfferDetails}
734
735
  params={{
735
736
  id: templateData._id,
736
737
  }}
@@ -25,7 +25,7 @@ const StyledLabel = styled(CapLabelInline)`
25
25
  const PrefixWrapper = styled.div`
26
26
  margin-right: 16px;
27
27
  `;
28
- const renderWhatsappData = (type, value) => (
28
+ const renderData = (type, value) => (
29
29
  <StyledLabel type={type}>
30
30
  {value}
31
31
  </StyledLabel>
@@ -37,7 +37,6 @@ export function SlideBoxHeader(props) {
37
37
  const mapTemplateCreate = !showTemplateNameHeader && slidBoxContent === 'createTemplate' && weChatTemplateType === MAP_TEMPLATE && templateStep !== 'modeSelection';
38
38
  const isTraiDlt = isTraiDLTEnable(isFullMode, smsRegister);
39
39
  const showCreateTraiSMSHeader = isTraiDlt && channel.toLowerCase() === "sms";
40
- const showTemplateName = [WHATSAPP, RCS].includes(channel.toLowerCase()) & slidBoxContent === 'editTemplate' & !isFullMode;
41
40
  const isWhatsappEdit = channel.toLowerCase() === WHATSAPP && slidBoxContent === 'editTemplate';
42
41
  const isWhatsappCreate = channel.toLowerCase() === WHATSAPP && slidBoxContent === 'createTemplate';
43
42
  const whatsappOverview = isWhatsappEdit && isFullMode;
@@ -48,6 +47,8 @@ export function SlideBoxHeader(props) {
48
47
  whatsappTemplateLanguageCode,
49
48
  } = templateData || {};
50
49
  const templateName = whatsappTemplateName || templateData?.name;
50
+ const showRcsTemplateName = channel.toLowerCase() === RCS && slidBoxContent === 'editTemplate' && !isFullMode && templateName;
51
+ const showTemplateName = isWhatsappEdit || showRcsTemplateName;
51
52
  const whatsappCategory = whatsappTemplateCategory || get(templateData, `versions.base.content.whatsapp.category`, '');
52
53
  const whatsappLanguageCode = whatsappTemplateLanguageCode || get(templateData, `versions.base.content.whatsapp.languages[0].language`, '');
53
54
 
@@ -100,18 +101,18 @@ export function SlideBoxHeader(props) {
100
101
  <>
101
102
  {showTemplateName ? (
102
103
  <>
103
- {renderWhatsappData("label1", <FormattedMessage {...globalMessages.templateNameLabel} />)}
104
- {renderWhatsappData("label2", templateName)}
104
+ {renderData("label1", <FormattedMessage {...globalMessages.templateNameLabel} />)}
105
+ {renderData("label2", templateName)}
105
106
  </>
106
107
  ) : ""}
107
108
  {isWhatsappEdit && (
108
109
  <>
109
- {renderWhatsappData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
110
- {renderWhatsappData("label1", <FormattedMessage {...whatsppMsg.templateCategoryLabel} />)}
111
- {renderWhatsappData("label2", formatString(whatsappCategory))}
112
- {renderWhatsappData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
113
- {renderWhatsappData("label1", <FormattedMessage {...whatsppMsg.languageLabel} />)}
114
- {renderWhatsappData("label2", LANGUAGE_OPTIONS?.find((option) => option.value === whatsappLanguageCode)?.label)}
110
+ {renderData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
111
+ {renderData("label1", <FormattedMessage {...whatsppMsg.templateCategoryLabel} />)}
112
+ {renderData("label2", formatString(whatsappCategory))}
113
+ {renderData("label3", <FormattedMessage {...whatsppMsg.labelSeperator} />)}
114
+ {renderData("label1", <FormattedMessage {...whatsppMsg.languageLabel} />)}
115
+ {renderData("label2", LANGUAGE_OPTIONS?.find((option) => option.value === whatsappLanguageCode)?.label)}
115
116
  </>)
116
117
  }
117
118
  </>
@@ -181,6 +181,7 @@ exports[`Test SlideBoxContent container Should render correct component for what
181
181
  "type": "WHATSAPP",
182
182
  "validity": true,
183
183
  "whatsappTemplateCategory": "ALERT_UPDATE",
184
+ "whatsappTemplateLanguageCode": "en",
184
185
  "whatsappTemplateName": "amit123456",
185
186
  }
186
187
  }
@@ -767,6 +767,7 @@ export const Rcs = (props) => {
767
767
  key="rcs-uploaded-image"
768
768
  imageData={rcsData}
769
769
  channel={RCS}
770
+ channelSpecificStyle={!isFullMode}
770
771
  />
771
772
  {renderTextComponent}
772
773
  </>
@@ -82,6 +82,7 @@ export const Whatsapp = (props) => {
82
82
  injectedTags,
83
83
  loadingTags,
84
84
  getFormData,
85
+ selectedOfferDetails,
85
86
  } = props || {};
86
87
  const { formatMessage } = intl;
87
88
  const { TextArea } = CapInput;
@@ -903,6 +904,7 @@ export const Whatsapp = (props) => {
903
904
  tags={tags || []}
904
905
  onContextChange={handleOnTagsContextChange}
905
906
  injectedTags={injectedTags || {}}
907
+ selectedOfferDetails={selectedOfferDetails}
906
908
  />
907
909
  )
908
910
  }