Skip to content

Commit

Permalink
Merge pull request #2430 from devtron-labs/fix/config-diff-sorting
Browse files Browse the repository at this point in the history
fix: Sort Order resetting when changing comparison option fix
  • Loading branch information
RohitRaj011 authored Jan 31, 2025
2 parents d618bd0 + b1cc21f commit 09475d2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 20 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.6.0",
"@devtron-labs/devtron-fe-common-lib": "1.6.0-patch-1",
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
"@rjsf/core": "^5.13.3",
"@rjsf/utils": "^5.13.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const DeploymentConfigCompare = ({

useEffect(() => {
// Set default initial sorting
if (!isManifestView) {
if (!isManifestView && sortBy !== DEPLOYMENT_CONFIG_DIFF_SORT_KEY) {
handleSorting(DEPLOYMENT_CONFIG_DIFF_SORT_KEY)
}
}, [])
Expand Down Expand Up @@ -380,8 +380,6 @@ export const DeploymentConfigCompare = ({

// METHODS
const onCompareEnvironmentChange = ({ value }: SelectPickerOptionType) => {
handleSorting('')

if (typeof value === 'number') {
updateSearchParams({
chartRefId: value,
Expand All @@ -406,8 +404,6 @@ export const DeploymentConfigCompare = ({
const onEnvironmentConfigTypeChange =
(isCompare?: boolean) =>
({ value }: SelectPickerOptionType) => {
handleSorting('')

if (typeof value === 'string') {
const modifiedValue = getPreviousDeploymentValue(value)
if (modifiedValue) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export const usePipelineDeploymentConfig = ({

useEffect(() => {
// INITIAL DEFAULT SORTING
handleSorting(DEPLOYMENT_CONFIG_DIFF_SORT_KEY)
if (sortBy !== DEPLOYMENT_CONFIG_DIFF_SORT_KEY) {
handleSorting(DEPLOYMENT_CONFIG_DIFF_SORT_KEY)
}
}, [])

// FETCH PREVIOUS DEPLOYMENTS
Expand Down Expand Up @@ -302,7 +304,6 @@ export const usePipelineDeploymentConfig = ({
)

const onDeploymentConfigChange = ({ value }: SelectPickerOptionType) => {
handleSorting('')
updateSearchParams({
[PipelineConfigDiffQueryParams.DEPLOY]: value as PipelineConfigDiffQueryParamsType['deploy'],
})
Expand Down
9 changes: 1 addition & 8 deletions src/components/app/details/triggerView/cdMaterial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -718,13 +718,6 @@ const CDMaterial = ({
}))
}

const handleInputChange = (event): void => {
setState({
...state,
searchText: event.target.value,
})
}

const handleFilterKeyPress = (_searchText: string): void => {
setState({
...state,
Expand Down Expand Up @@ -791,7 +784,7 @@ const CDMaterial = ({
const newParams = new URLSearchParams({
...searchParams,
sortBy: DEPLOYMENT_CONFIG_DIFF_SORT_KEY,
sort: SortingOrder.ASC,
sortOrder: SortingOrder.ASC,
mode: modeParamValue,
deploy: getConfigToDeployValue(),
})
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,10 @@
dependencies:
"@jridgewell/trace-mapping" "0.3.9"

"@devtron-labs/[email protected]":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.6.0.tgz#b470556c519117d7452f70f5cee70133ac8b87ae"
integrity sha512-9k7S+bLKr/Yat+gn7SayfW7FdsNrbNMTqqRdapYSsZrfSKyVnaNHFTuOGpvfZ8F5tlUxoQ7+zytohUm5PdGisg==
"@devtron-labs/[email protected]-patch-1":
version "1.6.0-patch-1"
resolved "https://registry.yarnpkg.com/@devtron-labs/devtron-fe-common-lib/-/devtron-fe-common-lib-1.6.0-patch-1.tgz#a538c5152d7fcf8626cb1468bf81d4f080f698da"
integrity sha512-I4uSNqP2+4O4OOzsxxYUDBCRzi82P/iBdEkT+gfF0mQWRcxEEl+dIlZgRD9LE7EEvHFjLOhkUlQbfKjLuQ53Bg==
dependencies:
"@types/react-dates" "^21.8.6"
ansi_up "^5.2.1"
Expand Down

0 comments on commit 09475d2

Please sign in to comment.