@@ -51,6 +51,7 @@ class ReportingConfigForm extends React.Component {
5151 active : this . props . config ? this . props . config . active : false ,
5252 enableCompression : this . props . config ? this . props . config . enableCompression : true ,
5353 submitState : SUBMIT_STATES . DEFAULT ,
54+ includeDate : this . props . config ? this . props . config . includeDate : true ,
5455 } ;
5556
5657 /**
@@ -127,6 +128,7 @@ class ReportingConfigForm extends React.Component {
127128 let requiredFields = [ ] ;
128129 formData . append ( 'active' , this . state . active ) ;
129130 formData . append ( 'enableCompression' , this . state . enableCompression ) ;
131+ formData . append ( 'includeDate' , this . state . includeDate ) ;
130132 if ( formData . get ( 'deliveryMethod' ) === 'email' ) {
131133 requiredFields = config ? [ ...REQUIRED_EMAIL_FIELDS ] : [ ...REQUIRED_NEW_EMAIL_FIELDS ] ;
132134 // transform email field to match what the api is looking for
@@ -257,6 +259,7 @@ class ReportingConfigForm extends React.Component {
257259 active,
258260 enableCompression,
259261 submitState,
262+ includeDate,
260263 } = this . state ;
261264 const selectedCatalogs = ( config ?. enterpriseCustomerCatalogs || [ ] ) . map ( item => item . uuid ) ;
262265 const dataTypesOptions = reportingConfigTypes . dataType . map ( ( item , index ) => ( {
@@ -456,65 +459,83 @@ class ReportingConfigForm extends React.Component {
456459 handleBlur = { this . handleBlur }
457460 />
458461 ) }
459- < div className = "col" >
460- < Form . Group
461- isInvalid = { ! ! APIErrors . enableCompression }
462+ < Form . Group
463+ isInvalid = { ! ! APIErrors . enableCompression }
464+ >
465+ < Form . Label >
466+ < FormattedMessage
467+ id = "admin.portal.reporting.config.enable.compression"
468+ defaultMessage = "Enable Compression"
469+ description = "Label for the Enable Compression field in the reporting configuration form"
470+ />
471+ </ Form . Label >
472+ < Form . Checkbox
473+ data-testid = "compressionCheckbox"
474+ className = "ml-3"
475+ checked = { enableCompression }
476+ onChange = { ( ) => this . setState ( prevState => ( { enableCompression : ! prevState . enableCompression } ) ) }
477+ />
478+ < Form . Text >
479+ < FormattedMessage
480+ id = "admin.portal.reporting.config.enable.compression.help"
481+ defaultMessage = "Specifies whether report should be compressed. Without compression files will not be password protected or encrypted."
482+ description = "Help text for the Enable Compression field in the reporting configuration form"
483+ />
484+ </ Form . Text >
485+ { ! ! APIErrors . enableCompression && (
486+ < Form . Control . Feedback type = "invalid" >
487+ { APIErrors . enableCompression }
488+ </ Form . Control . Feedback >
489+ ) }
490+ </ Form . Group >
491+ < Form . Group >
492+ < Form . Label >
493+ < FormattedMessage
494+ id = "admin.portal.reporting.config.include.date"
495+ defaultMessage = "Include Date"
496+ description = "Label for the Include Date field in the reporting configuration form"
497+ />
498+ </ Form . Label >
499+ < Form . Checkbox
500+ data-testid = "includeDateCheckbox"
501+ className = "ml-3"
502+ checked = { includeDate }
503+ onChange = { ( ) => this . setState ( prevState => ( { includeDate : ! prevState . includeDate } ) ) }
504+ />
505+ < Form . Text >
506+ < FormattedMessage
507+ id = "admin.portal.reporting.config.include.date.option.help"
508+ defaultMessage = "Specifies whether the report's filename should include the date."
509+ description = "Help text for the Include Date field in the reporting configuration form"
510+ />
511+ </ Form . Text >
512+ </ Form . Group >
513+ < Form . Group controlId = "enterpriseCustomerCatalogs" >
514+ < Form . Label >
515+ < FormattedMessage
516+ id = "admin.portal.reporting.config.enterprise.customer.catalogs"
517+ defaultMessage = "Enterprise Customer Catalogs"
518+ description = "Label for the Enterprise Customer Catalogs field in the reporting configuration form"
519+ />
520+ </ Form . Label >
521+ < Form . Control
522+ as = "select"
523+ name = "enterpriseCustomerCatalogUuids"
524+ multiple
525+ defaultValue = { selectedCatalogs }
462526 >
463- < Form . Label >
464- < FormattedMessage
465- id = "admin.portal.reporting.config.enable.compression"
466- defaultMessage = "Enable Compression"
467- description = "Label for the Enable Compression field in the reporting configuration form"
468- />
469- </ Form . Label >
470- < Form . Checkbox
471- data-testid = "compressionCheckbox"
472- className = "ml-3"
473- checked = { enableCompression }
474- onChange = { ( ) => this . setState ( prevState => ( { enableCompression : ! prevState . enableCompression } ) ) }
527+ { availableCatalogs && ( availableCatalogs . map ( ( item ) => (
528+ < option key = { item . uuid } value = { item . uuid } > Catalog { item . title } with UUID { item . uuid } </ option >
529+ ) ) ) }
530+ </ Form . Control >
531+ < Form . Text >
532+ < FormattedMessage
533+ id = "admin.portal.reporting.config.enterprise.customer.catalogs.help"
534+ defaultMessage = "The catalogs that should be included in the report. No selection means all catalogs will be included."
535+ description = "Help text for the Enterprise Customer Catalogs field in the reporting configuration form"
475536 />
476- < Form . Text >
477- < FormattedMessage
478- id = "admin.portal.reporting.config.enable.compression.help"
479- defaultMessage = "Specifies whether report should be compressed. Without compression files will not be password protected or encrypted."
480- description = "Help text for the Enable Compression field in the reporting configuration form"
481- />
482- </ Form . Text >
483- { ! ! APIErrors . enableCompression && (
484- < Form . Control . Feedback type = "invalid" >
485- { APIErrors . enableCompression }
486- </ Form . Control . Feedback >
487- ) }
488- </ Form . Group >
489- </ div >
490- < div className = "col" >
491- < Form . Group controlId = "enterpriseCustomerCatalogs" >
492- < Form . Label >
493- < FormattedMessage
494- id = "admin.portal.reporting.config.enterprise.customer.catalogs"
495- defaultMessage = "Enterprise Customer Catalogs"
496- description = "Label for the Enterprise Customer Catalogs field in the reporting configuration form"
497- />
498- </ Form . Label >
499- < Form . Control
500- as = "select"
501- name = "enterpriseCustomerCatalogUuids"
502- multiple
503- defaultValue = { selectedCatalogs }
504- >
505- { availableCatalogs && ( availableCatalogs . map ( ( item ) => (
506- < option key = { item . uuid } value = { item . uuid } > Catalog { item . title } with UUID { item . uuid } </ option >
507- ) ) ) }
508- </ Form . Control >
509- < Form . Text >
510- < FormattedMessage
511- id = "admin.portal.reporting.config.enterprise.customer.catalogs.help"
512- defaultMessage = "The catalogs that should be included in the report. No selection means all catalogs will be included."
513- description = "Help text for the Enterprise Customer Catalogs field in the reporting configuration form"
514- />
515- </ Form . Text >
516- </ Form . Group >
517- </ div >
537+ </ Form . Text >
538+ </ Form . Group >
518539 < div className = "row justify-content-between align-items-center form-group" >
519540 < Form . Group
520541 className = "mb-0"
@@ -596,6 +617,7 @@ ReportingConfigForm.propTypes = {
596617 config : PropTypes . shape ( {
597618 active : PropTypes . bool ,
598619 enableCompression : PropTypes . bool ,
620+ includeDate : PropTypes . bool ,
599621 dataType : PropTypes . string ,
600622 dayOfMonth : PropTypes . number ,
601623 dayOfWeek : PropTypes . number ,
0 commit comments