update: [code-2017] swagger (#2110)

* update: [code-2017] id and display_name to identifier
* fix: [code-2017] comment update
* fix: [code-2017] replace identifier with id in pipelines
* fix: [code-2017] prettier
* update: [code-2017] swagger
unified-ui
Ritik Kapoor 2024-07-05 16:39:26 +00:00 committed by Harness
parent d46516baa7
commit 87e418bb86
76 changed files with 3188 additions and 692 deletions

View File

@ -17,7 +17,7 @@ package types
import "encoding/json"
type Pipeline struct {
ID int64 `db:"pipeline_id" json:"-"`
ID int64 `db:"pipeline_id" json:"id"`
Description string `db:"pipeline_description" json:"description"`
Identifier string `db:"pipeline_uid" json:"identifier"`
Disabled bool `db:"pipeline_disabled" json:"disabled"`

View File

@ -1,4 +1,4 @@
import { atom } from 'jotai'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
export const repoMetadataAtom = atom<TypesRepository | undefined>(undefined)
export const repoMetadataAtom = atom<RepoRepositoryOutput | undefined>(undefined)

View File

@ -39,7 +39,7 @@ import { BranchTargetType, SettingTypeMode, SettingsTab, branchTargetOptions } f
import { useStrings } from 'framework/strings'
import { REGEX_VALID_REPO_NAME, getErrorMessage, permissionProps, rulesFormInitialPayload } from 'utils/Utils'
import type {
TypesRepository,
RepoRepositoryOutput,
OpenapiRule,
TypesPrincipalInfo,
EnumMergeMethod,
@ -58,7 +58,7 @@ import css from './BranchProtectionForm.module.scss'
const BranchProtectionForm = (props: {
ruleUid: string
editMode: boolean
repoMetadata?: TypesRepository | undefined
repoMetadata?: RepoRepositoryOutput | undefined
refetchRules: () => void
settingSectionMode: SettingTypeMode
}) => {
@ -172,7 +172,7 @@ const BranchProtectionForm = (props: {
userArrayState.length > 0 ? userArrayState : usersArray?.map(user => `${user.id} ${user.display_name}`)
return {
name: rule?.uid,
name: rule?.identifier,
desc: rule.description,
enable: rule.state !== 'disabled',
target: '',
@ -188,8 +188,9 @@ const BranchProtectionForm = (props: {
requireNewChanges: (rule.definition as ProtectionBranch)?.pullreq?.approvals?.require_latest_commit,
reqResOfChanges: (rule.definition as ProtectionBranch)?.pullreq?.approvals?.require_no_change_request,
requireCommentResolution: (rule.definition as ProtectionBranch)?.pullreq?.comments?.require_resolve_all, // eslint-disable-next-line @typescript-eslint/no-explicit-any
requireStatusChecks: (rule.definition as any)?.pullreq?.status_checks?.require_uids?.length > 0,
statusChecks: (rule.definition as ProtectionBranch)?.pullreq?.status_checks?.require_uids || ([] as string[]),
requireStatusChecks: (rule.definition as any)?.pullreq?.status_checks?.require_identifiers?.length > 0,
statusChecks:
(rule.definition as ProtectionBranch)?.pullreq?.status_checks?.require_identifiers || ([] as string[]),
limitMergeStrategies: !!(rule.definition as ProtectionBranch)?.pullreq?.merge?.strategies_allowed,
mergeCommit: isMergePresent,
squashMerge: isSquashPresent,
@ -210,7 +211,7 @@ const BranchProtectionForm = (props: {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},
@ -238,7 +239,7 @@ const BranchProtectionForm = (props: {
const bypassList = formData?.bypassList?.map(item => parseInt(item.split(' ')[0]))
const payload: OpenapiRule = {
uid: formData.name,
identifier: formData.name,
type: 'branch',
description: formData.desc,
state: formData.enable === true ? 'active' : 'disabled',
@ -267,7 +268,7 @@ const BranchProtectionForm = (props: {
delete_branch: formData.autoDelete
},
status_checks: {
require_uids: formData.statusChecks
require_identifiers: formData.statusChecks
}
},
lifecycle: {

View File

@ -41,7 +41,7 @@ const BranchProtectionHeader = ({
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},

View File

@ -99,12 +99,12 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
const { mutate } = useMutate<OpenapiRule>({
verb: 'PATCH',
path: `/api/v1/repos/${repoMetadata?.path}/+/rules/${row.original?.uid}`
path: `/api/v1/repos/${repoMetadata?.path}/+/rules/${row.original?.identifier}`
})
const [popoverDialogOpen, setPopoverDialogOpen] = useState(false)
const { mutate: deleteRule } = useMutate({
verb: 'DELETE',
path: `/api/v1/repos/${repoMetadata?.path}/+/rules/${row.original.uid}`
path: `/api/v1/repos/${repoMetadata?.path}/+/rules/${row.original.identifier}`
})
const confirmDelete = useConfirmAct()
const includeElements = (row.original?.pattern as ProtectionPattern)?.include?.map(
@ -149,7 +149,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
'pullreq.approvals.require_latest_commit': getString('branchProtection.reqNewChangesTitle'),
'pullreq.comments.require_resolve_all': getString('branchProtection.reqCommentResolutionTitle'),
'pullreq.status_checks.all_must_succeed': getString('branchProtection.reqStatusChecksTitle'),
'pullreq.status_checks.require_uids': getString('branchProtection.reqStatusChecksTitle'),
'pullreq.status_checks.require_identifiers': getString('branchProtection.reqStatusChecksTitle'),
'pullreq.merge.strategies_allowed': getString('branchProtection.limitMergeStrategies'),
'pullreq.merge.delete_branch': getString('branchProtection.autoDeleteTitle'),
'lifecycle.create_forbidden': getString('branchProtection.blockBranchCreation'),
@ -187,7 +187,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},
@ -215,7 +215,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
<StringSubstitute
str={checked ? getString('disableWebhookContent') : getString('enableWebhookContent')}
vars={{
name: <strong>{row.original?.uid}</strong>
name: <strong>{row.original?.identifier}</strong>
}}
/>
</Text>
@ -251,7 +251,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
<Toggle
{...permissionProps(permPushResult, standalone)}
padding={{ top: 'xsmall' }}
key={`${row.original.uid}-toggle`}
key={`${row.original.identifier}-toggle`}
// className={cx(css.toggle, checked ? css.toggleEnable : css.toggleDisable)}
checked={checked}></Toggle>
</Popover>
@ -259,7 +259,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
<Container padding={{ left: 'small' }} style={{ flexGrow: 1 }}>
<Layout.Horizontal spacing="small">
<Text padding={{ right: 'small', top: 'xsmall' }} lineClamp={1} width={150} className={css.title}>
{row.original.uid}
{row.original.identifier}
</Text>
{!!row.original.description && (
@ -284,7 +284,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
repoPath: repoMetadata?.path as string,
settingSection: settingSection,
settingSectionMode: SettingTypeMode.EDIT,
ruleId: String(row.original.uid)
ruleId: String(row.original.identifier)
})
)
}
@ -297,7 +297,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
confirmDelete({
className: css.hideButtonIcon,
title: getString('branchProtection.deleteProtectionRule'),
message: getString('branchProtection.deleteText', { rule: row.original.uid }),
message: getString('branchProtection.deleteText', { rule: row.original.identifier }),
action: async () => {
try {
await deleteRule({})
@ -337,7 +337,9 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
<>
{nonEmptyRules.map((rule: { value: string }) => {
return (
<Text key={`${row.original.uid}-${rule}`} className={css.appliedRulesTextContainer}>
<Text
key={`${row.original.identifier}-${rule}`}
className={css.appliedRulesTextContainer}>
{rule.value}
</Text>
)
@ -368,7 +370,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},
@ -405,13 +407,13 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
data={rules}
getRowClassName={() => css.row}
onRowClick={row => {
setCurRuleName(row.uid as string)
setCurRuleName(row.identifier as string)
history.push(
routes.toCODESettings({
repoPath: repoMetadata?.path as string,
settingSection: settingSection,
settingSectionMode: SettingTypeMode.EDIT,
ruleId: String(row.uid)
ruleId: String(row.identifier)
})
)
}}

View File

@ -26,7 +26,7 @@ import { useStrings } from 'framework/strings'
import { ThreadSection } from 'components/ThreadSection/ThreadSection'
import { PipeSeparator } from 'components/PipeSeparator/PipeSeparator'
import { useAppContext } from 'AppContext'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
import { MarkdownEditorWithPreview } from 'components/MarkdownEditorWithPreview/MarkdownEditorWithPreview'
import { MarkdownViewer } from 'components/MarkdownViewer/MarkdownViewer'
@ -94,7 +94,7 @@ interface CommentBoxProps<T> {
outlets?: Partial<Record<CommentBoxOutletPosition, React.ReactNode>>
autoFocusAndPosition?: boolean
enableReplyPlaceHolder?: boolean
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
standalone: boolean
routingId: string
copyLinkToComment: (commentId: number, commentItem: CommentItem<T>) => void
@ -310,7 +310,7 @@ interface CommentsThreadProps<T>
> {
onQuote: (content: string) => void
setDirty: (index: number, dirty: boolean) => void
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
}
const CommentsThread = <T = unknown,>({

View File

@ -32,7 +32,7 @@ import { useGet } from 'restful-react'
import { defaultTo } from 'lodash-es'
import { useAppContext } from 'AppContext'
import { useStrings } from 'framework/strings'
import type { TypesCommit, TypesRepository } from 'services/code'
import type { TypesCommit, RepoRepositoryOutput } from 'services/code'
import type { GitInfoProps } from 'utils/GitUtils'
import type { CODERoutes } from 'RouteDefinitions'
import { CommitActions } from 'components/CommitActions/CommitActions'
@ -41,7 +41,7 @@ import { TimePopoverWithLocal } from 'utils/timePopoverLocal/TimePopoverWithLoca
import { useDocumentTitle } from 'hooks/useDocumentTitle'
import css from './CommitInfo.module.scss'
const CommitInfo = (props: { repoMetadata: TypesRepository; commitRef: string }) => {
const CommitInfo = (props: { repoMetadata: RepoRepositoryOutput; commitRef: string }) => {
const { repoMetadata, commitRef } = props
const history = useHistory()
const { getString } = useStrings()

View File

@ -262,7 +262,7 @@ export const CreateBranchModalButton: React.FC<CreateBranchModalButtonProps> = (
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -236,7 +236,7 @@ export const CreateTagModalButton: React.FC<CreateTagModalButtonProps> = ({
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -29,7 +29,7 @@ import { Compartment, EditorState, Extension } from '@codemirror/state'
import { color } from '@uiw/codemirror-extensions-color'
import { hyperLink } from '@uiw/codemirror-extensions-hyper-link'
import { githubLight, githubDark } from '@uiw/codemirror-themes-all'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { useStrings } from 'framework/strings'
import { handleUpload } from 'utils/GitUtils'
import { handleFileDrop, handlePaste } from 'utils/Utils'
@ -50,7 +50,7 @@ export interface EditorProps {
onChange?: (doc: Text, viewUpdate: ViewUpdate, isDirty: boolean) => void
onViewUpdate?: (viewUpdate: ViewUpdate) => void
darkTheme?: boolean
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
inGitBlame?: boolean
standalone: boolean
routingId?: string

View File

@ -111,7 +111,7 @@ export function ExecutionPageHeader({
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string, gitRef })}>
{repoMetadata.uid}
{repoMetadata.identifier}
</Link>
{extraBreadcrumbLinks.map(link => (
<Fragment key={link.url}>

View File

@ -39,7 +39,7 @@ import type {
OpenapiCalculateCommitDivergenceRequest,
RepoCommitDivergence,
TypesCommit,
TypesRepository
RepoRepositoryOutput
} from 'services/code'
import { CommitActions } from 'components/CommitActions/CommitActions'
import { useAppContext } from 'AppContext'
@ -60,7 +60,7 @@ interface LatestCommitProps extends Pick<GitInfoProps, 'repoMetadata' | 'gitRef'
interface DivergenceInfoProps {
commitDivergence: RepoCommitDivergence
metadata: TypesRepository
metadata: RepoRepositoryOutput
currentGitRef: string
}

View File

@ -49,7 +49,7 @@ import {
import { decodeGitContent, handleUpload, normalizeGitRef } from 'utils/GitUtils'
import { defaultUsefulOrNot } from 'components/DefaultUsefulOrNot/UsefulOrNot'
import { AidaClient } from 'utils/types'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { useEventListener } from 'hooks/useEventListener'
import type { SuggestionBlock } from 'components/SuggestionBlock/SuggestionBlock'
import css from './MarkdownEditorWithPreview.module.scss'
@ -134,7 +134,7 @@ interface MarkdownEditorWithPreviewProps {
sourceGitRef?: string
targetGitRef?: string
setFlag?: React.Dispatch<React.SetStateAction<boolean>>
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
standalone: boolean
routingId: string
suggestionBlock?: SuggestionBlock

View File

@ -33,7 +33,7 @@ import {
} from '@harnessio/uicore'
import { FontVariation } from '@harnessio/design-system'
import { useModalHook } from 'hooks/useModalHook'
import type { OpenapiCreatePipelineRequest, TypesPipeline, TypesRepository } from 'services/code'
import type { OpenapiCreatePipelineRequest, TypesPipeline, RepoRepositoryOutput } from 'services/code'
import { useStrings } from 'framework/strings'
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
import { useAppContext } from 'AppContext'
@ -53,7 +53,7 @@ const useNewPipelineModal = () => {
const { getString } = useStrings()
const history = useHistory()
const { showError } = useToaster()
const [repo, setRepo] = useState<TypesRepository | undefined>()
const [repo, setRepo] = useState<RepoRepositoryOutput | undefined>()
const repoPath = useMemo(() => repo?.path || '', [repo])
const { mutate: savePipeline } = useMutate<TypesPipeline>({
@ -67,7 +67,7 @@ const useNewPipelineModal = () => {
const payload: OpenapiCreatePipelineRequest = {
config_path: yamlPath,
default_branch: branch,
uid: name
identifier: name
}
savePipeline(payload, { pathParams: { path: `/api/v1/repos/${repoPath}/+/pipelines` } })
.then(() => {
@ -167,7 +167,7 @@ const useNewPipelineModal = () => {
}, [repo])
return {
openModal: ({ repoMetadata }: { repoMetadata?: TypesRepository }) => {
openModal: ({ repoMetadata }: { repoMetadata?: RepoRepositoryOutput }) => {
setRepo(repoMetadata)
openModal()
},

View File

@ -69,8 +69,8 @@ import {
getProviderTypeMapping
} from 'utils/GitUtils'
import type {
TypesSpace,
TypesRepository,
SpaceSpaceOutput,
RepoRepositoryOutput,
SpaceImportRepositoriesOutput,
OpenapiCreateRepositoryRequest
} from 'services/code'
@ -95,7 +95,7 @@ export interface NewRepoModalButtonProps extends Omit<ButtonProps, 'onClick' | '
modalTitle: string
submitButtonTitle?: string
cancelButtonTitle?: string
onSubmit: (data: TypesRepository & SpaceImportRepositoriesOutput) => void
onSubmit: (data: RepoRepositoryOutput & SpaceImportRepositoriesOutput) => void
newRepoModalOnly?: boolean
notFoundRepoName?: string
}
@ -114,7 +114,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
const [enablePublicRepo, setEnablePublicRepo] = useState(false)
const { showError } = useToaster()
const { mutate: createRepo, loading: submitLoading } = useMutate<TypesRepository>({
const { mutate: createRepo, loading: submitLoading } = useMutate<RepoRepositoryOutput>({
verb: 'POST',
path: `/api/v1/repos`,
queryParams: standalone
@ -123,7 +123,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
space_path: space
}
})
const { mutate: importRepo, loading: importRepoLoading } = useMutate<TypesRepository>({
const { mutate: importRepo, loading: importRepoLoading } = useMutate<RepoRepositoryOutput>({
verb: 'POST',
path: `/api/v1/repos/import`,
queryParams: standalone
@ -132,7 +132,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
space_path: space
}
})
const { mutate: importMultipleRepositories, loading: submitImportLoading } = useMutate<TypesSpace>({
const { mutate: importMultipleRepositories, loading: submitImportLoading } = useMutate<SpaceSpaceOutput>({
verb: 'POST',
path: `/api/v1/spaces/${space}/+/import`
})
@ -179,7 +179,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
git_ignore: get(formData, 'gitignore', 'none'),
is_public: get(formData, 'isPublic') === RepoVisibility.PUBLIC,
license: get(formData, 'license', 'none'),
uid: get(formData, 'name', '').trim(),
identifier: get(formData, 'name', '').trim(),
readme: get(formData, 'addReadme', false),
parent_ref: space
}
@ -217,7 +217,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
const importPayload = {
description: formData.description || '',
parent_ref: space,
uid: formData.name,
identifier: formData.name,
provider,
provider_repo: compact([
formData.org,
@ -261,7 +261,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
const importPayload = {
description: (formData.description || '').trim(),
parent_ref: space,
uid: formData.name.trim(),
identifier: formData.name.trim(),
provider,
provider_space: compact([
formData.organization,

View File

@ -85,7 +85,7 @@ export const NewSecretModalButton: React.FC<NewSecretModalButtonProps> = ({
space_ref: space,
data: formData.value,
description: formData.description,
uid: formData.name
identifier: formData.name
}
await createSecret(payload)
hideModal()

View File

@ -40,7 +40,7 @@ import { compact, get } from 'lodash-es'
import { useModalHook } from 'hooks/useModalHook'
import { useStrings } from 'framework/strings'
import { getErrorMessage, permissionProps, REGEX_VALID_REPO_NAME } from 'utils/Utils'
import type { TypesSpace, OpenapiCreateSpaceRequest } from 'services/code'
import type { SpaceSpaceOutput, OpenapiCreateSpaceRequest } from 'services/code'
import { useAppContext } from 'AppContext'
import {
ImportSpaceFormData,
@ -84,7 +84,7 @@ export interface NewSpaceModalButtonProps extends Omit<ButtonProps, 'onClick' |
cancelButtonTitle?: string
onRefetch: () => void
handleNavigation?: (value: string) => void
onSubmit: (data: TypesSpace) => void
onSubmit: (data: SpaceSpaceOutput) => void
fromSpace?: boolean
}
export interface OpenapiCreateSpaceRequestExtended extends OpenapiCreateSpaceRequest {
@ -107,11 +107,11 @@ export const NewSpaceModalButton: React.FC<NewSpaceModalButtonProps> = ({
const { getString } = useStrings()
const { showError } = useToaster()
const { mutate: createSpace, loading: submitLoading } = useMutate<TypesSpace>({
const { mutate: createSpace, loading: submitLoading } = useMutate<SpaceSpaceOutput>({
verb: 'POST',
path: `/api/v1/spaces`
})
const { mutate: importSpace, loading: submitImportLoading } = useMutate<TypesSpace>({
const { mutate: importSpace, loading: submitImportLoading } = useMutate<SpaceSpaceOutput>({
verb: 'POST',
path: `/api/v1/spaces/import`
})
@ -123,7 +123,7 @@ export const NewSpaceModalButton: React.FC<NewSpaceModalButtonProps> = ({
const payload: OpenapiCreateSpaceRequestExtended = {
description: get(formData, 'description', '').trim(),
is_public: get(formData, 'isPublic') === RepoVisibility.PUBLIC,
uid: get(formData, 'name', '').trim(),
identifier: get(formData, 'name', '').trim(),
parent_id: standalone ? Number(space) : 0 // TODO: Backend needs to fix parentID: accept string or number
}
await createSpace(payload)
@ -156,7 +156,7 @@ export const NewSpaceModalButton: React.FC<NewSpaceModalButtonProps> = ({
try {
const importPayload = {
description: (formData.description || '').trim(),
uid: formData.name.trim(),
identifier: formData.name.trim(),
provider,
provider_space: compact([
formData.organization,

View File

@ -82,7 +82,7 @@ export const NewTriggerModalButton: React.FC<NewTriggerModalButtonProps> = ({
try {
const payload: OpenapiCreateTriggerRequest = {
actions: formData.actions,
uid: formData.name
identifier: formData.name
}
await createTrigger(payload)
hideModal()

View File

@ -69,7 +69,7 @@ const PipelineSettingsPageHeader = ({
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string, gitRef })}>
{repoMetadata.uid}
{repoMetadata.identifier}
</Link>
{extraBreadcrumbLinks.map(link => (
<Fragment key={link.url}>

View File

@ -89,7 +89,7 @@ const PipelineSettingsTab = ({ pipeline, repoPath, yamlPath }: SettingsContentPr
try {
const payload: OpenapiUpdatePipelineRequest = {
config_path: newYamlPath,
uid: name
identifier: name
}
await updatePipeline(payload, {
pathParams: { path: `/api/v1/repos/${repoPath}/+/pipelines/${pipeline}` }

View File

@ -145,7 +145,7 @@ const TriggerDetails = ({
const handleSubmit = async (formData: TriggerFormData) => {
try {
const payload: OpenapiUpdateTriggerRequest = {
uid: formData.name,
identifier: formData.name,
actions: formData.actions,
disabled: formData.disabled
}
@ -324,8 +324,8 @@ const PipelineTriggersTabs = ({ repoPath, pipeline }: PipelineTriggersTabsProps)
<Layout.Vertical spacing={'large'} className={css.triggerList}>
{data?.map((trigger, index) => (
<TriggerMenuItem
key={trigger.id}
name={trigger.uid as string}
key={trigger.identifier}
name={trigger.identifier as string}
lastUpdated={trigger.updated as number}
setSelectedTrigger={setSelectedTrigger}
index={index}
@ -339,7 +339,7 @@ const PipelineTriggersTabs = ({ repoPath, pipeline }: PipelineTriggersTabsProps)
<div className={css.separator} />
<Layout.Vertical padding={'large'}>
<TriggerDetails
name={data?.[selectedTrigger]?.uid as string}
name={data?.[selectedTrigger]?.identifier as string}
repoPath={repoPath}
pipeline={pipeline}
refetchTriggers={refetch}

View File

@ -107,7 +107,7 @@ const PluginSpecInputPath = `${PluginSpecPath}.${PluginsInputPath}`
const LIST_FETCHING_LIMIT = 100
const RunStepSpec: TypesPlugin = {
uid: 'run'
identifier: 'run'
}
export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
@ -180,7 +180,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
if (panelView !== PluginPanelView.Listing) return
if (query) {
setPlugins(existingPlugins => existingPlugins.filter((item: TypesPlugin) => item.uid?.includes(query)))
setPlugins(existingPlugins => existingPlugins.filter((item: TypesPlugin) => item.identifier?.includes(query)))
} else {
fetchAllPlugins().then(response => setPlugins(response))
}
@ -215,7 +215,9 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
} else {
setPluginCategory(PluginCategory.Drone)
fetchAllPlugins().then(response => {
const matchingPlugin = response?.find((_plugin: TypesPlugin) => _plugin?.uid === get(formData, 'spec.name'))
const matchingPlugin = response?.find(
(_plugin: TypesPlugin) => _plugin?.identifier === get(formData, 'spec.name')
)
if (matchingPlugin) {
setPlugin(matchingPlugin)
setPanelView(PluginPanelView.Configuration)
@ -314,7 +316,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
</Layout.Horizontal>
<Container className={css.plugins}>
{plugins?.map((pluginItem: TypesPlugin) => {
const { uid, description } = pluginItem
const { identifier, description } = pluginItem
return (
<Layout.Horizontal
flex={{ justifyContent: 'flex-start' }}
@ -326,7 +328,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
setPanelView(PluginPanelView.Configuration)
setPlugin(pluginItem)
}}
key={uid}
key={identifier}
width="100%">
<Icon name={'plugin-ci-step'} size={25} />
<Layout.Vertical padding={{ left: 'small' }} spacing="xsmall" className={css.pluginInfo}>
@ -334,7 +336,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
color={Color.GREY_900}
className={css.fontWeight600}
font={{ variation: FontVariation.BODY2_SEMI }}>
{uid}
{identifier}
</Text>
<Text color={Color.GREY_500} font={{ variation: FontVariation.SMALL }} className={css.pluginDesc}>
{description}
@ -619,9 +621,9 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
}}
className={css.arrow}
/>
{plugin?.uid && (
{plugin?.identifier && (
<Text font={{ variation: FontVariation.H4 }}>
{getString(isUpdate ? 'updateLabel' : 'addLabel')} {plugin.uid} {getString('plugins.stepLabel')}
{getString(isUpdate ? 'updateLabel' : 'addLabel')} {plugin.identifier} {getString('plugins.stepLabel')}
</Text>
)}
</Layout.Horizontal>
@ -639,7 +641,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
}
const updatedYAMLPayload = set({}, PluginSpecInputPath, payloadForYAMLUpdate)
set(updatedYAMLPayload, 'type', pluginCategory)
set(updatedYAMLPayload, `${PluginSpecPath}.name`, plugin?.uid)
set(updatedYAMLPayload, `${PluginSpecPath}.name`, plugin?.identifier)
onPluginAddUpdate({
pathToField,
isUpdate,

View File

@ -66,7 +66,7 @@ export function RepositoryPageHeader({
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
<Link to={routes.toCODERepository({ repoPath: (repoMetadata?.path as string) || '', gitRef })}>
{repoMetadata?.uid || ''}
{repoMetadata?.identifier || ''}
</Link>
{extraBreadcrumbLinks.map(link => (
<Fragment key={link.url}>

View File

@ -33,7 +33,7 @@ import {
} from '@harnessio/uicore'
import { useStrings } from 'framework/strings'
import { useModalHook } from 'hooks/useModalHook'
import type { CreateExecutionQueryParams, TypesExecution, TypesRepository } from 'services/code'
import type { CreateExecutionQueryParams, TypesExecution, RepoRepositoryOutput } from 'services/code'
import { getErrorMessage } from 'utils/Utils'
import { useAppContext } from 'AppContext'
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
@ -49,7 +49,7 @@ const useRunPipelineModal = () => {
const { getString } = useStrings()
const { showSuccess, showError, clear: clearToaster } = useToaster()
const history = useHistory()
const [repo, setRepo] = useState<TypesRepository>()
const [repo, setRepo] = useState<RepoRepositoryOutput>()
const [pipeline, setPipeline] = useState<string>('')
const repoPath = useMemo(() => repo?.path || '', [repo])
@ -133,7 +133,7 @@ const useRunPipelineModal = () => {
}, [repo?.default_branch, pipeline])
return {
openModal: ({ repoMetadata, pipeline: pipelineUid }: { repoMetadata: TypesRepository; pipeline: string }) => {
openModal: ({ repoMetadata, pipeline: pipelineUid }: { repoMetadata: RepoRepositoryOutput; pipeline: string }) => {
setRepo(repoMetadata)
setPipeline(pipelineUid)
openModal()

View File

@ -37,7 +37,7 @@ import { Classes, Popover, Position } from '@blueprintjs/core'
import { useStrings } from 'framework/strings'
import { ButtonRoleProps, voidFn } from 'utils/Utils'
import { useShowRequestError } from 'hooks/useShowRequestError'
import { TypesSpace, useGetSpace } from 'services/code'
import { SpaceSpaceOutput, useGetSpace } from 'services/code'
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
import { NewSpaceModalButton } from 'components/NewSpaceModalButton/NewSpaceModalButton'
@ -45,14 +45,14 @@ import { useAppContext } from 'AppContext'
import css from './SpaceSelector.module.scss'
interface SpaceSelectorProps {
onSelect: (space: TypesSpace, isUserAction: boolean) => void
onSelect: (space: SpaceSpaceOutput, isUserAction: boolean) => void
}
export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
const { routes } = useAppContext()
const { getString } = useStrings()
const history = useHistory()
const [selectedSpace, setSelectedSpace] = useState<TypesSpace | undefined>()
const [selectedSpace, setSelectedSpace] = useState<SpaceSpaceOutput | undefined>()
const space = useGetSpaceParam()
const [opened, setOpened] = React.useState(false)
const [searchTerm, setSearchTerm] = useState('')
@ -70,7 +70,7 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
})
const selectSpace = useCallback(
(_space: TypesSpace, isUserAction: boolean) => {
(_space: SpaceSpaceOutput, isUserAction: boolean) => {
setSelectedSpace(_space)
onSelect(_space, isUserAction)
},
@ -98,7 +98,7 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
is_public: false,
parent_id: 0,
path: '',
uid: getString('selectSpace'),
identifier: getString('selectSpace'),
updated: 0
},
false
@ -133,12 +133,12 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
/>
)
const columns: Column<{ space: TypesSpace }>[] = useMemo(
const columns: Column<{ space: SpaceSpaceOutput }>[] = useMemo(
() => [
{
Header: getString('spaces'),
width: 'calc(100% - 180px)',
Cell: ({ row }: CellProps<{ space: TypesSpace }>) => {
Cell: ({ row }: CellProps<{ space: SpaceSpaceOutput }>) => {
const record = row.original
return (
<Container className={css.nameContainer}>
@ -193,7 +193,7 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
</Container>
</Layout.Vertical> */}
<Text className={css.spaceName} lineClamp={1}>
{selectedSpace ? selectedSpace.uid : getString('selectSpace')}
{selectedSpace ? selectedSpace.identifier : getString('selectSpace')}
</Text>
</Container>
<Container className={css.icon}>
@ -224,14 +224,14 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
<Container padding={{ left: 'small' }}>
<Layout.Vertical padding={{ top: 'xxlarge' }} spacing="small">
{!!spaces?.length && (
<Table<{ space: TypesSpace }>
<Table<{ space: SpaceSpaceOutput }>
hideHeaders
className={cx(css.table, css.tableContainer)}
columns={columns}
data={spaces || []}
onRowClick={spaceData => {
setOpened(false)
selectSpace({ uid: spaceData?.space?.uid, path: spaceData?.space?.path }, true)
selectSpace({ identifier: spaceData?.space?.identifier, path: spaceData?.space?.path }, true)
}}
getRowClassName={row => cx(css.row, !row.original.space.description && css.noDesc)}
/>

View File

@ -51,7 +51,7 @@ const useUpdateSecretModal = () => {
const { mutate: updateSecret, loading } = useMutate<TypesSecret>({
verb: 'PATCH',
path: `/api/v1/secrets/${space}/${secret?.uid}/+`
path: `/api/v1/secrets/${space}/${secret?.identifier}/+`
})
const handleSubmit = async (formData: SecretFormData) => {
@ -59,7 +59,7 @@ const useUpdateSecretModal = () => {
const payload: OpenapiUpdateSecretRequest = {
data: formData.value,
description: formData.description,
uid: formData.name
identifier: formData.name
}
await updateSecret(payload)
hideModal()
@ -97,7 +97,7 @@ const useUpdateSecretModal = () => {
<Container>
<Formik
initialValues={{
name: secret?.uid || '',
name: secret?.identifier || '',
description: secret?.description || '',
value: '',
showValue: false

View File

@ -18,7 +18,7 @@ import { useEffect, useMemo } from 'react'
import { useParams } from 'react-router-dom'
import { useGet } from 'restful-react'
import type { CODEProps } from 'RouteDefinitions'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { diffRefsToRefs, makeDiffRefs } from 'utils/GitUtils'
import { getErrorMessage } from 'utils/Utils'
import { newCacheStrategy } from 'utils/CacheStrategy'
@ -41,7 +41,7 @@ export function useGetRepositoryMetadata() {
...otherPathParams
} = useParams<CODEProps>()
const repoPath = useMemo(() => `${space}/${repoName}`, [space, repoName])
const { data, error, loading, refetch, response } = useGet<TypesRepository>({
const { data, error, loading, refetch, response } = useGet<RepoRepositoryOutput>({
path: `/api/v1/repos/${repoPath}/+/`,
lazy: true
})

View File

@ -21,7 +21,7 @@ import { useHistory, useRouteMatch } from 'react-router-dom'
import { FingerprintLockCircle, BookmarkBook, UserSquare, Settings } from 'iconoir-react'
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
import { useStrings } from 'framework/strings'
import type { TypesSpace } from 'services/code'
import type { SpaceSpaceOutput } from 'services/code'
import { SpaceSelector } from 'components/SpaceSelector/SpaceSelector'
import { useAppContext } from 'AppContext'
import { isGitRev } from 'utils/GitUtils'
@ -31,7 +31,7 @@ import css from './DefaultMenu.module.scss'
export const DefaultMenu: React.FC = () => {
const history = useHistory()
const { routes, standalone } = useAppContext()
const [selectedSpace, setSelectedSpace] = useState<TypesSpace | undefined>()
const [selectedSpace, setSelectedSpace] = useState<SpaceSpaceOutput | undefined>()
const { repoMetadata, gitRef, commitRef } = useGetRepositoryMetadata()
const { getString } = useStrings()
const repoPath = useMemo(() => repoMetadata?.path || '', [repoMetadata])

View File

@ -50,7 +50,7 @@ import type {
TypesCommit,
TypesDiffStats,
TypesPullReq,
TypesRepository
RepoRepositoryOutput
} from 'services/code'
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
import { TabTitleWithCount, tabContainerCSS } from 'components/TabTitleWithCount/TabTitleWithCount'
@ -365,7 +365,7 @@ export default function Compare() {
),
panel: (
<CompareCommits
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
sourceSha={sourceGitRef}
targetSha={targetGitRef}
/>

View File

@ -59,7 +59,7 @@ export function CompareContentHeader({
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -92,7 +92,7 @@ const ExecutionList = () => {
const onEvent = useCallback(
data => {
// ideally this would include number - so we only check for executions on the page - but what if new executions are kicked off? - could check for ids that are higher than the lowest id on the page?
// ideally this would include number - so we only check for executions on the page - but what if new executions are kicked off? - could check for ids that are higher than the lowest ids on the page?
if (repoMetadata?.id === data?.repo_id && pipelineData?.id === data?.pipeline_id) {
//TODO - revisit full refresh - can I use the message to update the execution?
executionsRefetch()

View File

@ -148,7 +148,7 @@ const PipelineList = () => {
inExecution
/>
<Text className={css.repoName}>
<Keywords value={searchTerm}>{record.uid}</Keywords>
<Keywords value={searchTerm}>{record.identifier}</Keywords>
</Text>
</Layout.Horizontal>
)
@ -243,14 +243,14 @@ const PipelineList = () => {
Cell: ({ row }: CellProps<TypesPipeline>) => {
const [menuOpen, setMenuOpen] = useState(false)
const record = row.original
const { uid } = record
const { identifier } = record
const repoPath = repoMetadata?.path || ''
const confirmDeletePipeline = useConfirmAct()
const { showSuccess, showError } = useToaster()
const { mutate: deletePipeline } = useMutate<TypesPipeline>({
verb: 'DELETE',
path: `/api/v1/repos/${repoPath}/+/pipelines/${uid}`
path: `/api/v1/repos/${repoPath}/+/pipelines/${identifier}`
})
return (
@ -264,7 +264,7 @@ const PipelineList = () => {
<Button
variation={ButtonVariation.ICON}
icon="Options"
data-testid={`menu-${record.uid}`}
data-testid={`menu-${record.identifier}`}
onClick={e => {
e.stopPropagation()
setMenuOpen(true)
@ -276,7 +276,7 @@ const PipelineList = () => {
text={getString('edit')}
onClick={e => {
e.stopPropagation()
history.push(routes.toCODEPipelineEdit({ repoPath, pipeline: uid as string }))
history.push(routes.toCODEPipelineEdit({ repoPath, pipeline: identifier as string }))
}}
/>
<MenuItem
@ -292,7 +292,7 @@ const PipelineList = () => {
<String
useRichText
stringID="pipelines.deletePipelineConfirm"
vars={{ pipeline: row.original.uid }}
vars={{ pipeline: row.original.identifier }}
/>
),
action: async () => {
@ -302,7 +302,7 @@ const PipelineList = () => {
<StringSubstitute
str={getString('pipelines.deletePipelineSuccess')}
vars={{
pipeline: row.original.uid
pipeline: row.original.identifier
}}
/>,
5000
@ -322,7 +322,10 @@ const PipelineList = () => {
onClick={e => {
e.stopPropagation()
history.push(
routes.toCODEPipelineSettings({ repoPath: repoMetadata?.path || '', pipeline: uid as string })
routes.toCODEPipelineSettings({
repoPath: repoMetadata?.path || '',
pipeline: identifier as string
})
)
}}
/>
@ -371,7 +374,7 @@ const PipelineList = () => {
history.push(
routes.toCODEExecutions({
repoPath: repoMetadata?.path as string,
pipeline: pipelineInfo.uid as string
pipeline: pipelineInfo.identifier as string
})
)
}

View File

@ -74,7 +74,7 @@ export const Checks: React.FC<ChecksProps> = ({ repoMetadata, pullReqMetadata, p
if (selectedStage) {
return routes.toCODEExecution({
repoPath: repoMetadata?.path as string,
pipeline: selectedItemData?.uid as string,
pipeline: selectedItemData?.identifier as string,
execution: get(selectedItemData, 'payload.data.execution_number', '')
})
} else {
@ -211,7 +211,7 @@ export const Checks: React.FC<ChecksProps> = ({ repoMetadata, pullReqMetadata, p
color={Color.WHITE}
lineClamp={1}
tooltipProps={{ portalClassName: css.popover }}>
{selectedItemData?.uid}
{selectedItemData?.identifier}
{selectedStage ? ` / ${selectedStage.name}` : ''}
</Text>
<FlexExpander />
@ -246,7 +246,7 @@ export const Checks: React.FC<ChecksProps> = ({ repoMetadata, pullReqMetadata, p
<CheckPipelineSteps
repoMetadata={repoMetadata}
pullReqMetadata={pullReqMetadata}
pipelineName={selectedItemData?.uid as string}
pipelineName={selectedItemData?.identifier as string}
stage={selectedStage as TypesStage}
executionNumber={get(selectedItemData, 'payload.data.execution_number', '')}
/>

View File

@ -67,7 +67,7 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
const checksData = useMemo(() => sortBy(prChecksDecisionResult?.data || [], ['uid']), [prChecksDecisionResult?.data])
useMemo(() => {
if (selectedUID) {
const selectedDataItem = checksData.find(item => item.uid === selectedUID)
const selectedDataItem = checksData.find(item => item.identifier === selectedUID)
if (selectedDataItem) {
onDataItemChanged(selectedDataItem)
}
@ -76,7 +76,7 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
useEffect(() => {
if (uid) {
if (uid !== selectedUID && checksData.find(item => item.uid === uid)) {
if (uid !== selectedUID && checksData.find(item => item.identifier === uid)) {
setSelectedUID(uid)
}
} else {
@ -84,13 +84,13 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
if (defaultSelectedItem) {
onDataItemChanged(defaultSelectedItem)
setSelectedUID(defaultSelectedItem.uid)
setSelectedUID(defaultSelectedItem.identifier)
history.replace(
routes.toCODEPullRequest({
repoPath: repoMetadata.path as string,
pullRequestId: String(pullReqMetadata.number),
pullRequestSection: PullRequestSection.CHECKS
}) + `?uid=${defaultSelectedItem.uid}${selectedStage ? `&stageId=${selectedStage.name}` : ''}`
}) + `?uid=${defaultSelectedItem.identifier}${selectedStage ? `&stageId=${selectedStage.name}` : ''}`
)
}
}
@ -238,18 +238,18 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
</Layout.Horizontal>
)}
{(checks as TypesCheck[]).map((itemData: TypesCheck) => (
<Container key={`container_${itemData.uid}`} className={css.checkMenuItemContainer}>
<Container key={`container_${itemData.identifier}`} className={css.checkMenuItemContainer}>
<CheckMenuItem
repoMetadata={repoMetadata}
pullReqMetadata={pullReqMetadata}
prChecksDecisionResult={prChecksDecisionResult}
key={itemData.uid}
key={itemData.identifier}
itemData={itemData}
customFormatter={customFormatter}
isPipeline={itemData.payload?.kind === PullRequestCheckType.PIPELINE}
isSelected={itemData.uid === selectedUID}
isSelected={itemData.identifier === selectedUID}
onClick={stage => {
setSelectedUID(itemData.uid)
setSelectedUID(itemData.identifier)
setSelectedStage(stage || null)
setSelectedStageFromProps(stage || null)
@ -258,7 +258,7 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
repoPath: repoMetadata.path as string,
pullRequestId: String(pullReqMetadata.number),
pullRequestSection: PullRequestSection.CHECKS
}) + `?uid=${itemData.uid}${stage ? `&stageId=${stage.name}` : ''}`
}) + `?uid=${itemData.identifier}${stage ? `&stageId=${stage.name}` : ''}`
)
}}
setSelectedStage={stage => {
@ -301,11 +301,11 @@ const CheckMenuItem: React.FC<CheckMenuItemProps> = ({
}
}, [isSelected])
const name =
itemData?.uid &&
itemData?.uid.includes('-') &&
itemData?.identifier &&
itemData?.identifier.includes('-') &&
(itemData.payload?.kind as TypesCheckPayloadExtended) === CheckKindPayload.HARNESS_STAGE
? itemData.uid.split('-')[1]
: itemData.uid
? itemData.identifier.split('-')[1]
: itemData.identifier
return (
<Container className={css.menuItem}>
<Layout.Horizontal
@ -356,7 +356,7 @@ const CheckMenuItem: React.FC<CheckMenuItemProps> = ({
<Render when={isPipeline}>
<CheckPipelineStages
pipelineName={itemData.uid as string}
pipelineName={itemData.identifier as string}
executionNumber={get(itemData, 'payload.data.execution_number', '')}
expanded={expanded}
repoMetadata={repoMetadata}

View File

@ -146,8 +146,8 @@ const CheckSection: React.FC<CheckSectionsProps & { isPipeline?: boolean }> = ({
{getString(isPipeline ? 'pageTitle.pipelines' : 'checks')}
</Text>
<Container className={css.table}>
{data.map(({ uid, status, summary, created, ended, started }) => (
<Container className={css.row} key={uid}>
{data.map(({ identifier, status, summary, created, ended, started }) => (
<Container className={css.row} key={identifier}>
<Layout.Horizontal className={css.rowLayout}>
<Container className={css.status}>
<ExecutionStatus status={status as ExecutionState} />
@ -159,10 +159,10 @@ const CheckSection: React.FC<CheckSectionsProps & { isPipeline?: boolean }> = ({
repoPath: repoMetadata.path as string,
pullRequestId: String(pullReqMetadata.number),
pullRequestSection: PullRequestSection.CHECKS
}) + `?uid=${uid}`
}) + `?uid=${identifier}`
}>
<Text font={{ variation: FontVariation.SMALL_BOLD }} className={css.name} lineClamp={1}>
{uid}
{identifier}
</Text>
</Link>

View File

@ -221,7 +221,7 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -24,7 +24,7 @@ import type {
TypesPullReq,
TypesPullReqActivity,
TypesPullReqReviewer,
TypesRepository,
RepoRepositoryOutput,
TypesRuleViolations
} from 'services/code'
import { PanelSectionOutletPosition } from 'pages/PullRequest/PullRequestUtils'
@ -41,7 +41,7 @@ import CommentsSection from './sections/CommentsSection'
import ChangesSection from './sections/ChangesSection'
import css from './PullRequestOverviewPanel.module.scss'
interface PullRequestOverviewPanelProps {
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
pullReqMetadata: TypesPullReq
onPRStateChanged: () => void
refetchReviewers: () => void

View File

@ -38,7 +38,7 @@ import type {
TypesCodeOwnerEvaluationEntry,
TypesPullReq,
TypesPullReqReviewer,
TypesRepository
RepoRepositoryOutput
} from 'services/code'
import { capitalizeFirstLetter } from 'pages/PullRequest/Checks/ChecksUtils'
import greyCircle from '../../../../../icons/greyCircle.svg?url'
@ -50,7 +50,7 @@ import Timeout from '../../../../../icons/code-timeout.svg?url'
import css from '../PullRequestOverviewPanel.module.scss'
interface ChangesSectionProps {
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
pullReqMetadata: TypesPullReq
codeOwners: TypesCodeOwnerEvaluation | null
atLeastOneReviewerRule: boolean

View File

@ -32,7 +32,7 @@ import { isEmpty } from 'lodash-es'
import { useShowRequestError } from 'hooks/useShowRequestError'
import { ExecutionState, ExecutionStatus } from 'components/ExecutionStatus/ExecutionStatus'
import { useAppContext } from 'AppContext'
import type { TypesRepository, TypesPullReq, TypesCheck } from 'services/code'
import type { RepoRepositoryOutput, TypesPullReq, TypesCheck } from 'services/code'
import { useStrings } from 'framework/strings'
import { CheckStatus, PullRequestSection, timeDistance } from 'utils/Utils'
import { usePRChecksDecision } from 'hooks/usePRChecksDecision3'
@ -41,7 +41,7 @@ import Timeout from '../../../../../icons/code-timeout.svg?url'
import css from '../PullRequestOverviewPanel.module.scss'
interface ChecksSectionProps {
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
pullReqMetadata: TypesPullReq
}
@ -287,7 +287,7 @@ const ChecksSection = (props: ChecksSectionProps) => {
color={Color.GREY_700}
className={cx(css.checkName, css.textSize)}
font={{ variation: FontVariation.BODY }}>
{check.check.uid}
{check.check.identifier}
</Text>
<Text
padding={{ left: 'small' }}
@ -324,7 +324,7 @@ const ChecksSection = (props: ChecksSectionProps) => {
repoPath: repoMetadata.path as string,
pullRequestId: String(pullReqMetadata.number),
pullRequestSection: PullRequestSection.CHECKS
}) + `?uid=${check.check.uid}`
}) + `?uid=${check.check.identifier}`
}>
<Text padding={{ left: 'medium' }} color={Color.PRIMARY_7} className={css.blueText}>
{getString('details')}

View File

@ -18,13 +18,13 @@ import cx from 'classnames'
import { Color } from '@harnessio/design-system'
import { Button, ButtonSize, ButtonVariation, Container, Layout, SelectOption, Text } from '@harnessio/uicore'
import { useStrings } from 'framework/strings'
import type { TypesRepository, TypesPullReq, TypesViolation } from 'services/code'
import type { RepoRepositoryOutput, TypesPullReq, TypesViolation } from 'services/code'
import { PRCommentFilterType } from 'utils/Utils'
import Success from '../../../../../icons/code-success.svg?url'
import Fail from '../../../../../icons/code-fail.svg?url'
import css from '../PullRequestOverviewPanel.module.scss'
interface MergeSectionProps {
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
pullReqMetadata: TypesPullReq
resolvedCommentArr?: TypesViolation
requiresCommentApproval: boolean

View File

@ -24,7 +24,7 @@ import { Icon, IconName } from '@harnessio/icons'
import { Color, FontVariation } from '@harnessio/design-system'
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
import { useStrings } from 'framework/strings'
import type { TypesPullReq, TypesRepository, EnumPullReqReviewDecision } from 'services/code'
import type { TypesPullReq, RepoRepositoryOutput, EnumPullReqReviewDecision } from 'services/code'
import { getErrorMessage } from 'utils/Utils'
import { ReviewerSelect } from 'components/ReviewerSelect/ReviewerSelect'
import { PullReqReviewDecision, processReviewDecision } from 'pages/PullRequest/PullRequestUtils'
@ -33,7 +33,7 @@ import css from './PullRequestSideBar.module.scss'
interface PullRequestSideBarProps {
reviewers?: Unknown
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
pullRequestMetadata: TypesPullReq
refetchReviewers: () => void
}

View File

@ -25,7 +25,7 @@ import { useStrings } from 'framework/strings'
import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader'
import { getErrorMessage, PullRequestSection } from 'utils/Utils'
import { CodeIcon } from 'utils/GitUtils'
import type { TypesPullReq, TypesRepository } from 'services/code'
import type { TypesPullReq, RepoRepositoryOutput } from 'services/code'
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
import { TabTitleWithCount, tabContainerCSS } from 'components/TabTitleWithCount/TabTitleWithCount'
import { ExecutionStatus } from 'components/ExecutionStatus/ExecutionStatus'
@ -117,7 +117,7 @@ export default function PullRequest() {
<Render when={repoMetadata && pullReqMetadata}>
<>
<PullRequestMetaLine repoMetadata={repoMetadata as TypesRepository} {...pullReqMetadata} />
<PullRequestMetaLine repoMetadata={repoMetadata as RepoRepositoryOutput} {...pullReqMetadata} />
<Container className={tabContainerCSS.tabsContainer}>
<Tabs
@ -148,7 +148,7 @@ export default function PullRequest() {
<Conversation
routingId={routingId}
standalone={standalone}
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
pullReqMetadata={pullReqMetadata as TypesPullReq}
prChecksDecisionResult={pullReqChecksDecision}
onDescriptionSaved={() => {
@ -173,7 +173,7 @@ export default function PullRequest() {
),
panel: (
<PullRequestCommits
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
pullReqMetadata={pullReqMetadata as TypesPullReq}
pullReqCommits={pullReqCommits}
/>
@ -250,7 +250,7 @@ export default function PullRequest() {
),
panel: (
<Checks
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
pullReqMetadata={pullReqMetadata as TypesPullReq}
prChecksDecisionResult={pullReqChecksDecision}
/>

View File

@ -33,7 +33,7 @@ import { usePageIndex } from 'hooks/usePageIndex'
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
import { useUpdateQueryParams } from 'hooks/useUpdateQueryParams'
import { useQueryParams } from 'hooks/useQueryParams'
import type { TypesPullReq, TypesRepository } from 'services/code'
import type { TypesPullReq, RepoRepositoryOutput } from 'services/code'
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
import { PipeSeparator } from 'components/PipeSeparator/PipeSeparator'
@ -118,7 +118,7 @@ export default function PullRequests() {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},
@ -245,7 +245,7 @@ export default function PullRequests() {
<Layout.Vertical>
<PullRequestsContentHeader
loading={prLoading && searchTerm !== undefined}
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
activePullRequestFilterOption={filter}
onPullRequestFilterChanged={_filter => {
setFilter(_filter)

View File

@ -71,7 +71,7 @@ export function PullRequestsContentHeader({
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -37,7 +37,7 @@ import { useHistory } from 'react-router-dom'
import { useStrings, String } from 'framework/strings'
import { voidFn, formatDate, getErrorMessage, LIST_FETCHING_LIMIT, PageBrowserProps } from 'utils/Utils'
import { NewRepoModalButton } from 'components/NewRepoModalButton/NewRepoModalButton'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { useDeleteRepository } from 'services/code'
import { usePageIndex } from 'hooks/usePageIndex'
import { useQueryParams } from 'hooks/useQueryParams'
@ -57,7 +57,7 @@ import { getUsingFetch, getConfig } from 'services/config'
import noRepoImage from './no-repo.svg?url'
import css from './RepositoriesListing.module.scss'
interface TypesRepoExtended extends TypesRepository {
interface TypesRepoExtended extends RepoRepositoryOutput {
importing?: boolean
importProgress?: string
}
@ -82,7 +82,7 @@ export default function RepositoriesListing() {
const pageBrowser = useQueryParams<PageBrowserProps>()
const pageInit = pageBrowser.page ? parseInt(pageBrowser.page) : 1
const [page, setPage] = usePageIndex(pageInit)
const [updatedRepositories, setUpdatedRepositories] = useState<TypesRepository[]>()
const [updatedRepositories, setUpdatedRepositories] = useState<RepoRepositoryOutput[]>()
const {
data: repositories,
@ -90,7 +90,7 @@ export default function RepositoriesListing() {
loading,
refetch,
response
} = useGet<TypesRepository[]>({
} = useGet<RepoRepositoryOutput[]>({
path: `/api/v1/spaces/${space}/+/repos`,
queryParams: { page, limit: LIST_FETCHING_LIMIT, query: searchTerm },
debounce: 500
@ -125,7 +125,7 @@ export default function RepositoriesListing() {
const bearerToken = hooks?.useGetToken?.() || ''
const addImportProgressToData = async (repos: TypesRepository[]) => {
const addImportProgressToData = async (repos: RepoRepositoryOutput[]) => {
const updatedData = await Promise.all(
repos.map(async repo => {
if (repo.importing) {
@ -172,7 +172,7 @@ export default function RepositoriesListing() {
<Layout.Horizontal spacing="small" style={{ flexGrow: 1 }}>
<Layout.Vertical flex className={css.name} ref={rowContainerRef}>
<Text className={css.repoName} width={nameTextWidth} lineClamp={2}>
<Keywords value={searchTerm}>{record.uid}</Keywords>
<Keywords value={searchTerm}>{record.identifier}</Keywords>
<RepoPublicLabel isPublic={row.original.is_public} margin={{ left: 'small' }} />
</Text>
@ -243,7 +243,7 @@ export default function RepositoriesListing() {
<String
useRichText
stringID="deleteFailedImport"
vars={{ name: row.original?.uid }}
vars={{ name: row.original?.identifier }}
tagName="div"
/>
</Text>
@ -282,7 +282,7 @@ export default function RepositoriesListing() {
<String
useRichText
stringID="cancelImportConfirm"
vars={{ name: row.original?.uid }}
vars={{ name: row.original?.identifier }}
tagName="div"
/>
</Text>
@ -329,7 +329,7 @@ export default function RepositoriesListing() {
history.push(routes.toCODERepositories({ space: space as string }))
refetch()
} else {
history.push(routes.toCODERepository({ repoPath: (repoInfo as TypesRepository).path as string }))
history.push(routes.toCODERepository({ repoPath: (repoInfo as RepoRepositoryOutput).path as string }))
}
}}
/>

View File

@ -48,7 +48,7 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},
@ -159,7 +159,7 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
className={css.divContainer}>
<MarkdownViewer
source={getString('repoEmptyMarkdownClonePush')
.replace(/REPO_NAME/g, repoMetadata.uid || '')
.replace(/REPO_NAME/g, repoMetadata.identifier || '')
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
/>
</Container>
@ -170,7 +170,7 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
<MarkdownViewer
source={getString('repoEmptyMarkdownExisting')
.replace(/REPO_URL/g, repoMetadata.git_url || '')
.replace(/REPO_NAME/g, repoMetadata.uid || '')
.replace(/REPO_NAME/g, repoMetadata.identifier || '')
.replace(/CREATE_API_TOKEN_URL/g, standalone ? routes.toCODEUserProfile() : currentUserProfileURL || '')
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
/>

View File

@ -23,7 +23,7 @@ import { getErrorMessage } from 'utils/Utils'
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
import { useStrings } from 'framework/strings'
import type { OpenapiGetContentOutput, TypesRepository } from 'services/code'
import type { OpenapiGetContentOutput, RepoRepositoryOutput } from 'services/code'
import { Images } from 'images'
import { useSetPageContainerWidthVar } from 'hooks/useSetPageContainerWidthVar'
import { normalizeGitRef, isDir } from 'utils/GitUtils'
@ -58,14 +58,14 @@ export default function Repository() {
<Container className={cx(css.main, !!resourceContent && css.withFileViewer)} ref={domRef}>
<Match expr={fileNotExist}>
<Truthy>
<RepositoryHeader isFile={false} repoMetadata={repoMetadata as TypesRepository} />
<RepositoryHeader isFile={false} repoMetadata={repoMetadata as RepoRepositoryOutput} />
<Layout.Vertical>
<Container className={css.bannerContainer} padding={{ left: 'xlarge' }}>
<Text font={'small'} padding={{ left: 'large' }}>
<StringSubstitute
str={getString('branchDoesNotHaveFile')}
vars={{
repoName: repoMetadata?.uid,
repoName: repoMetadata?.identifier,
fileName: resourcePath,
branchName: gitRef
}}
@ -74,7 +74,7 @@ export default function Repository() {
</Container>
<Container padding={{ left: 'xlarge' }}>
<ContentHeader
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
gitRef={gitRef}
resourcePath={resourcePath}
resourceContent={resourceContent as OpenapiGetContentOutput}

View File

@ -47,14 +47,14 @@ export function ContentHeader({
const history = useHistory()
const _isDir = isDir(resourceContent)
const space = useGetSpaceParam()
const repoPath = compact([repoMetadata.uid, resourceContent?.path])
const repoPath = compact([repoMetadata.identifier, resourceContent?.path])
useDocumentTitle(isEmpty(resourceContent?.path) ? getString('pageTitle.repository') : repoPath.join('/'))
const permPushResult = hooks?.usePermissionTranslate?.(
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -123,7 +123,7 @@ export function FileContent({
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -24,7 +24,7 @@ import ReactTimeago from 'react-timeago'
import { useGet } from 'restful-react'
import { Render } from 'react-jsx-match'
import { noop } from 'lodash-es'
import type { GitBlamePart, TypesRepository } from 'services/code'
import type { GitBlamePart, RepoRepositoryOutput } from 'services/code'
import { normalizeGitRef, type GitInfoProps } from 'utils/GitUtils'
import { useStrings } from 'framework/strings'
import { getErrorMessage } from 'utils/Utils'
@ -45,7 +45,7 @@ interface BlameBlock {
}
interface BlameBlockExtended extends BlameBlock {
repoMetaData?: TypesRepository
repoMetaData?: RepoRepositoryOutput
}
type BlameBlockRecord = Record<number, BlameBlock>
@ -223,7 +223,7 @@ interface GitBlameRendererProps {
source: string
onViewUpdate?: (update: ViewUpdate) => void
blameBlocks: BlameBlockRecord
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
standalone: boolean
}

View File

@ -22,7 +22,7 @@ import cx from 'classnames'
import { ThreadSection } from 'components/ThreadSection/ThreadSection'
import { LIST_FETCHING_LIMIT, RenameDetails } from 'utils/Utils'
import { usePageIndex } from 'hooks/usePageIndex'
import type { TypesCommit, TypesRepository } from 'services/code'
import type { TypesCommit, RepoRepositoryOutput } from 'services/code'
import { useStrings } from 'framework/strings'
import { CommitsView } from 'components/CommitsView/CommitsView'
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
@ -33,7 +33,7 @@ const SingleFileRenameHistory = (props: {
details: RenameDetails
fileVisibility: { [key: string]: boolean }
setFileVisibility: React.Dispatch<React.SetStateAction<{ [key: string]: boolean }>>
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
page: number
/* eslint-disable @typescript-eslint/no-explicit-any */
response: any
@ -122,7 +122,7 @@ const SingleFileRenameHistory = (props: {
const AllFilesRenameHistory = (props: {
rename_details: RenameDetails[]
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
fileVisibility: { [key: string]: boolean }
setFileVisibility: React.Dispatch<React.SetStateAction<{ [key: string]: boolean }>>
setActiveTab: React.Dispatch<React.SetStateAction<string>>
@ -155,7 +155,7 @@ const AllFilesRenameHistory = (props: {
const RenameContentHistory = (props: {
rename_details: RenameDetails[]
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
setActiveTab: React.Dispatch<React.SetStateAction<string>>
}) => {
const { rename_details, repoMetadata, setActiveTab } = props

View File

@ -24,7 +24,7 @@ import { useGet } from 'restful-react'
import cx from 'classnames'
import { MarkdownViewer } from 'components/MarkdownViewer/MarkdownViewer'
import { useAppContext } from 'AppContext'
import type { OpenapiContentInfo, OpenapiGetContentOutput, RepoFileContent, TypesRepository } from 'services/code'
import type { OpenapiContentInfo, OpenapiGetContentOutput, RepoFileContent, RepoRepositoryOutput } from 'services/code'
import { useStrings } from 'framework/strings'
import { useShowRequestError } from 'hooks/useShowRequestError'
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
@ -35,7 +35,7 @@ import { permissionProps } from 'utils/Utils'
import css from './Readme.module.scss'
interface FolderContentProps {
metadata: TypesRepository
metadata: RepoRepositoryOutput
gitRef?: string
readmeInfo: OpenapiContentInfo
contentOnly?: boolean
@ -76,7 +76,7 @@ function ReadmeViewer({ metadata, gitRef, readmeInfo, contentOnly, maxWidth }: F
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -22,13 +22,13 @@ import { useHistory } from 'react-router-dom'
import { useAppContext } from 'AppContext'
import { useStrings } from 'framework/strings'
import { CodeIcon, RepositorySummaryData } from 'utils/GitUtils'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { permissionProps, formatDate } from 'utils/Utils'
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
import css from './RepositorySummary.module.scss'
interface RepositorySummaryProps {
metadata: TypesRepository
metadata: RepoRepositoryOutput
gitRef?: string
repoSummaryData: RepositorySummaryData | null
loadingSummaryData: boolean
@ -108,7 +108,7 @@ const RepositorySummary = (props: RepositorySummaryProps) => {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: metadata?.uid as string
resourceIdentifier: metadata?.identifier as string
},
permissions: ['code_repo_edit']
},

View File

@ -22,10 +22,10 @@ import { FontVariation } from '@harnessio/design-system'
import { RepoPublicLabel } from 'components/RepoPublicLabel/RepoPublicLabel'
import type { GitInfoProps } from 'utils/GitUtils'
import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import css from './RepositoryHeader.module.scss'
interface RepositoryHeaderProps extends Pick<GitInfoProps, 'repoMetadata'> {
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
className?: string
isFile: boolean
}
@ -43,7 +43,7 @@ export function RepositoryHeader(props: RepositoryHeaderProps) {
</span>
{/* <Icon name={CodeIcon.Repo} size={20} /> */}
<Text inline className={css.repoDropdown} font={{ variation: FontVariation.H4 }}>
{repoMetadata.uid}
{repoMetadata.identifier}
</Text>
<RepoPublicLabel isPublic={repoMetadata.is_public} />
</Layout.Horizontal>

View File

@ -41,7 +41,7 @@ import type {
OpenapiCalculateCommitDivergenceRequest,
RepoBranch,
RepoCommitDivergence,
TypesRepository
RepoRepositoryOutput
} from 'services/code'
import { CommitActions } from 'components/CommitActions/CommitActions'
import { formatDate, getErrorMessage } from 'utils/Utils'
@ -54,7 +54,7 @@ import css from './BranchesContent.module.scss'
interface BranchesContentProps {
searchTerm?: string
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
branches: RepoBranch[]
onDeleteSuccess: () => void
}

View File

@ -19,7 +19,7 @@ import { Container } from '@harnessio/uicore'
import { useGet } from 'restful-react'
import { Render } from 'react-jsx-match'
import { useHistory } from 'react-router-dom'
import type { RepoBranch, TypesRepository } from 'services/code'
import type { RepoBranch, RepoRepositoryOutput } from 'services/code'
import { usePageIndex } from 'hooks/usePageIndex'
import { LIST_FETCHING_LIMIT, PageBrowserProps } from 'utils/Utils'
import { useAppContext } from 'AppContext'
@ -76,7 +76,7 @@ export function RepositoryBranchesContent({ repoMetadata }: Partial<Pick<GitInfo
<Container padding="xlarge" className={css.resourceContent}>
<BranchesContentHeader
loading={loading && searchTerm !== undefined}
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
onBranchTypeSwitched={gitRef => {
setPage(1)
history.push(
@ -96,7 +96,7 @@ export function RepositoryBranchesContent({ repoMetadata }: Partial<Pick<GitInfo
{!!branches?.length && (
<BranchesContent
branches={branches}
repoMetadata={repoMetadata as TypesRepository}
repoMetadata={repoMetadata as RepoRepositoryOutput}
searchTerm={searchTerm}
onDeleteSuccess={refetch}
/>

View File

@ -47,7 +47,7 @@ export const RepositoryFileEditHeader: React.FC<RepositoryFileEditHeaderProps> =
<Layout.Horizontal spacing="small" className={css.breadcrumb}>
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
<Icon name="main-chevron-right" size={10} color={Color.GREY_500} />
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string })}>{repoMetadata.uid}</Link>
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string })}>{repoMetadata.identifier}</Link>
</Layout.Horizontal>
<Container padding={{ top: 'medium', bottom: 'medium' }}>
<Text font={{ variation: FontVariation.H4 }}>

View File

@ -53,7 +53,7 @@ const useDeleteRepoModal = () => {
<Layout.Vertical flex={{ justifyContent: 'center' }}>
<Icon name="nav-project" size={32} />
<Text font={{ size: 'large' }} color="grey900" padding={{ top: 'small', bottom: 'medium' }}>
{repoMetadata?.uid}
{repoMetadata?.identifier}
</Text>
</Layout.Vertical>
<Divider />
@ -76,7 +76,7 @@ const useDeleteRepoModal = () => {
</Container>
<Text padding={{ top: 'small' }} color="grey500">
{getString('repoDelete.deleteConfirm1', {
repo: repoMetadata?.uid
repo: repoMetadata?.identifier
})}
</Text>
<Button
@ -93,11 +93,11 @@ const useDeleteRepoModal = () => {
<>
<Text padding={{ top: 'small', bottom: 'small' }} color="grey500">
{getString('repoDelete.deleteConfirm2', {
repo: repoMetadata?.uid
repo: repoMetadata?.identifier
})}
</Text>
<TextInput
placeholder={repoMetadata?.uid}
placeholder={repoMetadata?.identifier}
value={deleteConfirmString}
onInput={e => {
setDeleteConfirmString(e.currentTarget.value)
@ -107,7 +107,7 @@ const useDeleteRepoModal = () => {
variation={ButtonVariation.SECONDARY}
intent="danger"
loading
disabled={deleteConfirmString !== repoMetadata?.uid || loading}
disabled={deleteConfirmString !== repoMetadata?.identifier || loading}
margin={{ top: 'small' }}
onClick={async () => {
try {

View File

@ -36,7 +36,7 @@ import { useMutate, useGet } from 'restful-react'
import { Render } from 'react-jsx-match'
import { ACCESS_MODES, getErrorMessage, permissionProps, voidFn } from 'utils/Utils'
import { useStrings } from 'framework/strings'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { useAppContext } from 'AppContext'
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
import { RepoVisibility } from 'utils/GitUtils'
@ -48,7 +48,7 @@ import Private from '../../../icons/private.svg?url'
import css from '../RepositorySettings.module.scss'
interface GeneralSettingsProps {
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
refetch: () => void
gitRef: string
isRepositoryEmpty: boolean
@ -84,7 +84,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},
@ -94,7 +94,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_delete']
},
@ -186,7 +186,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
<Formik
formName="repoGeneralSettings"
initialValues={{
name: repoMetadata?.uid,
name: repoMetadata?.identifier,
desc: repoMetadata?.description,
defaultBranch: repoMetadata?.default_branch,
isPublic: currRepoVisibility
@ -204,7 +204,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
</Container>
<Container className={css.content}>
<Text color={Color.GREY_800} className={css.textSize}>
{repoMetadata?.uid}
{repoMetadata?.identifier}
</Text>
</Container>
</Layout.Horizontal>

View File

@ -31,7 +31,7 @@ import { useGet, useMutate } from 'restful-react'
import { Render } from 'react-jsx-match'
import type { FormikState } from 'formik'
import { Color, FontVariation } from '@harnessio/design-system'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { useStrings } from 'framework/strings'
import { useAppContext } from 'AppContext'
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
@ -42,7 +42,7 @@ import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
import css from './SecurityScanSettings.module.scss'
interface SecurityScanProps {
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
activeTab: string
}
@ -63,7 +63,7 @@ const SecurityScanSettings = (props: SecurityScanProps) => {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},

View File

@ -87,7 +87,7 @@ export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repo
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_push']
},

View File

@ -26,7 +26,7 @@ import { noop } from 'lodash-es'
import { String, useStrings } from 'framework/strings'
import { useAppContext } from 'AppContext'
import type { RepoBranch, RepoCommitTag, TypesRepository } from 'services/code'
import type { RepoBranch, RepoCommitTag, RepoRepositoryOutput } from 'services/code'
import { formatDate, getErrorMessage, voidFn } from 'utils/Utils'
import { useConfirmAction } from 'hooks/useConfirmAction'
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
@ -37,7 +37,7 @@ import css from './TagsContent.module.scss'
interface TagsContentProps {
searchTerm?: string
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
branches: RepoBranch[]
onDeleteSuccess: () => void
}

View File

@ -5,7 +5,7 @@ import { useGet } from 'restful-react'
import { useStrings } from 'framework/strings'
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import css from './Search.module.scss'
@ -44,7 +44,7 @@ const KeywordSearchFilters: React.FC<KeywordSearchFiltersProps> = ({
const { getString } = useStrings()
const space = useGetSpaceParam()
const { data } = useGet<TypesRepository[]>({
const { data } = useGet<RepoRepositoryOutput[]>({
path: `/api/v1/spaces/${space}/+/repos`,
debounce: 500,
lazy: isRepoLevelSearch
@ -52,7 +52,7 @@ const KeywordSearchFilters: React.FC<KeywordSearchFiltersProps> = ({
const repositoryOptions =
data?.map(repository => ({
label: String(repository.uid),
label: String(repository.identifier),
value: String(repository.path)
})) || []

View File

@ -45,7 +45,7 @@ import { useQueryParams } from 'hooks/useQueryParams'
import { useAppContext } from 'AppContext'
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
import { voidFn, getErrorMessage, ButtonRoleProps } from 'utils/Utils'
import type { RepoFileContent, TypesRepository } from 'services/code'
import type { RepoFileContent, RepoRepositoryOutput } from 'services/code'
import { useShowRequestError } from 'hooks/useShowRequestError'
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
import { useGetResourceContent } from 'hooks/useGetResourceContent'
@ -291,7 +291,7 @@ export default function Search() {
interface SearchResultsProps {
data: SearchResultType[]
onSelect: (fileName: string, filePath: string, content: string, highlightedLines: number[]) => void
repoMetadata: TypesRepository | undefined
repoMetadata: RepoRepositoryOutput | undefined
standalone: boolean
}

View File

@ -39,7 +39,7 @@ const Execution = () => {
return (
<Container className={css.main}>
<PageHeader title={`THIS IS A SECRET = ${secret?.uid}`} />
<PageHeader title={`THIS IS A SECRET = ${secret?.identifier}`} />
</Container>
)
}

View File

@ -92,7 +92,7 @@ const SecretList = () => {
<Layout.Horizontal spacing="small" style={{ flexGrow: 1 }}>
<Layout.Vertical flex className={css.name}>
<Text className={css.repoName} lineClamp={1}>
<Keywords value={searchTerm}>{record.uid}</Keywords>
<Keywords value={searchTerm}>{record.identifier}</Keywords>
</Text>
{record.description && (
<Text className={css.desc} lineClamp={1}>
@ -125,7 +125,7 @@ const SecretList = () => {
Cell: ({ row }: CellProps<TypesSecret>) => {
const { mutate: deleteSecret } = useMutate({
verb: 'DELETE',
path: `/api/v1/secrets/${space}/${row.original.uid}/+`
path: `/api/v1/secrets/${space}/${row.original.identifier}/+`
})
const { showSuccess, showError } = useToaster()
const confirmDeleteSecret = useConfirmAct()
@ -150,7 +150,11 @@ const SecretList = () => {
confirmText: getString('delete'),
intent: Intent.DANGER,
message: (
<String useRichText stringID="secrets.deleteSecretConfirm" vars={{ uid: row.original.uid }} />
<String
useRichText
stringID="secrets.deleteSecretConfirm"
vars={{ uid: row.original.identifier }}
/>
),
action: async () => {
deleteSecret({})
@ -159,7 +163,7 @@ const SecretList = () => {
<StringSubstitute
str={getString('secrets.secretDeleted')}
vars={{
uid: truncateString(row.original.uid as string, 20)
uid: truncateString(row.original.identifier as string, 20)
}}
/>,
5000

View File

@ -35,7 +35,7 @@ import {
stringSubstitute
} from '@harnessio/uicore'
import { Icon } from '@harnessio/icons'
import type { TypesRepository } from 'services/code'
import type { RepoRepositoryOutput } from 'services/code'
import { useStrings } from 'framework/strings'
import type { ExportFormDataExtended } from 'utils/GitUtils'
@ -73,7 +73,7 @@ const ExportForm = (props: ExportFormProps) => {
organization: yup.string().trim().required(getString('importSpace.orgRequired')),
name: yup.string().trim().required(getString('importSpace.spaceNameRequired'))
})
const { data: repositories } = useGet<TypesRepository[]>({
const { data: repositories } = useGet<RepoRepositoryOutput[]>({
path: `/api/v1/spaces/${space}/+/repos`
})

View File

@ -222,7 +222,7 @@ export default function SpaceSettings() {
<Formik
formName="spaceGeneralSettings"
initialValues={{
name: data?.uid,
name: data?.identifier,
desc: data?.description
}}
onSubmit={voidFn(() => {
@ -354,7 +354,7 @@ export default function SpaceSettings() {
<Layout.Horizontal>
<TextInput
name="name"
value={formik.values.name || data?.uid}
value={formik.values.name || data?.identifier}
className={cx(css.textContainer, css.textSize)}
onChange={evt => {
formik.setFieldValue('name', (evt.currentTarget as HTMLInputElement)?.value)
@ -385,7 +385,7 @@ export default function SpaceSettings() {
variation={ButtonVariation.TERTIARY}
size={ButtonSize.SMALL}
onClick={() => {
formik.setFieldValue('name', data?.uid)
formik.setFieldValue('name', data?.identifier)
setEditName(ACCESS_MODES.VIEW)
}}
/>
@ -393,7 +393,7 @@ export default function SpaceSettings() {
</Layout.Horizontal>
) : (
<Text color={Color.GREY_800} className={css.textSize}>
{formik?.values?.name || data?.uid}
{formik?.values?.name || data?.identifier}
<Button
className={css.textSize}
text={getString('edit')}
@ -490,7 +490,7 @@ export default function SpaceSettings() {
padding={{ left: 'large', right: 'large', top: 'small', bottom: 'small' }}
color={Color.WARNING}>
{getString('spaceSetting.intentText', {
space: data?.uid
space: data?.identifier
})}
</Text>
</Container>

View File

@ -75,10 +75,10 @@ const useNewToken = ({ onClose }: { onClose: () => void }) => {
<Dialog isOpen enforceFocus={false} onClose={onModalClose} title={getString('createNewToken')}>
<Formik<OpenapiCreateTokenRequest>
initialValues={{
uid: ''
identifier: ''
}}
validationSchema={Yup.object().shape({
uid: Yup.string()
identifier: Yup.string()
.required(getString('validation.nameIsRequired'))
.matches(REGEX_VALID_REPO_NAME, getString('validation.nameInvalid')),
lifetime: Yup.number().required(getString('validation.expirationDateRequired'))
@ -102,7 +102,7 @@ const useNewToken = ({ onClose }: { onClose: () => void }) => {
return (
<FormikForm>
<FormInputWithCopyButton
name="uid"
name="identifier"
label={getString('name')}
placeholder={getString('newToken.namePlaceholder')}
disabled={isTokenGenerated}

View File

@ -190,7 +190,7 @@ const UserProfile = () => {
Cell: ({ row }: CellProps<TypesToken>) => {
return (
<Text font={{ variation: FontVariation.SMALL_SEMI }} lineClamp={1}>
{row.original.uid}
{row.original.identifier}
</Text>
)
}
@ -236,7 +236,7 @@ const UserProfile = () => {
)
},
{
accessor: 'uid',
accessor: 'identifier',
Header: '',
width: '5%',
Cell: ({ row }: CellProps<TypesToken>) => {
@ -246,7 +246,7 @@ const UserProfile = () => {
items={[
{
text: getString('deleteToken'),
onClick: () => handleDeleteToken(row.original.uid as string)
onClick: () => handleDeleteToken(row.original.identifier as string)
}
]}
/>

View File

@ -97,7 +97,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
const { routes } = useAppContext()
const { mutate, loading } = useMutate<OpenapiWebhookType>({
verb: isEdit ? 'PATCH' : 'POST',
path: `/api/v1/repos/${repoMetadata.path}/+/webhooks${isEdit ? `/${webhook?.id}` : ''}`
path: `/api/v1/repos/${repoMetadata.path}/+/webhooks${isEdit ? `/${webhook?.identifier}` : ''}`
})
const { hooks, standalone } = useAppContext()
const space = useGetSpaceParam()
@ -105,7 +105,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},
@ -116,7 +116,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
<Layout.Vertical className={css.form}>
<Formik<FormData>
initialValues={{
name: webhook?.display_name || '',
name: webhook?.identifier || '',
description: webhook?.description || '',
url: webhook?.url || '',
secret: isEdit && webhook?.has_secret ? SECRET_MASK : '',
@ -194,7 +194,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
const secret = (formData.secret || '').trim()
const data: OpenapiUpdateWebhookRequest = {
display_name: formData.name,
identifier: formData.name,
description: formData.description,
url: formData.url,
secret: secret !== SECRET_MASK ? secret : undefined,

View File

@ -101,7 +101,7 @@ export default function Webhooks() {
const { mutate } = useMutate<OpenapiWebhookType>({
verb: 'PATCH',
path: `/api/v1/repos/${repoMetadata?.path}/+/webhooks/${row.original?.id}`
path: `/api/v1/repos/${repoMetadata?.path}/+/webhooks/${row.original?.identifier}`
})
const [popoverDialogOpen, setPopoverDialogOpen] = useState(false)
@ -127,7 +127,7 @@ export default function Webhooks() {
<StringSubstitute
str={checked ? getString('disableWebhookContent') : getString('enableWebhookContent')}
vars={{
name: <strong>{row.original?.display_name}</strong>
name: <strong>{row.original?.identifier}</strong>
}}
/>
</Text>
@ -163,7 +163,7 @@ export default function Webhooks() {
interactionKind="click">
<Toggle
{...permissionProps(permPushResult, standalone)}
key={row.original.id}
key={row.original.identifier}
className={cx(css.toggle, checked ? css.toggleEnable : css.toggleDisable)}
checked={checked}></Toggle>
</Popover>
@ -176,7 +176,7 @@ export default function Webhooks() {
lineClamp={1}
width={300}
className={css.title}>
{row.original.display_name}
{row.original.identifier}
</Text>
{!!row.original.triggers?.length && (
<Text padding={{ left: 'small', right: 'small' }} color={Color.GREY_500}>
@ -212,7 +212,7 @@ export default function Webhooks() {
Cell: ({ row }: CellProps<OpenapiWebhookType>) => {
const { mutate: deleteWebhook } = useMutate({
verb: 'DELETE',
path: `/api/v1/repos/${repoMetadata?.path}/+/webhooks/${row.original.id}`
path: `/api/v1/repos/${repoMetadata?.path}/+/webhooks/${row.original.identifier}`
})
const confirmDelete = useConfirmAct()
@ -231,7 +231,7 @@ export default function Webhooks() {
history.push(
routes.toCODEWebhookDetails({
repoPath: repoMetadata?.path as string,
webhookId: String(row.original?.id)
webhookId: String(row.original?.identifier)
})
)
}
@ -272,7 +272,7 @@ export default function Webhooks() {
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},
@ -307,7 +307,7 @@ export default function Webhooks() {
history.push(
routes.toCODEWebhookDetails({
repoPath: repoMetadata.path as string,
webhookId: String(row.id)
webhookId: String(row.identifier)
})
)
}}

View File

@ -43,7 +43,7 @@ export function WebhooksHeader({ repoMetadata, loading, onSearchTermChanged }: W
{
resource: {
resourceType: 'CODE_REPOSITORY',
resourceIdentifier: repoMetadata?.uid as string
resourceIdentifier: repoMetadata?.identifier as string
},
permissions: ['code_repo_edit']
},

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -27,14 +27,14 @@ import type {
OpenapiGetContentOutput,
TypesCommit,
TypesPullReq,
TypesRepository,
RepoRepositoryOutput,
TypesRuleViolations
} from 'services/code'
import { getConfig } from 'services/config'
import { PullRequestSection, getErrorMessage } from './Utils'
export interface GitInfoProps {
repoMetadata: TypesRepository
repoMetadata: RepoRepositoryOutput
gitRef: string
resourcePath: string
resourceContent: OpenapiGetContentOutput
@ -287,7 +287,7 @@ export function formatTriggers(triggers: EnumWebhookTrigger[]) {
export const handleUpload = (
blob: File,
setMarkdownContent: (data: string) => void,
repoMetadata: TypesRepository | undefined,
repoMetadata: RepoRepositoryOutput | undefined,
showError: (message: React.ReactNode, timeout?: number | undefined, key?: string | undefined) => void,
standalone: boolean,
routingId?: string
@ -305,7 +305,7 @@ export const uploadImage = async (
// eslint-disable-next-line @typescript-eslint/no-explicit-any
fileBlob: any,
showError: (message: React.ReactNode, timeout?: number | undefined, key?: string | undefined) => void,
repoMetadata: TypesRepository | undefined,
repoMetadata: RepoRepositoryOutput | undefined,
standalone: boolean,
routingId?: string
) => {