Skip to content

Commit bb3d3d3

Browse files
committed
Merge branch 'main' into feat/doc-utm-source
2 parents b8f0677 + 4335197 commit bb3d3d3

File tree

13 files changed

+62
-18
lines changed

13 files changed

+62
-18
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.13.0-pre-9",
3+
"version": "1.14.0-pre-0",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Assets/IconV2/ic-terminal.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading

src/Common/SegmentedBarChart/SegmentedBarChart.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import { Entity, SegmentedBarChartProps } from './types'
2323
import './styles.scss'
2424

2525
const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
26+
hideLegend,
2627
entities: userEntities = [FALLBACK_ENTITY],
2728
rootClassName,
2829
countClassName,
@@ -36,7 +37,7 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
3637
const total = entities.reduce((sum, entity) => entity.value + sum, 0)
3738
const filteredEntities = entities.filter((entity) => !!entity.value)
3839

39-
const calcSegmentWidth = (entity: Entity) => `${(entity.value / total) * 100}%`
40+
const calcSegmentWidth = (entityValue: Entity['value']) => `${(entityValue / total) * 100}%`
4041

4142
const renderLabel = (label: Entity['label']) =>
4243
isLoading ? (
@@ -88,11 +89,17 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
8889
))
8990
}
9091

91-
const renderLegend = () => (
92-
<div className={`flexbox flex-wrap dc__row-gap-4 ${isProportional ? 'dc__gap-24' : 'dc__gap-16'}`}>
93-
{renderContent()}
94-
</div>
95-
)
92+
const renderLegend = () => {
93+
if (hideLegend) {
94+
return null
95+
}
96+
97+
return (
98+
<div className={`flexbox flex-wrap dc__row-gap-4 ${isProportional ? 'dc__gap-24' : 'dc__gap-16'}`}>
99+
{renderContent()}
100+
</div>
101+
)
102+
}
96103

97104
const renderBar = () => (
98105
<motion.div
@@ -112,7 +119,7 @@ const SegmentedBarChart: React.FC<SegmentedBarChartProps> = ({
112119
className={`h-8 ${index === 0 ? 'dc__left-radius-4' : ''} ${
113120
index === map.length - 1 ? 'dc__right-radius-4' : ''
114121
} ${isLoading ? 'shimmer' : ''}`}
115-
style={{ backgroundColor: entity.color, width: calcSegmentWidth(entity) }}
122+
style={{ backgroundColor: entity.color, width: calcSegmentWidth(entity.value) }}
116123
/>
117124
))}
118125
</motion.div>

src/Common/SegmentedBarChart/types.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,22 @@ export type Entity = {
2020
value: number
2121
}
2222

23-
export interface SegmentedBarChartProps {
24-
entities: NonNullable<Entity[]>
23+
type EntityPropType =
24+
| {
25+
hideLegend?: false
26+
entities: NonNullable<Entity[]>
27+
}
28+
| {
29+
hideLegend: true
30+
entities: NonNullable<Omit<Entity, 'label'> & { label?: never }>[]
31+
}
32+
33+
export type SegmentedBarChartProps = {
2534
rootClassName?: string
2635
countClassName?: string
2736
labelClassName?: string
2837
isProportional?: boolean
2938
swapLegendAndBar?: boolean
3039
showAnimationOnBar?: boolean
3140
isLoading?: boolean
32-
}
41+
} & EntityPropType

src/Pages/ResourceBrowser/NodeDrainOptions.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ChangeEvent, FocusEvent } from 'react'
17+
import { ChangeEvent, FocusEvent, useEffect } from 'react'
1818

1919
import { ReactComponent as ICTimer } from '@Icons/ic-timer.svg'
2020
import { Checkbox } from '@Common/Checkbox'
@@ -37,6 +37,10 @@ const NodeDrainOptions = ({
3737
ignoreAllDaemonSets: false,
3838
}
3939

40+
useEffect(() => {
41+
setNodeDrainOptions(nodeDrainOptions)
42+
}, [])
43+
4044
const handleGracePeriodOnChange = (e: ChangeEvent<HTMLInputElement>) => {
4145
setNodeDrainOptions({
4246
...nodeDrainOptions,

src/Pages/ResourceBrowser/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import { Dispatch, ReactElement, SetStateAction } from 'react'
1818

19+
import { TabProps } from '@Shared/Components'
1920
import { InstallationClusterType } from '@Shared/types'
2021

2122
import { NodeActionRequest } from './ResourceBrowser.Types'
@@ -113,6 +114,11 @@ export interface AdditionalConfirmationModalOptionsProps<T = unknown> {
113114
children?: ReactElement
114115
}
115116

117+
export type NodeDetailTabsInfoType = (Pick<TabProps, 'label' | 'icon'> & {
118+
id: string
119+
renderComponent: () => JSX.Element
120+
})[]
121+
116122
export interface InstallationClusterStepType {
117123
lastTransitionTime: string
118124
lastProbeTime: string

src/Shared/Components/BulkOperations/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import { ReactNode } from 'react'
1818

1919
import { APIOptions, DrawerProps } from '@Common/index'
20-
import { SegmentedBarChartProps } from '@Common/SegmentedBarChart'
20+
import { Entity } from '@Common/SegmentedBarChart/types'
2121

2222
import { ConfirmationModalProps } from '../ConfirmationModal/types'
2323
import { getProgressingStateForStatus } from '../Security'
@@ -64,7 +64,7 @@ export interface OperationResultStoreType {
6464
getResults: (
6565
sortComparator: (a: BulkOperationResultType, b: BulkOperationResultType) => number,
6666
) => BulkOperationResultWithIdType[]
67-
getBarChartEntities: () => SegmentedBarChartProps['entities']
67+
getBarChartEntities: () => NonNullable<Entity[]>
6868
getResultsStatusCount: () => Record<BulkOperationResultType['status'], number>
6969
getSize: () => number
7070
updateResultStatus: (

src/Shared/Components/CodeEditor/codeEditor.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@
131131

132132
.cm-panels-top {
133133
border-bottom: none;
134+
135+
&:has(.code-editor__search) {
136+
z-index: 0;
137+
}
134138
}
135139

136140
// TOOLTIPS

0 commit comments

Comments
 (0)