@imposium-hub/components 2.15.0-2 → 2.16.0-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 (100) 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/asset-details/AssetDetails.js +1 -1
  5. package/dist/cjs/components/assets/AssetsTableComplexTagCell.js +1 -1
  6. package/dist/cjs/components/assets/AssetsTableTagsPivot.js +1 -1
  7. package/dist/cjs/components/assets/AssetsTypeIcon.js +2 -0
  8. package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
  9. package/dist/cjs/components/assets/AssetsUploadMenu.js +1 -1
  10. package/dist/cjs/components/change-report/ChangeReportTree.js +65 -10
  11. package/dist/cjs/components/change-report/ChangeReportTree.js.map +1 -1
  12. package/dist/cjs/components/controlled-list/ControlledList.stories.js +1 -1
  13. package/dist/cjs/components/number-field/NumberField.d.ts +2 -2
  14. package/dist/cjs/components/number-field/NumberField.js +7 -4
  15. package/dist/cjs/components/number-field/NumberField.js.map +1 -1
  16. package/dist/cjs/components/publish-wizard/PublishWizard.js +36 -38
  17. package/dist/cjs/components/publish-wizard/PublishWizard.js.map +1 -1
  18. package/dist/cjs/components/tag/Tag.js.map +1 -1
  19. package/dist/cjs/components/tag/Tag.test.js.map +1 -1
  20. package/dist/cjs/constants/copy.d.ts +1 -0
  21. package/dist/cjs/constants/copy.js +3 -2
  22. package/dist/cjs/constants/copy.js.map +1 -1
  23. package/dist/cjs/constants/icons.d.ts +5 -0
  24. package/dist/cjs/constants/icons.js +12 -2
  25. package/dist/cjs/constants/icons.js.map +1 -1
  26. package/dist/cjs/constants/snippets.d.ts +2 -0
  27. package/dist/cjs/index.d.ts +1 -1
  28. package/dist/cjs/index.js +1 -1
  29. package/dist/cjs/redux/actions/publish.d.ts +1 -1
  30. package/dist/cjs/redux/actions/publish.js +2 -2
  31. package/dist/cjs/redux/actions/publish.js.map +1 -1
  32. package/dist/esm/components/app-wrapper/AppWrapper.d.ts +0 -1
  33. package/dist/esm/components/app-wrapper/AppWrapper.js +1 -1
  34. package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
  35. package/dist/esm/components/asset-details/AssetDetails.js +1 -1
  36. package/dist/esm/components/assets/AssetsTableComplexTagCell.js +1 -1
  37. package/dist/esm/components/assets/AssetsTableTagsPivot.js +1 -1
  38. package/dist/esm/components/assets/AssetsTypeIcon.js +2 -0
  39. package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
  40. package/dist/esm/components/assets/AssetsUploadMenu.js +1 -1
  41. package/dist/esm/components/change-report/ChangeReportTree.js +64 -10
  42. package/dist/esm/components/change-report/ChangeReportTree.js.map +1 -1
  43. package/dist/esm/components/controlled-list/ControlledList.stories.js +1 -1
  44. package/dist/esm/components/number-field/NumberField.d.ts +2 -2
  45. package/dist/esm/components/number-field/NumberField.js +5 -4
  46. package/dist/esm/components/number-field/NumberField.js.map +1 -1
  47. package/dist/esm/components/publish-wizard/PublishWizard.js +36 -38
  48. package/dist/esm/components/publish-wizard/PublishWizard.js.map +1 -1
  49. package/dist/esm/components/tag/Tag.js.map +1 -1
  50. package/dist/esm/components/tag/Tag.test.js.map +1 -1
  51. package/dist/esm/constants/copy.d.ts +1 -0
  52. package/dist/esm/constants/copy.js +3 -2
  53. package/dist/esm/constants/copy.js.map +1 -1
  54. package/dist/esm/constants/icons.d.ts +5 -0
  55. package/dist/esm/constants/icons.js +10 -0
  56. package/dist/esm/constants/icons.js.map +1 -1
  57. package/dist/esm/constants/snippets.d.ts +2 -0
  58. package/dist/esm/index.d.ts +1 -1
  59. package/dist/esm/index.js +1 -1
  60. package/dist/esm/redux/actions/publish.d.ts +1 -1
  61. package/dist/esm/redux/actions/publish.js +2 -2
  62. package/dist/esm/redux/actions/publish.js.map +1 -1
  63. package/dist/styles.css +54 -10
  64. package/dist/styles.less +65 -13
  65. package/less/components/change-report.less +50 -9
  66. package/less/components/publish-wizard.less +15 -4
  67. package/package.json +5 -1
  68. package/src/components/advanced-number-field/AdvancedNumberField.test.tsx +704 -0
  69. package/src/components/anchor-field/AnchorField.test.tsx +130 -0
  70. package/src/components/app-wrapper/AppWrapper.tsx +1 -6
  71. package/src/components/asset-details/AssetDetails.test.tsx +494 -0
  72. package/src/components/asset-details/AssetDetails.tsx +1 -1
  73. package/src/components/assets/AssetField.test.tsx +439 -0
  74. package/src/components/assets/AssetsTableAssetIdCell.test.tsx +134 -0
  75. package/src/components/assets/AssetsTableAssetIdFilter.test.tsx +95 -0
  76. package/src/components/assets/AssetsTableComplexTagCell.test.tsx +159 -0
  77. package/src/components/assets/AssetsTableComplexTagCell.tsx +1 -1
  78. package/src/components/assets/AssetsTableDateCell.test.tsx +106 -0
  79. package/src/components/assets/AssetsTableTagsPivot.tsx +1 -1
  80. package/src/components/assets/AssetsTypeIcon.tsx +2 -0
  81. package/src/components/assets/AssetsUploadMenu.tsx +1 -1
  82. package/src/components/change-report/ChangeReportTree.tsx +104 -16
  83. package/src/components/controlled-list/ControlledList.stories.tsx +1 -1
  84. package/src/components/number-field/NumberField.test.tsx +383 -0
  85. package/src/components/number-field/NumberField.tsx +15 -9
  86. package/src/components/publish-wizard/PublishWizard.tsx +52 -53
  87. package/src/components/text-field/TextField.test.tsx +988 -0
  88. package/src/constants/copy.ts +3 -2
  89. package/src/constants/icons.tsx +10 -0
  90. package/src/constants/snippets.ts +2 -0
  91. package/src/index.ts +1 -1
  92. package/src/redux/actions/publish.ts +7 -2
  93. package/src/test/setup.ts +91 -0
  94. package/src/test/utils.tsx +44 -0
  95. package/tsconfig.eslint.json +8 -0
  96. package/tsconfig.json +1 -1
  97. package/vitest.config.ts +31 -0
  98. package/src/components/service-icon/ServiceIcon.test.tsx +0 -0
  99. /package/src/components/{Tag → tag}/Tag.test.tsx +0 -0
  100. /package/src/components/{Tag → tag}/Tag.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 });
@@ -399,12 +410,12 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
399
410
  const { publishing } = this.props.publishData;
400
411
  const disabledForCrM = this.shouldDisablePublishButtonForCrM();
401
412
  const hasReviewStep = !!this.props.auditLogEnabled;
402
- const publishScreenIndex = hasReviewStep ? 1 : 0;
403
- const distributionScreenIndex = hasReviewStep ? 2 : 1;
413
+ const distributionScreenIndex = 1;
404
414
  const lowerButtons = [];
405
415
 
406
416
  if (hasReviewStep && screenIndex === 0) {
407
417
  // Review Changes step: Skip and Publish buttons (no Back)
418
+ // Publish triggers the actual publish and goes to Distribution
408
419
  lowerButtons.push(
409
420
  <Button
410
421
  tooltip={copy.publish.btnSkip}
@@ -420,13 +431,14 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
420
431
  tooltip={copy.publish.btnPublish}
421
432
  size={'large'}
422
433
  key='btn-publish-review'
423
- onClick={() => this.setState({ screenIndex: publishScreenIndex })}
434
+ disabled={publishing}
435
+ onClick={() => this.handlePublish()}
424
436
  color='primary'>
425
437
  {copy.publish.btnPublish}
426
438
  </Button>
427
439
  );
428
- } else if (screenIndex === publishScreenIndex) {
429
- // Publish step: Publish and Skip buttons
440
+ } else if (!hasReviewStep && screenIndex === 0) {
441
+ // Non-review path: original Publish step
430
442
  const projectType = story.creativeId
431
443
  ? CRM_INTEGRATED_PROJECT_TYPES.SINGLE_CREATIVE
432
444
  : CRM_INTEGRATED_PROJECT_TYPES.MULTI_CREATIVE;
@@ -447,7 +459,6 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
447
459
  </Button>
448
460
  );
449
461
 
450
- // skip publish
451
462
  lowerButtons.push(
452
463
  <Button
453
464
  tooltip={copy.publish.btnSkip}
@@ -458,19 +469,6 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
458
469
  {copy.publish.btnSkip}
459
470
  </Button>
460
471
  );
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
472
  } else {
475
473
  // Distribution and sub-screens: Back button (and Done/Finish if applicable)
476
474
  if (done || error) {
@@ -486,18 +484,21 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
486
484
  );
487
485
  }
488
486
 
489
- // Back button: from distribution → go to publish step
487
+ // Back button: from distribution → go to review/publish (screen 0)
490
488
  // from sub-screens → go back to distribution
491
- const backIndex =
492
- screenIndex === distributionScreenIndex
493
- ? publishScreenIndex
494
- : distributionScreenIndex;
489
+ // Disable back to review if publishing or already published
490
+ const backIndex = screenIndex === distributionScreenIndex ? 0 : distributionScreenIndex;
491
+ const disableBack =
492
+ hasReviewStep &&
493
+ screenIndex === distributionScreenIndex &&
494
+ (publishing || this.state.publishTriggered);
495
495
 
496
496
  lowerButtons.push(
497
497
  <Button
498
498
  tooltip={copy.publish.btnBack}
499
499
  size={'large'}
500
500
  key='btn-back'
501
+ disabled={disableBack}
501
502
  onClick={() =>
502
503
  this.setState(
503
504
  {
@@ -555,6 +556,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
555
556
  <textarea
556
557
  className='publish-notes-textarea'
557
558
  value={publishNotes}
559
+ maxLength={copy.publish.publishNotesMaxLength}
558
560
  onChange={(e) => this.setState({ publishNotes: e.target.value })}
559
561
  placeholder={copy.publish.publishNotesPlaceholder}
560
562
  />
@@ -696,9 +698,8 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
696
698
  private nextClickHandler = () => {
697
699
  this.setState({ nextStep: true, error: false });
698
700
 
699
- const hasReviewStep = !!this.props.auditLogEnabled;
700
- const exportIndex = hasReviewStep ? 8 : 7;
701
- const crmExportIndex = hasReviewStep ? 9 : 8;
701
+ const exportIndex = 7;
702
+ const crmExportIndex = 8;
702
703
  if (this.state.screenIndex === exportIndex || this.state.screenIndex === crmExportIndex) {
703
704
  this.emailWorkflow.current.getWrappedInstance().proceedWithExport();
704
705
  }
@@ -758,30 +759,28 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
758
759
  <div className='publish-wizard'>
759
760
  <div className='publish-wizard-header'>
760
761
  {copy.publish.publishTitle}
761
- <PublishStatusIndicator api={api} />
762
+ <PublishStatusIndicator
763
+ api={api}
764
+ storyId={story.id}
765
+ />
762
766
  </div>
763
767
  {/* <PaneErrorBoundry>*/}
764
768
  <div>
765
769
  {hasReviewStep && screenIndex === 0 && this.renderReviewChanges()}
766
- {screenIndex === (hasReviewStep ? 1 : 0) && this.renderPublish()}
767
- {screenIndex === (hasReviewStep ? 2 : 1) && this.renderDistributionOptions()}
768
- {screenIndex === (hasReviewStep ? 3 : 2) && (
770
+ {!hasReviewStep && screenIndex === 0 && this.renderPublish()}
771
+ {screenIndex === 1 && this.renderDistributionOptions()}
772
+ {screenIndex === 2 && (
769
773
  <WebpageHosted
770
774
  story={story}
771
775
  compositionId={selectedComposition}
772
776
  accessKey={accessKey}
773
777
  />
774
778
  )}
775
- {(screenIndex === (hasReviewStep ? 4 : 3) ||
776
- screenIndex === (hasReviewStep ? 8 : 7) ||
777
- screenIndex === (hasReviewStep ? 9 : 8)) && (
779
+ {(screenIndex === 3 || screenIndex === 7 || screenIndex === 8) && (
778
780
  <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)}
781
+ isCrM={screenIndex === 8}
782
+ isExport={screenIndex === 7 || screenIndex === 8}
783
+ isEmail={screenIndex === 3}
785
784
  api={api}
786
785
  story={story}
787
786
  variables={variables}
@@ -807,7 +806,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
807
806
  ref={this.emailWorkflow}
808
807
  />
809
808
  )}
810
- {screenIndex === (hasReviewStep ? 6 : 5) && (
809
+ {screenIndex === 5 && (
811
810
  <HubSpotFlow
812
811
  handleError={handleError}
813
812
  status={status}
@@ -817,7 +816,7 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
817
816
  compositionId={selectedComposition}
818
817
  />
819
818
  )}
820
- {screenIndex === (hasReviewStep ? 7 : 6) && <APIIntegration />}
819
+ {screenIndex === 6 && <APIIntegration />}
821
820
  <br />
822
821
  <HRule />
823
822
  <div className='lower-buttons'>{this.renderLowerButtons()}</div>
@@ -907,7 +906,7 @@ export const DistributeOptions = ({
907
906
  creativeManagerBaseUrl,
908
907
  hasReviewStep = false
909
908
  }) => {
910
- const shift = hasReviewStep ? 1 : 0;
909
+ const shift = 0;
911
910
  const selectOption = (index: number) => onSelectOption(index + shift);
912
911
  const isPrerendersEnabled = useFlag('feature.IMPOSIUM_EDITOR.PRERENDERS_CRM_WORKFLOW');
913
912