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 .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v22
v24.14.1
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
"version": "1.23.4-pre-2",
"version": "1.23.5-pre-1",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
Expand Down
4 changes: 2 additions & 2 deletions src/Common/ClipboardButton/ClipboardButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const ClipboardButton = ({
size,
}: ClipboardProps) => {
const [copied, setCopied] = useState<boolean>(false)
const setCopiedFalseTimeoutRef = useRef<ReturnType<typeof setTimeout>>(-1)
const setCopiedFalseTimeoutRef = useRef<ReturnType<typeof setTimeout> | number>(-1)

const handleTriggerCopy = () => {
setCopied(true)
Expand Down Expand Up @@ -90,7 +90,7 @@ export const ClipboardButton = ({

useEffect(
() => () => {
if (setCopiedFalseTimeoutRef.current > -1) {
if ((setCopiedFalseTimeoutRef.current as number) > -1) {
clearTimeout(setCopiedFalseTimeoutRef.current)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const UseRegisterShortcutProvider = ({
const disableShortcutsRef = useRef<boolean>(false)
const shortcutsRef = useRef<Record<string, ShortcutType>>({})
const keysDownRef = useRef<Set<Uppercase<string>>>(new Set())
const keyDownTimeoutRef = useRef<ReturnType<typeof setTimeout>>(-1)
const keyDownTimeoutRef = useRef<ReturnType<typeof setTimeout> | number>(-1)
const ignoredTags = ignoreTags ?? IGNORE_TAGS_FALLBACK

const registerShortcut: UseRegisterShortcutContextType['registerShortcut'] = useCallback(
Expand Down Expand Up @@ -113,7 +113,7 @@ const UseRegisterShortcutProvider = ({

keysDownRef.current.clear()

if (keyDownTimeoutRef.current > -1) {
if ((keyDownTimeoutRef.current as number) > -1) {
clearTimeout(keyDownTimeoutRef.current)
keyDownTimeoutRef.current = -1
}
Expand Down Expand Up @@ -178,7 +178,7 @@ const UseRegisterShortcutProvider = ({
window.removeEventListener('keyup', handleKeyupEvent)
window.removeEventListener('blur', handleBlur)

if (keyDownTimeoutRef.current > -1) {
if ((keyDownTimeoutRef.current as number) > -1) {
clearTimeout(keyDownTimeoutRef.current)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ const BulkOperations = ({
try {
setApiCallInProgress(true)

let timeout = -1
let timeout: ReturnType<typeof setTimeout> | number = -1

const triggerUpdate = () => {
if (timeout >= 0) {
if ((timeout as number) >= 0) {
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const createTooltip = (view: EditorView): Tooltip => {
// Plugin to show and remove tooltip on keypress
const keypressTooltipPlugin = ViewPlugin.fromClass(
class {
private timeoutId: number | null = null
private timeoutId: ReturnType<typeof setTimeout> | number | null = null

constructor(public view: EditorView) {
this.view.dom.addEventListener('keydown', this.handleKeyPress)
Expand Down
2 changes: 1 addition & 1 deletion src/Shared/Components/Table/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ export type ConfigurableColumnsConfigType<
> = Record<string, ConfigurableColumnsType<RowData, FilterVariant, AdditionalProps>['visibleColumns']>

export interface GetFilteringPromiseProps<RowData extends unknown> {
searchSortTimeoutRef: React.MutableRefObject<number>
searchSortTimeoutRef: React.MutableRefObject<ReturnType<typeof setTimeout> | number>
callback: () => Promise<RowsType<RowData>> | RowsType<RowData>
}

Expand Down
33 changes: 23 additions & 10 deletions src/Shared/Store/IndexStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,20 +116,33 @@ export function getiNodesByRootNodeWithChildNodes(
})
})

// Add containers to Pod type nodes
// Add init containers and containers to Pod type nodes
children
.filter((_child) => _child.kind.toLowerCase() == Nodes.Pod.toLowerCase())
.map((_pn) => {
const podMeta = (podMetadata || _appDetailsSubject.getValue().resourceTree?.podMetadata)?.filter(
(_pmd) => _pmd.uid === _pn.uid,
)[0]

const initNodes: iNode[] = (podMeta?.initContainers || []).map((_c: string) => {
const initNode = {} as iNode
initNode.kind = Nodes.Containers
initNode.name = _c
initNode.pNode = _pn
initNode.isInitContainer = true
return initNode
})

const containerNodes: iNode[] = (podMeta?.containers || []).map((_c: string) => {
const childNode = {} as iNode
childNode.kind = Nodes.Containers
childNode.name = _c
childNode.pNode = _pn
return childNode
})

// eslint-disable-next-line no-param-reassign
_pn.childNodes = (podMetadata || _appDetailsSubject.getValue().resourceTree?.podMetadata)
?.filter((_pmd) => _pmd.uid === _pn.uid)[0]
?.containers?.map((_c) => {
const childNode = {} as iNode
childNode.kind = Nodes.Containers
childNode.pNode = _pn
childNode.name = _c
return childNode
})
_pn.childNodes = [...initNodes, ...containerNodes]
})
children = children.flatMap((_node) => _node.childNodes ?? [])
}
Expand Down
2 changes: 2 additions & 0 deletions src/Shared/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ export interface iNode extends Node {
type: NodeType
status: string
pNode?: iNode
/** Marks a node as an init container, used for display purposes in the resource tree. */
isInitContainer?: boolean
}

export interface HelmReleaseStatus {
Expand Down
Loading