Skip to content
Snippets Groups Projects
Commit a7502e9a authored by piotr.kupczyk@id.ethz.ch's avatar piotr.kupczyk@id.ethz.ch
Browse files

SSDM-13463 : Export selection of fields from tables - UI part - change export options

parent e49a2118
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
......@@ -115,6 +115,7 @@ const keys = {
HOUR_OR_HOURS: 'HOUR_OR_HOURS',
IGNORE_EXISTING: 'IGNORE_EXISTING',
IMPORT: 'IMPORT',
IMPORT_COMPATIBLE: 'IMPORT_COMPATIBLE',
IMPORT_SUCCEEDED: 'IMPORT_SUCCEEDED',
IMPORT_FAILED: 'IMPORT_FAILED',
IMPORT_FILE: 'IMPORT_FILE',
......@@ -409,6 +410,7 @@ const messages_en = {
[keys.HOUR_OR_HOURS]: '${0} hour(s)',
[keys.IGNORE_EXISTING]: 'Ignore if exists',
[keys.IMPORT]: 'Import',
[keys.IMPORT_COMPATIBLE]: 'Import Compatible',
[keys.IMPORT_SUCCEEDED]: 'Successfully imported data.',
[keys.IMPORT_FAILED]: 'Import failed.',
[keys.IMPORT_FILE]: 'XLS or ZIP File',
......
......@@ -5,6 +5,10 @@ const TYPES_CONTENT = 'TYPES'
const VOCABULARIES_CONTENT = 'VOCABULARIES'
const ENTITIES_CONTENT = 'ENTITIES'
const IMPORT_COMPATIBLE_YES = 'YES'
const IMPORT_COMPATIBLE_NO = 'NO'
const IMPORT_COMPATIBLE_OPTIONS = [IMPORT_COMPATIBLE_YES, IMPORT_COMPATIBLE_NO]
const ALL_COLUMNS = 'ALL_COLUMNS'
const VISIBLE_COLUMNS = 'VISIBLE_COLUMNS'
const COLUMNS_OPTIONS = [ALL_COLUMNS, VISIBLE_COLUMNS]
......@@ -24,14 +28,17 @@ export default {
TYPES_CONTENT,
VOCABULARIES_CONTENT,
ENTITIES_CONTENT,
IMPORT_COMPATIBLE_OPTIONS,
IMPORT_COMPATIBLE_YES,
IMPORT_COMPATIBLE_NO,
COLUMNS_OPTIONS,
ROWS_OPTIONS,
VALUES_OPTIONS,
ALL_COLUMNS,
VISIBLE_COLUMNS,
ROWS_OPTIONS,
ALL_PAGES,
CURRENT_PAGE,
SELECTED_ROWS,
VALUES_OPTIONS,
PLAIN_TEXT,
RICH_TEXT
}
......@@ -109,16 +109,18 @@ class GridExports extends React.PureComponent {
})
}
const isXLSExport =
exportable.fileFormat === GridExportOptions.XLS_FILE_FORMAT
const isTSVExport =
exportable.fileFormat === GridExportOptions.TSV_FILE_FORMAT
const isXLSEntityExport =
exportable.fileFormat === GridExportOptions.XLS_FILE_FORMAT &&
isXLSExport &&
exportable.fileContent === GridExportOptions.ENTITIES_CONTENT
const isXLSTypesExport =
exportable.fileFormat === GridExportOptions.XLS_FILE_FORMAT &&
exportable.fileContent === GridExportOptions.TYPES_CONTENT
isXLSExport && exportable.fileContent === GridExportOptions.TYPES_CONTENT
return (
<div className={classes.container}>
......@@ -146,27 +148,48 @@ class GridExports extends React.PureComponent {
>
<Container square={true} className={classes.popup}>
<div>
{(isTSVExport || isXLSEntityExport) && (
{isXLSExport && (
<div className={classes.field}>
<SelectField
label={messages.get(messages.COLUMNS)}
name='columns'
label={messages.get(messages.IMPORT_COMPATIBLE)}
name='importCompatible'
mandatory={true}
emptyOption={{}}
options={[
{
label: messages.get(messages.ALL_COLUMNS),
value: GridExportOptions.ALL_COLUMNS
label: messages.get(messages.YES),
value: GridExportOptions.IMPORT_COMPATIBLE_YES
},
{
label: messages.get(messages.VISIBLE_COLUMNS),
value: GridExportOptions.VISIBLE_COLUMNS
label: messages.get(messages.NO),
value: GridExportOptions.IMPORT_COMPATIBLE_NO
}
]}
value={exportOptions.columns}
value={exportOptions.importCompatible}
variant='standard'
onChange={this.handleChange}
/>
</div>
)}
<div className={classes.field}>
<SelectField
label={messages.get(messages.COLUMNS)}
name='columns'
options={[
{
label: messages.get(messages.ALL_COLUMNS),
value: GridExportOptions.ALL_COLUMNS
},
{
label: messages.get(messages.VISIBLE_COLUMNS),
value: GridExportOptions.VISIBLE_COLUMNS
}
]}
value={exportOptions.columns}
variant='standard'
onChange={this.handleChange}
/>
</div>
<div className={classes.field}>
<SelectField
label={messages.get(messages.ROWS)}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment