dbeaver/pro#9614 add predefined param for connection type#4454
dbeaver/pro#9614 add predefined param for connection type#4454devnaumov wants to merge 11 commits into
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 77 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
| return; | ||
| } | ||
|
|
||
| const typeIds: string[] = []; |
There was a problem hiding this comment.
use Set for O(1) search
| } | ||
|
|
||
| override async load(): Promise<void> { | ||
| await this.connectionTypeResource.load(CachedMapAllKey); |
There was a problem hiding this comment.
is it really have to block the loading? why not to do it lazy? plus we don't handle errors here
There was a problem hiding this comment.
Dont understand the question. We need to make sure connection types are loaded as soon as possible
| this.sync( | ||
| sessionResource, | ||
| () => {}, | ||
| () => CachedMapAllKey, | ||
| ); | ||
| } |
There was a problem hiding this comment.
do we really need it?
all connection should already be synced with the app, so we need to only sync with connections themselves
There was a problem hiding this comment.
If sessionResource is outdated, we want connection types to be marked as outdated as well
There was a problem hiding this comment.
why do we want it? Session resource has fields like language, why do we need to mark all connection types as outdated when we change it?
|
|
||
| const context = data.model.dataSource?.executionContext; | ||
| if (context) { | ||
| typeColor = connectionTypeService.getConnectionTypeColor(createConnectionParam(context.projectId, context.connectionId)); |
There was a problem hiding this comment.
why not webapp/packages/core-connections/src/ConnectionType/useConnectionTypeColor.ts ?
| let typeColor: string | undefined; | ||
|
|
||
| if (executionContext) { | ||
| typeColor = connectionTypeService.getConnectionTypeColor(createConnectionParam(executionContext.projectId, executionContext.connectionId)); |
There was a problem hiding this comment.
I believe we should use the hook in tsx components since it's introduced in this PR
| return null; | ||
| } | ||
|
|
||
| const typeColor = connectionTypeService.getConnectionTypeColor(connectionKey); |
There was a problem hiding this comment.
useConnectionTypeColor
| color = connectionType.colorDark; | ||
| } | ||
|
|
||
| color = color ?? connectionType.colorLight; |
There was a problem hiding this comment.
what is this fallback for?
color is already colorLight if we don't have colorDark
closes 9614