Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: onboard argo apps #555

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
82fa56a
fix: rename MIGRATE_HELM to MIGRATE_EXTERNAL_APPS in ReleaseMode enum
AbhishekA1509 Jan 27, 2025
9135029
feat: add isGitOpsEnabled flag to MainContext interface
AbhishekA1509 Jan 28, 2025
716a644
feat: add NodeStatusDTO enum and support for Progressing component in…
AbhishekA1509 Jan 29, 2025
0819f5f
feat: add action button support to InfoColourBar component
AbhishekA1509 Jan 29, 2025
2a456e2
feat: restructure isGitOpsEnabled into featureGitOpsFlags with detail…
AbhishekA1509 Jan 30, 2025
83be291
feat: enhance layout of InfoColourBar by adding flex-grow-1 class bas…
AbhishekA1509 Jan 31, 2025
78a81b5
feat: enhance GenericSectionErrorState to support ReactNode for subTi…
AbhishekA1509 Jan 31, 2025
bdbcc94
Merge branch 'develop' into feat/onboard-argo-apps
AbhishekA1509 Feb 3, 2025
953ab36
feat: add PipelineMigratedFromType enum and enhance GenericSectionErr…
AbhishekA1509 Feb 4, 2025
b312dc6
fix: cleanup editor state from migratedFrom in DT
AbhishekA1509 Feb 4, 2025
757976c
Merge branch 'develop' into feat/onboard-argo-apps
AbhishekA1509 Feb 6, 2025
218bcae
Merge branch 'develop' into feat/onboard-argo-apps
AbhishekA1509 Feb 10, 2025
7bd30ec
chore: Bump version to 1.6.13-beta-2 in package.json and package-lock…
AbhishekA1509 Feb 11, 2025
e344081
feat: Add environment data route and service for fetching environment…
AbhishekA1509 Feb 11, 2025
7f8c7bf
Merge branch 'develop' into feat/onboard-argo-apps
AbhishekA1509 Feb 17, 2025
c44cf70
chore: update version to 1.7.2-beta-2 and enhance type definitions fo…
AbhishekA1509 Feb 17, 2025
b9bb870
Merge branch 'develop' into feat/onboard-argo-apps
AbhishekA1509 Feb 18, 2025
2b85491
chore: update version to 1.7.5-beta-1 in package.json and package-loc…
AbhishekA1509 Feb 18, 2025
4241636
Merge branch 'develop' into feat/onboard-argo-apps
shivani170 Feb 20, 2025
91c60c5
Merge branch 'develop' into feat/onboard-argo-apps
shivani170 Feb 20, 2025
bd62da3
type added
shivani170 Feb 20, 2025
13f43f9
chore: type dded in main context
shivani170 Feb 20, 2025
84bad87
chore: version bump
shivani170 Feb 21, 2025
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
23 changes: 16 additions & 7 deletions src/Common/InfoColorBar/InfoColourbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { Link } from 'react-router-dom'
import { InfoColourBarType } from '../Types'
import { Tooltip } from '@Common/Tooltip'
import { Button } from '@Shared/Components'
import './infoColourBar.scss'

const InfoColourBar = ({
Expand Down Expand Up @@ -82,15 +83,23 @@ const InfoColourBar = ({

const renderMessageWrapper = () => {
if (textConfig) {
const { heading, description } = textConfig
const { heading, description, actionButtonConfig } = textConfig

return (
<div className="flexbox-col">
{heading && <h6 className="m-0 cn-9 fs-13 fw-6 lh-20 dc__truncate">{heading}</h6>}
<div className="flexbox flex-grow-1 dc__content-space dc__align-start">
<div className="flexbox-col">
{heading && <h6 className="m-0 cn-9 fs-13 fw-6 lh-20 dc__truncate">{heading}</h6>}

<Tooltip content={description}>
<p className="dc__truncate--clamp-3 m-0 cn-9 fs-13 fw-4 lh-20">{description}</p>
</Tooltip>
<Tooltip content={description}>
<p className="dc__truncate--clamp-3 m-0 cn-9 fs-13 fw-4 lh-20">{description}</p>
</Tooltip>
</div>

{actionButtonConfig && (
<Button
{...actionButtonConfig}
/>
)}
</div>
)
}
Expand All @@ -109,7 +118,7 @@ const InfoColourBar = ({
className={`${classname} info_text flex dc__content-space pt-8 pb-8 pl-12 pr-12 br-4 top fs-13 fw-4`}
style={styles}
>
<div className={`flex top ${typeof renderActionButton === 'function' ? 'mr-5' : ''}`}>
<div className={`flex top ${typeof renderActionButton === 'function' ? 'mr-5' : ''} ${!!textConfig ? 'flex-grow-1' : ''}`}>
{!hideIcon && (
<div className={`icon-dim-${iconSize ?? '20'} mr-10`}>
<Icon className={`icon-dim-${iconSize ?? '20'} ${iconClass || ''} mr-8`} />
Expand Down
2 changes: 2 additions & 0 deletions src/Common/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
Severity,
PolicyBlockInfo,
TargetPlatformItemDTO,
ButtonProps,
} from '../Shared'
import {
ACTION_STATE,
Expand Down Expand Up @@ -217,6 +218,7 @@ interface InfoColourBarTextConfigType {
* If given would be shown below the heading (if given)
*/
description: string
actionButtonConfig?: ButtonProps
}

type InfoColourBarMessageProp = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ export interface SelectedChartDetailsType {
selectedChart: DeploymentChartVersionType
}

export enum PipelineMigratedFromType {
HELM_RELEASE = 'helmRelease',
ARGO_APPLICATION = 'argoApplication',
}

interface EnvironmentConfigType {
id: number
status: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface CustomTagType {

export enum ReleaseMode {
NEW_DEPLOYMENT = 'create',
MIGRATE_HELM = 'link',
MIGRATE_EXTERNAL_APPS = 'link',
}

export interface CDFormType {
Expand Down
9 changes: 9 additions & 0 deletions src/Shared/Components/CICDHistory/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,15 @@ export interface StatusFilterButtonType {
maxInlineFiltersCount?: number
}

export enum NodeStatusDTO {
Healthy = 'Healthy',
Progressing = 'Progressing',
Unknown = 'Unknown',
Suspended = 'Suspended',
Degraded = 'Degraded',
Missing = 'Missing',
}

export enum NodeStatus {
Degraded = 'degraded',
Healthy = 'healthy',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
* limitations under the License.
*/

import { ReactNode } from 'react'
import { ComponentSizeType } from '@Shared/constants'
import { ReactComponent as ErrorIcon } from '../../../Assets/Icon/ic-error-exclamation.svg'
import { ReactComponent as ICInfoOutline } from '../../../Assets/Icon/ic-info-outline.svg'
import { Progressing } from '@Common/Progressing'
import { ReactComponent as ErrorIcon } from '@Icons/ic-error-exclamation.svg'
import { ReactComponent as ICInfoOutline } from '@Icons/ic-info-outline.svg'
import { Button, ButtonVariantType } from '../Button'
import { GenericSectionErrorStateProps } from './types'

Expand All @@ -29,33 +31,57 @@ const GenericSectionErrorState = ({
buttonText = 'Reload',
rootClassName,
useInfoIcon = false,
}: GenericSectionErrorStateProps) => (
<div className={`flex column dc__gap-8 p-16 ${withBorder ? 'dc__border br-4' : ''} ${rootClassName || ''}`}>
{useInfoIcon ? (
<ICInfoOutline className="icon-dim-24" />
) : (
<ErrorIcon className="icon-dim-24 alert-icon-r5-imp" />
)}
<div className="flex column dc__gap-4 dc__align-center">
<h3 className="fs-13 lh-20 fw-6 cn-9 m-0">{title}</h3>
{(subTitle || description) && (
<div className="flex column fs-13 lh-20 fw-4 cn-7">
{subTitle && <p className="m-0">{subTitle}</p>}
{description && <p className="m-0">{description}</p>}
</div>
progressingProps,
}: GenericSectionErrorStateProps) => {
const renderMarker = () => {
if (progressingProps) {
return <Progressing {...progressingProps} />
}

if (useInfoIcon) {
return <ICInfoOutline className="icon-dim-24" />
}

return <ErrorIcon className="icon-dim-24 alert-icon-r5-imp" />
}

const renderSubHeading = (content: ReactNode) => {
if (!content) {
return null
}

if (typeof content === 'string') {
return <p className="m-0 dc__truncate--clamp-6">{content}</p>
}

return content
}

return (
<div className={`flex column dc__gap-8 p-16 ${withBorder ? 'dc__border br-4' : ''} ${rootClassName || ''}`}>
{renderMarker()}

<div className="flex column dc__gap-4 dc__align-center">
<h3 className="fs-13 lh-20 fw-6 cn-9 m-0">{title}</h3>
{(subTitle || description) && (
<div className="flex column fs-13 lh-20 fw-4 cn-7">
{renderSubHeading(subTitle)}
{renderSubHeading(description)}
</div>
)}
</div>

{reload && (
<Button
text={buttonText}
onClick={reload}
variant={ButtonVariantType.text}
size={ComponentSizeType.small}
dataTestId="generic-section-reload-button"
/>
)}
</div>

{reload && (
<Button
text={buttonText}
onClick={reload}
variant={ButtonVariantType.text}
size={ComponentSizeType.small}
dataTestId="generic-section-reload-button"
/>
)}
</div>
)
)
}

export default GenericSectionErrorState
38 changes: 28 additions & 10 deletions src/Shared/Components/GenericSectionErrorState/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
* limitations under the License.
*/

export interface GenericSectionErrorStateProps {
import { ReactNode } from 'react'
import { ProgressingProps } from '@Common/Types'

export type GenericSectionErrorStateProps = {
/**
* Handler for reloading the section
*/
Expand All @@ -32,11 +35,11 @@ export interface GenericSectionErrorStateProps {
/**
* @default 'We could not load the information on this page.'
*/
subTitle?: string
subTitle?: ReactNode
/**
* @default 'Please reload or try again later'
*/
description?: string
description?: ReactNode
/**
* @default 'Reload'
*/
Expand All @@ -45,10 +48,25 @@ export interface GenericSectionErrorStateProps {
* to be applied on parent div
*/
rootClassName?: string
/**
* If true, info icon would be used instead of error
*
* @default false
*/
useInfoIcon?: boolean
}
} & (
| {
/**
* If provided, would render the Progressing component with given props instead of error icon
*/
progressingProps: ProgressingProps
useInfoIcon?: never
}
| {
progressingProps?: never
/**
* If true, info icon would be used instead of error
*
* @default false
*/
useInfoIcon: boolean
}
| {
progressingProps?: never
useInfoIcon?: never
}
)
11 changes: 11 additions & 0 deletions src/Shared/Providers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,17 @@ export interface MainContext {
}
isAirgapped: boolean
isSuperAdmin: boolean
featureGitOpsFlags: {
isFeatureGitOpsEnabled: boolean
/**
*
*/
isFeatureUserDefinedGitOpsEnabled: boolean
/**
* Feature flag for Migrate to devtron from argo cd
*/
isFeatureArgoCdMigrationEnabled: boolean
}
isManifestScanningEnabled: boolean
}

Expand Down