@imposium-hub/components 1.41.0 → 1.41.2

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.
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import Button from '../button/Button';
3
3
  import SelectField from '../select-field/SelectField';
4
4
  import HRule from '../h-rule/HRule';
5
- import {ICON_EMAIL, ICON_GLOBE, ICON_HUBSPOT, ICON_PROJECT_DIAGRAM} from '../../constants/icons';
5
+ import {ICON_DOWNLOAD, ICON_EMAIL, ICON_GLOBE, ICON_HUBSPOT, ICON_PROJECT_DIAGRAM} from '../../constants/icons';
6
6
  import {IImposiumAPI} from '../../services/API';
7
7
  import * as copy from '../../constants/copy';
8
8
  import {ASSET_TYPES} from '../../constants/assets';
@@ -34,7 +34,7 @@ interface IPublishWizardProps {
34
34
  createFreshBatch : (e : string) => any;
35
35
  getBatches : () => any;
36
36
  getBatchExport : (batchId : string) => any;
37
- importBatchFromCsv : (storyId : string, batchId : string, batchName : string, csvFile : File, accessKey : string, compId : string) => any;
37
+ importBatchFromCsv : (storyId : string, batchId : string, batchName : string, csvFile : File, accessKey : string, compId : string, addEmbed : boolean, addMedia : boolean) => any;
38
38
  handleNotification? : (n) => void;
39
39
  batchJobs : any;
40
40
  renderBatch : (batchId : string, batchName ? : string) => any;
@@ -307,6 +307,10 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
307
307
  label : <span>{ICON_PROJECT_DIAGRAM}&nbsp;{copy.publish.btnAPI}</span>,
308
308
  onClick: (e) => this.onSelectOption(6)
309
309
  },
310
+ {
311
+ label : <span>{ICON_DOWNLOAD}&nbsp;{copy.publish.btnExport}</span>,
312
+ onClick: (e) => this.onSelectOption(7)
313
+ },
310
314
  ];
311
315
 
312
316
  return (
@@ -375,8 +379,9 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
375
379
  {screenIndex === 0 && this.renderPublish()}
376
380
  {screenIndex === 1 && this.renderDistributionOptions()}
377
381
  {screenIndex === 2 && <WebpageHosted story={story} compositionId={selectedComposition} accessKey={accessKey} />}
378
- {screenIndex === 3 &&
382
+ {(screenIndex === 3 || screenIndex === 7) &&
379
383
  <EmailWorkflow
384
+ isExport = {screenIndex === 7}
380
385
  api={api}
381
386
  story={story}
382
387
  onDone={this.onDoneHandler}
@@ -404,23 +409,6 @@ class PublishWizard extends React.PureComponent<IPublishWizardProps, IPublishWiz
404
409
  />
405
410
  }
406
411
  {screenIndex === 6 && <APIIntegration/>}
407
- {screenIndex === 7 &&
408
- <EmailWorkflow
409
- api={api}
410
- renderBatch={renderBatch}
411
- batchJobs={batchJobs}
412
- story={story}
413
- onDone={this.onDoneHandler}
414
- status={status}
415
- accessKey = {accessKey}
416
- compositionId = {selectedComposition}
417
- compositionName = {compName}
418
- handleError={handleError}
419
- createFreshBatch={createFreshBatch}
420
- getBatches={getBatches}
421
- getBatchExport={getBatchExport}
422
- importBatchFromCsv={importBatchFromCsv}
423
- />}
424
412
  <br/>
425
413
  <HRule/>
426
414
  <div className = 'lower-buttons'>{this.renderLowerButtons()}</div>
@@ -6,14 +6,14 @@ import {BigButton} from '../PublishWizard';
6
6
  import { ExportToCsv } from 'export-to-csv';
7
7
  import { ICON_DOWNLOAD, ICON_UPLOAD } from '../../../constants/icons';
8
8
  import * as moment from 'moment';
9
- import {IImposiumAPI} from '../../../services/API';
9
+ import { IImposiumAPI } from '../../../services/API';
10
10
 
11
11
  interface IEmailWorkflowProps {
12
12
  story : any;
13
13
  createFreshBatch : (e : string) => any;
14
14
  getBatches : () => any;
15
15
  getBatchExport : (batchId : string) => any;
16
- importBatchFromCsv : (storyId : string, batchId : string, batchName : string, csvFile : File, accessKey : string, compId : string, embed : boolean) => any;
16
+ importBatchFromCsv : (storyId : string, batchId : string, batchName : string, csvFile : File, accessKey : string, compId : string, embed : boolean, addMedia : boolean) => any;
17
17
  renderBatch : (batchId : string, batchName : string) => any;
18
18
  status : string;
19
19
  accessKey : string;
@@ -126,7 +126,7 @@ class EmailWorkflow extends React.PureComponent<IEmailWorkflowProps, IEmailWorkf
126
126
 
127
127
  private importBatch({story_id, id, name, uploadEvt}) {
128
128
  const {accessKey, compositionId, isExport, handleError} = this.props;
129
- this.props.importBatchFromCsv(story_id, id, name, uploadEvt.target.files[0], accessKey, compositionId, !isExport)
129
+ this.props.importBatchFromCsv(story_id, id, name, uploadEvt.target.files[0], accessKey, compositionId, !isExport, isExport)
130
130
  .then(() => {
131
131
  this.setState({uploadComplete: true, uploading: false});
132
132
  if (isExport) {
@@ -179,12 +179,12 @@ class EmailWorkflow extends React.PureComponent<IEmailWorkflowProps, IEmailWorkf
179
179
  const {renderedBatch, selectedBatchId, uploading, uploadComplete} = this.state;
180
180
  if (isExport && uploadComplete && !renderedBatch) {
181
181
  return (
182
- <span className={'progress-bar'}>
182
+ <div className={'progress-bar'}>
183
183
  <progress
184
184
  max = {EmailWorkflow.PROGRESS_MAX_VALUE}
185
185
  value = {batchJobs.renders[selectedBatchId]}
186
186
  />
187
- </span>
187
+ </div>
188
188
  );
189
189
  }
190
190
  if (uploading) {
package/constants/copy.ts CHANGED
@@ -150,6 +150,9 @@ export const publish = {
150
150
  // api
151
151
  btnAPI: 'API integration',
152
152
 
153
+ // export
154
+ btnExport: 'Export',
155
+
153
156
  // global
154
157
  btnPublish: 'Publish',
155
158
  btnSkip: 'Skip',