Skip to content

Commit

Permalink
feat(input_schema): storage editor types (#476)
Browse files Browse the repository at this point in the history
This PR introduce new input schema `editor` values for `string`
property:
`dataset`, `keyValueStore` and `requestQueue` based on issue:
apify/apify-core#12871

The editor will show storage inputs enabling users to search and select
storage, then the storage id is taken as field value.
Input PR waiting for this:
apify/apify-core#17521
Docs PR: apify/apify-docs#1211
  • Loading branch information
MFori authored Sep 13, 2024
1 parent 8a492ec commit c9a4a9d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/input_schema/src/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"title": { "type": "string" },
"description": { "type": "string" },
"nullable": { "type": "boolean" },
"editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "hidden"] },
"editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "hidden", "dataset", "keyValueStore", "requestQueue"] },
"isSecret": { "type": "boolean" }
},
"required": ["type", "title", "description", "editor"],
Expand All @@ -112,7 +112,7 @@
"nullable": { "type": "boolean" },
"minLength": { "type": "integer" },
"maxLength": { "type": "integer" },
"editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "hidden"] },
"editor": { "enum": ["javascript", "python", "textfield", "textarea", "datepicker", "hidden", "dataset", "keyValueStore", "requestQueue"] },
"isSecret": { "type": "boolean" },
"sectionCaption": { "type": "string" },
"sectionDescription": { "type": "string" }
Expand Down
2 changes: 1 addition & 1 deletion packages/input_schema/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type CommonFieldDefinition<T> = {

export type StringFieldDefinition = CommonFieldDefinition<string> & {
type: 'string'
editor: 'textfield' | 'textarea' | 'javascript' | 'python' | 'select' | 'datepicker' | 'hidden' | 'json';
editor: 'textfield' | 'textarea' | 'javascript' | 'python' | 'select' | 'datepicker' | 'hidden' | 'json' | 'dataset' | 'keyValueStore' | 'requestQueue';
pattern?: string;
minLength?: number;
maxLength?: number;
Expand Down
2 changes: 1 addition & 1 deletion test/input_schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('input_schema.json', () => {

expect(() => validateInputSchema(validator, schema)).toThrow(
'Input schema is not valid (Field schema.properties.myField.editor must be equal to one of the allowed values: '
+ '"javascript", "python", "textfield", "textarea", "datepicker", "hidden")',
+ '"javascript", "python", "textfield", "textarea", "datepicker", "hidden", "dataset", "keyValueStore", "requestQueue")',
);
});

Expand Down

0 comments on commit c9a4a9d

Please sign in to comment.