Skip to content

fix: Clicking on the website data source cannot open the data source settings interface#4446

Merged
shaohuzhang1 merged 1 commit intov2from
pr@v2@fix_workflow_debug
Dec 5, 2025
Merged

fix: Clicking on the website data source cannot open the data source settings interface#4446
shaohuzhang1 merged 1 commit intov2from
pr@v2@fix_workflow_debug

Conversation

@shaohuzhang1
Copy link
Copy Markdown
Contributor

fix: Clicking on the website data source cannot open the data source settings interface

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Dec 5, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link
Copy Markdown

f2c-ci-robot bot commented Dec 5, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

}
node_id = n
? [WorkflowType.DataSourceLocalNode, WorkflowType.DataSourceWebNode].includes(n.type)
? n.type
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The provided code snippet seems mostly correct for its purpose, but there is one suggestion for improvement:

if (n !== undefined && n.properties.node_data && n.properties.node_data.tool_lib_id) {
  extra.value.current_tool_id = n.properties.node_data.tool_lib_id;
}

In JavaScript/TypeScript, undefined cannot be used directly to check for truthiness due to coercion rules. Using strict equality checks (!==) or ensuring that n is defined prevents unnecessary comparisons with other falsy values. This change improves clarity and correctness.

Here's the optimized version of the function:

const sourceChange = (node_id: string) => {
  base_form_data.value.node_id = node_id
  const n = source_node_list.value.find((n: any) => n.id === node_id);
  if (n && n.properties.node_data?.tool_lib_id) {
    extra.value.current_tool_id = n.properties.node_data.tool_lib_id;
  }
  // ... rest of the original function ...
};

This modification adds a conditional check before accessing n.type after filtering source_node_list. The use of optional chaining operator (?.) makes the expression safer by avoiding errors when n.properties.node_data is not available.

@shaohuzhang1 shaohuzhang1 merged commit 3a7818d into v2 Dec 5, 2025
3 of 6 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@v2@fix_workflow_debug branch December 5, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant