/
githubmirror
/
gitness
Обзор
Документация
Войти
/
githubmirror
/
gitness
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
web/src/ar/frameworks/RepositoryStep/Repository.tsx
181 строка
5 KB
Shivang Kaushal
fix: [AH-2312]: client setup details is giving 500 at account and org level when you select the project level registry scope should be account, org and project (#5035)
10 мар 2026, 13:09
10 мар 2026, 13:09
11b6d8b
Код
Авторство
О чём код?
/* * Copyright 2024 Harness, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { IconName } from '@harnessio/icons' import type { RegistryMetadata } from '@harnessio/react-har-service-client' import { LocalArtifactType, RepositoryDetailsTab } from '@ar/pages/repository-details/constants' import type { UpstreamRepositoryURLInputSource } from '@ar/pages/upstream-proxy-details/types' import type { FormikFowardRef, RepositoryPackageType, RepositoryConfigType, PageType, Scanners } from '@ar/common/types' import type { StringKeys } from '../strings' export interface CreateRepositoryFormProps { type: RepositoryConfigType } export interface RepositoryConfigurationFormProps<T> { readonly: boolean formikRef?: FormikFowardRef<T> type: RepositoryConfigType } export interface RepositoryActionsProps<T> { data: T readonly: boolean type: RepositoryConfigType pageType: PageType /** Pre-computed registry ref (e.g. from list). When set, used for Setup Client. */ registryRef?: string } export interface RepositoySetupClientProps { onClose: () => void repoKey: string artifactKey?: string versionKey?: string /** Pre-computed registry ref (e.g. from list). When set, used for client-setup-details API. */ registryRef?: string } export interface RepositoryDetailsHeaderProps<T> { data: T type: RepositoryConfigType } export interface RepositoryTreeNodeProps { data: RegistryMetadata isLastChild?: boolean } export abstract class RepositoryStep<T, U = unknown> { protected abstract packageType: RepositoryPackageType protected abstract repositoryName: string protected abstract defaultValues: T protected abstract defaultUpstreamProxyValues: U protected abstract repositoryIcon: IconName protected abstract supportsUpstreamProxy: boolean protected repositoryIconColor?: string protected repositoryIconSize?: number protected supportedScanners?: Scanners[] protected supportedUpstreamURLSources?: UpstreamRepositoryURLInputSource[] protected isWebhookSupported?: boolean protected isDependencyFirewallSupported?: boolean isSupportCustomRegistrySuffix?: boolean supportedRepositoryTabs?: RepositoryDetailsTab[] supportedArtifactTypes?: LocalArtifactType[] enterpriseAdvancedOptionSubTitle?: StringKeys getPackageType(): string { return this.packageType } getSupportedScanners(): Scanners[] { return this.supportedScanners ?? [] } getSupportedRepositoryTabs(): RepositoryDetailsTab[] { return ( this.supportedRepositoryTabs ?? [ RepositoryDetailsTab.PACKAGES, RepositoryDetailsTab.CONFIGURATION, RepositoryDetailsTab.METADATA, RepositoryDetailsTab.WEBHOOKS ] ) } getSupportedArtifactTypes(): LocalArtifactType[] { return this.supportedArtifactTypes ?? [LocalArtifactType.ARTIFACTS] } getSupportedUpstreamURLSources(): UpstreamRepositoryURLInputSource[] { return this.supportedUpstreamURLSources ?? [] } getDefaultValues(initialValues: T): T { return { ...this.defaultValues, ...initialValues } } getUpstreamProxyDefaultValues(initialValues: U): U { return { ...this.defaultUpstreamProxyValues, ...initialValues } } getIconName(): IconName { return this.repositoryIcon } getIconColor(): string | undefined { return this.repositoryIconColor } getIconSize(): number | undefined { return this.repositoryIconSize } getStepName(): string { return this.repositoryName } getRepositoryInitialValues(data: T): T { return data } getUpstreamProxyInitialValues(data: U): U { return data } getSupportsUpstreamProxy(): boolean { return this.supportsUpstreamProxy } processRepositoryFormData(values: U): U { return values } processUpstreamProxyFormData(values: T): T { return values } getIsWebhookSupported(): boolean { return this.isWebhookSupported ?? false } getIsDependencyFirewallSupported(): boolean { return this.isDependencyFirewallSupported ?? false } getIsSupportCustomRegistrySuffix(): boolean { return this.isSupportCustomRegistrySuffix ?? false } abstract renderCreateForm(props: CreateRepositoryFormProps): JSX.Element abstract renderCofigurationForm(props: RepositoryConfigurationFormProps<U>): JSX.Element abstract renderActions(props: RepositoryActionsProps<U>): JSX.Element abstract renderSetupClient(props: RepositoySetupClientProps): JSX.Element abstract renderRepositoryDetailsHeader(props: RepositoryDetailsHeaderProps<U>): JSX.Element abstract renderRedirectPage(): JSX.Element abstract renderTreeNodeView(props: RepositoryTreeNodeProps): JSX.Element abstract renderTreeNodeDetails(): JSX.Element }