add tool plugin param type date and date-picker#36163
Open
zyqzyq wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
Fixes #<issue number>.Fixes #36162
Summary
This change adds first-class support for
dateanddate-pickertool/plugin parameter types end to end: schema normalization, backend typing/casting, workflow UI (tool node, variable picker, constant field, trigger form), plugin reasoning configuration, and i18n. Values fordateare handled as a single calendar day (string);date-pickerrepresents an optional start/end range serialized as a JSON string/object consistent with backend casting.Backend
CommonParameterTypewithDATEandDATE_PICKER(api/core/entities/parameter_entities.py).PluginParameterType/ToolParameterTypeandcast_parameter_value/as_normal_typelogic fordateanddate-picker(api/core/plugin/entities/parameters.py,api/core/tools/entities/tool_entities.py).date-pickercasting edge cases (api/tests/unit_tests/core/entities/test_entities_parameter_entities.py).Frontend
FormTypeEnum.dateandFormTypeEnum.datePicker(declarations.ts) and schema mapping into-form-schema.ts(including aliases such asdatepicker→date-picker).toolDeclarativeTypeMatchesinform-input-item.helpers.ts(used by form input, variable picker, reasoning config, and input variable list).form-input-item.tsxrenders a native date input fordateandToolDateRangePickerfordate-picker(timezone from app context).constant-field.tsx,input-var-list.tsx,tool-form/item.tsx, andtrigger-plugin/.../trigger-form/item.tsxupdated for labels, tooltips, and picker behavior.var-reference-picker.tsx/var-reference-picker.trigger.tsxforce constant mode fordate-pickerand hide the mixed constant/variable type switch where inappropriate.reasoning-config-form.tsx+reasoning-config-form.helpers.tsaligned with the same types, filters, andToolDateRangePicker.tool-date-range-picker.tsx,tool-date-range-value.ts(parse/stringify range payload);cnfrom@langgenius/dify-ui/cnfor bundler compatibility.nodes.tool.dateRange.*inweb/i18n/en-US/workflow.jsonandweb/i18n/zh-Hans/workflow.json.form-input-item.helpers.spec.ts,reasoning-config-form.helpers.spec.tsfor declarative matching and date / date-picker behavior.Screenshots
date/date-pickerin provider YAML were not rendered with dedicated controls in the workflow tool node and related pickers.(Replace the table cells with embedded images if you attach screenshots in the PR.)
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint gods