mirror of https://github.com/apache/druid.git
Web console: fix missing value input in timestampSpec step (#7698)
This commit is contained in:
parent
cb6ec2cab8
commit
169d2493bc
|
@ -255,11 +255,12 @@ const TIMESTAMP_SPEC_FORM_FIELDS: Field<TimestampSpec>[] = [
|
|||
{
|
||||
name: 'column',
|
||||
type: 'string',
|
||||
isDefined: (timestampSpec: TimestampSpec) => isColumnTimestampSpec(timestampSpec)
|
||||
defaultValue: 'timestamp'
|
||||
},
|
||||
{
|
||||
name: 'format',
|
||||
type: 'string',
|
||||
defaultValue: 'auto',
|
||||
suggestions: ['auto'].concat(TIMESTAMP_FORMAT_VALUES),
|
||||
isDefined: (timestampSpec: TimestampSpec) => isColumnTimestampSpec(timestampSpec),
|
||||
info: <p>
|
||||
|
@ -269,12 +270,30 @@ const TIMESTAMP_SPEC_FORM_FIELDS: Field<TimestampSpec>[] = [
|
|||
{
|
||||
name: 'missingValue',
|
||||
type: 'string',
|
||||
isDefined: (timestampSpec: TimestampSpec) => !isColumnTimestampSpec(timestampSpec)
|
||||
placeholder: '(optional)',
|
||||
info: <p>
|
||||
This value will be used if the specified column can not be found.
|
||||
</p>
|
||||
}
|
||||
];
|
||||
|
||||
export function getTimestampSpecFormFields() {
|
||||
return TIMESTAMP_SPEC_FORM_FIELDS;
|
||||
const CONSTANT_TIMESTAMP_SPEC_FORM_FIELDS: Field<TimestampSpec>[] = [
|
||||
{
|
||||
name: 'missingValue',
|
||||
label: 'Constant value',
|
||||
type: 'string',
|
||||
info: <p>
|
||||
The dummy value that will be used as the timestamp.
|
||||
</p>
|
||||
}
|
||||
];
|
||||
|
||||
export function getTimestampSpecFormFields(timestampSpec: TimestampSpec) {
|
||||
if (isColumnTimestampSpec(timestampSpec)) {
|
||||
return TIMESTAMP_SPEC_FORM_FIELDS;
|
||||
} else {
|
||||
return CONSTANT_TIMESTAMP_SPEC_FORM_FIELDS;
|
||||
}
|
||||
}
|
||||
|
||||
export function issueWithTimestampSpec(timestampSpec: TimestampSpec | undefined): string | null {
|
||||
|
|
|
@ -1112,7 +1112,7 @@ export class LoadDataView extends React.Component<LoadDataViewProps, LoadDataVie
|
|||
</ButtonGroup>
|
||||
</FormGroup>
|
||||
<AutoForm
|
||||
fields={getTimestampSpecFormFields()}
|
||||
fields={getTimestampSpecFormFields(timestampSpec)}
|
||||
model={timestampSpec}
|
||||
onChange={(timestampSpec) => {
|
||||
this.updateSpec(deepSet(spec, 'dataSchema.parser.parseSpec.timestampSpec', timestampSpec));
|
||||
|
|
Loading…
Reference in New Issue