@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.
- package/dist/cjs/components/app-wrapper/AppWrapper.d.ts +0 -1
- package/dist/cjs/components/app-wrapper/AppWrapper.js +1 -1
- package/dist/cjs/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/cjs/components/asset-details/AssetDetails.js +1 -1
- package/dist/cjs/components/assets/AssetsTableComplexTagCell.js +1 -1
- package/dist/cjs/components/assets/AssetsTableTagsPivot.js +1 -1
- package/dist/cjs/components/assets/AssetsTypeIcon.js +2 -0
- package/dist/cjs/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/cjs/components/assets/AssetsUploadMenu.js +1 -1
- package/dist/cjs/components/change-report/ChangeReportTree.js +65 -10
- package/dist/cjs/components/change-report/ChangeReportTree.js.map +1 -1
- package/dist/cjs/components/controlled-list/ControlledList.stories.js +1 -1
- package/dist/cjs/components/number-field/NumberField.d.ts +2 -2
- package/dist/cjs/components/number-field/NumberField.js +7 -4
- package/dist/cjs/components/number-field/NumberField.js.map +1 -1
- package/dist/cjs/components/publish-wizard/PublishWizard.js +36 -38
- package/dist/cjs/components/publish-wizard/PublishWizard.js.map +1 -1
- package/dist/cjs/components/tag/Tag.js.map +1 -1
- package/dist/cjs/components/tag/Tag.test.js.map +1 -1
- package/dist/cjs/constants/copy.d.ts +1 -0
- package/dist/cjs/constants/copy.js +3 -2
- package/dist/cjs/constants/copy.js.map +1 -1
- package/dist/cjs/constants/icons.d.ts +5 -0
- package/dist/cjs/constants/icons.js +12 -2
- package/dist/cjs/constants/icons.js.map +1 -1
- package/dist/cjs/constants/snippets.d.ts +2 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/redux/actions/publish.d.ts +1 -1
- package/dist/cjs/redux/actions/publish.js +2 -2
- package/dist/cjs/redux/actions/publish.js.map +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.d.ts +0 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js +1 -1
- package/dist/esm/components/app-wrapper/AppWrapper.js.map +1 -1
- package/dist/esm/components/asset-details/AssetDetails.js +1 -1
- package/dist/esm/components/assets/AssetsTableComplexTagCell.js +1 -1
- package/dist/esm/components/assets/AssetsTableTagsPivot.js +1 -1
- package/dist/esm/components/assets/AssetsTypeIcon.js +2 -0
- package/dist/esm/components/assets/AssetsTypeIcon.js.map +1 -1
- package/dist/esm/components/assets/AssetsUploadMenu.js +1 -1
- package/dist/esm/components/change-report/ChangeReportTree.js +64 -10
- package/dist/esm/components/change-report/ChangeReportTree.js.map +1 -1
- package/dist/esm/components/controlled-list/ControlledList.stories.js +1 -1
- package/dist/esm/components/number-field/NumberField.d.ts +2 -2
- package/dist/esm/components/number-field/NumberField.js +5 -4
- package/dist/esm/components/number-field/NumberField.js.map +1 -1
- package/dist/esm/components/publish-wizard/PublishWizard.js +36 -38
- package/dist/esm/components/publish-wizard/PublishWizard.js.map +1 -1
- package/dist/esm/components/tag/Tag.js.map +1 -1
- package/dist/esm/components/tag/Tag.test.js.map +1 -1
- package/dist/esm/constants/copy.d.ts +1 -0
- package/dist/esm/constants/copy.js +3 -2
- package/dist/esm/constants/copy.js.map +1 -1
- package/dist/esm/constants/icons.d.ts +5 -0
- package/dist/esm/constants/icons.js +10 -0
- package/dist/esm/constants/icons.js.map +1 -1
- package/dist/esm/constants/snippets.d.ts +2 -0
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/redux/actions/publish.d.ts +1 -1
- package/dist/esm/redux/actions/publish.js +2 -2
- package/dist/esm/redux/actions/publish.js.map +1 -1
- package/dist/styles.css +54 -10
- package/dist/styles.less +65 -13
- package/less/components/change-report.less +50 -9
- package/less/components/publish-wizard.less +15 -4
- package/package.json +5 -1
- package/src/components/advanced-number-field/AdvancedNumberField.test.tsx +704 -0
- package/src/components/anchor-field/AnchorField.test.tsx +130 -0
- package/src/components/app-wrapper/AppWrapper.tsx +1 -6
- package/src/components/asset-details/AssetDetails.test.tsx +494 -0
- package/src/components/asset-details/AssetDetails.tsx +1 -1
- package/src/components/assets/AssetField.test.tsx +439 -0
- package/src/components/assets/AssetsTableAssetIdCell.test.tsx +134 -0
- package/src/components/assets/AssetsTableAssetIdFilter.test.tsx +95 -0
- package/src/components/assets/AssetsTableComplexTagCell.test.tsx +159 -0
- package/src/components/assets/AssetsTableComplexTagCell.tsx +1 -1
- package/src/components/assets/AssetsTableDateCell.test.tsx +106 -0
- package/src/components/assets/AssetsTableTagsPivot.tsx +1 -1
- package/src/components/assets/AssetsTypeIcon.tsx +2 -0
- package/src/components/assets/AssetsUploadMenu.tsx +1 -1
- package/src/components/change-report/ChangeReportTree.tsx +104 -16
- package/src/components/controlled-list/ControlledList.stories.tsx +1 -1
- package/src/components/number-field/NumberField.test.tsx +383 -0
- package/src/components/number-field/NumberField.tsx +15 -9
- package/src/components/publish-wizard/PublishWizard.tsx +52 -53
- package/src/components/text-field/TextField.test.tsx +988 -0
- package/src/constants/copy.ts +3 -2
- package/src/constants/icons.tsx +10 -0
- package/src/constants/snippets.ts +2 -0
- package/src/index.ts +1 -1
- package/src/redux/actions/publish.ts +7 -2
- package/src/test/setup.ts +91 -0
- package/src/test/utils.tsx +44 -0
- package/tsconfig.eslint.json +8 -0
- package/tsconfig.json +1 -1
- package/vitest.config.ts +31 -0
- package/src/components/service-icon/ServiceIcon.test.tsx +0 -0
- /package/src/components/{Tag → tag}/Tag.test.tsx +0 -0
- /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: (
|
|
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
|
|
168
|
-
|
|
169
|
-
|
|
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:
|
|
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
|
|
334
|
-
|
|
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
|
|
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
|
-
|
|
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 ===
|
|
429
|
-
//
|
|
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
|
|
487
|
+
// Back button: from distribution → go to review/publish (screen 0)
|
|
490
488
|
// from sub-screens → go back to distribution
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
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
|
|
700
|
-
const
|
|
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
|
|
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
|
-
{
|
|
767
|
-
{screenIndex ===
|
|
768
|
-
{screenIndex ===
|
|
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 ===
|
|
776
|
-
screenIndex === (hasReviewStep ? 8 : 7) ||
|
|
777
|
-
screenIndex === (hasReviewStep ? 9 : 8)) && (
|
|
779
|
+
{(screenIndex === 3 || screenIndex === 7 || screenIndex === 8) && (
|
|
778
780
|
<EmailWorkflow
|
|
779
|
-
isCrM={screenIndex ===
|
|
780
|
-
isExport={
|
|
781
|
-
|
|
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 ===
|
|
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 ===
|
|
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 =
|
|
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
|
|