Skip to content

Commit 5581003

Browse files
authored
Merge pull request #764 from devtron-labs/feat/info-clock-v2
feat: Deployment history config diff info block replacement & removal of Info color bar
2 parents 1ed9b1a + 6082644 commit 5581003

File tree

8 files changed

+12
-250
lines changed

8 files changed

+12
-250
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.15.0-pre-0",
3+
"version": "1.15.0-pre-1",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/InfoColorBar/InfoColourbar.tsx

Lines changed: 0 additions & 138 deletions
This file was deleted.

src/Common/InfoColorBar/infoColourBar.scss

Lines changed: 0 additions & 44 deletions
This file was deleted.

src/Common/Types.ts

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
Severity,
2626
PolicyBlockInfo,
2727
TargetPlatformItemDTO,
28-
ButtonProps,
2928
ComponentLayoutType,
3029
StatusType,
3130
DocLinkProps,
@@ -230,56 +229,6 @@ export enum ImageType {
230229
Medium = 'medium',
231230
SMALL = 'small',
232231
}
233-
234-
interface InfoColourBarTextConfigType {
235-
/**
236-
* If given would be shown above the description, in bold
237-
*/
238-
heading?: string
239-
/**
240-
* If given would be shown below the heading (if given)
241-
*/
242-
description: string
243-
actionButtonConfig?: ButtonProps
244-
}
245-
246-
type InfoColourBarMessageProp =
247-
| {
248-
message: ReactNode
249-
linkText?: ReactNode
250-
redirectLink?: string
251-
linkOnClick?: () => void
252-
linkClass?: string
253-
internalLink?: boolean
254-
255-
textConfig?: never
256-
}
257-
| {
258-
textConfig: InfoColourBarTextConfigType
259-
260-
message?: never
261-
linkText?: never
262-
redirectLink?: never
263-
linkOnClick?: () => never
264-
linkClass?: never
265-
internalLink?: never
266-
}
267-
268-
export type InfoColourBarType = InfoColourBarMessageProp & {
269-
classname: string
270-
Icon
271-
iconClass?: string
272-
iconSize?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
273-
renderActionButton?: () => JSX.Element
274-
styles?: CSSProperties
275-
/**
276-
* If true, the icon is not shown
277-
*
278-
* @default false
279-
*/
280-
hideIcon?: boolean
281-
}
282-
283232
export interface ReloadType {
284233
reload?: (event?: any) => void
285234
className?: string

src/Common/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export * from './Helper'
4141
export * from './Hooks'
4242
export * from './ImageTags'
4343
export * from './ImageTags.Types'
44-
export { default as InfoColourBar } from './InfoColorBar/InfoColourbar'
4544
export * from './Markdown'
4645
export * from './Modals/Modal'
4746
export * from './Modals/VisibleModal'

src/Shared/Components/CICDHistory/DeploymentHistoryConfigDiff/DeploymentHistoryConfigDiff.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
import { useMemo, useState } from 'react'
1818
import { generatePath, Route, Switch, useLocation, useRouteMatch } from 'react-router-dom'
1919

20-
import { ReactComponent as ICError } from '@Icons/ic-error.svg'
2120
import ErrorScreenManager from '@Common/ErrorScreenManager'
2221
import { useAsync } from '@Common/Helper'
2322
import { useUrlFilters } from '@Common/Hooks'
24-
import { GenericEmptyState, InfoColourBar, SortingOrder } from '@Common/index'
23+
import { GenericEmptyState, SortingOrder } from '@Common/index'
2524
import { Progressing } from '@Common/Progressing'
2625
import { DEPLOYMENT_CONFIG_DIFF_SORT_KEY, getAppEnvDeploymentConfigList } from '@Shared/Components/DeploymentConfigDiff'
26+
import { InfoBlock } from '@Shared/Components/InfoBlock'
2727
import { groupArrayByObjectKey } from '@Shared/Helpers'
2828
import { useMainContext } from '@Shared/Providers'
2929
import { EnvResourceType, getAppEnvDeploymentConfig, getCompareSecretsData } from '@Shared/Services'
@@ -262,10 +262,9 @@ export const DeploymentHistoryConfigDiff = ({
262262
)}
263263
</div>
264264
{hasPreviousDeploymentConfigNotFoundError && (
265-
<InfoColourBar
266-
classname="error_bar cn-9 fs-13 lh-20"
267-
Icon={ICError}
268-
message="Diff unavailable: Configurations for previous deployment not found."
265+
<InfoBlock
266+
variant="error"
267+
description="Diff unavailable: Configurations for previous deployment not found."
269268
/>
270269
)}
271270
</div>

src/Shared/Components/CMCS/helpers.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { ReactComponent as ICWarningY5 } from '@Icons/ic-warning-y5.svg'
18-
import { InfoColourBar } from '@Common/index'
17+
import { InfoBlock } from '../InfoBlock'
1918

2019
export const renderHashiOrAwsDeprecatedInfo = () => (
21-
<InfoColourBar
22-
classname="warn"
23-
message={
20+
<InfoBlock
21+
description={
2422
<p className="m-0 cn-9 fs-13 lh-20">
2523
<span>
2624
Kubernetes External Secret (KES) has been deprecated and will be removed in the next Devtron
@@ -37,7 +35,6 @@ export const renderHashiOrAwsDeprecatedInfo = () => (
3735
</a>
3836
</p>
3937
}
40-
Icon={ICWarningY5}
41-
iconSize={20}
38+
variant="warning"
4239
/>
4340
)

0 commit comments

Comments
 (0)