1111 * or submit itself to any jurisdiction.
1212 */
1313
14+ import spinner from '../../../components/common/spinner.js' ;
1415import { h } from '/js/src/index.js' ;
1516
1617/**
@@ -31,12 +32,14 @@ const exportForm = (exportModel, modalHandler) => {
3132
3233 const fieldsSelected = selectedFields . length > 0 ;
3334
34- const fieldsSelectionHeader1 = h ( 'label.form-check-label.f4.mt1' , { for : '' } , 'Fields' ) ;
35- const fieldsSelectionHeader2 = h (
36- 'label.form-check-label.f6' ,
37- { for : '' } ,
38- 'Select which fields to be exported. (CTRL + click for multiple selection)' ,
39- ) ;
35+ const fieldsSelectionLabels = [
36+ h ( 'label.form-check-label.f4.mt1' , { for : 'fields' } , 'Fields' ) ,
37+ h (
38+ 'label.form-check-label.f6' ,
39+ { for : 'fields' } ,
40+ 'Select which fields to be exported. (CTRL + click for multiple selection)' ,
41+ ) ,
42+ ] ;
4043
4144 const fieldsSelection = h ( 'select#fields.form-control' , {
4245 style : 'min-height: 20rem;' ,
@@ -51,8 +54,10 @@ const exportForm = (exportModel, modalHandler) => {
5154 } , name ) ) ,
5255 ] ) ;
5356
54- const exportTypeSelectionHeader1 = h ( 'label.form-check-label.f4.mt1' , { for : '' } , 'Export type' ) ;
55- const exportTypeSelectionHeader2 = h ( 'label.form-check-label.f6' , { for : '' } , 'Select output format' ) ;
57+ const exportTypeSelectionHeader = [
58+ h ( '.form-check-label.f4.mt1' , 'Export type' ) ,
59+ h ( '.form-check-label.f6' , 'Select output format' ) ,
60+ ] ;
5661
5762 const exportTypeSelect = h ( '.flex-row.g3' , exportTypes . map ( ( exportType ) => {
5863 const id = `runs-export-type-${ exportType } ` ;
@@ -83,18 +88,19 @@ const exportForm = (exportModel, modalHandler) => {
8388
8489 const dataLength = exportModel . items . match ( { Success : ( { length } = { } ) => length , Other : ( ) => null } ) ;
8590 const { totalExistingItemsCount } = exportModel ;
91+
92+ const truncatedDataInfo = dataLength && dataLength < totalExistingItemsCount
93+ ? h (
94+ '#truncated-export-warning.warning' ,
95+ `The data export is limited to ${ dataLength } entries, only the last data will be exported` ,
96+ )
97+ : null ;
98+
8699 return [
87- dataLength && dataLength < totalExistingItemsCount
88- ? h (
89- '#truncated-export-warning.warning' ,
90- `The data export is limited to ${ dataLength } entries, only the last data will be exported` ,
91- )
92- : null ,
93- fieldsSelectionHeader1 ,
94- fieldsSelectionHeader2 ,
100+ dataAvailable ? truncatedDataInfo : spinner ( { size : 2 , absolute : false } ) ,
101+ fieldsSelectionLabels ,
95102 fieldsSelection ,
96- exportTypeSelectionHeader1 ,
97- exportTypeSelectionHeader2 ,
103+ exportTypeSelectionHeader ,
98104 exportTypeSelect ,
99105 exportBtn ,
100106 ] ;
0 commit comments