@imposium-hub/components 2.2.4 → 2.2.6
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/header/Header.d.ts +1 -0
- package/dist/cjs/components/header/Header.js +4 -3
- package/dist/cjs/components/header/Header.js.map +1 -1
- package/dist/cjs/components/publish-wizard/publish/EmailWorkflow.js +5 -5
- package/dist/cjs/components/publish-wizard/publish/EmailWorkflow.js.map +1 -1
- package/dist/cjs/components/story-previewer/StoryPreviewer.js +4 -4
- package/dist/cjs/components/story-previewer/StoryPreviewer.js.map +1 -1
- package/dist/cjs/services/API.d.ts +9 -3
- package/dist/cjs/services/API.js +4 -1
- package/dist/cjs/services/API.js.map +1 -1
- package/dist/esm/components/header/Header.d.ts +1 -0
- package/dist/esm/components/header/Header.js +4 -3
- package/dist/esm/components/header/Header.js.map +1 -1
- package/dist/esm/components/publish-wizard/publish/EmailWorkflow.js +4 -5
- package/dist/esm/components/publish-wizard/publish/EmailWorkflow.js.map +1 -1
- package/dist/esm/components/story-previewer/StoryPreviewer.js +4 -4
- package/dist/esm/components/story-previewer/StoryPreviewer.js.map +1 -1
- package/dist/esm/services/API.d.ts +9 -3
- package/dist/esm/services/API.js +4 -1
- package/dist/esm/services/API.js.map +1 -1
- package/dist/styles.css +6 -0
- package/dist/styles.less +1 -1
- package/less/components/form-field.less +1 -1
- package/package.json +1 -1
- package/src/components/header/Header.tsx +8 -3
- package/src/components/publish-wizard/publish/EmailWorkflow.tsx +4 -6
- package/src/components/story-previewer/StoryPreviewer.tsx +18 -5
- package/src/services/API.ts +19 -3
|
@@ -19,6 +19,7 @@ export interface IHeaderProps {
|
|
|
19
19
|
onStoryChange?: (story: any) => any;
|
|
20
20
|
logout: (...args) => any;
|
|
21
21
|
auth: any;
|
|
22
|
+
story: any;
|
|
22
23
|
baseUrl: any;
|
|
23
24
|
}
|
|
24
25
|
|
|
@@ -153,6 +154,7 @@ class ImposiumHeader extends React.PureComponent<IHeaderProps, IHeaderState> {
|
|
|
153
154
|
public componentDidUpdate(prevProps: Readonly<IHeaderProps>): void {
|
|
154
155
|
const { accessData } = this.state;
|
|
155
156
|
const { activeOrganization } = this.props;
|
|
157
|
+
|
|
156
158
|
if (activeOrganization !== prevProps.activeOrganization) {
|
|
157
159
|
this.parseAccessData(accessData, activeOrganization);
|
|
158
160
|
}
|
|
@@ -298,7 +300,7 @@ class ImposiumHeader extends React.PureComponent<IHeaderProps, IHeaderState> {
|
|
|
298
300
|
};
|
|
299
301
|
|
|
300
302
|
public render() {
|
|
301
|
-
const { email, activeOrganization, activeStory, hideStoryPicker } = this.props;
|
|
303
|
+
const { email, activeOrganization, activeStory, hideStoryPicker, story } = this.props;
|
|
302
304
|
const {
|
|
303
305
|
accessData,
|
|
304
306
|
showAccountDropdown,
|
|
@@ -455,7 +457,9 @@ class ImposiumHeader extends React.PureComponent<IHeaderProps, IHeaderState> {
|
|
|
455
457
|
if (showStoriesDropdown === false) this.getAccessData();
|
|
456
458
|
});
|
|
457
459
|
}}>
|
|
458
|
-
<div className='story-name'>
|
|
460
|
+
<div className='story-name'>
|
|
461
|
+
{currentStory ? currentStory.name : story ? story.name : ''}
|
|
462
|
+
</div>
|
|
459
463
|
{this.renderDropdownChevron(showStoriesDropdown)}
|
|
460
464
|
</button>
|
|
461
465
|
);
|
|
@@ -585,7 +589,8 @@ class ImposiumHeader extends React.PureComponent<IHeaderProps, IHeaderState> {
|
|
|
585
589
|
|
|
586
590
|
const mapStateToProps = (state): any => {
|
|
587
591
|
return {
|
|
588
|
-
auth: state.auth
|
|
592
|
+
auth: state.auth,
|
|
593
|
+
story: state.story
|
|
589
594
|
};
|
|
590
595
|
};
|
|
591
596
|
|
|
@@ -369,15 +369,15 @@ class EmailWorkflow extends React.PureComponent<IEmailWorkflowProps, IEmailWorkf
|
|
|
369
369
|
onError(false); // reset the parent error
|
|
370
370
|
this.props
|
|
371
371
|
.importBatchFromCsv(story_id, id, file, accessKey, compositionId, !isExport, isExport)
|
|
372
|
-
.then(() => {
|
|
373
|
-
if (
|
|
372
|
+
.then((res) => {
|
|
373
|
+
if (res?.missing_columns) {
|
|
374
374
|
onError(true); // set the error to true
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
this.setState({ uploadComplete: true, uploading: false });
|
|
378
378
|
this.getBatch();
|
|
379
379
|
|
|
380
|
-
if (isExport &&
|
|
380
|
+
if (isExport && res?.missing_columns?.length === 0) {
|
|
381
381
|
this.renderBatch({ id });
|
|
382
382
|
}
|
|
383
383
|
})
|
|
@@ -583,9 +583,7 @@ class EmailWorkflow extends React.PureComponent<IEmailWorkflowProps, IEmailWorkf
|
|
|
583
583
|
|
|
584
584
|
// add an empty option to the columns
|
|
585
585
|
colOpts.unshift('');
|
|
586
|
-
|
|
587
|
-
const missingColumn = Object.keys(missing).map((m) => missing[m]);
|
|
588
|
-
const showMissing = missingColumn.join();
|
|
586
|
+
const showMissing = missing[missing.length - 1].join();
|
|
589
587
|
|
|
590
588
|
if (colOpts.length < varArray.length) {
|
|
591
589
|
return (
|
|
@@ -443,7 +443,8 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
443
443
|
experienceId,
|
|
444
444
|
triggerJob = false,
|
|
445
445
|
compositionId?: string,
|
|
446
|
-
useWorkingCopy?: boolean
|
|
446
|
+
useWorkingCopy?: boolean,
|
|
447
|
+
fastRender?: boolean
|
|
447
448
|
) {
|
|
448
449
|
if (!this.timer.running) {
|
|
449
450
|
this.timer.start();
|
|
@@ -461,7 +462,12 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
461
462
|
},
|
|
462
463
|
() => {
|
|
463
464
|
if (triggerJob) {
|
|
464
|
-
api.triggerEvent(
|
|
465
|
+
api.triggerEvent(
|
|
466
|
+
experienceId,
|
|
467
|
+
compositionId,
|
|
468
|
+
useWorkingCopy,
|
|
469
|
+
fastRender
|
|
470
|
+
)
|
|
465
471
|
.then((resTrigger) => {
|
|
466
472
|
this.setState(
|
|
467
473
|
{
|
|
@@ -577,8 +583,15 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
577
583
|
}
|
|
578
584
|
|
|
579
585
|
private createExperience() {
|
|
580
|
-
const {
|
|
581
|
-
|
|
586
|
+
const {
|
|
587
|
+
storyId,
|
|
588
|
+
onNotification,
|
|
589
|
+
onError,
|
|
590
|
+
api,
|
|
591
|
+
onExperienceCreated,
|
|
592
|
+
useWorkingCopy,
|
|
593
|
+
editor: { fastRender }
|
|
594
|
+
} = this.props;
|
|
582
595
|
|
|
583
596
|
const compId = this.getCompId();
|
|
584
597
|
|
|
@@ -603,7 +616,7 @@ class StoryPreviewer extends React.PureComponent<IStoryPreviewerProps, IStoryPre
|
|
|
603
616
|
onExperienceCreated(resExp);
|
|
604
617
|
}
|
|
605
618
|
|
|
606
|
-
this.getExperience(resExp.id, true, compId, useWorkingCopy);
|
|
619
|
+
this.getExperience(resExp.id, true, compId, useWorkingCopy, fastRender);
|
|
607
620
|
})
|
|
608
621
|
.catch((e) => {
|
|
609
622
|
this.resetState();
|
package/src/services/API.ts
CHANGED
|
@@ -53,7 +53,12 @@ export interface IImposiumAPI {
|
|
|
53
53
|
getExperience(experienceId: string, poll: boolean);
|
|
54
54
|
blockByExperience(experienceId: string);
|
|
55
55
|
getExperienceLog(experienceId: string);
|
|
56
|
-
triggerEvent(
|
|
56
|
+
triggerEvent(
|
|
57
|
+
experienceId: string,
|
|
58
|
+
compositionId?: string,
|
|
59
|
+
useWorkingCopy?: boolean,
|
|
60
|
+
fastRender?: boolean
|
|
61
|
+
);
|
|
57
62
|
getBatches(storyId: string, params?: any);
|
|
58
63
|
getBatch(batchId: string, page: number);
|
|
59
64
|
getBatchProgress(batchId: string);
|
|
@@ -131,7 +136,13 @@ export interface IImposiumAPI {
|
|
|
131
136
|
);
|
|
132
137
|
getDataset(storyId: string, datasetId: string);
|
|
133
138
|
deleteDataset(storyId: string, datasetId: string);
|
|
134
|
-
textToSpeech(
|
|
139
|
+
textToSpeech(options: ITTSOptions);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
interface ITTSOptions {
|
|
143
|
+
text: string;
|
|
144
|
+
voice: string;
|
|
145
|
+
service: string;
|
|
135
146
|
}
|
|
136
147
|
|
|
137
148
|
interface ICancelTokenCache {
|
|
@@ -1088,7 +1099,8 @@ export default class API {
|
|
|
1088
1099
|
public triggerEvent = (
|
|
1089
1100
|
experienceId: string,
|
|
1090
1101
|
compositionId?: string,
|
|
1091
|
-
useWorkingCopy?: boolean
|
|
1102
|
+
useWorkingCopy?: boolean,
|
|
1103
|
+
fastRender?: boolean
|
|
1092
1104
|
): Promise<any | Error> => {
|
|
1093
1105
|
const route = `/experience/${experienceId}/trigger-event`;
|
|
1094
1106
|
|
|
@@ -1100,6 +1112,10 @@ export default class API {
|
|
|
1100
1112
|
formData.append('published', 'false');
|
|
1101
1113
|
}
|
|
1102
1114
|
|
|
1115
|
+
if (fastRender) {
|
|
1116
|
+
formData.append('fastRender', 'true');
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1103
1119
|
return this.doRequest({
|
|
1104
1120
|
method: 'POST',
|
|
1105
1121
|
url: route,
|