Skip to content

Commit b1aae68

Browse files
authored
Merge pull request #183 from devtron-labs/feat/fluxCD
chore: move app list constants to common constants
2 parents 0fe0cec + 1ed3952 commit b1aae68

File tree

10 files changed

+59
-45
lines changed

10 files changed

+59
-45
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": "0.1.18",
3+
"version": "0.1.19",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/AppStatus/AppStatus.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,23 @@ export default function AppStatus({
3333
}
3434
const appStatusLowerCase = status?.toLowerCase()
3535
const isNotDeployed = appStatusLowerCase === StatusConstants.NOT_DEPLOYED.noSpaceLower
36-
const iconClass = isNotDeployed ? StatusConstants.NOT_DEPLOYED.lowerCase : appStatusLowerCase
36+
const isNotReady = appStatus === StatusConstants.NOT_READY.normalCase
3737
const statusMessage = status || (isVirtualEnv ? StatusConstants.NOT_AVILABLE.normalCase : '-')
3838
const notDeployed = isJobView ? YET_TO_RUN : StatusConstants.NOT_DEPLOYED.normalCase
3939
const textContent = isNotDeployed ? notDeployed : statusMessage
4040

41+
const getIconClass = () => {
42+
if (isNotDeployed) {
43+
return StatusConstants.NOT_DEPLOYED.lowerCase
44+
}
45+
if (isNotReady) {
46+
return StatusConstants.NOT_READY.lowerCase
47+
}
48+
return appStatusLowerCase
49+
}
50+
51+
const iconClass = getIconClass()
52+
4153
const renderIcon = () => {
4254
if (iconClass) {
4355
return <span className={`dc__app-summary__icon icon-dim-16 ${iconClass} ${iconClass}--node`} />

src/Common/AppStatus/constants.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ export const StatusConstants = {
2020
normalCase: 'Not deployed',
2121
lowerCase: 'not-deployed',
2222
},
23+
NOT_READY: {
24+
noSpaceLower: 'notready',
25+
normalCase: 'Not Ready',
26+
lowerCase: 'not-ready',
27+
},
2328
APP_STATUS: {
2429
noSpaceLower: 'appStatus',
2530
normalText: 'App status',

src/Common/Types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ export enum DeploymentAppTypes {
564564
GITOPS = 'argo_cd',
565565
MANIFEST_DOWNLOAD = 'manifest_download',
566566
MANIFEST_PUSH = 'manifest_push',
567+
FLUX = 'flux',
567568
}
568569

569570
export interface VulnerabilityType {

src/Shared/Components/Header/HeaderWithCreateButton/HeaderWithCreateButon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { ReactComponent as DropDown } from '../../../../Assets/Icon/ic-dropdown-
2222
import { ReactComponent as ChartIcon } from '../../../../Assets/Icon/ic-charts.svg'
2323
import { ReactComponent as AddIcon } from '../../../../Assets/Icon/ic-add.svg'
2424
import { ReactComponent as JobIcon } from '../../../../Assets/Icon/ic-k8s-job.svg'
25-
import AppListConstants from './constants'
25+
import { AppListConstants } from '../../../constants'
2626
import './HeaderWithCreateButton.scss'
2727
import { useMainContext } from '../../../Providers'
2828

src/Shared/Components/Header/HeaderWithCreateButton/constants.ts

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

src/Shared/constants.tsx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,10 +406,36 @@ export const APP_STATUS_HEADERS = ['KIND', 'NAME', 'STATUS', 'MESSAGE']
406406
export const MATERIAL_EXCLUDE_TIPPY_TEXT =
407407
'Not available for build as this commit contains changes in excluded files or folders'
408408

409+
export const AppListConstants = {
410+
SAMPLE_NODE_REPO_URL: 'https://github.com/devtron-labs/getting-started-nodejs',
411+
CREATE_DEVTRON_APP_URL: 'create-d-app',
412+
AppTabs: {
413+
DEVTRON_APPS: 'Devtron Apps',
414+
HELM_APPS: 'Helm Apps',
415+
ARGO_APPS: 'ArgoCD Apps',
416+
FLUX_APPS: 'FluxCD Apps',
417+
},
418+
AppType: {
419+
DEVTRON_APPS: 'd',
420+
HELM_APPS: 'h',
421+
ARGO_APPS: 'a',
422+
FLUX_APPS: 'f',
423+
},
424+
FilterType: {
425+
PROJECT: 'team',
426+
CLUTSER: 'cluster',
427+
NAMESPACE: 'namespace',
428+
ENVIRONMENT: 'environment',
429+
APP_STATUS: 'appStatus',
430+
TEMPLATE_TYPE: 'templateType',
431+
},
432+
}
433+
409434
export enum K8sResourcePayloadAppType {
410435
DEVTRON_APP = 0,
411436
HELM_APP = 1,
412437
EXTERNAL_ARGO_APP = 2,
438+
EXTERNAL_FLUX_APP = 3,
413439
}
414440

415441
// Disallowing this rule since ansi specifically works with escape characters

src/Shared/types.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export enum AppType {
163163
DEVTRON_HELM_CHART = 'devtron_helm_chart',
164164
EXTERNAL_HELM_CHART = 'external_helm_chart',
165165
EXTERNAL_ARGO_APP = 'external_argo_app',
166+
EXTERNAL_FLUX_APP = 'external_flux_app',
166167
}
167168

168169
export interface HelmReleaseStatus {
@@ -180,6 +181,11 @@ interface MaterialInfo {
180181
url: string
181182
webhookData: string
182183
}
184+
export interface FluxAppStatusDetail {
185+
status: string
186+
message: string
187+
reason: string
188+
}
183189
export interface AppDetails {
184190
appId?: number
185191
appName: string
@@ -221,6 +227,8 @@ export interface AppDetails {
221227
helmPackageName?: string
222228
appStatus?: string
223229
chartAvatar?: string
230+
fluxTemplateType?: string
231+
FluxAppStatusDetail?: FluxAppStatusDetail
224232
}
225233

226234
export enum RegistryType {

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ export interface customEnv {
6969
FEATURE_USER_DEFINED_GITOPS_REPO_ENABLE: boolean
7070
ENABLE_RESOURCE_SCAN_V2?: boolean
7171
HIDE_RESOURCE_WATCHER?: boolean
72-
ORGANIZATION_NAME?: string
72+
ORGANIZATION_NAME: string
73+
FEATURE_EXTERNAL_FLUX_CD_ENABLE: boolean
7374
FEATURE_SCOPED_VARIABLE_ENVIRONMENT_LIST_ENABLE?: boolean
7475
FEATURE_STEP_WISE_LOGS_ENABLE?: boolean
7576
FEATURE_IMAGE_PROMOTION_ENABLE?: boolean

0 commit comments

Comments
 (0)