Skip to content

Commit 4b7474a

Browse files
authored
Merge pull request #2101 from devtron-labs/fix/cluster-terminal-node-issue
chore: cluster terminal node issue fix
2 parents 8868536 + 3d7bb0f commit 4b7474a

File tree

6 files changed

+41
-16
lines changed

6 files changed

+41
-16
lines changed

src/components/ClusterNodes/ClusterTerminal.tsx

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ node-details-full-screen
759759
]
760760

761761
return (
762-
<div className="mr-16">
762+
<div>
763763
<TabGroup tabs={tabs} size={ComponentSizeType.medium} />
764764
</div>
765765
)
@@ -861,14 +861,34 @@ node-details-full-screen
861861

862862
const fullScreenClassWrapper = isFullScreen ? 'cluster-full_screen' : 'cluster-terminal-view-container'
863863

864+
const getNodeGroupOptions = () => {
865+
const nodeGroupOptions = nodeGroups.reduce((acc, group) => {
866+
if (group.label) {
867+
acc.push({
868+
label: group.label,
869+
options: group.options,
870+
})
871+
} else {
872+
const options = group.options.map((option) => ({
873+
label: option.label,
874+
value: option.value,
875+
}))
876+
acc.push(...options) // Flatten the array into the accumulator
877+
}
878+
return acc
879+
}, [])
880+
881+
return nodeGroupOptions
882+
}
883+
864884
const selectionListData: TerminalSelectionListDataType = {
865885
firstRow: [
866886
{
867887
type: TerminalWrapperType.REACT_SELECT,
868888
classNamePrefix: 'cluster-terminal-node',
869889
title: SELECT_TITLE.NODE,
870890
placeholder: 'Select node',
871-
options: nodeGroups,
891+
options: getNodeGroupOptions(),
872892
defaultValue: selectedNodeName,
873893
value: selectedNodeName,
874894
onChange: onChangeNodes,

src/components/app/list-new/AppListService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const getDevtronInstalledHelmApps = (
4141
): Promise<HelmAppListResponse> => {
4242
const baseUrl = Routes.CHART_INSTALLED
4343
const params: GetDevtronHelmAppListParamsType = {
44-
clusterIdsCsv,
44+
clusterIds: clusterIdsCsv,
4545
appStatuses,
4646
}
4747
const url = getUrlWithSearchParams(baseUrl, params)

src/components/app/list-new/AppListType.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ export interface useFilterOptionsProps
194194
| 'isExternalFlux'
195195
> {}
196196

197-
export interface GetDevtronHelmAppListParamsType extends Pick<HelmAppListProps, 'clusterIdsCsv'> {
197+
export interface GetDevtronHelmAppListParamsType {
198198
appStatuses: string
199+
clusterIds: string
199200
}

src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/terminal/TerminalWrapper.component.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function TerminalWrapper({
3232
}: TerminalWrapperProps) {
3333
const firstStrip = () => {
3434
return (
35-
<div className="flex left w-100">
35+
<div className="flex left w-100 dc__gap-10 dc__zi-13">
3636
{selectionListData.firstRow.map((ele) => {
3737
return terminalStripTypeData(ele)
3838
})}
@@ -77,7 +77,7 @@ export default function TerminalWrapper({
7777
<div className={className} data-testid={dataTestId}>
7878
<div className="flex bcn-0 pl-20 h-32 terminal-action-strip dc__zi-11">{firstStrip()}</div>
7979
{selectionListData.secondRow && (
80-
<div className="flex left bcn-0 pl-20 dc__border-top terminal-action-strip">{secondStrip()}</div>
80+
<div className="flex left bcn-0 pl-20 dc__border-top terminal-action-strip dc__gap-12">{secondStrip()}</div>
8181
)}
8282
{typeof selectionListData.tabSwitcher.terminalTabWrapper === 'function'
8383
? selectionListData.tabSwitcher.terminalTabWrapper(renderTerminalView())

src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/terminal/terminal.utils.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const creatableSelectWrapper = (selectData: SelectWrapperType) => {
6060
iconClassName="icon-dim-16 fcn-6"
6161
/>
6262
)}
63-
<div className="cn-6 ml-8 mr-4">{selectData.title}</div>
63+
<div className="cn-6">{selectData.title}</div>
6464
<div>
6565
<CreatableSelect
6666
placeholder={selectData.placeholder}
@@ -126,15 +126,15 @@ const connectionButton = (connectData: ConnectionButtonType) => {
126126
content={connectData.connectTerminal ? 'Disconnect and terminate pod' : 'Connect to terminal'}
127127
>
128128
{connectData.connectTerminal ? (
129-
<span className="flex mr-8">
129+
<span className="flex">
130130
<Disconnect
131131
className="icon-dim-16 mr-4 cursor"
132132
data-testid="node-details-terminal-disconnect"
133133
onClick={connectData.closeTerminalModal}
134134
/>
135135
</span>
136136
) : (
137-
<span className="flex mr-8">
137+
<span className="flex">
138138
<Connect
139139
className="icon-dim-16 mr-4 cursor"
140140
data-testid="node-details-terminal-connect"
@@ -195,19 +195,19 @@ const connectionSwitch = (switchProps: ConnectionSwitchType) => {
195195
}
196196
return (
197197
<>
198-
<span className="bcn-2 mr-8 h-32" style={{ width: '1px' }} />
198+
<span className="bcn-2 h-32" style={{ width: '1px' }} />
199199
<Tippy
200200
className="default-tt cursor"
201201
arrow={false}
202202
placement="bottom"
203203
content={switchProps.toggleButton ? 'Disconnect from pod' : 'Reconnect to pod'}
204204
>
205205
{switchProps.toggleButton ? (
206-
<span className="mr-8 flex" data-testid="disconnect-button">
206+
<span className="flex" data-testid="disconnect-button">
207207
<Stop className="icon-dim-16 fcr-5 mr-4 cursor" onClick={switchProps.stopTerminalConnection} />
208208
</span>
209209
) : (
210-
<span className="mr-8 flex" data-testid="play-button">
210+
<span className="flex" data-testid="play-button">
211211
<Play className="icon-dim-16 fcg-5 mr-4 cursor" onClick={switchProps.resumePodConnection} />
212212
</span>
213213
)}
@@ -222,7 +222,7 @@ const clearTerminal = (clearProps: ClearTerminalType) => {
222222
}
223223
return (
224224
<Tippy className="default-tt" arrow={false} placement="bottom" content="Clear">
225-
<div className="flex mr-8" data-testid={clearProps.dataTestId}>
225+
<div className="flex" data-testid={clearProps.dataTestId}>
226226
<Abort className="icon-dim-16 mr-4 fcn-6 cursor" onClick={clearProps.setTerminalCleared} />
227227
</div>
228228
</Tippy>
@@ -235,7 +235,7 @@ const debugModeToggleButton = (selectData: DebugModeType) => {
235235
}
236236
return (
237237
<>
238-
<span className="bcn-2 mr-8 h-32" style={{ width: '1px' }} />
238+
<span className="bcn-2 h-32" style={{ width: '1px' }} />
239239
{selectData.showInfoTippy && (
240240
<InfoIconTippy
241241
heading="Debug mode"
@@ -247,7 +247,7 @@ const debugModeToggleButton = (selectData: DebugModeType) => {
247247
/>
248248
)}
249249
<span>Debug Mode</span>
250-
<span className="toggle-icon-dim ml-8">
250+
<span className="toggle-icon-dim">
251251
<Toggle onSelect={selectData.onToggle} dataTestId="toggle-debug-mode" selected={selectData.isEnabled} />
252252
</span>
253253
</>
@@ -314,7 +314,7 @@ const manifestEditButtons = ({
314314

315315
return (
316316
<>
317-
<span className="bcn-2 mr-8 h-32" style={{ width: '1px' }} />
317+
<span className="bcn-2 h-32" style={{ width: '1px' }} />
318318
{renderButtons()}
319319
{buttonSelectionState !== EditModeType.NON_EDIT && (
320320
<span

src/css/base.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4419,6 +4419,10 @@ textarea::placeholder {
44194419
z-index: 11;
44204420
}
44214421

4422+
.dc__zi-13 {
4423+
z-index: 13;
4424+
}
4425+
44224426
.dc__zi-20 {
44234427
z-index: 20;
44244428
}

0 commit comments

Comments
 (0)