@capillarytech/creatives-library 7.12.16 → 7.12.18

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.18",
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
  }
@@ -11,7 +11,11 @@ exports[`Test SlideBoxHeader container Should render correct component for rcs c
11
11
  key="creatives-container-slidebox-header-content"
12
12
  >
13
13
  <CapHeader
14
- description={false}
14
+ description={
15
+ <React.Fragment>
16
+
17
+ </React.Fragment>
18
+ }
15
19
  descriptionClass=""
16
20
  inline={false}
17
21
  prefix={false}
@@ -130,70 +134,74 @@ exports[`Test SlideBoxHeader container Should render correct component for whats
130
134
  <CapHeader
131
135
  description={
132
136
  <React.Fragment>
133
- <SlideBoxHeader__StyledLabel
134
- type="label1"
135
- >
136
- <FormattedMessage
137
- defaultMessage="Template name"
138
- id="creatives.containersV2.templateNameLabel"
139
- values={Object {}}
140
- />
141
- </SlideBoxHeader__StyledLabel>
142
- <SlideBoxHeader__StyledLabel
143
- type="label2"
144
- >
145
- amit123456
146
- </SlideBoxHeader__StyledLabel>
147
- <SlideBoxHeader__StyledLabel
148
- type="label3"
149
- >
150
- <FormattedMessage
151
- defaultMessage="|"
152
- id="creatives.containersV2.Whatsapp.labelSeperator"
153
- values={Object {}}
154
- />
155
- </SlideBoxHeader__StyledLabel>
156
- <SlideBoxHeader__StyledLabel
157
- type="label1"
158
- >
159
- <FormattedMessage
160
- defaultMessage="Template category"
161
- id="creatives.containersV2.Whatsapp.templateCategoryLabel"
162
- values={Object {}}
163
- />
164
- </SlideBoxHeader__StyledLabel>
165
- <SlideBoxHeader__StyledLabel
166
- type="label2"
167
- >
168
- Alert Update
169
- </SlideBoxHeader__StyledLabel>
170
- <SlideBoxHeader__StyledLabel
171
- type="label3"
172
- >
173
- <FormattedMessage
174
- defaultMessage="|"
175
- id="creatives.containersV2.Whatsapp.labelSeperator"
176
- values={Object {}}
177
- />
178
- </SlideBoxHeader__StyledLabel>
179
- <SlideBoxHeader__StyledLabel
180
- type="label1"
181
- >
182
- <FormattedMessage
183
- defaultMessage="Language"
184
- id="creatives.containersV2.Whatsapp.languageLabel"
185
- values={Object {}}
186
- />
187
- </SlideBoxHeader__StyledLabel>
188
- <SlideBoxHeader__StyledLabel
189
- type="label2"
190
- >
191
- <FormattedMessage
192
- defaultMessage="English"
193
- id="creatives.containersV2.Whatsapp.english"
194
- values={Object {}}
195
- />
196
- </SlideBoxHeader__StyledLabel>
137
+ <React.Fragment>
138
+ <SlideBoxHeader__StyledLabel
139
+ type="label1"
140
+ >
141
+ <FormattedMessage
142
+ defaultMessage="Template name"
143
+ id="creatives.containersV2.templateNameLabel"
144
+ values={Object {}}
145
+ />
146
+ </SlideBoxHeader__StyledLabel>
147
+ <SlideBoxHeader__StyledLabel
148
+ type="label2"
149
+ >
150
+ amit123456
151
+ </SlideBoxHeader__StyledLabel>
152
+ </React.Fragment>
153
+ <React.Fragment>
154
+ <SlideBoxHeader__StyledLabel
155
+ type="label3"
156
+ >
157
+ <FormattedMessage
158
+ defaultMessage="|"
159
+ id="creatives.containersV2.Whatsapp.labelSeperator"
160
+ values={Object {}}
161
+ />
162
+ </SlideBoxHeader__StyledLabel>
163
+ <SlideBoxHeader__StyledLabel
164
+ type="label1"
165
+ >
166
+ <FormattedMessage
167
+ defaultMessage="Template category"
168
+ id="creatives.containersV2.Whatsapp.templateCategoryLabel"
169
+ values={Object {}}
170
+ />
171
+ </SlideBoxHeader__StyledLabel>
172
+ <SlideBoxHeader__StyledLabel
173
+ type="label2"
174
+ >
175
+ Alert Update
176
+ </SlideBoxHeader__StyledLabel>
177
+ <SlideBoxHeader__StyledLabel
178
+ type="label3"
179
+ >
180
+ <FormattedMessage
181
+ defaultMessage="|"
182
+ id="creatives.containersV2.Whatsapp.labelSeperator"
183
+ values={Object {}}
184
+ />
185
+ </SlideBoxHeader__StyledLabel>
186
+ <SlideBoxHeader__StyledLabel
187
+ type="label1"
188
+ >
189
+ <FormattedMessage
190
+ defaultMessage="Language"
191
+ id="creatives.containersV2.Whatsapp.languageLabel"
192
+ values={Object {}}
193
+ />
194
+ </SlideBoxHeader__StyledLabel>
195
+ <SlideBoxHeader__StyledLabel
196
+ type="label2"
197
+ >
198
+ <FormattedMessage
199
+ defaultMessage="English"
200
+ id="creatives.containersV2.Whatsapp.english"
201
+ values={Object {}}
202
+ />
203
+ </SlideBoxHeader__StyledLabel>
204
+ </React.Fragment>
197
205
  </React.Fragment>
198
206
  }
199
207
  descriptionClass=""
@@ -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
  </>