Skip to content

Commit e19cf7f

Browse files
committed
Merge branch 'main' into fix-deployment-stage-logs
2 parents 4064e90 + 2bf2679 commit e19cf7f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2271
-7
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ HIDE_EXCLUDE_INCLUDE_GIT_COMMITS=true
3131
ENABLE_BUILD_CONTEXT=false
3232
CLAIR_TOOL_VERSION=
3333
ENABLE_RESTART_WORKLOAD=false
34+
ENABLE_SCOPED_VARIABLES=false
Lines changed: 6 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/components/ClusterNodes/NodeDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ export default function NodeDetails({
642642
const _url = `${URLS.RESOURCE_BROWSER}/${clusterId}/${namespace}/pod/${_group}/${name}${
643643
tab ? `/${tab.toLowerCase()}` : ''
644644
}`
645-
const isAdded = addTab(_group, 'pod', name, _url)
645+
const isAdded = addTab(`${_group}_${namespace}`, 'pod', name, _url)
646646
if (isAdded) {
647647
updateNodeSelectionData(_nodeSelectionData, _group)
648648
push(_url)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import React from 'react'
2+
import { GridProps } from './types'
3+
4+
// This is meant to be a reusable component that will provide a grid like dynamic layout where xs is the number of columns out of 12 that the item will take up
5+
export default function Grid({
6+
container,
7+
spacing = 0,
8+
item,
9+
xs,
10+
containerClass = '',
11+
itemClass = '',
12+
children,
13+
}: GridProps) {
14+
const containerStyles = container ? { gap: spacing + 'px' } : {}
15+
16+
if (item) {
17+
const getColumnWidth = () => {
18+
const percentageWidth = (xs / 12) * 100
19+
// DONT CHANGE IT FROM CALC SINCE CALC CONVERTS TO PX which is needed to handle text overflow
20+
return `calc(${percentageWidth}%)`
21+
}
22+
23+
const itemStyles = {
24+
flex: `1 1 ${getColumnWidth()}`,
25+
}
26+
27+
return (
28+
<div className={`p-0 ${itemClass}`} style={itemStyles}>
29+
{children}
30+
</div>
31+
)
32+
}
33+
34+
return (
35+
<div className={`flex-wrap flexbox ${container ? containerClass : ''}`} style={containerStyles}>
36+
{children}
37+
</div>
38+
)
39+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export interface GridProps {
2+
container?: boolean
3+
spacing?: number
4+
item?: boolean
5+
xs?: number
6+
containerClass?: string
7+
itemClass?: string
8+
children?: React.ReactNode
9+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React from 'react'
2+
import HiddenInputProps from './types'
3+
4+
export default function HiddenInput({ handleFileUpload, children, id }: HiddenInputProps) {
5+
return (
6+
<>
7+
<input
8+
type="file"
9+
id={id}
10+
accept=".yaml, .yml, .json"
11+
style={{
12+
display: 'none',
13+
}}
14+
onChange={handleFileUpload}
15+
/>
16+
17+
<label htmlFor={id} className="flex column center cursor m-0 h-100 w-100">
18+
{children}
19+
</label>
20+
</>
21+
)
22+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default interface HiddenInputProps {
2+
handleFileUpload: (e: React.ChangeEvent<HTMLInputElement>) => void
3+
children?: React.ReactNode
4+
id: string
5+
}

src/components/common/formFields/Widgets/Widgets.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ progress.styled-progress-bar {
104104
}
105105
}
106106

107+
progress.styled-progress-bar-error {
108+
color: var(--R500);
109+
110+
&::-webkit-progress-value {
111+
background-color: var(--R500);
112+
}
113+
114+
&::-moz-progress-bar {
115+
background-color: var(--R500);
116+
}
117+
}
118+
107119
.shortcut-key-badge {
108120
box-shadow: 0px 1px 0px var(--N200);
109121
}

src/components/common/formFields/Widgets/Widgets.tsx

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,26 @@ export const StyledSelect = (props: StyledSelectPropsType) => {
303303
)
304304
}
305305

306-
export const StyledProgressBar = ({ resetProgress, updateProgressValue }: StyledProgressBarProps) => {
307-
const [progressValue, setProgressValue] = useState(0)
306+
export const StyledProgressBar = ({
307+
resetProgress,
308+
updateProgressValue,
309+
styles,
310+
classes,
311+
progress,
312+
}: StyledProgressBarProps) => {
313+
const [progressValue, setProgressValue] = useState(progress ?? 0)
308314
let progressTimer = null
309315

310316
useEffect(() => {
311317
progressTimer = setInterval(() => {
312318
setProgressValue((prevValue) => {
313319
const _currentValue = prevValue + 1
320+
// checking for both null and undefined
321+
if (progress != null) {
322+
clearInterval(progressTimer)
323+
return progress
324+
}
325+
314326
if (_currentValue === 100) {
315327
clearInterval(progressTimer)
316328
}
@@ -328,9 +340,16 @@ export const StyledProgressBar = ({ resetProgress, updateProgressValue }: Styled
328340
clearInterval(progressTimer)
329341
}
330342
}
331-
}, [resetProgress])
343+
}, [resetProgress, progress])
332344

333-
return <progress className="styled-progress-bar" value={progressValue} max={100} />
345+
return (
346+
<progress
347+
className={`styled-progress-bar ${classes ?? ''}`}
348+
value={progressValue}
349+
max={100}
350+
style={styles ? { ...styles } : {}}
351+
/>
352+
)
334353
}
335354

336355
export const ShortcutKeyBadge = ({ rootClassName, shortcutKey, onClick }: ShortcutKeyBadgeProps) => {

0 commit comments

Comments
 (0)