Skip to content

Commit 83d3695

Browse files
authored
Merge pull request #509 from devtron-labs/feat/add-default-sorting-config-compare
feat: DeploymentHistoryConfigDiff - add default sorting - ASC order
2 parents 9ea2c2f + 1be69e0 commit 83d3695

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
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.4.8",
3+
"version": "1.4.8-beta-1",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
import { useEffect, useState } from 'react'
22
import { generatePath, useRouteMatch } from 'react-router-dom'
33

4-
import { DeploymentConfigDiff, DeploymentConfigDiffProps } from '@Shared/Components/DeploymentConfigDiff'
5-
import { DEFAULT_BASE_PAGE_SIZE, SortingOrder } from '@Common/Constants'
4+
import {
5+
DEPLOYMENT_CONFIG_DIFF_SORT_KEY,
6+
DeploymentConfigDiff,
7+
DeploymentConfigDiffProps,
8+
} from '@Shared/Components/DeploymentConfigDiff'
9+
import { DEFAULT_BASE_PAGE_SIZE } from '@Common/Constants'
610
import { useUrlFilters } from '@Common/Hooks'
711
import {
812
getSelectPickerOptionByValue,
@@ -43,6 +47,7 @@ export const DeploymentHistoryConfigDiffCompare = ({
4347
string,
4448
DeploymentHistoryConfigDiffQueryParams
4549
>({
50+
initialSortKey: DEPLOYMENT_CONFIG_DIFF_SORT_KEY,
4651
parseSearchParams: parseDeploymentHistoryDiffSearchParams(previousWfrId),
4752
})
4853

@@ -170,7 +175,7 @@ export const DeploymentHistoryConfigDiffCompare = ({
170175
return null
171176
}
172177

173-
const onSorting = () => handleSorting(sortOrder !== SortingOrder.DESC ? 'sort-config' : '')
178+
const onSorting = () => handleSorting(DEPLOYMENT_CONFIG_DIFF_SORT_KEY)
174179

175180
const sortingConfig: DeploymentConfigDiffProps['sortingConfig'] = {
176181
handleSorting: onSorting,

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ export const diffStateTextColorMap: Record<DeploymentConfigDiffState, `c${string
3333
deleted: 'cr-5',
3434
noDiff: 'cn-7',
3535
}
36+
37+
export const DEPLOYMENT_CONFIG_DIFF_SORT_KEY = 'sort-config'

0 commit comments

Comments
 (0)