Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change description field type to textarea #644

Draft
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions common/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export type MDSQueryParams = {

export type ConfigFieldType =
| 'string'
| 'textArea'
| 'json'
| 'jsonArray'
| 'jsonString'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class CopyIngestProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'tag',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class TextChunkingIngestProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'tag',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class TextEmbeddingIngestProcessor extends Processor {
this.optionalFields = [
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'tag',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export class TextImageEmbeddingIngestProcessor extends Processor {
this.optionalFields = [
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'tag',
Expand Down
2 changes: 1 addition & 1 deletion public/configs/ml_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export abstract class MLProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class CollapseProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'ignore_failure',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class NormalizationProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'tag',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class RerankProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'ignore_failure',
Expand Down
2 changes: 1 addition & 1 deletion public/configs/sort_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export abstract class SortProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'tag',
Expand Down
2 changes: 1 addition & 1 deletion public/configs/split_processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export abstract class SplitProcessor extends Processor {
},
{
id: 'description',
type: 'string',
type: 'textArea',
},
{
id: 'tag',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ export function ConfigFieldList(props: ConfigFieldListProps) {
);
break;
}
case 'textArea': {
el = (
<EuiFlexItem key={idx}>
<TextField
label={camelCaseToTitleString(field.id)}
fieldPath={fieldPath}
showError={true}
textArea={true}
/>
<EuiSpacer size={CONFIG_FIELD_SPACER_SIZE} />
</EuiFlexItem>
);
break;
}
case 'select': {
el = (
<EuiFlexItem key={idx}>
Expand Down
1 change: 1 addition & 0 deletions public/utils/config_to_form_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ function searchIndexConfigToFormik(
export function getInitialValue(fieldType: ConfigFieldType): ConfigFieldValue {
switch (fieldType) {
case 'string':
case 'textArea':
case 'select':
case 'jsonLines': {
return '';
Expand Down
1 change: 1 addition & 0 deletions public/utils/config_to_schema_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ export function getFieldSchema(

switch (field.type) {
case 'string':
case 'textArea':
case 'select': {
baseSchema = defaultStringSchema;
break;
Expand Down
Loading