@imposium-hub/components 2.15.0-3 → 2.16.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.
Files changed (84) hide show
  1. package/dist/cjs/components/app-wrapper/AppWrapper.d.ts +0 -1
  2. package/dist/cjs/components/app-wrapper/AppWrapper.js +1 -1
  3. package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
  4. package/dist/cjs/components/assets/AssetsTypeIcon.js +2 -0
  5. package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
  6. package/dist/cjs/components/change-report/ChangeReportTree.js +65 -10
  7. package/dist/cjs/components/change-report/ChangeReportTree.js.map +1 -1
  8. package/dist/cjs/components/number-field/NumberField.d.ts +2 -2
  9. package/dist/cjs/components/number-field/NumberField.js +7 -4
  10. package/dist/cjs/components/number-field/NumberField.js.map +1 -1
  11. package/dist/cjs/components/publish-wizard/PublishWizard.js +40 -39
  12. package/dist/cjs/components/publish-wizard/PublishWizard.js.map +1 -1
  13. package/dist/cjs/constants/copy.d.ts +1 -0
  14. package/dist/cjs/constants/copy.js +3 -2
  15. package/dist/cjs/constants/copy.js.map +1 -1
  16. package/dist/cjs/constants/icons.d.ts +5 -0
  17. package/dist/cjs/constants/icons.js +12 -2
  18. package/dist/cjs/constants/icons.js.map +1 -1
  19. package/dist/cjs/constants/snippets.d.ts +2 -0
  20. package/dist/cjs/redux/actions/publish.d.ts +1 -1
  21. package/dist/cjs/redux/actions/publish.js +2 -2
  22. package/dist/cjs/redux/actions/publish.js.map +1 -1
  23. package/dist/esm/components/app-wrapper/AppWrapper.d.ts +0 -1
  24. package/dist/esm/components/app-wrapper/AppWrapper.js +1 -1
  25. package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
  26. package/dist/esm/components/assets/AssetsTypeIcon.js +2 -0
  27. package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
  28. package/dist/esm/components/change-report/ChangeReportTree.js +64 -10
  29. package/dist/esm/components/change-report/ChangeReportTree.js.map +1 -1
  30. package/dist/esm/components/number-field/NumberField.d.ts +2 -2
  31. package/dist/esm/components/number-field/NumberField.js +5 -4
  32. package/dist/esm/components/number-field/NumberField.js.map +1 -1
  33. package/dist/esm/components/publish-wizard/PublishWizard.js +40 -39
  34. package/dist/esm/components/publish-wizard/PublishWizard.js.map +1 -1
  35. package/dist/esm/constants/copy.d.ts +1 -0
  36. package/dist/esm/constants/copy.js +3 -2
  37. package/dist/esm/constants/copy.js.map +1 -1
  38. package/dist/esm/constants/icons.d.ts +5 -0
  39. package/dist/esm/constants/icons.js +10 -0
  40. package/dist/esm/constants/icons.js.map +1 -1
  41. package/dist/esm/constants/snippets.d.ts +2 -0
  42. package/dist/esm/redux/actions/publish.d.ts +1 -1
  43. package/dist/esm/redux/actions/publish.js +2 -2
  44. package/dist/esm/redux/actions/publish.js.map +1 -1
  45. package/dist/styles.css +54 -10
  46. package/dist/styles.less +65 -13
  47. package/less/components/change-report.less +50 -9
  48. package/less/components/publish-wizard.less +15 -4
  49. package/package.json +5 -1
  50. package/src/components/advanced-number-field/AdvancedNumberField.test.tsx +724 -0
  51. package/src/components/anchor-field/AnchorField.test.tsx +130 -0
  52. package/src/components/app-wrapper/AppWrapper.tsx +1 -6
  53. package/src/components/asset-details/AssetDetails.test.tsx +494 -0
  54. package/src/components/assets/AssetField.test.tsx +449 -0
  55. package/src/components/assets/AssetsTableAssetIdCell.test.tsx +142 -0
  56. package/src/components/assets/AssetsTableAssetIdFilter.test.tsx +95 -0
  57. package/src/components/assets/AssetsTableComplexTagCell.test.tsx +161 -0
  58. package/src/components/assets/AssetsTableDateCell.test.tsx +106 -0
  59. package/src/components/assets/AssetsTableDropzone.test.tsx +132 -0
  60. package/src/components/assets/AssetsTableDurationCell.test.tsx +119 -0
  61. package/src/components/assets/AssetsTableGlobalCell.test.tsx +46 -0
  62. package/src/components/assets/AssetsTableNameCell.test.tsx +166 -0
  63. package/src/components/assets/AssetsTableNameFilter.test.tsx +95 -0
  64. package/src/components/assets/AssetsTablePreviewCell.test.tsx +191 -0
  65. package/src/components/assets/AssetsTableRateCell.test.tsx +87 -0
  66. package/src/components/assets/AssetsTableSelectCell.test.tsx +156 -0
  67. package/src/components/assets/AssetsTableSelectFilter.test.tsx +119 -0
  68. package/src/components/assets/AssetsTableStatusCell.test.tsx +60 -0
  69. package/src/components/assets/AssetsTypeIcon.tsx +2 -0
  70. package/src/components/change-report/ChangeReportTree.tsx +104 -16
  71. package/src/components/number-field/NumberField.test.tsx +383 -0
  72. package/src/components/number-field/NumberField.tsx +15 -9
  73. package/src/components/publish-wizard/PublishWizard.tsx +59 -54
  74. package/src/components/text-field/TextField.test.tsx +988 -0
  75. package/src/constants/copy.ts +3 -2
  76. package/src/constants/icons.tsx +10 -0
  77. package/src/constants/snippets.ts +2 -0
  78. package/src/redux/actions/publish.ts +7 -2
  79. package/src/test/setup.ts +91 -0
  80. package/src/test/utils.tsx +44 -0
  81. package/tsconfig.eslint.json +8 -0
  82. package/tsconfig.json +1 -1
  83. package/vitest.config.ts +31 -0
  84. package/src/components/service-icon/ServiceIcon.test.tsx +0 -0
@@ -39,7 +39,12 @@ interface IPublishWizardProps {
39
39
  checkStoryForErrors(): any;
40
40
  addViewer(c: any): void;
41
41
  exportExperiences: () => void;
42
- publishVersion: (api: IImposiumAPI, sId: string, creativeIds?: string[]) => any;
42
+ publishVersion: (
43
+ api: IImposiumAPI,
44
+ sId: string,
45
+ message?: string,
46
+ creativeIds?: string[]
47
+ ) => any;
43
48
  batchesList: any;
44
49
  onClose(): any;
45
50
  api: IImposiumAPI;
@@ -103,6 +108,7 @@ interface IPublishWizardState {
103
108
  selectedCreatives: string[];
104
109
  changeReport: IChangeReportSection[] | null;
105
110
  publishNotes: string;
111
+ publishTriggered: boolean;
106
112
  }
107
113
 
108
114
  interface IBigButtonProps {
@@ -156,7 +162,8 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
156
162
  publishError: null,
157
163
  selectedCreatives: [],
158
164
  changeReport: null,
159
- publishNotes: ''
165
+ publishNotes: '',
166
+ publishTriggered: false
160
167
  };
161
168
  this.emailWorkflow = React.createRef();
162
169
  this.hiddenFileInputRef = React.createRef();
@@ -164,9 +171,11 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
164
171
 
165
172
  public componentDidUpdate(prevProps, prevState) {
166
173
  const hasReviewStep = !!this.props.auditLogEnabled;
167
- // If we just finished publishing, advance from the Publish screen to the Distribution screen
168
- const publishScreenIndex = hasReviewStep ? 1 : 0;
169
- const distributionScreenIndex = hasReviewStep ? 2 : 1;
174
+ // If we just finished publishing, advance to the Distribution screen
175
+ // When hasReviewStep: screen 0 = Review Changes, screen 1 = Distribution
176
+ // When !hasReviewStep: screen 0 = Publish, screen 1 = Distribution
177
+ const publishScreenIndex = 0;
178
+ const distributionScreenIndex = hasReviewStep ? 1 : 1;
170
179
  if (
171
180
  prevProps.publishData.publishing &&
172
181
  !this.props.publishData.publishing &&
@@ -190,7 +199,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
190
199
  this.setState({ changeReport: report });
191
200
  })
192
201
  .catch(() => {
193
- this.setState({ changeReport: null });
202
+ this.setState({ changeReport: [] });
194
203
  });
195
204
  }
196
205
 
@@ -324,18 +333,20 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
324
333
  };
325
334
 
326
335
  private handlePublish() {
336
+ this.setState({ publishTriggered: true });
327
337
  const {
328
338
  story: { id },
329
339
  api,
330
340
  handleError,
331
341
  fromCrM
332
342
  } = this.props;
333
- const hasReviewStep = !!this.props.auditLogEnabled;
334
- const distributionScreenIndex = hasReviewStep ? 2 : 1;
343
+ const distributionScreenIndex = 1;
344
+
345
+ const { publishNotes } = this.state;
335
346
 
336
347
  if (fromCrM) {
337
348
  this.props
338
- .publishVersion(api, id, this.state.selectedCreatives)
349
+ .publishVersion(api, id, publishNotes, this.state.selectedCreatives)
339
350
  .then(() => {
340
351
  this.setState({ screenIndex: distributionScreenIndex });
341
352
  })
@@ -343,7 +354,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
343
354
  this.setState({ publishError: e });
344
355
  });
345
356
  } else {
346
- this.props.publishVersion(api, id).catch((e) => {
357
+ this.props.publishVersion(api, id, publishNotes).catch((e) => {
347
358
  handleError(e);
348
359
  });
349
360
  this.setState({ screenIndex: distributionScreenIndex });
@@ -382,7 +393,12 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
382
393
  }
383
394
 
384
395
  private getErrorCopyForCrMPublish() {
385
- const { story, project } = this.props;
396
+ const { story, project, fromCrM } = this.props;
397
+
398
+ if (!fromCrM) {
399
+ return null;
400
+ }
401
+
386
402
  const variables = story ? story.acts[project.actId].inventory : {};
387
403
  const varLength = variables ? Object.keys(variables).length : 0;
388
404
 
@@ -399,12 +415,12 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
399
415
  const { publishing } = this.props.publishData;
400
416
  const disabledForCrM = this.shouldDisablePublishButtonForCrM();
401
417
  const hasReviewStep = !!this.props.auditLogEnabled;
402
- const publishScreenIndex = hasReviewStep ? 1 : 0;
403
- const distributionScreenIndex = hasReviewStep ? 2 : 1;
418
+ const distributionScreenIndex = 1;
404
419
  const lowerButtons = [];
405
420
 
406
421
  if (hasReviewStep && screenIndex === 0) {
407
422
  // Review Changes step: Skip and Publish buttons (no Back)
423
+ // Publish triggers the actual publish and goes to Distribution
408
424
  lowerButtons.push(
409
425
  <Button
410
426
  tooltip={copy.publish.btnSkip}
@@ -420,13 +436,14 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
420
436
  tooltip={copy.publish.btnPublish}
421
437
  size={'large'}
422
438
  key='btn-publish-review'
423
- onClick={() => this.setState({ screenIndex: publishScreenIndex })}
439
+ disabled={publishing}
440
+ onClick={() => this.handlePublish()}
424
441
  color='primary'>
425
442
  {copy.publish.btnPublish}
426
443
  </Button>
427
444
  );
428
- } else if (screenIndex === publishScreenIndex) {
429
- // Publish step: Publish and Skip buttons
445
+ } else if (!hasReviewStep && screenIndex === 0) {
446
+ // Non-review path: original Publish step
430
447
  const projectType = story.creativeId
431
448
  ? CRM_INTEGRATED_PROJECT_TYPES.SINGLE_CREATIVE
432
449
  : CRM_INTEGRATED_PROJECT_TYPES.MULTI_CREATIVE;
@@ -447,7 +464,6 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
447
464
  </Button>
448
465
  );
449
466
 
450
- // skip publish
451
467
  lowerButtons.push(
452
468
  <Button
453
469
  tooltip={copy.publish.btnSkip}
@@ -458,19 +474,6 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
458
474
  {copy.publish.btnSkip}
459
475
  </Button>
460
476
  );
461
-
462
- if (hasReviewStep) {
463
- lowerButtons.push(
464
- <Button
465
- tooltip={copy.publish.btnBack}
466
- size={'large'}
467
- key='btn-back'
468
- onClick={() => this.setState({ screenIndex: 0 })}
469
- color='primary'>
470
- {copy.publish.btnBack}
471
- </Button>
472
- );
473
- }
474
477
  } else {
475
478
  // Distribution and sub-screens: Back button (and Done/Finish if applicable)
476
479
  if (done || error) {
@@ -486,18 +489,21 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
486
489
  );
487
490
  }
488
491
 
489
- // Back button: from distribution → go to publish step
492
+ // Back button: from distribution → go to review/publish (screen 0)
490
493
  // from sub-screens → go back to distribution
491
- const backIndex =
492
- screenIndex === distributionScreenIndex
493
- ? publishScreenIndex
494
- : distributionScreenIndex;
494
+ // Disable back to review if publishing or already published
495
+ const backIndex = screenIndex === distributionScreenIndex ? 0 : distributionScreenIndex;
496
+ const disableBack =
497
+ hasReviewStep &&
498
+ screenIndex === distributionScreenIndex &&
499
+ (publishing || this.state.publishTriggered);
495
500
 
496
501
  lowerButtons.push(
497
502
  <Button
498
503
  tooltip={copy.publish.btnBack}
499
504
  size={'large'}
500
505
  key='btn-back'
506
+ disabled={disableBack}
501
507
  onClick={() =>
502
508
  this.setState(
503
509
  {
@@ -555,6 +561,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
555
561
  <textarea
556
562
  className='publish-notes-textarea'
557
563
  value={publishNotes}
564
+ maxLength={copy.publish.publishNotesMaxLength}
558
565
  onChange={(e) => this.setState({ publishNotes: e.target.value })}
559
566
  placeholder={copy.publish.publishNotesPlaceholder}
560
567
  />
@@ -572,6 +579,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
572
579
  const projectType = story.creativeId
573
580
  ? CRM_INTEGRATED_PROJECT_TYPES.SINGLE_CREATIVE
574
581
  : CRM_INTEGRATED_PROJECT_TYPES.MULTI_CREATIVE;
582
+
575
583
  const error = errorCopy ? (
576
584
  <p className='publish-error'>
577
585
  <span className='icon'>{ICON_EXCLAIMATION_TRIANGLE}</span>&nbsp;&nbsp;{errorCopy}
@@ -696,9 +704,8 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
696
704
  private nextClickHandler = () => {
697
705
  this.setState({ nextStep: true, error: false });
698
706
 
699
- const hasReviewStep = !!this.props.auditLogEnabled;
700
- const exportIndex = hasReviewStep ? 8 : 7;
701
- const crmExportIndex = hasReviewStep ? 9 : 8;
707
+ const exportIndex = 7;
708
+ const crmExportIndex = 8;
702
709
  if (this.state.screenIndex === exportIndex || this.state.screenIndex === crmExportIndex) {
703
710
  this.emailWorkflow.current.getWrappedInstance().proceedWithExport();
704
711
  }
@@ -758,30 +765,28 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
758
765
  <div className='publish-wizard'>
759
766
  <div className='publish-wizard-header'>
760
767
  {copy.publish.publishTitle}
761
- <PublishStatusIndicator api={api} />
768
+ <PublishStatusIndicator
769
+ api={api}
770
+ storyId={story.id}
771
+ />
762
772
  </div>
763
773
  {/* <PaneErrorBoundry>*/}
764
774
  <div>
765
775
  {hasReviewStep && screenIndex === 0 && this.renderReviewChanges()}
766
- {screenIndex === (hasReviewStep ? 1 : 0) && this.renderPublish()}
767
- {screenIndex === (hasReviewStep ? 2 : 1) && this.renderDistributionOptions()}
768
- {screenIndex === (hasReviewStep ? 3 : 2) && (
776
+ {!hasReviewStep && screenIndex === 0 && this.renderPublish()}
777
+ {screenIndex === 1 && this.renderDistributionOptions()}
778
+ {screenIndex === 2 && (
769
779
  <WebpageHosted
770
780
  story={story}
771
781
  compositionId={selectedComposition}
772
782
  accessKey={accessKey}
773
783
  />
774
784
  )}
775
- {(screenIndex === (hasReviewStep ? 4 : 3) ||
776
- screenIndex === (hasReviewStep ? 8 : 7) ||
777
- screenIndex === (hasReviewStep ? 9 : 8)) && (
785
+ {(screenIndex === 3 || screenIndex === 7 || screenIndex === 8) && (
778
786
  <EmailWorkflow
779
- isCrM={screenIndex === (hasReviewStep ? 9 : 8)}
780
- isExport={
781
- screenIndex === (hasReviewStep ? 8 : 7) ||
782
- screenIndex === (hasReviewStep ? 9 : 8)
783
- }
784
- isEmail={screenIndex === (hasReviewStep ? 4 : 3)}
787
+ isCrM={screenIndex === 8}
788
+ isExport={screenIndex === 7 || screenIndex === 8}
789
+ isEmail={screenIndex === 3}
785
790
  api={api}
786
791
  story={story}
787
792
  variables={variables}
@@ -807,7 +812,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
807
812
  ref={this.emailWorkflow}
808
813
  />
809
814
  )}
810
- {screenIndex === (hasReviewStep ? 6 : 5) && (
815
+ {screenIndex === 5 && (
811
816
  <HubSpotFlow
812
817
  handleError={handleError}
813
818
  status={status}
@@ -817,7 +822,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
817
822
  compositionId={selectedComposition}
818
823
  />
819
824
  )}
820
- {screenIndex === (hasReviewStep ? 7 : 6) && <APIIntegration />}
825
+ {screenIndex === 6 && <APIIntegration />}
821
826
  <br />
822
827
  <HRule />
823
828
  <div className='lower-buttons'>{this.renderLowerButtons()}</div>
@@ -907,7 +912,7 @@ export const DistributeOptions = ({
907
912
  creativeManagerBaseUrl,
908
913
  hasReviewStep = false
909
914
  }) => {
910
- const shift = hasReviewStep ? 1 : 0;
915
+ const shift = 0;
911
916
  const selectOption = (index: number) => onSelectOption(index + shift);
912
917
  const isPrerendersEnabled = useFlag('feature.IMPOSIUM_EDITOR.PRERENDERS_CRM_WORKFLOW');
913
918