Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/devtron-labs/dashboard i…
Browse files Browse the repository at this point in the history
…nto feat/persist-app-details-filter
  • Loading branch information
arunjaindev committed Nov 15, 2024
2 parents 79c3e9e + cbfac90 commit f041911
Show file tree
Hide file tree
Showing 24 changed files with 52 additions and 251 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"homepage": "/dashboard",
"dependencies": {
"@devtron-labs/devtron-fe-common-lib": "1.0.4",
"@devtron-labs/devtron-fe-common-lib": "1.0.5",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rjsf/core": "^5.13.3",
"@rjsf/utils": "^5.13.3",
Expand Down
101 changes: 0 additions & 101 deletions src/Pages/ResourceBrowser/ClusterList/ClusterMap/ClusterMap.tsx

This file was deleted.

35 changes: 0 additions & 35 deletions src/Pages/ResourceBrowser/ClusterList/ClusterMap/clustermap.scss

This file was deleted.

2 changes: 0 additions & 2 deletions src/Pages/ResourceBrowser/ClusterList/ClusterMap/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/Pages/ResourceBrowser/ClusterList/ClusterMap/types.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/Pages/ResourceBrowser/ClusterList/ClusterMap/utils.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/Pages/ResourceBrowser/ClusterList/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/Pages/ResourceBrowser/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ const BulkCITrigger = ({
}
}

return () => getCIBlockState(appDetails.ciPipelineId, appDetails.appId, branchNames, appDetails.name)
return !branchNames
? () => null
: () => getCIBlockState(appDetails.ciPipelineId, appDetails.appId, branchNames, appDetails.name)
})

if (policyPromiseFunctionList?.length) {
Expand Down
5 changes: 3 additions & 2 deletions src/components/CIPipelineN/CIPipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,15 +241,16 @@ export default function CIPipeline({
}
}

const areMandatoryPluginPossible = !isJobCard && !!processPluginData
// mandatory plugins are applicable for job ci but not jobs
const areMandatoryPluginPossible = !isJobView && !!processPluginData

// NOTE: Wrap this method in try catch block to handle error
const getMandatoryPluginData = async (
_formData: PipelineFormType,
/**
* ids required to fetch in case we have a plugin in step
*/
requiredPluginIds?: PluginDetailPayloadType['pluginId'],
requiredPluginIds?: PluginDetailPayloadType['pluginIds'],
): Promise<void> => {
if (areMandatoryPluginPossible) {
let branchName = ''
Expand Down
3 changes: 2 additions & 1 deletion src/components/CIPipelineN/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ export const Sidebar = ({
const showMandatoryWarning = (): boolean => {
return (
!!MandatoryPluginWarning &&
!isJobCard &&
// mandatory plugins are applicable for Job CI but not Jobs
!isJobView &&
mandatoryPluginData &&
((isPreBuildTab && !mandatoryPluginData.isValidPre) ||
(activeStageName === BuildStageVariable.PostBuild && !mandatoryPluginData.isValidPost))
Expand Down
8 changes: 4 additions & 4 deletions src/components/ClusterNodes/ClusterSelectionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import { AddClusterButton } from '@Components/ResourceBrowser/PageHeader.buttons
import { ReactComponent as Error } from '@Icons/ic-error-exclamation.svg'
import { ReactComponent as Success } from '@Icons/appstatus/healthy.svg'
import { ReactComponent as TerminalIcon } from '@Icons/ic-terminal-fill.svg'
import { ClusterMap, ClusterTreeMapData } from '@Pages/ResourceBrowser'
import { ClusterDetail } from './types'
import ClusterNodeEmptyState from './ClusterNodeEmptyStates'
import { ClusterSelectionType } from '../ResourceBrowser/Types'
Expand All @@ -45,11 +44,12 @@ import './clusterNodes.scss'
const KubeConfigButton = importComponentFromFELibrary('KubeConfigButton', null, 'function')
const ClusterStatusCell = importComponentFromFELibrary('ClusterStatus', null, 'function')
const ClusterFilters = importComponentFromFELibrary('ClusterFilters', null, 'function')
const ClusterMap = importComponentFromFELibrary('ClusterMap', null, 'function')

const getClusterMapData = (data: ClusterDetail[]): ClusterTreeMapData['data'] =>
const getClusterMapData = (data: ClusterDetail[]) =>
data.map(({ name, id, nodeCount, status }) => ({
name,
status: status as ClusterTreeMapData['data'][0]['status'],
status,
href: `${URLS.RESOURCE_BROWSER}/${id}/${ALL_NAMESPACE_OPTION.value}/${SIDEBAR_KEYS.nodeGVK.Kind.toLowerCase()}/${K8S_EMPTY_GROUP}`,
value: nodeCount ?? 0,
}))
Expand Down Expand Up @@ -86,7 +86,7 @@ const ClusterSelectionList: React.FC<ClusterSelectionType> = ({
})
}, [searchKey, clusterOptions, `${clusterFilter}`])

const treeMapData = useMemo<ClusterTreeMapData[]>(() => {
const treeMapData = useMemo(() => {
const { prodClusters, nonProdClusters } = filteredList.reduce(
(acc, curr) => {
if (curr.status && curr.status !== ClusterStatusType.CONNECTION_FAILED) {
Expand Down
3 changes: 2 additions & 1 deletion src/components/app/details/triggerView/TriggerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
ToastVariantType,
TOAST_ACCESS_DENIED,
BlockedStateData,
getEnvironmentListMinPublic,
} from '@devtron-labs/devtron-fe-common-lib'
import ReactGA from 'react-ga4'
import { withRouter, NavLink, Route, Switch } from 'react-router-dom'
Expand Down Expand Up @@ -65,7 +66,7 @@ import {
NO_COMMIT_SELECTED,
} from '../../../../config'
import { AppNotConfigured } from '../appDetails/AppDetails'
import { getEnvironmentListMinPublic, getHostURLConfiguration } from '../../../../services/service'
import { getHostURLConfiguration } from '../../../../services/service'
import { ReactComponent as ICError } from '../../../../assets/icons/ic-error-exclamation.svg'
import { ReactComponent as CloseIcon } from '../../../../assets/icons/ic-close.svg'
import { getCIWebhookRes } from './ciWebhook.service'
Expand Down
14 changes: 12 additions & 2 deletions src/components/app/details/triggerView/ciMaterial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class CIMaterial extends Component<CIMaterialProps, CIMaterialState> {
showTriggerButton
onTrigger={this.handleStartBuildAction}
nodeType={nodeType}
isJobView={this.props.isJobCI}
>
<ButtonWithLoader
rootClassName="cta-with-img cta-with-img--ci-trigger-btn"
Expand All @@ -238,8 +239,17 @@ class CIMaterial extends Component<CIMaterialProps, CIMaterialState> {
isLoading={this.props.isLoading}
onClick={noop}
>
<Play className="trigger-btn__icon" />
Start Build
{this.props.isJobCI ? (
<>
<RunIcon className="trigger-job-btn__icon" />
Run Job
</>
) : (
<>
<Play className="trigger-btn__icon" />
Start Build
</>
)}
</ButtonWithLoader>
</AllowedWithWarningTippy>
)
Expand Down
1 change: 1 addition & 0 deletions src/components/app/list-new/AppListFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ const AppListFilters = ({
namespaceListResponse?.result,
appListFiltersResponse?.appListFilters.result.clusters,
appListFiltersResponse?.appListFilters.result.teams,
appCount,
)
}
fileName={FILE_NAMES.Apps}
Expand Down
3 changes: 2 additions & 1 deletion src/components/app/list-new/AppListService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ export const getDevtronAppListDataToExport = (
namespaceList: EnvironmentListHelmResult[],
clusterList: Cluster[],
projectList: Teams[],
appCount: number
) => {
const appListPayload: AppListPayloadType = getDevtronAppListPayload(filterConfig, environmentList, namespaceList)
const appListPayload: AppListPayloadType = {...getDevtronAppListPayload(filterConfig, environmentList, namespaceList), offset: 0, size: appCount} // Over riding size and offset as we need all list (no pagination)
const clusterMap = new Map<string, number>()
clusterList.forEach((cluster) => clusterMap.set(cluster.cluster_name, cluster.id))
return getAppList(appListPayload).then(({ result }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/app/list/DevtronAppListContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ const DevtronAppList = ({
...expandedState,
isAllExpandable: parsedAppList.some((app) => app.environments.length > 1),
})
setAppCount(parsedAppList.length)
setAppCount(appListResponse?.result?.appCount || 0)
}, [appListResponseLoading])

const handleEditApp = (appId: number): void => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/cdPipeline/CDPipeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
ProcessPluginDataParamsType,
ProcessPluginDataReturnType,
ResourceKindType,
getEnvironmentListMinPublic,
} from '@devtron-labs/devtron-fe-common-lib'
import { useEffect, useMemo, useRef, useState } from 'react'
import { Redirect, Route, Switch, useParams, useRouteMatch } from 'react-router-dom'
Expand All @@ -71,7 +72,6 @@ import {
saveCDPipeline,
updateCDPipeline,
} from './cdPipeline.service'
import { getEnvironmentListMinPublic } from '../../services/service'
import { Sidebar } from '../CIPipelineN/Sidebar'
import DeleteCDNode from './DeleteCDNode'
import { PreBuild } from '../CIPipelineN/PreBuild'
Expand Down
Loading

0 comments on commit f041911

Please sign in to comment.