mirror of
https://github.com/harness/drone.git
synced 2025-05-17 09:30:00 +08:00
feat: [AH-518]: fix alignment issue of overview cards on version details page (#2828)
* feat: [AH-518]: resolve PR comments * feat: [AH-518]: fix alignment issue of overview cards on version details page * feat: [AH-518]: disable security scan section and show aquatrivy selected by default * feat: [AH-518]: use normal search input instead of AI search input on global artifact list page * feat: [AH-518]: update text to total downloads instead of total weekly downloads * feat: [AH-518]: remove labels from UI * feat: [AH-518]: disable cleanup policy * feat: [AH-518]: set min width for name columns in all tables in HAR module
This commit is contained in:
parent
f7411b41c9
commit
465275b549
@ -18,3 +18,7 @@
|
|||||||
--page-header-height: 0px;
|
--page-header-height: 0px;
|
||||||
background-color: var(--primary-bg) !important;
|
background-color: var(--primary-bg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root {
|
||||||
|
--har-table-name-column-min-width: 250px;
|
||||||
|
}
|
||||||
|
@ -20,10 +20,10 @@ import type { FormikProps } from 'formik'
|
|||||||
import { FontVariation } from '@harnessio/design-system'
|
import { FontVariation } from '@harnessio/design-system'
|
||||||
import { Button, Card, Layout } from '@harnessio/uicore'
|
import { Button, Card, Layout } from '@harnessio/uicore'
|
||||||
|
|
||||||
|
import { useStrings } from '@ar/frameworks/strings'
|
||||||
import CleanupPolicy from './CleanupPolicy'
|
import CleanupPolicy from './CleanupPolicy'
|
||||||
import css from './CleanupPolicyList.module.scss'
|
import css from './CleanupPolicyList.module.scss'
|
||||||
|
|
||||||
// TODO: update type once BE support cleanup policy
|
|
||||||
interface CleanupPolicyListProps<T> {
|
interface CleanupPolicyListProps<T> {
|
||||||
name: string
|
name: string
|
||||||
formikProps: FormikProps<T>
|
formikProps: FormikProps<T>
|
||||||
@ -35,11 +35,11 @@ interface CleanupPolicyListProps<T> {
|
|||||||
}
|
}
|
||||||
export default function CleanupPolicyList<T>(props: CleanupPolicyListProps<T>): JSX.Element {
|
export default function CleanupPolicyList<T>(props: CleanupPolicyListProps<T>): JSX.Element {
|
||||||
const { name, formikProps, disabled, onAdd, addButtonLabel, getDefaultValue, onRemove } = props
|
const { name, formikProps, disabled, onAdd, addButtonLabel, getDefaultValue, onRemove } = props
|
||||||
|
const { getString } = useStrings()
|
||||||
const values = get(formikProps.values, name)
|
const values = get(formikProps.values, name)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout.Vertical spacing="small">
|
<Layout.Vertical spacing="small">
|
||||||
{/* TODO: update type once BE support cleanup policy */}
|
|
||||||
{values?.map((each: any, index: number) => (
|
{values?.map((each: any, index: number) => (
|
||||||
<CleanupPolicy key={each.id} disabled={disabled} name={`${name}[${index}]`} onRemove={() => onRemove(index)} />
|
<CleanupPolicy key={each.id} disabled={disabled} name={`${name}[${index}]`} onRemove={() => onRemove(index)} />
|
||||||
))}
|
))}
|
||||||
@ -54,6 +54,7 @@ export default function CleanupPolicyList<T>(props: CleanupPolicyListProps<T>):
|
|||||||
data-testid="add-patter"
|
data-testid="add-patter"
|
||||||
onClick={() => onAdd(getDefaultValue())}
|
onClick={() => onAdd(getDefaultValue())}
|
||||||
text={addButtonLabel}
|
text={addButtonLabel}
|
||||||
|
tooltip={getString('comingSoon')}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
|
@ -15,21 +15,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useContext } from 'react'
|
import React, { useContext } from 'react'
|
||||||
import { defaultTo } from 'lodash-es'
|
|
||||||
import { Expander } from '@blueprintjs/core'
|
import { Expander } from '@blueprintjs/core'
|
||||||
import { Button, ButtonVariation, Layout, getErrorInfoFromErrorObject, useToaster } from '@harnessio/uicore'
|
import { Button, ButtonVariation, Layout } from '@harnessio/uicore'
|
||||||
import { useUpdateArtifactLabelsMutation, type ArtifactSummary } from '@harnessio/react-har-service-client'
|
import type { ArtifactSummary } from '@harnessio/react-har-service-client'
|
||||||
|
|
||||||
import { useDecodedParams, useGetSpaceRef } from '@ar/hooks'
|
import { useDecodedParams } from '@ar/hooks'
|
||||||
import { encodeRef } from '@ar/hooks/useGetSpaceRef'
|
|
||||||
import { useStrings } from '@ar/frameworks/strings/String'
|
import { useStrings } from '@ar/frameworks/strings/String'
|
||||||
import type { RepositoryPackageType } from '@ar/common/types'
|
import type { RepositoryPackageType } from '@ar/common/types'
|
||||||
import type { ArtifactDetailsPathParams } from '@ar/routes/types'
|
import type { ArtifactDetailsPathParams } from '@ar/routes/types'
|
||||||
import WeeklyDownloads from '@ar/components/PageTitle/WeeklyDownloads'
|
import WeeklyDownloads from '@ar/components/PageTitle/WeeklyDownloads'
|
||||||
import CreatedAndModifiedAt from '@ar/components/PageTitle/CreatedAndModifiedAt'
|
import CreatedAndModifiedAt from '@ar/components/PageTitle/CreatedAndModifiedAt'
|
||||||
import ArtifactTags from '@ar/components/PageTitle/ArtifactTags'
|
|
||||||
import NameAndDescription from '@ar/components/PageTitle/NameAndDescription'
|
import NameAndDescription from '@ar/components/PageTitle/NameAndDescription'
|
||||||
import { PermissionIdentifier, ResourceType } from '@ar/common/permissionTypes'
|
|
||||||
import { useSetupClientModal } from '@ar/pages/repository-details/hooks/useSetupClientModal/useSetupClientModal'
|
import { useSetupClientModal } from '@ar/pages/repository-details/hooks/useSetupClientModal/useSetupClientModal'
|
||||||
|
|
||||||
import RepositoryIcon from '@ar/frameworks/RepositoryStep/RepositoryIcon'
|
import RepositoryIcon from '@ar/frameworks/RepositoryStep/RepositoryIcon'
|
||||||
@ -44,33 +40,11 @@ interface ArtifactDetailsHeaderContentProps {
|
|||||||
function ArtifactDetailsHeaderContent(props: ArtifactDetailsHeaderContentProps): JSX.Element {
|
function ArtifactDetailsHeaderContent(props: ArtifactDetailsHeaderContentProps): JSX.Element {
|
||||||
const { iconSize = 40 } = props
|
const { iconSize = 40 } = props
|
||||||
const { data } = useContext(ArtifactProviderContext)
|
const { data } = useContext(ArtifactProviderContext)
|
||||||
const spaceRef = useGetSpaceRef()
|
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const { showSuccess, showError, clear } = useToaster()
|
|
||||||
const pathParams = useDecodedParams<ArtifactDetailsPathParams>()
|
const pathParams = useDecodedParams<ArtifactDetailsPathParams>()
|
||||||
|
|
||||||
const { repositoryIdentifier, artifactIdentifier } = pathParams
|
const { repositoryIdentifier, artifactIdentifier } = pathParams
|
||||||
const { packageType, imageName, modifiedAt, createdAt, downloadsCount, labels } = data as ArtifactSummary
|
const { packageType, imageName, modifiedAt, createdAt, downloadsCount } = data as ArtifactSummary
|
||||||
|
|
||||||
const { mutateAsync: modifyArtifactLabels } = useUpdateArtifactLabelsMutation()
|
|
||||||
|
|
||||||
const handleUpdateArtifactLabels = async (newLabels: string[]) => {
|
|
||||||
try {
|
|
||||||
const response = await modifyArtifactLabels({
|
|
||||||
body: { labels: newLabels },
|
|
||||||
registry_ref: spaceRef,
|
|
||||||
artifact: encodeRef(artifactIdentifier)
|
|
||||||
})
|
|
||||||
if (response.content.status === 'SUCCESS') {
|
|
||||||
clear()
|
|
||||||
showSuccess(getString('artifactDetails.labelsUpdated'))
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
} catch (e: any) {
|
|
||||||
showError(getErrorInfoFromErrorObject(e, true))
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const [showSetupClientModal] = useSetupClientModal({
|
const [showSetupClientModal] = useSetupClientModal({
|
||||||
repoKey: repositoryIdentifier,
|
repoKey: repositoryIdentifier,
|
||||||
@ -87,7 +61,7 @@ function ArtifactDetailsHeaderContent(props: ArtifactDetailsHeaderContentProps):
|
|||||||
spacing="small"
|
spacing="small"
|
||||||
flex={{ justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
flex={{ justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
||||||
<NameAndDescription name={imageName} hideDescription />
|
<NameAndDescription name={imageName} hideDescription />
|
||||||
<WeeklyDownloads downloads={downloadsCount} label={getString('artifactDetails.downloadsThisWeek')} />
|
<WeeklyDownloads downloads={downloadsCount} label={getString('artifactDetails.totalDownloads')} />
|
||||||
</Layout.Vertical>
|
</Layout.Vertical>
|
||||||
<Expander />
|
<Expander />
|
||||||
<Layout.Vertical
|
<Layout.Vertical
|
||||||
@ -105,18 +79,6 @@ function ArtifactDetailsHeaderContent(props: ArtifactDetailsHeaderContentProps):
|
|||||||
icon="setting"
|
icon="setting"
|
||||||
/>
|
/>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
<ArtifactTags
|
|
||||||
onChange={handleUpdateArtifactLabels}
|
|
||||||
labels={defaultTo(labels, [])}
|
|
||||||
placeholder={getString('artifactDetails.artifactLabelInputPlaceholder')}
|
|
||||||
permission={{
|
|
||||||
permission: PermissionIdentifier.EDIT_ARTIFACT_REGISTRY,
|
|
||||||
resource: {
|
|
||||||
resourceType: ResourceType.ARTIFACT_REGISTRY,
|
|
||||||
resourceIdentifier: repositoryIdentifier
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Layout.Vertical>
|
</Layout.Vertical>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
</Layout.Vertical>
|
</Layout.Vertical>
|
||||||
|
@ -2,3 +2,4 @@ page: Artifact Details Page
|
|||||||
downloadsThisWeek: Downloads This Week
|
downloadsThisWeek: Downloads This Week
|
||||||
artifactLabelInputPlaceholder: Type input and hit enter
|
artifactLabelInputPlaceholder: Type input and hit enter
|
||||||
labelsUpdated: Artifact labels updated successfully!
|
labelsUpdated: Artifact labels updated successfully!
|
||||||
|
totalDownloads: Total Downloads
|
||||||
|
@ -14,10 +14,18 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useMemo } from 'react'
|
import React, { useMemo, useRef } from 'react'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
import { flushSync } from 'react-dom'
|
||||||
import { Expander } from '@blueprintjs/core'
|
import { Expander } from '@blueprintjs/core'
|
||||||
import { HarnessDocTooltip, Page, Button, ButtonVariation } from '@harnessio/uicore'
|
import {
|
||||||
|
HarnessDocTooltip,
|
||||||
|
Page,
|
||||||
|
Button,
|
||||||
|
ButtonVariation,
|
||||||
|
ExpandingSearchInput,
|
||||||
|
ExpandingSearchInputHandle
|
||||||
|
} from '@harnessio/uicore'
|
||||||
import {
|
import {
|
||||||
GetAllHarnessArtifactsQueryQueryParams,
|
GetAllHarnessArtifactsQueryQueryParams,
|
||||||
useGetAllHarnessArtifactsQuery
|
useGetAllHarnessArtifactsQuery
|
||||||
@ -30,10 +38,8 @@ import { useGetSpaceRef, useParentComponents, useParentHooks } from '@ar/hooks'
|
|||||||
import PackageTypeSelector from '@ar/components/PackageTypeSelector/PackageTypeSelector'
|
import PackageTypeSelector from '@ar/components/PackageTypeSelector/PackageTypeSelector'
|
||||||
|
|
||||||
import { ArtifactListVersionFilter } from './constants'
|
import { ArtifactListVersionFilter } from './constants'
|
||||||
import LabelsSelector from './components/LabelsSelector/LabelsSelector'
|
|
||||||
import ArtifactListTable from './components/ArtifactListTable/ArtifactListTable'
|
import ArtifactListTable from './components/ArtifactListTable/ArtifactListTable'
|
||||||
import RepositorySelector from './components/RepositorySelector/RepositorySelector'
|
import RepositorySelector from './components/RepositorySelector/RepositorySelector'
|
||||||
import ArtifactSearchInput from './components/ArtifactSearchInput/ArtifactSearchInput'
|
|
||||||
import { useArtifactListQueryParamOptions, type ArtifactListPageQueryParams } from './utils'
|
import { useArtifactListQueryParamOptions, type ArtifactListPageQueryParams } from './utils'
|
||||||
|
|
||||||
import css from './ArtifactListPage.module.scss'
|
import css from './ArtifactListPage.module.scss'
|
||||||
@ -47,6 +53,7 @@ function ArtifactListPage(): JSX.Element {
|
|||||||
const { searchTerm, isDeployedArtifacts, repositoryKey, page, size, latestVersion, packageTypes, labels } =
|
const { searchTerm, isDeployedArtifacts, repositoryKey, page, size, latestVersion, packageTypes, labels } =
|
||||||
queryParams
|
queryParams
|
||||||
const spaceRef = useGetSpaceRef('')
|
const spaceRef = useGetSpaceRef('')
|
||||||
|
const searchRef = useRef({} as ExpandingSearchInputHandle)
|
||||||
|
|
||||||
const { preference: sortingPreference, setPreference: setSortingPreference } = usePreferenceStore<string | undefined>(
|
const { preference: sortingPreference, setPreference: setSortingPreference } = usePreferenceStore<string | undefined>(
|
||||||
PreferenceScope.USER,
|
PreferenceScope.USER,
|
||||||
@ -84,6 +91,7 @@ function ArtifactListPage(): JSX.Element {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const handleClearAllFilters = (): void => {
|
const handleClearAllFilters = (): void => {
|
||||||
|
flushSync(searchRef.current.clear)
|
||||||
updateQueryParams({
|
updateQueryParams({
|
||||||
page: 0,
|
page: 0,
|
||||||
searchTerm: '',
|
searchTerm: '',
|
||||||
@ -108,12 +116,23 @@ function ArtifactListPage(): JSX.Element {
|
|||||||
/>
|
/>
|
||||||
<Page.SubHeader className={css.subHeader}>
|
<Page.SubHeader className={css.subHeader}>
|
||||||
<div className={css.subHeaderItems}>
|
<div className={css.subHeaderItems}>
|
||||||
<ArtifactSearchInput
|
{/* TODO: remove AI serach input as not implemented from BE and use normal search input */}
|
||||||
|
{/* <ArtifactSearchInput
|
||||||
searchTerm={searchTerm || ''}
|
searchTerm={searchTerm || ''}
|
||||||
onChange={text => {
|
onChange={text => {
|
||||||
updateQueryParams({ searchTerm: text || undefined, page: DEFAULT_PAGE_INDEX })
|
updateQueryParams({ searchTerm: text || undefined, page: DEFAULT_PAGE_INDEX })
|
||||||
}}
|
}}
|
||||||
placeholder={getString('search')}
|
placeholder={getString('search')}
|
||||||
|
/> */}
|
||||||
|
<ExpandingSearchInput
|
||||||
|
alwaysExpanded
|
||||||
|
width={400}
|
||||||
|
placeholder={getString('search')}
|
||||||
|
onChange={text => {
|
||||||
|
updateQueryParams({ searchTerm: text || undefined, page: DEFAULT_PAGE_INDEX })
|
||||||
|
}}
|
||||||
|
defaultValue={searchTerm}
|
||||||
|
ref={searchRef}
|
||||||
/>
|
/>
|
||||||
<RepositorySelector
|
<RepositorySelector
|
||||||
value={repositoryKey}
|
value={repositoryKey}
|
||||||
@ -127,12 +146,13 @@ function ArtifactListPage(): JSX.Element {
|
|||||||
updateQueryParams({ packageTypes: val, page: DEFAULT_PAGE_INDEX })
|
updateQueryParams({ packageTypes: val, page: DEFAULT_PAGE_INDEX })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<LabelsSelector
|
{/* TODO: remove for beta release. but support in future */}
|
||||||
|
{/* <LabelsSelector
|
||||||
value={labels}
|
value={labels}
|
||||||
onChange={val => {
|
onChange={val => {
|
||||||
updateQueryParams({ labels: val, page: DEFAULT_PAGE_INDEX })
|
updateQueryParams({ labels: val, page: DEFAULT_PAGE_INDEX })
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
<Expander />
|
<Expander />
|
||||||
<ButtonTabs
|
<ButtonTabs
|
||||||
className={css.filterTabContainer}
|
className={css.filterTabContainer}
|
||||||
|
@ -24,7 +24,6 @@ import { useGetAllArtifactsByRegistryQuery } from '@harnessio/react-har-service-
|
|||||||
import { useStrings } from '@ar/frameworks/strings'
|
import { useStrings } from '@ar/frameworks/strings'
|
||||||
import { DEFAULT_PAGE_INDEX, PreferenceScope } from '@ar/constants'
|
import { DEFAULT_PAGE_INDEX, PreferenceScope } from '@ar/constants'
|
||||||
import { useGetSpaceRef, useParentHooks } from '@ar/hooks'
|
import { useGetSpaceRef, useParentHooks } from '@ar/hooks'
|
||||||
import LabelsSelector from './components/LabelsSelector/LabelsSelector'
|
|
||||||
import {
|
import {
|
||||||
useRegistryArtifactListQueryParamOptions,
|
useRegistryArtifactListQueryParamOptions,
|
||||||
type RegistryArtifactListPageQueryParams
|
type RegistryArtifactListPageQueryParams
|
||||||
@ -104,12 +103,13 @@ function RegistryArtifactListPage({ pageBodyClassName }: RegistryArtifactListPag
|
|||||||
<>
|
<>
|
||||||
<Page.SubHeader className={css.subHeader}>
|
<Page.SubHeader className={css.subHeader}>
|
||||||
<div className={css.subHeaderItems}>
|
<div className={css.subHeaderItems}>
|
||||||
<LabelsSelector
|
{/* TODO: remove for beta release. but support in future */}
|
||||||
|
{/* <LabelsSelector
|
||||||
value={labels}
|
value={labels}
|
||||||
onChange={val => {
|
onChange={val => {
|
||||||
updateQueryParams({ labels: val, page: DEFAULT_PAGE_INDEX })
|
updateQueryParams({ labels: val, page: DEFAULT_PAGE_INDEX })
|
||||||
}}
|
}}
|
||||||
/>
|
/> */}
|
||||||
<Expander />
|
<Expander />
|
||||||
<ExpandingSearchInput
|
<ExpandingSearchInput
|
||||||
alwaysExpanded
|
alwaysExpanded
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 1fr 10rem 10rem 15rem 15rem 15rem 50px;
|
grid-template-columns: minmax(var(--har-table-name-column-min-width), 1fr) 10rem 10rem 15rem 15rem 15rem 50px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 1fr 15rem 20rem 15rem;
|
grid-template-columns: minmax(var(--har-table-name-column-min-width), 1fr) 15rem 20rem 15rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 1fr 10rem 10rem 10rem 20rem 10rem 50px !important;
|
grid-template-columns: minmax(var(--har-table-name-column-min-width), 1fr) 10rem 10rem 10rem 20rem 10rem 50px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
|
@ -48,7 +48,7 @@ export class DockerRepositoryType extends RepositoryStep<VirtualRegistryRequest>
|
|||||||
protected packageType = RepositoryPackageType.DOCKER
|
protected packageType = RepositoryPackageType.DOCKER
|
||||||
protected repositoryName = 'Docker Repository'
|
protected repositoryName = 'Docker Repository'
|
||||||
protected repositoryIcon: IconName = 'docker-step'
|
protected repositoryIcon: IconName = 'docker-step'
|
||||||
protected supportedScanners = [Scanners.AQUA_TRIVY, Scanners.GRYPE]
|
protected supportedScanners = [Scanners.AQUA_TRIVY]
|
||||||
|
|
||||||
protected defaultValues: VirtualRegistryRequest = {
|
protected defaultValues: VirtualRegistryRequest = {
|
||||||
packageType: RepositoryPackageType.DOCKER,
|
packageType: RepositoryPackageType.DOCKER,
|
||||||
|
@ -95,7 +95,7 @@ function RepositoryConfigurationFormContent(
|
|||||||
<RepositoryIncludeExcludePatternFormContent isEdit disabled={readonly} />
|
<RepositoryIncludeExcludePatternFormContent isEdit disabled={readonly} />
|
||||||
<Separator />
|
<Separator />
|
||||||
<Container className={css.upstreamProxiesContainer}>
|
<Container className={css.upstreamProxiesContainer}>
|
||||||
<RepositoryCleanupPoliciesFormContent isEdit disabled={readonly} />
|
<RepositoryCleanupPoliciesFormContent isEdit disabled />
|
||||||
</Container>
|
</Container>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
@ -36,7 +36,7 @@ interface SelectContainerScannersFormSectionProps {
|
|||||||
export default function SelectContainerScannersFormSection(
|
export default function SelectContainerScannersFormSection(
|
||||||
props: SelectContainerScannersFormSectionProps
|
props: SelectContainerScannersFormSectionProps
|
||||||
): JSX.Element {
|
): JSX.Element {
|
||||||
const { packageType, readonly } = props
|
const { packageType } = props
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
|
|
||||||
const availableScannerOptions = useMemo(() => {
|
const availableScannerOptions = useMemo(() => {
|
||||||
@ -61,7 +61,7 @@ export default function SelectContainerScannersFormSection(
|
|||||||
packageType={packageType as RepositoryPackageType}
|
packageType={packageType as RepositoryPackageType}
|
||||||
options={availableScannerOptions}
|
options={availableScannerOptions}
|
||||||
isEdit
|
isEdit
|
||||||
readonly={readonly}
|
readonly
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
</Container>
|
</Container>
|
||||||
|
@ -20,7 +20,7 @@ import { FontVariation } from '@harnessio/design-system'
|
|||||||
import { Checkbox, CheckboxVariant, Container, Layout, Text } from '@harnessio/uicore'
|
import { Checkbox, CheckboxVariant, Container, Layout, Text } from '@harnessio/uicore'
|
||||||
|
|
||||||
import { useLicenseStore } from '@ar/hooks'
|
import { useLicenseStore } from '@ar/hooks'
|
||||||
import type { RepositoryPackageType } from '@ar/common/types'
|
import { Scanners, type RepositoryPackageType } from '@ar/common/types'
|
||||||
import { LICENSE_STATE_VALUES } from '@ar/common/LicenseTypes'
|
import { LICENSE_STATE_VALUES } from '@ar/common/LicenseTypes'
|
||||||
import type { VirtualRegistryRequest } from '@ar/pages/repository-details/types'
|
import type { VirtualRegistryRequest } from '@ar/pages/repository-details/types'
|
||||||
import type { ScannerConfigSpec } from '@ar/pages/repository-details/constants'
|
import type { ScannerConfigSpec } from '@ar/pages/repository-details/constants'
|
||||||
@ -55,7 +55,8 @@ export default function SelectScannerFormSection(props: SelectScannerFormSection
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getCheckboxState = (value: ScannerConfigSpec['value']) => {
|
const getCheckboxState = (value: ScannerConfigSpec['value']) => {
|
||||||
return values.scanners?.some(each => each.name === value) || false
|
return value === Scanners.AQUA_TRIVY
|
||||||
|
// return values.scanners?.some(each => each.name === value) || false
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 1fr 12rem 10rem 10rem 10rem 10rem 12rem 50px;
|
grid-template-columns: minmax(var(--har-table-name-column-min-width), 1fr) 10rem 8rem 9rem 10rem 10rem 10rem 50px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ export default function UpstreamProxyConfigurationFormContent(
|
|||||||
<UpstreamProxyIncludeExcludePatternFormContent formikProps={formikProps} isEdit readonly={readonly} />
|
<UpstreamProxyIncludeExcludePatternFormContent formikProps={formikProps} isEdit readonly={readonly} />
|
||||||
<Separator />
|
<Separator />
|
||||||
<Container className={css.cleanupPoliciesContainer}>
|
<Container className={css.cleanupPoliciesContainer}>
|
||||||
<UpstreamProxyCleanupPoliciesFormContent formikProps={formikProps} isEdit disabled={readonly} />
|
<UpstreamProxyCleanupPoliciesFormContent formikProps={formikProps} isEdit disabled />
|
||||||
</Container>
|
</Container>
|
||||||
</Card>
|
</Card>
|
||||||
</CollapseContainer>
|
</CollapseContainer>
|
||||||
|
@ -24,6 +24,10 @@
|
|||||||
padding: var(--spacing-7) !important;
|
padding: var(--spacing-7) !important;
|
||||||
background-color: var(--white);
|
background-color: var(--white);
|
||||||
margin: var(--spacing-large);
|
margin: var(--spacing-large);
|
||||||
|
|
||||||
|
& .card {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.gridContainer {
|
.gridContainer {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
// This is an auto-generated file
|
// This is an auto-generated file
|
||||||
|
export declare const card: string
|
||||||
export declare const cardContainer: string
|
export declare const cardContainer: string
|
||||||
export declare const deploymentTablePageBody: string
|
export declare const deploymentTablePageBody: string
|
||||||
export declare const gridContainer: string
|
export declare const gridContainer: string
|
||||||
|
@ -69,7 +69,7 @@ export default function DockerVersionOverviewContent(): JSX.Element {
|
|||||||
{response && (
|
{response && (
|
||||||
<Layout.Vertical className={css.cardContainer} spacing="medium" flex={{ alignItems: 'flex-start' }}>
|
<Layout.Vertical className={css.cardContainer} spacing="medium" flex={{ alignItems: 'flex-start' }}>
|
||||||
<DockerVersionOverviewCards />
|
<DockerVersionOverviewCards />
|
||||||
<Card title="General Information">
|
<Card title={getString('versionDetails.overview.generalInformation.title')} className={css.card}>
|
||||||
<Layout.Vertical spacing="medium">
|
<Layout.Vertical spacing="medium">
|
||||||
<Text font={{ variation: FontVariation.CARD_TITLE }}>
|
<Text font={{ variation: FontVariation.CARD_TITLE }}>
|
||||||
{getString('versionDetails.overview.generalInformation.title')}
|
{getString('versionDetails.overview.generalInformation.title')}
|
||||||
|
@ -63,6 +63,7 @@ export default function DeploymentOverviewCards(props: DeploymentOverviewCardsPr
|
|||||||
<DeploymentsCard
|
<DeploymentsCard
|
||||||
prodCount={defaultTo(deploymentStats?.Production, 0)}
|
prodCount={defaultTo(deploymentStats?.Production, 0)}
|
||||||
nonProdCount={defaultTo(deploymentStats?.PreProduction, 0)}
|
nonProdCount={defaultTo(deploymentStats?.PreProduction, 0)}
|
||||||
|
hideBuildDetails
|
||||||
/>
|
/>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
)
|
)
|
||||||
|
@ -28,6 +28,6 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 1fr 10rem 20rem 15rem 15rem;
|
grid-template-columns: minmax(var(--har-table-name-column-min-width), 1fr) 10rem 20rem 15rem 15rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,4 +30,8 @@
|
|||||||
border: 1px solid var(--primary-2);
|
border: 1px solid var(--primary-2);
|
||||||
box-shadow: 0px 4px 8px 0px rgba(69, 71, 101, 0.16), 0px 0px 2px 0px rgba(40, 41, 61, 0.04);
|
box-shadow: 0px 4px 8px 0px rgba(69, 71, 101, 0.16), 0px 0px 2px 0px rgba(40, 41, 61, 0.04);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.deploymentsCard {
|
||||||
|
width: 40%;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,4 +18,5 @@
|
|||||||
// This is an auto-generated file
|
// This is an auto-generated file
|
||||||
export declare const card: string
|
export declare const card: string
|
||||||
export declare const container: string
|
export declare const container: string
|
||||||
|
export declare const deploymentsCard: string
|
||||||
export declare const securityTestsCard: string
|
export declare const securityTestsCard: string
|
||||||
|
@ -83,7 +83,7 @@ export default function DockerVersionOverviewCards() {
|
|||||||
{responseData && (
|
{responseData && (
|
||||||
<Layout.Horizontal width="100%" spacing="medium">
|
<Layout.Horizontal width="100%" spacing="medium">
|
||||||
<DeploymentsCard
|
<DeploymentsCard
|
||||||
className={css.card}
|
className={classNames(css.card, css.deploymentsCard)}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
handleRedirectToTab(VersionDetailsTab.DEPLOYMENTS)
|
handleRedirectToTab(VersionDetailsTab.DEPLOYMENTS)
|
||||||
}}
|
}}
|
||||||
|
@ -35,10 +35,11 @@ interface DeploymentsCardProps {
|
|||||||
executionId?: string
|
executionId?: string
|
||||||
className?: string
|
className?: string
|
||||||
onClick?: () => void
|
onClick?: () => void
|
||||||
|
hideBuildDetails?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function DeploymentsCard(props: DeploymentsCardProps) {
|
export default function DeploymentsCard(props: DeploymentsCardProps) {
|
||||||
const { prodCount, nonProdCount, pipelineName, executionId, onClick, className, pipelineId } = props
|
const { prodCount, nonProdCount, pipelineName, executionId, onClick, className, pipelineId, hideBuildDetails } = props
|
||||||
const totalCount = defaultTo(prodCount, 0) + defaultTo(nonProdCount, 0)
|
const totalCount = defaultTo(prodCount, 0) + defaultTo(nonProdCount, 0)
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const { scope } = useAppStore()
|
const { scope } = useAppStore()
|
||||||
@ -72,30 +73,36 @@ export default function DeploymentsCard(props: DeploymentsCardProps) {
|
|||||||
/>
|
/>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
</Layout.Vertical>
|
</Layout.Vertical>
|
||||||
{getRouteToPipelineExecutionView && pipelineName && executionId && pipelineId && (
|
{!hideBuildDetails && (
|
||||||
<Layout.Vertical spacing="medium" flex={{ justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
<Layout.Vertical spacing="medium" flex={{ justifyContent: 'space-between', alignItems: 'flex-start' }}>
|
||||||
<Text font={{ variation: FontVariation.CARD_TITLE }}>
|
<Text font={{ variation: FontVariation.CARD_TITLE }}>
|
||||||
{getString('versionDetails.cards.deploymentsCard.buildTitle')}
|
{getString('versionDetails.cards.deploymentsCard.buildTitle')}
|
||||||
</Text>
|
</Text>
|
||||||
<Layout.Vertical spacing="xsmall">
|
{getRouteToPipelineExecutionView && pipelineName && executionId && pipelineId ? (
|
||||||
<Link
|
<Layout.Vertical spacing="xsmall">
|
||||||
to={getRouteToPipelineExecutionView({
|
<Link
|
||||||
accountId: scope.accountId,
|
to={getRouteToPipelineExecutionView({
|
||||||
orgIdentifier: scope.orgIdentifier,
|
accountId: scope.accountId,
|
||||||
projectIdentifier: scope.projectIdentifier,
|
orgIdentifier: scope.orgIdentifier,
|
||||||
pipelineIdentifier: pipelineId,
|
projectIdentifier: scope.projectIdentifier,
|
||||||
executionIdentifier: executionId,
|
pipelineIdentifier: pipelineId,
|
||||||
module: 'ci'
|
executionIdentifier: executionId,
|
||||||
})}
|
module: 'ci'
|
||||||
onClick={evt => {
|
})}
|
||||||
evt.stopPropagation()
|
onClick={evt => {
|
||||||
}}>
|
evt.stopPropagation()
|
||||||
{pipelineName}
|
}}>
|
||||||
</Link>
|
{pipelineName}
|
||||||
|
</Link>
|
||||||
|
<Text color={Color.GREY_500} font={{ variation: FontVariation.SMALL }}>
|
||||||
|
{getString('versionDetails.cards.deploymentsCard.executionId')}: {executionId}
|
||||||
|
</Text>
|
||||||
|
</Layout.Vertical>
|
||||||
|
) : (
|
||||||
<Text color={Color.GREY_500} font={{ variation: FontVariation.SMALL }}>
|
<Text color={Color.GREY_500} font={{ variation: FontVariation.SMALL }}>
|
||||||
{getString('versionDetails.cards.deploymentsCard.executionId')}: {executionId}
|
{getString('na')}
|
||||||
</Text>
|
</Text>
|
||||||
</Layout.Vertical>
|
)}
|
||||||
</Layout.Vertical>
|
</Layout.Vertical>
|
||||||
)}
|
)}
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
|
@ -70,6 +70,7 @@ export default function SupplyChainCard(props: SupplyChainCardProps) {
|
|||||||
rightIcon="download-manifests"
|
rightIcon="download-manifests"
|
||||||
variation={ButtonVariation.LINK}
|
variation={ButtonVariation.LINK}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
|
disabled={!provenanceId}
|
||||||
onClick={evt => {
|
onClick={evt => {
|
||||||
killEvent(evt)
|
killEvent(evt)
|
||||||
download(provenanceId)
|
download(provenanceId)
|
||||||
|
@ -44,7 +44,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 40px 1fr 10rem 10rem 38rem;
|
grid-template-columns: 40px minmax(var(--har-table-name-column-min-width), 1fr) 10rem 10rem 38rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,7 +52,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 40px 1fr 15rem 10rem 10rem 30rem;
|
grid-template-columns: 40px minmax(var(--har-table-name-column-min-width), 1fr) 15rem 10rem 10rem 30rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 1fr 8rem 8rem 10rem 35rem;
|
grid-template-columns: minmax(var(--har-table-name-column-min-width), 1fr) 8rem 8rem 10rem 35rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@
|
|||||||
div[class*='TableV2--cells'],
|
div[class*='TableV2--cells'],
|
||||||
div[class*='TableV2--header'] {
|
div[class*='TableV2--header'] {
|
||||||
display: grid !important;
|
display: grid !important;
|
||||||
grid-template-columns: 1fr 8rem 8rem 10rem 35rem;
|
grid-template-columns: minmax(200px, 1fr) 8rem 8rem 10rem 35rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ new: NEW
|
|||||||
harLabel: '{{ $.repositoryList.artifactRegistry.label }}'
|
harLabel: '{{ $.repositoryList.artifactRegistry.label }}'
|
||||||
na: N/A
|
na: N/A
|
||||||
cancel: Cancel
|
cancel: Cancel
|
||||||
|
comingSoon: Coming Soon.
|
||||||
failedToLoadData: Failed to load data. Please try again!
|
failedToLoadData: Failed to load data. Please try again!
|
||||||
noResultsFound: No results found
|
noResultsFound: No results found
|
||||||
optionalField: '{{name}} (optional)'
|
optionalField: '{{name}} (optional)'
|
||||||
|
@ -14,6 +14,7 @@ export interface StringsMap {
|
|||||||
'artifactDetails.downloadsThisWeek': string
|
'artifactDetails.downloadsThisWeek': string
|
||||||
'artifactDetails.labelsUpdated': string
|
'artifactDetails.labelsUpdated': string
|
||||||
'artifactDetails.page': string
|
'artifactDetails.page': string
|
||||||
|
'artifactDetails.totalDownloads': string
|
||||||
'artifactList.deployedArtifacts': string
|
'artifactList.deployedArtifacts': string
|
||||||
'artifactList.page': string
|
'artifactList.page': string
|
||||||
'artifactList.pageHeading': string
|
'artifactList.pageHeading': string
|
||||||
@ -230,6 +231,7 @@ export interface StringsMap {
|
|||||||
'cleanupPolicy.name': string
|
'cleanupPolicy.name': string
|
||||||
'cleanupPolicy.placeholder': string
|
'cleanupPolicy.placeholder': string
|
||||||
clearFilters: string
|
clearFilters: string
|
||||||
|
comingSoon: string
|
||||||
copied: string
|
copied: string
|
||||||
copy: string
|
copy: string
|
||||||
createdAt: string
|
createdAt: string
|
||||||
|
Loading…
Reference in New Issue
Block a user