Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/YDBDefinitionList/YDBDefinitionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function YDBDefinitionList({
{...restProps}
>
{items.map((item) => (
<DefinitionList.Item key={item.name} {...item} />
<DefinitionList.Item key={item.name} children={item.content} {...item} />
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

[nitpick] Explicitly setting the children prop alongside spreading {...item} could lead to conflicts if item also contains a children property. The explicit children={item.content} will override any children in the spread, but this pattern can be confusing. Consider using content={item.content} if the component supports it, or ensure the prop precedence is intentional.

Suggested change
<DefinitionList.Item key={item.name} children={item.content} {...item} />
<DefinitionList.Item key={item.name} name={item.name} copyText={item.copyText}>
{item.content}
</DefinitionList.Item>

Copilot uses AI. Check for mistakes.
))}
</DefinitionList>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export function Credentials({connection}: CredentialsProps) {
}

if ('OAuthToken' in connection) {
return 'OAuth';
return connection.OAuthToken !== undefined &&
('Token' in connection.OAuthToken || 'TokenSecretName' in connection.OAuthToken)
? 'OAuth'
: '';
Comment on lines +23 to +26
Copy link

Copilot AI Aug 7, 2025

Choose a reason for hiding this comment

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

[nitpick] The complex conditional logic spread across multiple lines reduces readability. Consider extracting this validation into a helper function like hasValidOAuthToken(connection.OAuthToken) to improve maintainability and make the intent clearer.

Suggested change
return connection.OAuthToken !== undefined &&
('Token' in connection.OAuthToken || 'TokenSecretName' in connection.OAuthToken)
? 'OAuth'
: '';
return hasValidOAuthToken(connection.OAuthToken) ? 'OAuth' : '';

Copilot uses AI. Check for mistakes.
}

return 'unknown';
Expand Down
Loading