fix: [AH-518]: fix issue with registry and package type select on UI (#2830)

* fix: [AH-518]: show detailed error message coming from api response
* fix: [AH-518]: fix incorrect placeholder and handle loading senario for digest selector
* fix: [AH-518]: fix issue with registry and package type select on UI
pull/3576/head
Shivanand Sonnad 2024-10-18 10:08:47 +00:00 committed by Harness
parent 21bdad8ece
commit c3221fb0ff
7 changed files with 11 additions and 6 deletions

View File

@ -30,7 +30,8 @@ export default function PackageTypeSelector(props: PackageTypeSelectorProps): JS
const { getString } = useStrings()
return (
<MultiSelectDropdownList
buttonTestId="package-manager-select"
width={180}
buttonTestId="package-type-select"
items={RepositoryTypes.filter(each => !each.disabled).map(each => ({ ...each, label: getString(each.label) }))}
value={value}
onSelect={onChange}

View File

@ -54,8 +54,8 @@ export default function RepositorySelector(props: RepositorySelectorProps): JSX.
return (
<DropDown
minWidth={120}
buttonTestId="pipeline-select"
width={180}
buttonTestId="regitry-select"
onChange={option => {
props.onChange(option.value as string)
}}

View File

@ -16,7 +16,7 @@
import React, { useState } from 'react'
import { defaultTo } from 'lodash-es'
import { Button, ButtonVariation, Container, Text, useToaster } from '@harnessio/uicore'
import { Button, ButtonVariation, Container, getErrorInfoFromErrorObject, Text, useToaster } from '@harnessio/uicore'
import { FontVariation } from '@harnessio/design-system'
import type { ClientSetupStep } from '@harnessio/react-har-service-client'
@ -43,7 +43,7 @@ export default function GenerateTokenStep({ stepIndex, step }: GenerateTokenStep
})
.catch(err => {
clear()
showError(err?.message || getString('repositoryDetails.clientSetup.failedToGenerateToken'))
showError(getErrorInfoFromErrorObject(err) || getString('repositoryDetails.clientSetup.failedToGenerateToken'))
})
}
return (

View File

@ -89,7 +89,7 @@ export default function ArchitectureSelector(props: ArchitectureSelectorProps):
usePortal={true}
addClearBtn={false}
itemDisabled={item => !item.value}
placeholder={getString('artifactList.table.allRepositories')}
placeholder={loading ? getString('loading') : getString('versionDetails.selectDigestPlaceholder')}
isLabel
getCustomLabel={option => (
<HeaderTitle tag="span" className={css.primaryColor}>

View File

@ -1,4 +1,5 @@
page: Version Details Page
selectDigestPlaceholder: All Digest
tabs:
overview: Overview
artifactDetails: Artifact Details

View File

@ -16,6 +16,7 @@ tabNotFound: Tab not found
search: Search
copied: Copied
download: download
loading: Loading...
dateLabel: Date
timeLabel: Time
harnessAI: Harness AI

View File

@ -189,6 +189,7 @@ export interface StringsMap {
'versionDetails.overview.generalInformation.url': string
'versionDetails.overview.generalInformation.version': string
'versionDetails.page': string
'versionDetails.selectDigestPlaceholder': string
'versionDetails.tabs.artifactDetails': string
'versionDetails.tabs.code': string
'versionDetails.tabs.deployments': string
@ -247,6 +248,7 @@ export interface StringsMap {
harnessAI: string
id: string
lastUpdated: string
loading: string
modifiedAt: string
moduleName: string
na: string