Skip to content

Refactor/fe types#45

Merged
srijanpatel merged 2 commits intomainfrom
refactor/fe-types
Dec 12, 2024
Merged

Refactor/fe types#45
srijanpatel merged 2 commits intomainfrom
refactor/fe-types

Conversation

@srijanpatel
Copy link
Copy Markdown
Collaborator

@srijanpatel srijanpatel commented Dec 12, 2024

Fix TS types, bottom-up. From API responses to components.


Important

Refactor TypeScript types in Dashboard.tsx and api.ts to use WorkflowResponse and WorkflowCreateRequest, ensuring type consistency across components and API functions.

  • Type Changes:
    • Replace Workflow with WorkflowResponse in Dashboard.tsx and api.ts.
    • Replace WorkflowDefinition with WorkflowCreateRequest in Dashboard.tsx and api.ts.
    • Remove Workflow and related interfaces from workflow.ts.
  • API Function Updates:
    • Update return types in api.ts for functions like getWorkflows, createWorkflow, updateWorkflow, duplicateWorkflow, etc., to use WorkflowResponse.
    • Update parameter types in api.ts for functions like createWorkflow, updateWorkflow, etc., to use WorkflowCreateRequest.
  • Component Updates:
    • Update state and function parameters in Dashboard.tsx to use WorkflowResponse instead of Workflow.

This description was created by Ellipsis for ab77052. It will automatically update as commits are pushed.

@srijanpatel srijanpatel merged commit f9ad446 into main Dec 12, 2024
Copy link
Copy Markdown
Contributor

@ellipsis-dev ellipsis-dev Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Reviewed everything up to ab77052 in 23 seconds

More details
  • Looked at 431 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. frontend/src/components/Dashboard.tsx:44
  • Draft comment:
    The use of as WorkflowResponse[] is unnecessary here since getWorkflows already returns a Promise<WorkflowResponse[]>.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The use of as for type casting is unnecessary here since the function getWorkflows already returns a Promise<WorkflowResponse[]>.
2. frontend/src/components/Dashboard.tsx:292
  • Draft comment:
    The key property should be workflow.id instead of workflow.key to match the WorkflowResponse type.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The key property in the TableRow component should be workflow.id instead of workflow.key to match the WorkflowResponse type.
3. frontend/src/components/Dashboard.tsx:121
  • Draft comment:
    The WorkflowCreateRequest interface has an optional definition property, but the code assumes it is always present. Ensure definition is defined before accessing its properties.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The WorkflowCreateRequest interface has an optional definition property, but the code assumes it is always present. This could lead to runtime errors if definition is undefined.
4. frontend/src/components/Dashboard.tsx:161
  • Draft comment:
    The WorkflowCreateRequest interface has an optional definition property, but the code assumes it is always present. Ensure definition is defined before accessing its properties.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The WorkflowCreateRequest interface has an optional definition property, but the code assumes it is always present. This could lead to runtime errors if definition is undefined.
5. frontend/src/utils/api.ts:132
  • Draft comment:
    The WorkflowCreateRequest interface has an optional definition property, but the code assumes it is always present. Ensure definition is defined before accessing its properties.
  • Reason this comment was not posted:
    Confidence changes required: 50%
    The WorkflowCreateRequest interface has an optional definition property, but the code assumes it is always present. This could lead to runtime errors if definition is undefined.

Workflow ID: wflow_cxBbXHod0S4DvCSh


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@srijanpatel srijanpatel deleted the refactor/fe-types branch December 12, 2024 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant