fix: [AH-421]: fix issue with double encoding in UI for artifact name in url params (#2757)

* fix: [AH-421]: fix issue with double encoding in UI for artifact name in url params
abhinav-harness-patch-1
Shivanand Sonnad 2024-10-02 02:38:46 +00:00 committed by Harness
parent eeb4688b59
commit 40a9472d4d
2 changed files with 4 additions and 6 deletions

View File

@ -16,12 +16,11 @@
import React, { useContext } from 'react'
import { defaultTo } from 'lodash-es'
import { useParams } from 'react-router-dom'
import { Expander } from '@blueprintjs/core'
import { Button, ButtonVariation, Layout, getErrorInfoFromErrorObject, useToaster } from '@harnessio/uicore'
import { useUpdateArtifactLabelsMutation, type ArtifactSummary } from '@harnessio/react-har-service-client'
import { useGetSpaceRef } from '@ar/hooks'
import { useDecodedParams, useGetSpaceRef } from '@ar/hooks'
import { encodeRef } from '@ar/hooks/useGetSpaceRef'
import { useStrings } from '@ar/frameworks/strings/String'
import type { RepositoryPackageType } from '@ar/common/types'
@ -48,7 +47,7 @@ function ArtifactDetailsHeaderContent(props: ArtifactDetailsHeaderContentProps):
const spaceRef = useGetSpaceRef()
const { getString } = useStrings()
const { showSuccess, showError, clear } = useToaster()
const pathParams = useParams<ArtifactDetailsPathParams>()
const pathParams = useDecodedParams<ArtifactDetailsPathParams>()
const { repositoryIdentifier, artifactIdentifier } = pathParams
const { packageType, imageName, modifiedAt, createdAt, downloadsCount, labels } = data as ArtifactSummary

View File

@ -18,7 +18,6 @@ import React, { useMemo, useRef } from 'react'
import { Expander } from '@blueprintjs/core'
import { defaultTo } from 'lodash-es'
import { flushSync } from 'react-dom'
import { useParams } from 'react-router-dom'
import { useGetArtifactDeploymentsQuery, useGetDockerArtifactManifestsQuery } from '@harnessio/react-har-service-client'
import {
Button,
@ -29,7 +28,7 @@ import {
Page
} from '@harnessio/uicore'
import { useGetSpaceRef, useParentHooks } from '@ar/hooks'
import { useDecodedParams, useGetSpaceRef, useParentHooks } from '@ar/hooks'
import { DEFAULT_PAGE_INDEX, PreferenceScope } from '@ar/constants'
import { useStrings } from '@ar/frameworks/strings'
import { encodeRef } from '@ar/hooks/useGetSpaceRef'
@ -54,7 +53,7 @@ export default function DockerDeploymentsContent() {
const searchRef = useRef({} as ExpandingSearchInputHandle)
const { getString } = useStrings()
const registryRef = useGetSpaceRef()
const params = useParams<VersionDetailsPathParams>()
const params = useDecodedParams<VersionDetailsPathParams>()
const { preference: sortingPreference, setPreference: setSortingPreference } = usePreferenceStore<string | undefined>(
PreferenceScope.USER,