@capillarytech/creatives-library 8.0.347 → 8.0.348

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 (38) hide show
  1. package/package.json +1 -1
  2. package/services/api.js +0 -20
  3. package/services/tests/api.test.js +0 -59
  4. package/utils/tests/v2Common.test.js +1 -46
  5. package/utils/v2common.js +0 -18
  6. package/v2Components/CapCustomSkeleton/index.js +1 -1
  7. package/v2Components/CapCustomSkeleton/tests/__snapshots__/index.test.js.snap +12 -12
  8. package/v2Components/CommonTestAndPreview/UnifiedPreview/WhatsAppPreviewContent.js +18 -6
  9. package/v2Components/CommonTestAndPreview/UnifiedPreview/_unifiedPreview.scss +27 -0
  10. package/v2Components/CommonTestAndPreview/tests/UnifiedPreview/WhatsAppPreviewContent.test.js +48 -0
  11. package/v2Components/TemplatePreview/_templatePreview.scss +21 -0
  12. package/v2Components/TemplatePreview/index.js +18 -6
  13. package/v2Components/TemplatePreview/tests/__snapshots__/index.test.js.snap +1 -0
  14. package/v2Containers/CreativesContainer/SlideBoxFooter.js +1 -3
  15. package/v2Containers/CreativesContainer/index.js +9 -6
  16. package/v2Containers/CreativesContainer/messages.js +0 -4
  17. package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +0 -3
  18. package/v2Containers/Templates/ChannelTypeIllustration.js +6 -23
  19. package/v2Containers/Templates/_templates.scss +24 -179
  20. package/v2Containers/Templates/actions.js +0 -44
  21. package/v2Containers/Templates/constants.js +0 -23
  22. package/v2Containers/Templates/index.js +58 -378
  23. package/v2Containers/Templates/messages.js +0 -88
  24. package/v2Containers/Templates/reducer.js +1 -84
  25. package/v2Containers/Templates/sagas.js +0 -64
  26. package/v2Containers/Templates/selectors.js +0 -12
  27. package/v2Containers/Templates/tests/ChannelTypeIllustration.test.js +0 -12
  28. package/v2Containers/Templates/tests/__snapshots__/index.test.js.snap +1122 -1345
  29. package/v2Containers/Templates/tests/index.test.js +0 -6
  30. package/v2Containers/Templates/tests/reducer.test.js +0 -178
  31. package/v2Containers/Templates/tests/sagas.test.js +8 -390
  32. package/v2Containers/Templates/tests/selector.test.js +0 -32
  33. package/v2Containers/TemplatesV2/TemplatesV2.style.js +1 -1
  34. package/v2Containers/Whatsapp/constants.js +8 -0
  35. package/v2Containers/Whatsapp/index.js +142 -5
  36. package/v2Containers/Whatsapp/index.scss +8 -0
  37. package/v2Containers/Whatsapp/messages.js +16 -0
  38. package/v2Containers/Assets/images/archive_Empty_Illustration.svg +0 -9
@@ -1,9 +1,5 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import PropTypes from 'prop-types';
3
- import zaloillustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
4
- import inAppIllustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
5
- import { FormattedMessage } from 'react-intl';
6
- import { CapIllustration } from "@capillarytech/cap-ui-library";
7
3
  import emailIllustration from '../Assets/images/emailIllustration.svg';
8
4
  import smsIllustration from '../Assets/images/smsIllustration.svg';
9
5
  import pushIllustration from '../Assets/images/pushIllustration.svg';
@@ -12,12 +8,13 @@ import lineIllustration from '../Assets/images/lineIllustration.svg';
12
8
  import facebookIllustration from '../Assets/images/facebookIllustration.svg';
13
9
  import whatsappIllustration from '../Assets/images/whatsappIllustration.png';
14
10
  import whatsappOrZaloAccountIllustration from '../Assets/images/whatsappOrZaloAccountIllustration.svg';
15
- import archiveEmptyStateIllustration from '../Assets/images/archive_Empty_Illustration.svg';
16
11
  import rcsIllustration from '../Assets/images/rcsIllustration.png';
12
+ import zaloillustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
13
+ import inAppIllustration from '@capillarytech/cap-ui-library/assets/images/featureUiNotEnabledIllustration.svg';
17
14
  import messages from './messages';
18
- import {
19
- MOBILE_PUSH, SMS, EMAIL, LINE, VIBER, FACEBOOK, WHATSAPP, RCS, ZALO, INAPP, WEBPUSH,
20
- } from '../CreativesContainer/constants';
15
+ import { FormattedMessage } from 'react-intl';
16
+ import { CapIllustration } from "@capillarytech/cap-ui-library";
17
+ import { MOBILE_PUSH, SMS, EMAIL, LINE, VIBER, FACEBOOK, WHATSAPP, RCS, ZALO, INAPP, WEBPUSH } from '../CreativesContainer/constants';
21
18
 
22
19
 
23
20
  // Configuration object for channel types
@@ -83,8 +80,7 @@ function ChannelTypeIllustration(props) {
83
80
  isFullMode,
84
81
  createTemplate,
85
82
  currentChannel,
86
- hostName,
87
- isArchivedMode,
83
+ hostName
88
84
  } = props;
89
85
 
90
86
  const templateText = useMemo(() => {
@@ -92,18 +88,6 @@ function ChannelTypeIllustration(props) {
92
88
  return isFullMode ? templateIntlMsg : '';
93
89
  }, [isFullMode]);
94
90
 
95
- if (isArchivedMode) {
96
- return (
97
- <CapIllustration
98
- illustrationImage={archiveEmptyStateIllustration}
99
- title={<FormattedMessage {...messages.noArchivedCreatives} />}
100
- description={<FormattedMessage {...messages.noArchivedCreativesDesc} />}
101
- descriptionPosition="bottom"
102
- descriptionClassName="illustration-desc archive-illustration"
103
- />
104
- );
105
- }
106
-
107
91
  const getChannelTypeIllustrationInfo = (type, hostName) => {
108
92
  // Handle special cases with hostName dependency
109
93
  if (type === WHATSAPP) {
@@ -212,6 +196,5 @@ ChannelTypeIllustration.propTypes = {
212
196
  createTemplate: PropTypes.func.isRequired,
213
197
  currentChannel: PropTypes.string,
214
198
  hostName: PropTypes.string,
215
- isArchivedMode: PropTypes.bool,
216
199
  };
217
200
  export default ChannelTypeIllustration;
@@ -1,45 +1,41 @@
1
1
  @import '~@capillarytech/cap-ui-library/styles/_variables.scss';
2
2
 
3
3
  .ant-tabs-content{
4
- margin-top: $CAP_SPACE_16;
4
+ margin-top: 16px;
5
5
  .ant-tabs-tabpane-active{
6
6
  padding: unset;
7
7
  }
8
8
  }
9
- //removing current one as not required now in each row we'll have 3 cards for which css has been added
10
9
 
11
- // 3 cards per row across all breakpoints
12
- .creatives-templates-list {
13
- .v2-pagination-container,
14
- .v2-pagination-container-half {
15
- .cap-custom-card-list-row {
16
- .cap-custom-card-list-col {
17
- width: calc(33.33% - #{$CAP_SPACE_08});
18
- margin-right: $CAP_SPACE_12;
19
- &:nth-child(3n) {
20
- margin-right: 0;
10
+ @media screen and (max-width: 1172px) {
11
+ .creatives-templates-list.full-mode{
12
+ .v2-pagination-container {
13
+ .cap-custom-card-list-row {
14
+ .cap-custom-card-list-col{
15
+ &:nth-child(3n+3) { //every 4th child
16
+ margin-right: unset;
17
+ }
21
18
  }
22
19
  }
23
20
  }
24
21
  }
25
22
  }
26
23
 
27
- .creatives-templates-list {
28
- position: relative;
29
-
30
- .archive-listing-spinner {
31
- position: absolute;
32
- top: 50%;
33
- left: 50%;
34
- transform: translate(-50%, -50%);
35
- display: flex;
36
- align-items: center;
37
- gap: $CAP_SPACE_08;
38
- background: $CAP_WHITE;
39
- padding: $CAP_SPACE_08 $CAP_SPACE_16;
40
- border-radius: $CAP_SPACE_08;
41
- z-index: 10;
24
+ @media screen and (min-width: 1172px) {
25
+ .creatives-templates-list.full-mode{
26
+ .v2-pagination-container {
27
+ .cap-custom-card-list-row {
28
+ .cap-custom-card-list-col{
29
+ &:nth-child(4n+4) { //every 4th child
30
+ margin-right: unset;
31
+ }
32
+ }
33
+ }
34
+ }
42
35
  }
36
+ }
37
+
38
+ .creatives-templates-list {
43
39
 
44
40
  .delete-template-confirm {
45
41
  .ant-modal-footer {
@@ -678,37 +674,6 @@
678
674
  font-size: 14px;
679
675
  }
680
676
 
681
- // Archive/Unarchive confirm modal overrides — scoped to avoid affecting other modals
682
- .archive-confirm-modal {
683
- .ant-modal-body {
684
- padding: $CAP_SPACE_32 $CAP_SPACE_32 $CAP_SPACE_24;
685
- margin-top: 8.571rem;
686
- }
687
-
688
- // Remove the left margin added when an icon is present
689
- .ant-modal-confirm-body {
690
- > .anticon + .ant-modal-confirm-title + .ant-modal-confirm-content {
691
- margin-left: 0;
692
- }
693
- }
694
-
695
- // Left-align buttons, remove float
696
- .ant-modal-confirm-btns {
697
- float: none;
698
- display: flex;
699
- align-items: center;
700
- gap: $CAP_SPACE_08;
701
- margin-top: $CAP_SPACE_16;
702
-
703
- // Cancel button styling
704
- .ant-btn:not(.ant-btn-primary) {
705
- background-color: $CAP_G08;
706
- border-color: $CAP_G08;
707
- color: $CAP_G01;
708
- }
709
- }
710
- }
711
-
712
677
  .popover-action-container {
713
678
  line-height: 24px;
714
679
  }
@@ -1136,124 +1101,4 @@
1136
1101
  .inapp-illustration-parent {
1137
1102
  height: "calc(100vh - 325px)";
1138
1103
  overflow: 'auto';
1139
- }
1140
-
1141
- // Archive feature layout classes
1142
- .illustration-scroll-wrapper {
1143
- height: calc(100vh - 20.3125rem);
1144
- overflow: auto;
1145
- }
1146
-
1147
- .filter-row {
1148
- display: flex;
1149
- align-items: center;
1150
- justify-content: space-between;
1151
- width: 102%;
1152
- }
1153
-
1154
- .filter-row-content {
1155
- flex: 1;
1156
- }
1157
-
1158
- .bulk-selection-bar {
1159
- display: flex;
1160
- align-items: center;
1161
- gap: $CAP_SPACE_12;
1162
- flex-shrink: 0;
1163
- margin-right: $CAP_SPACE_32;
1164
- }
1165
-
1166
- .archived-mode-header {
1167
- display: flex;
1168
- align-items: center;
1169
- gap: $CAP_SPACE_12;
1170
- margin-bottom: $CAP_SPACE_16;
1171
-
1172
- .archived-mode-back-icon {
1173
- cursor: pointer;
1174
- font-size: 1.428rem;
1175
- }
1176
- }
1177
-
1178
- .archived-tag {
1179
- margin-left: $CAP_SPACE_08;
1180
- font-size: 0.786rem;
1181
- }
1182
-
1183
- .popover-archive-action {
1184
- cursor: pointer;
1185
- padding: $CAP_SPACE_08 0;
1186
- }
1187
-
1188
- .archive-menu-item {
1189
- display: inline-flex;
1190
- align-items: center;
1191
- gap: $CAP_SPACE_08;
1192
- margin-top: 1rem;
1193
- }
1194
-
1195
- .archive-btn-label {
1196
- margin-right: 0.714rem;
1197
- }
1198
-
1199
- .bulk-selection-bar .cap-button-v2-prefix {
1200
- margin-top: 1rem;
1201
- }
1202
-
1203
- .bulk-selection-bar .ant-btn.cap-button-v2 > .cap-button-v2-prefix + span {
1204
- margin-left: -$CAP_SPACE_06;
1205
- }
1206
-
1207
- .template-card-top-bar {
1208
- display: flex;
1209
- align-items: center;
1210
- justify-content: space-between;
1211
- padding: $CAP_SPACE_08 $CAP_SPACE_12 0;
1212
- }
1213
-
1214
- .template-listing-header-actions {
1215
- display: flex;
1216
- justify-content: space-between;
1217
- align-items: center;
1218
- gap: $CAP_SPACE_08;
1219
- }
1220
-
1221
- .template-listing-more-btn {
1222
- padding: 0;
1223
- margin-right: $CAP_SPACE_12;
1224
- min-width: auto;
1225
- }
1226
-
1227
- .notification-template-label {
1228
- color: $CAP_G04;
1229
- }
1230
-
1231
- .notification-template-name {
1232
- color: $CAP_G01;
1233
- }
1234
-
1235
- .template-card-title {
1236
- display: flex;
1237
- align-items: center;
1238
- min-width: 0;
1239
-
1240
- .cap-checkbox-v2 {
1241
- flex-shrink: 0;
1242
- margin-right: $CAP_SPACE_04;
1243
- // Remove the empty label span's padding that antd Checkbox renders when no children are passed
1244
- .ant-checkbox + span {
1245
- padding-left: 0;
1246
- padding-right: 0;
1247
- }
1248
- }
1249
-
1250
- .template-card-name {
1251
- font-weight: 500;
1252
- font-size: $FONT_SIZE_L;
1253
- color: $CAP_G01;
1254
- overflow: hidden;
1255
- text-overflow: ellipsis;
1256
- white-space: nowrap;
1257
- min-width: 0;
1258
- }
1259
- }
1104
+ }
@@ -167,47 +167,3 @@ export function getCdnTransformationConfig() {
167
167
  type: types.GET_CDN_TRANSFORMATION_CONFIG_REQUEST,
168
168
  };
169
169
  }
170
-
171
- export function archiveTemplate(channel, id, successMessage, description) {
172
- return {
173
- type: types.ARCHIVE_TEMPLATE_REQUEST, channel, id, successMessage, description
174
- };
175
- }
176
-
177
- export function unarchiveTemplate(channel, id, successMessage, description) {
178
- return {
179
- type: types.UNARCHIVE_TEMPLATE_REQUEST, channel, id, successMessage, description
180
- };
181
- }
182
-
183
- export function bulkArchiveTemplates(channel, ids, successMessage) {
184
- return {
185
- type: types.BULK_ARCHIVE_REQUEST, channel, ids, successMessage
186
- };
187
- }
188
-
189
- export function bulkUnarchiveTemplates(channel, ids, successMessage) {
190
- return {
191
- type: types.BULK_UNARCHIVE_REQUEST, channel, ids, successMessage
192
- };
193
- }
194
-
195
- export function setArchiveFilter(filter) {
196
- return { type: types.SET_ARCHIVE_FILTER, filter };
197
- }
198
-
199
- export function toggleTemplateSelection(id) {
200
- return { type: types.TOGGLE_TEMPLATE_SELECTION, id };
201
- }
202
-
203
- export function selectAllTemplates(ids) {
204
- return { type: types.SELECT_ALL_TEMPLATES, ids };
205
- }
206
-
207
- export function clearTemplateSelection() {
208
- return { type: types.CLEAR_TEMPLATE_SELECTION };
209
- }
210
-
211
- export function setArchivedMode(isArchived) {
212
- return { type: types.SET_ARCHIVED_MODE, isArchived };
213
- }
@@ -91,26 +91,3 @@ export const noApprovedWhatsappTemplatesDesc ='noApprovedWhatsappTemplatesDesc'
91
91
  export const zaloDescIllustration='zaloDescIllustration'
92
92
  export const noApprovedRcsTemplatesTitle='noApprovedRcsTemplatesTitle'
93
93
  export const noApprovedRcsTemplatesDesc='noApprovedRcsTemplatesDesc'
94
-
95
- // Archive feature
96
- export const ARCHIVE_TEMPLATE_REQUEST = 'app/v2Containers/Templates/ARCHIVE_TEMPLATE_REQUEST';
97
- export const ARCHIVE_TEMPLATE_SUCCESS = 'app/v2Containers/Templates/ARCHIVE_TEMPLATE_SUCCESS';
98
- export const ARCHIVE_TEMPLATE_FAILURE = 'app/v2Containers/Templates/ARCHIVE_TEMPLATE_FAILURE';
99
-
100
- export const UNARCHIVE_TEMPLATE_REQUEST = 'app/v2Containers/Templates/UNARCHIVE_TEMPLATE_REQUEST';
101
- export const UNARCHIVE_TEMPLATE_SUCCESS = 'app/v2Containers/Templates/UNARCHIVE_TEMPLATE_SUCCESS';
102
- export const UNARCHIVE_TEMPLATE_FAILURE = 'app/v2Containers/Templates/UNARCHIVE_TEMPLATE_FAILURE';
103
-
104
- export const BULK_ARCHIVE_REQUEST = 'app/v2Containers/Templates/BULK_ARCHIVE_REQUEST';
105
- export const BULK_ARCHIVE_SUCCESS = 'app/v2Containers/Templates/BULK_ARCHIVE_SUCCESS';
106
- export const BULK_ARCHIVE_FAILURE = 'app/v2Containers/Templates/BULK_ARCHIVE_FAILURE';
107
-
108
- export const BULK_UNARCHIVE_REQUEST = 'app/v2Containers/Templates/BULK_UNARCHIVE_REQUEST';
109
- export const BULK_UNARCHIVE_SUCCESS = 'app/v2Containers/Templates/BULK_UNARCHIVE_SUCCESS';
110
- export const BULK_UNARCHIVE_FAILURE = 'app/v2Containers/Templates/BULK_UNARCHIVE_FAILURE';
111
-
112
- export const SET_ARCHIVE_FILTER = 'app/v2Containers/Templates/SET_ARCHIVE_FILTER';
113
- export const TOGGLE_TEMPLATE_SELECTION = 'app/v2Containers/Templates/TOGGLE_TEMPLATE_SELECTION';
114
- export const SELECT_ALL_TEMPLATES = 'app/v2Containers/Templates/SELECT_ALL_TEMPLATES';
115
- export const CLEAR_TEMPLATE_SELECTION = 'app/v2Containers/Templates/CLEAR_TEMPLATE_SELECTION';
116
- export const SET_ARCHIVED_MODE = 'app/v2Containers/Templates/SET_ARCHIVED_MODE';