refactor: sort json before exporting and add tags to flows (#6849)
* feat: Enhance flow download with recursive JSON sorting - Add `sortJsonStructure` function to recursively sort object keys and array elements - Improve `downloadFlow` function to create deterministic JSON output - Add error handling for flow download process - Ensure consistent and predictable JSON file generation * feat: Include flow tags in export modal payload Add `tags` to the export modal payload to ensure comprehensive flow metadata is preserved during export * 📝 (model.py): Add tags field to FlowRead and FlowHeader models for better organization and categorization of flows ✨ (use-post-add-flow.ts): Add support for adding tags to a new flow in the frontend ✨ (exportModal/index.tsx): Include tags when exporting a flow in the export modal ♻️ (index.tsx): Refactor ListComponent to remove unnecessary comments and improve code readability 🔧 (reactflowUtils.ts): Update createNewFlow function to include tags field when creating a new flow * style: add blank line --------- Co-authored-by: cristhianzl <cristhian.lousa@gmail.com> Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
This commit is contained in:
parent
1cc49962d5
commit
e5f654a752
5 changed files with 66 additions and 24 deletions
|
|
@ -200,6 +200,7 @@ class FlowRead(FlowBase):
|
|||
id: UUID
|
||||
user_id: UUID | None = Field()
|
||||
folder_id: UUID | None = Field()
|
||||
tags: list[str] | None = Field(None, description="The tags of the flow")
|
||||
|
||||
|
||||
class FlowHeader(BaseModel):
|
||||
|
|
@ -215,6 +216,7 @@ class FlowHeader(BaseModel):
|
|||
endpoint_name: str | None = Field(None, description="The name of the endpoint associated with this flow")
|
||||
description: str | None = Field(None, description="A description of the flow")
|
||||
data: dict | None = Field(None, description="The data of the component, if is_component is True")
|
||||
tags: list[str] | None = Field(None, description="The tags of the flow")
|
||||
|
||||
@field_validator("data", mode="before")
|
||||
@classmethod
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue