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

Add login block #1264

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Add login block #1264

merged 1 commit into from
Nov 26, 2024

Conversation

wintonzheng
Copy link
Contributor

@wintonzheng wintonzheng commented Nov 26, 2024

Important

Adds LoginNode component for login workflows, including UI, types, and integration into the workflow system.

  • Behavior:
    • Adds LoginNode component in LoginNode.tsx for login workflows with fields for URL, navigation goal, and credential key.
    • Introduces CredentialParameterSelector in CredentialParameterSelector.tsx for selecting credential parameters.
  • Types:
    • Defines LoginNodeData and LoginNode types in types.ts.
    • Updates WorkflowBlock and BlockYAML types in workflowTypes.ts and workflowYamlTypes.ts to include LoginBlock.
  • Integration:
    • Updates index.ts to include LoginNode in WorkflowBlockNode and nodeTypes.
    • Modifies workflowEditorUtils.ts to handle LoginNode in functions like convertToNode, createNode, and getWorkflowBlock.
    • Adds LoginBlock to nodeLibraryItems in WorkflowNodeLibraryPanel.tsx.

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

…src/'

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Adds `LoginNode` component for login workflows, including UI, types, and integration into the workflow system.
>
>   - **Behavior**:
>     - Adds `LoginNode` component in `LoginNode.tsx` for login workflows with fields for URL, navigation goal, and credential key.
>     - Introduces `CredentialParameterSelector` in `CredentialParameterSelector.tsx` for selecting credential parameters.
>   - **Types**:
>     - Defines `LoginNodeData` and `LoginNode` types in `types.ts`.
>     - Updates `WorkflowBlock` and `BlockYAML` types in `workflowTypes.ts` and `workflowYamlTypes.ts` to include `LoginBlock`.
>   - **Integration**:
>     - Updates `index.ts` to include `LoginNode` in `WorkflowBlockNode` and `nodeTypes`.
>     - Modifies `workflowEditorUtils.ts` to handle `LoginNode` in functions like `convertToNode`, `createNode`, and `getWorkflowBlock`.
>     - Adds `LoginBlock` to `nodeLibraryItems` in `WorkflowNodeLibraryPanel.tsx`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for f8fbafe609950b5693fc09d4bfcaa6415214dcc2. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
Copy link
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.

❌ Changes requested. Incremental review on 5bb522f in 1 minute and 17 seconds

More details
  • Looked at 734 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 7 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/nodes/LoginNode/CredentialParameterSelector.tsx:21
  • Draft comment:
    useId is not suitable for noneItemValue. Consider using a simple string like 'none' instead.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The use of useId is appropriate when a unique identifier is needed, especially in a list of items where uniqueness is important. The comment suggests using a simple string, which might not guarantee uniqueness. Without strong evidence that useId is inappropriate here, the comment seems speculative.
    I might be missing some context about why useId would be inappropriate here. Perhaps there's a specific reason why a simple string would be better, but the comment doesn't provide that reasoning.
    The comment lacks strong evidence or reasoning for why useId is unsuitable. Without additional context or evidence, the suggestion seems speculative.
    The comment should be deleted as it lacks strong evidence and seems speculative about the use of useId.
2. skyvern-frontend/src/routes/workflows/editor/nodes/LoginNode/types.ts:7
  • Draft comment:
    Consider initializing errorCodeMapping as null instead of the string "null" for clarity and consistency.
  • Reason this comment was not posted:
    Marked as duplicate.
3. skyvern-frontend/src/routes/workflows/editor/nodes/LoginNode/types.ts:23
  • Draft comment:
    Consider initializing errorCodeMapping as null instead of the string "null" for clarity and consistency.
  • Reason this comment was not posted:
    Marked as duplicate.
4. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:266
  • Draft comment:
    Consider initializing errorCodeMapping as null instead of the string "null" for clarity and consistency.
  • Reason this comment was not posted:
    Marked as duplicate.
5. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:820
  • Draft comment:
    Consider initializing errorCodeMapping as null instead of the string "null" for clarity and consistency.
  • Reason this comment was not posted:
    Marked as duplicate.
6. skyvern-frontend/src/routes/workflows/types/workflowTypes.ts:269
  • Draft comment:
    Consider initializing errorCodeMapping as null instead of the string "null" for clarity and consistency.
  • Reason this comment was not posted:
    Marked as duplicate.
7. skyvern-frontend/src/routes/workflows/types/workflowYamlTypes.ts:182
  • Draft comment:
    Consider initializing errorCodeMapping as null instead of the string "null" for clarity and consistency.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_rhaanvD6QplXF3CB


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

const [inputs, setInputs] = useState({
url: data.url,
navigationGoal: data.navigationGoal,
errorCodeMapping: data.errorCodeMapping,
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider initializing errorCodeMapping as null instead of the string "null" for clarity and consistency.

Suggested change
errorCodeMapping: data.errorCodeMapping,
errorCodeMapping: data.errorCodeMapping ?? null,

Copy link
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.

❌ Changes requested. Reviewed everything up to 5bb522f in 1 minute and 26 seconds

More details
  • Looked at 734 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. skyvern-frontend/src/routes/workflows/editor/nodes/LoginNode/CredentialParameterSelector.tsx:21
  • Draft comment:
    Using useId for noneItemValue is unnecessary. Consider using a simple string or constant instead.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The use of useId is a common practice to ensure unique identifiers, especially in React components. The comment suggests a simplification, but it doesn't provide strong evidence that the current approach is incorrect or problematic. Without evidence that useId is causing an issue, the comment seems speculative.
    I might be overlooking a simpler solution that achieves the same result without useId. However, the current implementation seems to follow a standard practice for ensuring uniqueness.
    The use of useId is a standard approach in React for generating unique IDs, and without evidence of an issue, the comment's suggestion seems unnecessary.
    The comment does not provide strong evidence that using useId is incorrect or problematic. It seems speculative and not actionable, so it should be deleted.
2. skyvern-frontend/src/routes/workflows/editor/nodes/LoginNode/LoginNode.tsx:47
  • Draft comment:
    Initialize errorCodeMapping with null instead of the string "null" to avoid confusion.
  • Reason this comment was not posted:
    Marked as duplicate.
3. skyvern-frontend/src/routes/workflows/editor/nodes/LoginNode/LoginNode.tsx:245
  • Draft comment:
    Initialize errorCodeMapping with null instead of the string "null" to avoid confusion.
  • Reason this comment was not posted:
    Marked as duplicate.
4. skyvern-frontend/src/routes/workflows/editor/workflowEditorUtils.ts:266
  • Draft comment:
    Initialize errorCodeMapping with null instead of the string "null" to avoid confusion.
  • Reason this comment was not posted:
    Marked as duplicate.

Workflow ID: wflow_SOBCqRdmpKJDY6hq


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

url: "",
navigationGoal:
"If you're not on the login page, navigate to login page and login using the credentials given. First, take actions on promotional popups or cookie prompts that could prevent taking other action on the web page. If you fail to login to find the login page or can't login after several trials, terminate. If login is completed, you're successful. ",
errorCodeMapping: "null",
Copy link
Contributor

Choose a reason for hiding this comment

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

Initialize errorCodeMapping with null instead of the string "null" to avoid confusion.

Suggested change
errorCodeMapping: "null",
errorCodeMapping: null,

@msalihaltun msalihaltun merged commit 1de4df2 into main Nov 26, 2024
2 checks passed
@msalihaltun msalihaltun deleted the salih/login-block branch November 26, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants