mirror of
https://github.com/harness/drone.git
synced 2025-05-07 14:52:12 +08:00
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
This commit is contained in:
parent
d46516baa7
commit
87e418bb86
@ -17,7 +17,7 @@ package types
|
|||||||
import "encoding/json"
|
import "encoding/json"
|
||||||
|
|
||||||
type Pipeline struct {
|
type Pipeline struct {
|
||||||
ID int64 `db:"pipeline_id" json:"-"`
|
ID int64 `db:"pipeline_id" json:"id"`
|
||||||
Description string `db:"pipeline_description" json:"description"`
|
Description string `db:"pipeline_description" json:"description"`
|
||||||
Identifier string `db:"pipeline_uid" json:"identifier"`
|
Identifier string `db:"pipeline_uid" json:"identifier"`
|
||||||
Disabled bool `db:"pipeline_disabled" json:"disabled"`
|
Disabled bool `db:"pipeline_disabled" json:"disabled"`
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { atom } from 'jotai'
|
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)
|
||||||
|
@ -39,7 +39,7 @@ import { BranchTargetType, SettingTypeMode, SettingsTab, branchTargetOptions } f
|
|||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { REGEX_VALID_REPO_NAME, getErrorMessage, permissionProps, rulesFormInitialPayload } from 'utils/Utils'
|
import { REGEX_VALID_REPO_NAME, getErrorMessage, permissionProps, rulesFormInitialPayload } from 'utils/Utils'
|
||||||
import type {
|
import type {
|
||||||
TypesRepository,
|
RepoRepositoryOutput,
|
||||||
OpenapiRule,
|
OpenapiRule,
|
||||||
TypesPrincipalInfo,
|
TypesPrincipalInfo,
|
||||||
EnumMergeMethod,
|
EnumMergeMethod,
|
||||||
@ -58,7 +58,7 @@ import css from './BranchProtectionForm.module.scss'
|
|||||||
const BranchProtectionForm = (props: {
|
const BranchProtectionForm = (props: {
|
||||||
ruleUid: string
|
ruleUid: string
|
||||||
editMode: boolean
|
editMode: boolean
|
||||||
repoMetadata?: TypesRepository | undefined
|
repoMetadata?: RepoRepositoryOutput | undefined
|
||||||
refetchRules: () => void
|
refetchRules: () => void
|
||||||
settingSectionMode: SettingTypeMode
|
settingSectionMode: SettingTypeMode
|
||||||
}) => {
|
}) => {
|
||||||
@ -172,7 +172,7 @@ const BranchProtectionForm = (props: {
|
|||||||
userArrayState.length > 0 ? userArrayState : usersArray?.map(user => `${user.id} ${user.display_name}`)
|
userArrayState.length > 0 ? userArrayState : usersArray?.map(user => `${user.id} ${user.display_name}`)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: rule?.uid,
|
name: rule?.identifier,
|
||||||
desc: rule.description,
|
desc: rule.description,
|
||||||
enable: rule.state !== 'disabled',
|
enable: rule.state !== 'disabled',
|
||||||
target: '',
|
target: '',
|
||||||
@ -188,8 +188,9 @@ const BranchProtectionForm = (props: {
|
|||||||
requireNewChanges: (rule.definition as ProtectionBranch)?.pullreq?.approvals?.require_latest_commit,
|
requireNewChanges: (rule.definition as ProtectionBranch)?.pullreq?.approvals?.require_latest_commit,
|
||||||
reqResOfChanges: (rule.definition as ProtectionBranch)?.pullreq?.approvals?.require_no_change_request,
|
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
|
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,
|
requireStatusChecks: (rule.definition as any)?.pullreq?.status_checks?.require_identifiers?.length > 0,
|
||||||
statusChecks: (rule.definition as ProtectionBranch)?.pullreq?.status_checks?.require_uids || ([] as string[]),
|
statusChecks:
|
||||||
|
(rule.definition as ProtectionBranch)?.pullreq?.status_checks?.require_identifiers || ([] as string[]),
|
||||||
limitMergeStrategies: !!(rule.definition as ProtectionBranch)?.pullreq?.merge?.strategies_allowed,
|
limitMergeStrategies: !!(rule.definition as ProtectionBranch)?.pullreq?.merge?.strategies_allowed,
|
||||||
mergeCommit: isMergePresent,
|
mergeCommit: isMergePresent,
|
||||||
squashMerge: isSquashPresent,
|
squashMerge: isSquashPresent,
|
||||||
@ -210,7 +211,7 @@ const BranchProtectionForm = (props: {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
@ -238,7 +239,7 @@ const BranchProtectionForm = (props: {
|
|||||||
|
|
||||||
const bypassList = formData?.bypassList?.map(item => parseInt(item.split(' ')[0]))
|
const bypassList = formData?.bypassList?.map(item => parseInt(item.split(' ')[0]))
|
||||||
const payload: OpenapiRule = {
|
const payload: OpenapiRule = {
|
||||||
uid: formData.name,
|
identifier: formData.name,
|
||||||
type: 'branch',
|
type: 'branch',
|
||||||
description: formData.desc,
|
description: formData.desc,
|
||||||
state: formData.enable === true ? 'active' : 'disabled',
|
state: formData.enable === true ? 'active' : 'disabled',
|
||||||
@ -267,7 +268,7 @@ const BranchProtectionForm = (props: {
|
|||||||
delete_branch: formData.autoDelete
|
delete_branch: formData.autoDelete
|
||||||
},
|
},
|
||||||
status_checks: {
|
status_checks: {
|
||||||
require_uids: formData.statusChecks
|
require_identifiers: formData.statusChecks
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
lifecycle: {
|
lifecycle: {
|
||||||
|
@ -41,7 +41,7 @@ const BranchProtectionHeader = ({
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
|
@ -99,12 +99,12 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
|
|
||||||
const { mutate } = useMutate<OpenapiRule>({
|
const { mutate } = useMutate<OpenapiRule>({
|
||||||
verb: 'PATCH',
|
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 [popoverDialogOpen, setPopoverDialogOpen] = useState(false)
|
||||||
const { mutate: deleteRule } = useMutate({
|
const { mutate: deleteRule } = useMutate({
|
||||||
verb: 'DELETE',
|
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 confirmDelete = useConfirmAct()
|
||||||
const includeElements = (row.original?.pattern as ProtectionPattern)?.include?.map(
|
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.approvals.require_latest_commit': getString('branchProtection.reqNewChangesTitle'),
|
||||||
'pullreq.comments.require_resolve_all': getString('branchProtection.reqCommentResolutionTitle'),
|
'pullreq.comments.require_resolve_all': getString('branchProtection.reqCommentResolutionTitle'),
|
||||||
'pullreq.status_checks.all_must_succeed': getString('branchProtection.reqStatusChecksTitle'),
|
'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.strategies_allowed': getString('branchProtection.limitMergeStrategies'),
|
||||||
'pullreq.merge.delete_branch': getString('branchProtection.autoDeleteTitle'),
|
'pullreq.merge.delete_branch': getString('branchProtection.autoDeleteTitle'),
|
||||||
'lifecycle.create_forbidden': getString('branchProtection.blockBranchCreation'),
|
'lifecycle.create_forbidden': getString('branchProtection.blockBranchCreation'),
|
||||||
@ -187,7 +187,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
@ -215,7 +215,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
<StringSubstitute
|
<StringSubstitute
|
||||||
str={checked ? getString('disableWebhookContent') : getString('enableWebhookContent')}
|
str={checked ? getString('disableWebhookContent') : getString('enableWebhookContent')}
|
||||||
vars={{
|
vars={{
|
||||||
name: <strong>{row.original?.uid}</strong>
|
name: <strong>{row.original?.identifier}</strong>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
@ -251,7 +251,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
<Toggle
|
<Toggle
|
||||||
{...permissionProps(permPushResult, standalone)}
|
{...permissionProps(permPushResult, standalone)}
|
||||||
padding={{ top: 'xsmall' }}
|
padding={{ top: 'xsmall' }}
|
||||||
key={`${row.original.uid}-toggle`}
|
key={`${row.original.identifier}-toggle`}
|
||||||
// className={cx(css.toggle, checked ? css.toggleEnable : css.toggleDisable)}
|
// className={cx(css.toggle, checked ? css.toggleEnable : css.toggleDisable)}
|
||||||
checked={checked}></Toggle>
|
checked={checked}></Toggle>
|
||||||
</Popover>
|
</Popover>
|
||||||
@ -259,7 +259,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
<Container padding={{ left: 'small' }} style={{ flexGrow: 1 }}>
|
<Container padding={{ left: 'small' }} style={{ flexGrow: 1 }}>
|
||||||
<Layout.Horizontal spacing="small">
|
<Layout.Horizontal spacing="small">
|
||||||
<Text padding={{ right: 'small', top: 'xsmall' }} lineClamp={1} width={150} className={css.title}>
|
<Text padding={{ right: 'small', top: 'xsmall' }} lineClamp={1} width={150} className={css.title}>
|
||||||
{row.original.uid}
|
{row.original.identifier}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{!!row.original.description && (
|
{!!row.original.description && (
|
||||||
@ -284,7 +284,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
repoPath: repoMetadata?.path as string,
|
repoPath: repoMetadata?.path as string,
|
||||||
settingSection: settingSection,
|
settingSection: settingSection,
|
||||||
settingSectionMode: SettingTypeMode.EDIT,
|
settingSectionMode: SettingTypeMode.EDIT,
|
||||||
ruleId: String(row.original.uid)
|
ruleId: String(row.original.identifier)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -297,7 +297,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
confirmDelete({
|
confirmDelete({
|
||||||
className: css.hideButtonIcon,
|
className: css.hideButtonIcon,
|
||||||
title: getString('branchProtection.deleteProtectionRule'),
|
title: getString('branchProtection.deleteProtectionRule'),
|
||||||
message: getString('branchProtection.deleteText', { rule: row.original.uid }),
|
message: getString('branchProtection.deleteText', { rule: row.original.identifier }),
|
||||||
action: async () => {
|
action: async () => {
|
||||||
try {
|
try {
|
||||||
await deleteRule({})
|
await deleteRule({})
|
||||||
@ -337,7 +337,9 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
<>
|
<>
|
||||||
{nonEmptyRules.map((rule: { value: string }) => {
|
{nonEmptyRules.map((rule: { value: string }) => {
|
||||||
return (
|
return (
|
||||||
<Text key={`${row.original.uid}-${rule}`} className={css.appliedRulesTextContainer}>
|
<Text
|
||||||
|
key={`${row.original.identifier}-${rule}`}
|
||||||
|
className={css.appliedRulesTextContainer}>
|
||||||
{rule.value}
|
{rule.value}
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
@ -368,7 +370,7 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
@ -405,13 +407,13 @@ const BranchProtectionListing = (props: { activeTab: string }) => {
|
|||||||
data={rules}
|
data={rules}
|
||||||
getRowClassName={() => css.row}
|
getRowClassName={() => css.row}
|
||||||
onRowClick={row => {
|
onRowClick={row => {
|
||||||
setCurRuleName(row.uid as string)
|
setCurRuleName(row.identifier as string)
|
||||||
history.push(
|
history.push(
|
||||||
routes.toCODESettings({
|
routes.toCODESettings({
|
||||||
repoPath: repoMetadata?.path as string,
|
repoPath: repoMetadata?.path as string,
|
||||||
settingSection: settingSection,
|
settingSection: settingSection,
|
||||||
settingSectionMode: SettingTypeMode.EDIT,
|
settingSectionMode: SettingTypeMode.EDIT,
|
||||||
ruleId: String(row.uid)
|
ruleId: String(row.identifier)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
@ -26,7 +26,7 @@ import { useStrings } from 'framework/strings'
|
|||||||
import { ThreadSection } from 'components/ThreadSection/ThreadSection'
|
import { ThreadSection } from 'components/ThreadSection/ThreadSection'
|
||||||
import { PipeSeparator } from 'components/PipeSeparator/PipeSeparator'
|
import { PipeSeparator } from 'components/PipeSeparator/PipeSeparator'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||||
import { MarkdownEditorWithPreview } from 'components/MarkdownEditorWithPreview/MarkdownEditorWithPreview'
|
import { MarkdownEditorWithPreview } from 'components/MarkdownEditorWithPreview/MarkdownEditorWithPreview'
|
||||||
import { MarkdownViewer } from 'components/MarkdownViewer/MarkdownViewer'
|
import { MarkdownViewer } from 'components/MarkdownViewer/MarkdownViewer'
|
||||||
@ -94,7 +94,7 @@ interface CommentBoxProps<T> {
|
|||||||
outlets?: Partial<Record<CommentBoxOutletPosition, React.ReactNode>>
|
outlets?: Partial<Record<CommentBoxOutletPosition, React.ReactNode>>
|
||||||
autoFocusAndPosition?: boolean
|
autoFocusAndPosition?: boolean
|
||||||
enableReplyPlaceHolder?: boolean
|
enableReplyPlaceHolder?: boolean
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
standalone: boolean
|
standalone: boolean
|
||||||
routingId: string
|
routingId: string
|
||||||
copyLinkToComment: (commentId: number, commentItem: CommentItem<T>) => void
|
copyLinkToComment: (commentId: number, commentItem: CommentItem<T>) => void
|
||||||
@ -310,7 +310,7 @@ interface CommentsThreadProps<T>
|
|||||||
> {
|
> {
|
||||||
onQuote: (content: string) => void
|
onQuote: (content: string) => void
|
||||||
setDirty: (index: number, dirty: boolean) => void
|
setDirty: (index: number, dirty: boolean) => void
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
const CommentsThread = <T = unknown,>({
|
const CommentsThread = <T = unknown,>({
|
||||||
|
@ -32,7 +32,7 @@ import { useGet } from 'restful-react'
|
|||||||
import { defaultTo } from 'lodash-es'
|
import { defaultTo } from 'lodash-es'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import { useStrings } from 'framework/strings'
|
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 { GitInfoProps } from 'utils/GitUtils'
|
||||||
import type { CODERoutes } from 'RouteDefinitions'
|
import type { CODERoutes } from 'RouteDefinitions'
|
||||||
import { CommitActions } from 'components/CommitActions/CommitActions'
|
import { CommitActions } from 'components/CommitActions/CommitActions'
|
||||||
@ -41,7 +41,7 @@ import { TimePopoverWithLocal } from 'utils/timePopoverLocal/TimePopoverWithLoca
|
|||||||
import { useDocumentTitle } from 'hooks/useDocumentTitle'
|
import { useDocumentTitle } from 'hooks/useDocumentTitle'
|
||||||
import css from './CommitInfo.module.scss'
|
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 { repoMetadata, commitRef } = props
|
||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
|
@ -262,7 +262,7 @@ export const CreateBranchModalButton: React.FC<CreateBranchModalButtonProps> = (
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -236,7 +236,7 @@ export const CreateTagModalButton: React.FC<CreateTagModalButtonProps> = ({
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -29,7 +29,7 @@ import { Compartment, EditorState, Extension } from '@codemirror/state'
|
|||||||
import { color } from '@uiw/codemirror-extensions-color'
|
import { color } from '@uiw/codemirror-extensions-color'
|
||||||
import { hyperLink } from '@uiw/codemirror-extensions-hyper-link'
|
import { hyperLink } from '@uiw/codemirror-extensions-hyper-link'
|
||||||
import { githubLight, githubDark } from '@uiw/codemirror-themes-all'
|
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 { useStrings } from 'framework/strings'
|
||||||
import { handleUpload } from 'utils/GitUtils'
|
import { handleUpload } from 'utils/GitUtils'
|
||||||
import { handleFileDrop, handlePaste } from 'utils/Utils'
|
import { handleFileDrop, handlePaste } from 'utils/Utils'
|
||||||
@ -50,7 +50,7 @@ export interface EditorProps {
|
|||||||
onChange?: (doc: Text, viewUpdate: ViewUpdate, isDirty: boolean) => void
|
onChange?: (doc: Text, viewUpdate: ViewUpdate, isDirty: boolean) => void
|
||||||
onViewUpdate?: (viewUpdate: ViewUpdate) => void
|
onViewUpdate?: (viewUpdate: ViewUpdate) => void
|
||||||
darkTheme?: boolean
|
darkTheme?: boolean
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
inGitBlame?: boolean
|
inGitBlame?: boolean
|
||||||
standalone: boolean
|
standalone: boolean
|
||||||
routingId?: string
|
routingId?: string
|
||||||
|
@ -111,7 +111,7 @@ export function ExecutionPageHeader({
|
|||||||
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
||||||
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
||||||
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string, gitRef })}>
|
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string, gitRef })}>
|
||||||
{repoMetadata.uid}
|
{repoMetadata.identifier}
|
||||||
</Link>
|
</Link>
|
||||||
{extraBreadcrumbLinks.map(link => (
|
{extraBreadcrumbLinks.map(link => (
|
||||||
<Fragment key={link.url}>
|
<Fragment key={link.url}>
|
||||||
|
@ -39,7 +39,7 @@ import type {
|
|||||||
OpenapiCalculateCommitDivergenceRequest,
|
OpenapiCalculateCommitDivergenceRequest,
|
||||||
RepoCommitDivergence,
|
RepoCommitDivergence,
|
||||||
TypesCommit,
|
TypesCommit,
|
||||||
TypesRepository
|
RepoRepositoryOutput
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { CommitActions } from 'components/CommitActions/CommitActions'
|
import { CommitActions } from 'components/CommitActions/CommitActions'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
@ -60,7 +60,7 @@ interface LatestCommitProps extends Pick<GitInfoProps, 'repoMetadata' | 'gitRef'
|
|||||||
|
|
||||||
interface DivergenceInfoProps {
|
interface DivergenceInfoProps {
|
||||||
commitDivergence: RepoCommitDivergence
|
commitDivergence: RepoCommitDivergence
|
||||||
metadata: TypesRepository
|
metadata: RepoRepositoryOutput
|
||||||
currentGitRef: string
|
currentGitRef: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ import {
|
|||||||
import { decodeGitContent, handleUpload, normalizeGitRef } from 'utils/GitUtils'
|
import { decodeGitContent, handleUpload, normalizeGitRef } from 'utils/GitUtils'
|
||||||
import { defaultUsefulOrNot } from 'components/DefaultUsefulOrNot/UsefulOrNot'
|
import { defaultUsefulOrNot } from 'components/DefaultUsefulOrNot/UsefulOrNot'
|
||||||
import { AidaClient } from 'utils/types'
|
import { AidaClient } from 'utils/types'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
import { useEventListener } from 'hooks/useEventListener'
|
import { useEventListener } from 'hooks/useEventListener'
|
||||||
import type { SuggestionBlock } from 'components/SuggestionBlock/SuggestionBlock'
|
import type { SuggestionBlock } from 'components/SuggestionBlock/SuggestionBlock'
|
||||||
import css from './MarkdownEditorWithPreview.module.scss'
|
import css from './MarkdownEditorWithPreview.module.scss'
|
||||||
@ -134,7 +134,7 @@ interface MarkdownEditorWithPreviewProps {
|
|||||||
sourceGitRef?: string
|
sourceGitRef?: string
|
||||||
targetGitRef?: string
|
targetGitRef?: string
|
||||||
setFlag?: React.Dispatch<React.SetStateAction<boolean>>
|
setFlag?: React.Dispatch<React.SetStateAction<boolean>>
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
standalone: boolean
|
standalone: boolean
|
||||||
routingId: string
|
routingId: string
|
||||||
suggestionBlock?: SuggestionBlock
|
suggestionBlock?: SuggestionBlock
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
} from '@harnessio/uicore'
|
} from '@harnessio/uicore'
|
||||||
import { FontVariation } from '@harnessio/design-system'
|
import { FontVariation } from '@harnessio/design-system'
|
||||||
import { useModalHook } from 'hooks/useModalHook'
|
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 { useStrings } from 'framework/strings'
|
||||||
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
|
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
@ -53,7 +53,7 @@ const useNewPipelineModal = () => {
|
|||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const { showError } = useToaster()
|
const { showError } = useToaster()
|
||||||
const [repo, setRepo] = useState<TypesRepository | undefined>()
|
const [repo, setRepo] = useState<RepoRepositoryOutput | undefined>()
|
||||||
const repoPath = useMemo(() => repo?.path || '', [repo])
|
const repoPath = useMemo(() => repo?.path || '', [repo])
|
||||||
|
|
||||||
const { mutate: savePipeline } = useMutate<TypesPipeline>({
|
const { mutate: savePipeline } = useMutate<TypesPipeline>({
|
||||||
@ -67,7 +67,7 @@ const useNewPipelineModal = () => {
|
|||||||
const payload: OpenapiCreatePipelineRequest = {
|
const payload: OpenapiCreatePipelineRequest = {
|
||||||
config_path: yamlPath,
|
config_path: yamlPath,
|
||||||
default_branch: branch,
|
default_branch: branch,
|
||||||
uid: name
|
identifier: name
|
||||||
}
|
}
|
||||||
savePipeline(payload, { pathParams: { path: `/api/v1/repos/${repoPath}/+/pipelines` } })
|
savePipeline(payload, { pathParams: { path: `/api/v1/repos/${repoPath}/+/pipelines` } })
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -167,7 +167,7 @@ const useNewPipelineModal = () => {
|
|||||||
}, [repo])
|
}, [repo])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
openModal: ({ repoMetadata }: { repoMetadata?: TypesRepository }) => {
|
openModal: ({ repoMetadata }: { repoMetadata?: RepoRepositoryOutput }) => {
|
||||||
setRepo(repoMetadata)
|
setRepo(repoMetadata)
|
||||||
openModal()
|
openModal()
|
||||||
},
|
},
|
||||||
|
@ -69,8 +69,8 @@ import {
|
|||||||
getProviderTypeMapping
|
getProviderTypeMapping
|
||||||
} from 'utils/GitUtils'
|
} from 'utils/GitUtils'
|
||||||
import type {
|
import type {
|
||||||
TypesSpace,
|
SpaceSpaceOutput,
|
||||||
TypesRepository,
|
RepoRepositoryOutput,
|
||||||
SpaceImportRepositoriesOutput,
|
SpaceImportRepositoriesOutput,
|
||||||
OpenapiCreateRepositoryRequest
|
OpenapiCreateRepositoryRequest
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
@ -95,7 +95,7 @@ export interface NewRepoModalButtonProps extends Omit<ButtonProps, 'onClick' | '
|
|||||||
modalTitle: string
|
modalTitle: string
|
||||||
submitButtonTitle?: string
|
submitButtonTitle?: string
|
||||||
cancelButtonTitle?: string
|
cancelButtonTitle?: string
|
||||||
onSubmit: (data: TypesRepository & SpaceImportRepositoriesOutput) => void
|
onSubmit: (data: RepoRepositoryOutput & SpaceImportRepositoriesOutput) => void
|
||||||
newRepoModalOnly?: boolean
|
newRepoModalOnly?: boolean
|
||||||
notFoundRepoName?: string
|
notFoundRepoName?: string
|
||||||
}
|
}
|
||||||
@ -114,7 +114,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
|
|||||||
const [enablePublicRepo, setEnablePublicRepo] = useState(false)
|
const [enablePublicRepo, setEnablePublicRepo] = useState(false)
|
||||||
const { showError } = useToaster()
|
const { showError } = useToaster()
|
||||||
|
|
||||||
const { mutate: createRepo, loading: submitLoading } = useMutate<TypesRepository>({
|
const { mutate: createRepo, loading: submitLoading } = useMutate<RepoRepositoryOutput>({
|
||||||
verb: 'POST',
|
verb: 'POST',
|
||||||
path: `/api/v1/repos`,
|
path: `/api/v1/repos`,
|
||||||
queryParams: standalone
|
queryParams: standalone
|
||||||
@ -123,7 +123,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
|
|||||||
space_path: space
|
space_path: space
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const { mutate: importRepo, loading: importRepoLoading } = useMutate<TypesRepository>({
|
const { mutate: importRepo, loading: importRepoLoading } = useMutate<RepoRepositoryOutput>({
|
||||||
verb: 'POST',
|
verb: 'POST',
|
||||||
path: `/api/v1/repos/import`,
|
path: `/api/v1/repos/import`,
|
||||||
queryParams: standalone
|
queryParams: standalone
|
||||||
@ -132,7 +132,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
|
|||||||
space_path: space
|
space_path: space
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const { mutate: importMultipleRepositories, loading: submitImportLoading } = useMutate<TypesSpace>({
|
const { mutate: importMultipleRepositories, loading: submitImportLoading } = useMutate<SpaceSpaceOutput>({
|
||||||
verb: 'POST',
|
verb: 'POST',
|
||||||
path: `/api/v1/spaces/${space}/+/import`
|
path: `/api/v1/spaces/${space}/+/import`
|
||||||
})
|
})
|
||||||
@ -179,7 +179,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
|
|||||||
git_ignore: get(formData, 'gitignore', 'none'),
|
git_ignore: get(formData, 'gitignore', 'none'),
|
||||||
is_public: get(formData, 'isPublic') === RepoVisibility.PUBLIC,
|
is_public: get(formData, 'isPublic') === RepoVisibility.PUBLIC,
|
||||||
license: get(formData, 'license', 'none'),
|
license: get(formData, 'license', 'none'),
|
||||||
uid: get(formData, 'name', '').trim(),
|
identifier: get(formData, 'name', '').trim(),
|
||||||
readme: get(formData, 'addReadme', false),
|
readme: get(formData, 'addReadme', false),
|
||||||
parent_ref: space
|
parent_ref: space
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
|
|||||||
const importPayload = {
|
const importPayload = {
|
||||||
description: formData.description || '',
|
description: formData.description || '',
|
||||||
parent_ref: space,
|
parent_ref: space,
|
||||||
uid: formData.name,
|
identifier: formData.name,
|
||||||
provider,
|
provider,
|
||||||
provider_repo: compact([
|
provider_repo: compact([
|
||||||
formData.org,
|
formData.org,
|
||||||
@ -261,7 +261,7 @@ export const NewRepoModalButton: React.FC<NewRepoModalButtonProps> = ({
|
|||||||
const importPayload = {
|
const importPayload = {
|
||||||
description: (formData.description || '').trim(),
|
description: (formData.description || '').trim(),
|
||||||
parent_ref: space,
|
parent_ref: space,
|
||||||
uid: formData.name.trim(),
|
identifier: formData.name.trim(),
|
||||||
provider,
|
provider,
|
||||||
provider_space: compact([
|
provider_space: compact([
|
||||||
formData.organization,
|
formData.organization,
|
||||||
|
@ -85,7 +85,7 @@ export const NewSecretModalButton: React.FC<NewSecretModalButtonProps> = ({
|
|||||||
space_ref: space,
|
space_ref: space,
|
||||||
data: formData.value,
|
data: formData.value,
|
||||||
description: formData.description,
|
description: formData.description,
|
||||||
uid: formData.name
|
identifier: formData.name
|
||||||
}
|
}
|
||||||
await createSecret(payload)
|
await createSecret(payload)
|
||||||
hideModal()
|
hideModal()
|
||||||
|
@ -40,7 +40,7 @@ import { compact, get } from 'lodash-es'
|
|||||||
import { useModalHook } from 'hooks/useModalHook'
|
import { useModalHook } from 'hooks/useModalHook'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { getErrorMessage, permissionProps, REGEX_VALID_REPO_NAME } from 'utils/Utils'
|
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 { useAppContext } from 'AppContext'
|
||||||
import {
|
import {
|
||||||
ImportSpaceFormData,
|
ImportSpaceFormData,
|
||||||
@ -84,7 +84,7 @@ export interface NewSpaceModalButtonProps extends Omit<ButtonProps, 'onClick' |
|
|||||||
cancelButtonTitle?: string
|
cancelButtonTitle?: string
|
||||||
onRefetch: () => void
|
onRefetch: () => void
|
||||||
handleNavigation?: (value: string) => void
|
handleNavigation?: (value: string) => void
|
||||||
onSubmit: (data: TypesSpace) => void
|
onSubmit: (data: SpaceSpaceOutput) => void
|
||||||
fromSpace?: boolean
|
fromSpace?: boolean
|
||||||
}
|
}
|
||||||
export interface OpenapiCreateSpaceRequestExtended extends OpenapiCreateSpaceRequest {
|
export interface OpenapiCreateSpaceRequestExtended extends OpenapiCreateSpaceRequest {
|
||||||
@ -107,11 +107,11 @@ export const NewSpaceModalButton: React.FC<NewSpaceModalButtonProps> = ({
|
|||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const { showError } = useToaster()
|
const { showError } = useToaster()
|
||||||
|
|
||||||
const { mutate: createSpace, loading: submitLoading } = useMutate<TypesSpace>({
|
const { mutate: createSpace, loading: submitLoading } = useMutate<SpaceSpaceOutput>({
|
||||||
verb: 'POST',
|
verb: 'POST',
|
||||||
path: `/api/v1/spaces`
|
path: `/api/v1/spaces`
|
||||||
})
|
})
|
||||||
const { mutate: importSpace, loading: submitImportLoading } = useMutate<TypesSpace>({
|
const { mutate: importSpace, loading: submitImportLoading } = useMutate<SpaceSpaceOutput>({
|
||||||
verb: 'POST',
|
verb: 'POST',
|
||||||
path: `/api/v1/spaces/import`
|
path: `/api/v1/spaces/import`
|
||||||
})
|
})
|
||||||
@ -123,7 +123,7 @@ export const NewSpaceModalButton: React.FC<NewSpaceModalButtonProps> = ({
|
|||||||
const payload: OpenapiCreateSpaceRequestExtended = {
|
const payload: OpenapiCreateSpaceRequestExtended = {
|
||||||
description: get(formData, 'description', '').trim(),
|
description: get(formData, 'description', '').trim(),
|
||||||
is_public: get(formData, 'isPublic') === RepoVisibility.PUBLIC,
|
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
|
parent_id: standalone ? Number(space) : 0 // TODO: Backend needs to fix parentID: accept string or number
|
||||||
}
|
}
|
||||||
await createSpace(payload)
|
await createSpace(payload)
|
||||||
@ -156,7 +156,7 @@ export const NewSpaceModalButton: React.FC<NewSpaceModalButtonProps> = ({
|
|||||||
try {
|
try {
|
||||||
const importPayload = {
|
const importPayload = {
|
||||||
description: (formData.description || '').trim(),
|
description: (formData.description || '').trim(),
|
||||||
uid: formData.name.trim(),
|
identifier: formData.name.trim(),
|
||||||
provider,
|
provider,
|
||||||
provider_space: compact([
|
provider_space: compact([
|
||||||
formData.organization,
|
formData.organization,
|
||||||
|
@ -82,7 +82,7 @@ export const NewTriggerModalButton: React.FC<NewTriggerModalButtonProps> = ({
|
|||||||
try {
|
try {
|
||||||
const payload: OpenapiCreateTriggerRequest = {
|
const payload: OpenapiCreateTriggerRequest = {
|
||||||
actions: formData.actions,
|
actions: formData.actions,
|
||||||
uid: formData.name
|
identifier: formData.name
|
||||||
}
|
}
|
||||||
await createTrigger(payload)
|
await createTrigger(payload)
|
||||||
hideModal()
|
hideModal()
|
||||||
|
@ -69,7 +69,7 @@ const PipelineSettingsPageHeader = ({
|
|||||||
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
||||||
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
||||||
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string, gitRef })}>
|
<Link to={routes.toCODERepository({ repoPath: repoMetadata.path as string, gitRef })}>
|
||||||
{repoMetadata.uid}
|
{repoMetadata.identifier}
|
||||||
</Link>
|
</Link>
|
||||||
{extraBreadcrumbLinks.map(link => (
|
{extraBreadcrumbLinks.map(link => (
|
||||||
<Fragment key={link.url}>
|
<Fragment key={link.url}>
|
||||||
|
@ -89,7 +89,7 @@ const PipelineSettingsTab = ({ pipeline, repoPath, yamlPath }: SettingsContentPr
|
|||||||
try {
|
try {
|
||||||
const payload: OpenapiUpdatePipelineRequest = {
|
const payload: OpenapiUpdatePipelineRequest = {
|
||||||
config_path: newYamlPath,
|
config_path: newYamlPath,
|
||||||
uid: name
|
identifier: name
|
||||||
}
|
}
|
||||||
await updatePipeline(payload, {
|
await updatePipeline(payload, {
|
||||||
pathParams: { path: `/api/v1/repos/${repoPath}/+/pipelines/${pipeline}` }
|
pathParams: { path: `/api/v1/repos/${repoPath}/+/pipelines/${pipeline}` }
|
||||||
|
@ -145,7 +145,7 @@ const TriggerDetails = ({
|
|||||||
const handleSubmit = async (formData: TriggerFormData) => {
|
const handleSubmit = async (formData: TriggerFormData) => {
|
||||||
try {
|
try {
|
||||||
const payload: OpenapiUpdateTriggerRequest = {
|
const payload: OpenapiUpdateTriggerRequest = {
|
||||||
uid: formData.name,
|
identifier: formData.name,
|
||||||
actions: formData.actions,
|
actions: formData.actions,
|
||||||
disabled: formData.disabled
|
disabled: formData.disabled
|
||||||
}
|
}
|
||||||
@ -324,8 +324,8 @@ const PipelineTriggersTabs = ({ repoPath, pipeline }: PipelineTriggersTabsProps)
|
|||||||
<Layout.Vertical spacing={'large'} className={css.triggerList}>
|
<Layout.Vertical spacing={'large'} className={css.triggerList}>
|
||||||
{data?.map((trigger, index) => (
|
{data?.map((trigger, index) => (
|
||||||
<TriggerMenuItem
|
<TriggerMenuItem
|
||||||
key={trigger.id}
|
key={trigger.identifier}
|
||||||
name={trigger.uid as string}
|
name={trigger.identifier as string}
|
||||||
lastUpdated={trigger.updated as number}
|
lastUpdated={trigger.updated as number}
|
||||||
setSelectedTrigger={setSelectedTrigger}
|
setSelectedTrigger={setSelectedTrigger}
|
||||||
index={index}
|
index={index}
|
||||||
@ -339,7 +339,7 @@ const PipelineTriggersTabs = ({ repoPath, pipeline }: PipelineTriggersTabsProps)
|
|||||||
<div className={css.separator} />
|
<div className={css.separator} />
|
||||||
<Layout.Vertical padding={'large'}>
|
<Layout.Vertical padding={'large'}>
|
||||||
<TriggerDetails
|
<TriggerDetails
|
||||||
name={data?.[selectedTrigger]?.uid as string}
|
name={data?.[selectedTrigger]?.identifier as string}
|
||||||
repoPath={repoPath}
|
repoPath={repoPath}
|
||||||
pipeline={pipeline}
|
pipeline={pipeline}
|
||||||
refetchTriggers={refetch}
|
refetchTriggers={refetch}
|
||||||
|
@ -107,7 +107,7 @@ const PluginSpecInputPath = `${PluginSpecPath}.${PluginsInputPath}`
|
|||||||
const LIST_FETCHING_LIMIT = 100
|
const LIST_FETCHING_LIMIT = 100
|
||||||
|
|
||||||
const RunStepSpec: TypesPlugin = {
|
const RunStepSpec: TypesPlugin = {
|
||||||
uid: 'run'
|
identifier: 'run'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
||||||
@ -180,7 +180,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
|||||||
if (panelView !== PluginPanelView.Listing) return
|
if (panelView !== PluginPanelView.Listing) return
|
||||||
|
|
||||||
if (query) {
|
if (query) {
|
||||||
setPlugins(existingPlugins => existingPlugins.filter((item: TypesPlugin) => item.uid?.includes(query)))
|
setPlugins(existingPlugins => existingPlugins.filter((item: TypesPlugin) => item.identifier?.includes(query)))
|
||||||
} else {
|
} else {
|
||||||
fetchAllPlugins().then(response => setPlugins(response))
|
fetchAllPlugins().then(response => setPlugins(response))
|
||||||
}
|
}
|
||||||
@ -215,7 +215,9 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
|||||||
} else {
|
} else {
|
||||||
setPluginCategory(PluginCategory.Drone)
|
setPluginCategory(PluginCategory.Drone)
|
||||||
fetchAllPlugins().then(response => {
|
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) {
|
if (matchingPlugin) {
|
||||||
setPlugin(matchingPlugin)
|
setPlugin(matchingPlugin)
|
||||||
setPanelView(PluginPanelView.Configuration)
|
setPanelView(PluginPanelView.Configuration)
|
||||||
@ -314,7 +316,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
|||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
<Container className={css.plugins}>
|
<Container className={css.plugins}>
|
||||||
{plugins?.map((pluginItem: TypesPlugin) => {
|
{plugins?.map((pluginItem: TypesPlugin) => {
|
||||||
const { uid, description } = pluginItem
|
const { identifier, description } = pluginItem
|
||||||
return (
|
return (
|
||||||
<Layout.Horizontal
|
<Layout.Horizontal
|
||||||
flex={{ justifyContent: 'flex-start' }}
|
flex={{ justifyContent: 'flex-start' }}
|
||||||
@ -326,7 +328,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
|||||||
setPanelView(PluginPanelView.Configuration)
|
setPanelView(PluginPanelView.Configuration)
|
||||||
setPlugin(pluginItem)
|
setPlugin(pluginItem)
|
||||||
}}
|
}}
|
||||||
key={uid}
|
key={identifier}
|
||||||
width="100%">
|
width="100%">
|
||||||
<Icon name={'plugin-ci-step'} size={25} />
|
<Icon name={'plugin-ci-step'} size={25} />
|
||||||
<Layout.Vertical padding={{ left: 'small' }} spacing="xsmall" className={css.pluginInfo}>
|
<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}
|
color={Color.GREY_900}
|
||||||
className={css.fontWeight600}
|
className={css.fontWeight600}
|
||||||
font={{ variation: FontVariation.BODY2_SEMI }}>
|
font={{ variation: FontVariation.BODY2_SEMI }}>
|
||||||
{uid}
|
{identifier}
|
||||||
</Text>
|
</Text>
|
||||||
<Text color={Color.GREY_500} font={{ variation: FontVariation.SMALL }} className={css.pluginDesc}>
|
<Text color={Color.GREY_500} font={{ variation: FontVariation.SMALL }} className={css.pluginDesc}>
|
||||||
{description}
|
{description}
|
||||||
@ -619,9 +621,9 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
|||||||
}}
|
}}
|
||||||
className={css.arrow}
|
className={css.arrow}
|
||||||
/>
|
/>
|
||||||
{plugin?.uid && (
|
{plugin?.identifier && (
|
||||||
<Text font={{ variation: FontVariation.H4 }}>
|
<Text font={{ variation: FontVariation.H4 }}>
|
||||||
{getString(isUpdate ? 'updateLabel' : 'addLabel')} {plugin.uid} {getString('plugins.stepLabel')}
|
{getString(isUpdate ? 'updateLabel' : 'addLabel')} {plugin.identifier} {getString('plugins.stepLabel')}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
@ -639,7 +641,7 @@ export const PluginsPanel = (props: PluginsPanelInterface): JSX.Element => {
|
|||||||
}
|
}
|
||||||
const updatedYAMLPayload = set({}, PluginSpecInputPath, payloadForYAMLUpdate)
|
const updatedYAMLPayload = set({}, PluginSpecInputPath, payloadForYAMLUpdate)
|
||||||
set(updatedYAMLPayload, 'type', pluginCategory)
|
set(updatedYAMLPayload, 'type', pluginCategory)
|
||||||
set(updatedYAMLPayload, `${PluginSpecPath}.name`, plugin?.uid)
|
set(updatedYAMLPayload, `${PluginSpecPath}.name`, plugin?.identifier)
|
||||||
onPluginAddUpdate({
|
onPluginAddUpdate({
|
||||||
pathToField,
|
pathToField,
|
||||||
isUpdate,
|
isUpdate,
|
||||||
|
@ -66,7 +66,7 @@ export function RepositoryPageHeader({
|
|||||||
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
||||||
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
||||||
<Link to={routes.toCODERepository({ repoPath: (repoMetadata?.path as string) || '', gitRef })}>
|
<Link to={routes.toCODERepository({ repoPath: (repoMetadata?.path as string) || '', gitRef })}>
|
||||||
{repoMetadata?.uid || ''}
|
{repoMetadata?.identifier || ''}
|
||||||
</Link>
|
</Link>
|
||||||
{extraBreadcrumbLinks.map(link => (
|
{extraBreadcrumbLinks.map(link => (
|
||||||
<Fragment key={link.url}>
|
<Fragment key={link.url}>
|
||||||
|
@ -33,7 +33,7 @@ import {
|
|||||||
} from '@harnessio/uicore'
|
} from '@harnessio/uicore'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { useModalHook } from 'hooks/useModalHook'
|
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 { getErrorMessage } from 'utils/Utils'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
|
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
|
||||||
@ -49,7 +49,7 @@ const useRunPipelineModal = () => {
|
|||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const { showSuccess, showError, clear: clearToaster } = useToaster()
|
const { showSuccess, showError, clear: clearToaster } = useToaster()
|
||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const [repo, setRepo] = useState<TypesRepository>()
|
const [repo, setRepo] = useState<RepoRepositoryOutput>()
|
||||||
const [pipeline, setPipeline] = useState<string>('')
|
const [pipeline, setPipeline] = useState<string>('')
|
||||||
const repoPath = useMemo(() => repo?.path || '', [repo])
|
const repoPath = useMemo(() => repo?.path || '', [repo])
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ const useRunPipelineModal = () => {
|
|||||||
}, [repo?.default_branch, pipeline])
|
}, [repo?.default_branch, pipeline])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
openModal: ({ repoMetadata, pipeline: pipelineUid }: { repoMetadata: TypesRepository; pipeline: string }) => {
|
openModal: ({ repoMetadata, pipeline: pipelineUid }: { repoMetadata: RepoRepositoryOutput; pipeline: string }) => {
|
||||||
setRepo(repoMetadata)
|
setRepo(repoMetadata)
|
||||||
setPipeline(pipelineUid)
|
setPipeline(pipelineUid)
|
||||||
openModal()
|
openModal()
|
||||||
|
@ -37,7 +37,7 @@ import { Classes, Popover, Position } from '@blueprintjs/core'
|
|||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { ButtonRoleProps, voidFn } from 'utils/Utils'
|
import { ButtonRoleProps, voidFn } from 'utils/Utils'
|
||||||
import { useShowRequestError } from 'hooks/useShowRequestError'
|
import { useShowRequestError } from 'hooks/useShowRequestError'
|
||||||
import { TypesSpace, useGetSpace } from 'services/code'
|
import { SpaceSpaceOutput, useGetSpace } from 'services/code'
|
||||||
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
|
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
|
||||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||||
import { NewSpaceModalButton } from 'components/NewSpaceModalButton/NewSpaceModalButton'
|
import { NewSpaceModalButton } from 'components/NewSpaceModalButton/NewSpaceModalButton'
|
||||||
@ -45,14 +45,14 @@ import { useAppContext } from 'AppContext'
|
|||||||
import css from './SpaceSelector.module.scss'
|
import css from './SpaceSelector.module.scss'
|
||||||
|
|
||||||
interface SpaceSelectorProps {
|
interface SpaceSelectorProps {
|
||||||
onSelect: (space: TypesSpace, isUserAction: boolean) => void
|
onSelect: (space: SpaceSpaceOutput, isUserAction: boolean) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
|
export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
|
||||||
const { routes } = useAppContext()
|
const { routes } = useAppContext()
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const [selectedSpace, setSelectedSpace] = useState<TypesSpace | undefined>()
|
const [selectedSpace, setSelectedSpace] = useState<SpaceSpaceOutput | undefined>()
|
||||||
const space = useGetSpaceParam()
|
const space = useGetSpaceParam()
|
||||||
const [opened, setOpened] = React.useState(false)
|
const [opened, setOpened] = React.useState(false)
|
||||||
const [searchTerm, setSearchTerm] = useState('')
|
const [searchTerm, setSearchTerm] = useState('')
|
||||||
@ -70,7 +70,7 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const selectSpace = useCallback(
|
const selectSpace = useCallback(
|
||||||
(_space: TypesSpace, isUserAction: boolean) => {
|
(_space: SpaceSpaceOutput, isUserAction: boolean) => {
|
||||||
setSelectedSpace(_space)
|
setSelectedSpace(_space)
|
||||||
onSelect(_space, isUserAction)
|
onSelect(_space, isUserAction)
|
||||||
},
|
},
|
||||||
@ -98,7 +98,7 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
|
|||||||
is_public: false,
|
is_public: false,
|
||||||
parent_id: 0,
|
parent_id: 0,
|
||||||
path: '',
|
path: '',
|
||||||
uid: getString('selectSpace'),
|
identifier: getString('selectSpace'),
|
||||||
updated: 0
|
updated: 0
|
||||||
},
|
},
|
||||||
false
|
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'),
|
Header: getString('spaces'),
|
||||||
width: 'calc(100% - 180px)',
|
width: 'calc(100% - 180px)',
|
||||||
Cell: ({ row }: CellProps<{ space: TypesSpace }>) => {
|
Cell: ({ row }: CellProps<{ space: SpaceSpaceOutput }>) => {
|
||||||
const record = row.original
|
const record = row.original
|
||||||
return (
|
return (
|
||||||
<Container className={css.nameContainer}>
|
<Container className={css.nameContainer}>
|
||||||
@ -193,7 +193,7 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
|
|||||||
</Container>
|
</Container>
|
||||||
</Layout.Vertical> */}
|
</Layout.Vertical> */}
|
||||||
<Text className={css.spaceName} lineClamp={1}>
|
<Text className={css.spaceName} lineClamp={1}>
|
||||||
{selectedSpace ? selectedSpace.uid : getString('selectSpace')}
|
{selectedSpace ? selectedSpace.identifier : getString('selectSpace')}
|
||||||
</Text>
|
</Text>
|
||||||
</Container>
|
</Container>
|
||||||
<Container className={css.icon}>
|
<Container className={css.icon}>
|
||||||
@ -224,14 +224,14 @@ export const SpaceSelector: React.FC<SpaceSelectorProps> = ({ onSelect }) => {
|
|||||||
<Container padding={{ left: 'small' }}>
|
<Container padding={{ left: 'small' }}>
|
||||||
<Layout.Vertical padding={{ top: 'xxlarge' }} spacing="small">
|
<Layout.Vertical padding={{ top: 'xxlarge' }} spacing="small">
|
||||||
{!!spaces?.length && (
|
{!!spaces?.length && (
|
||||||
<Table<{ space: TypesSpace }>
|
<Table<{ space: SpaceSpaceOutput }>
|
||||||
hideHeaders
|
hideHeaders
|
||||||
className={cx(css.table, css.tableContainer)}
|
className={cx(css.table, css.tableContainer)}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={spaces || []}
|
data={spaces || []}
|
||||||
onRowClick={spaceData => {
|
onRowClick={spaceData => {
|
||||||
setOpened(false)
|
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)}
|
getRowClassName={row => cx(css.row, !row.original.space.description && css.noDesc)}
|
||||||
/>
|
/>
|
||||||
|
@ -51,7 +51,7 @@ const useUpdateSecretModal = () => {
|
|||||||
|
|
||||||
const { mutate: updateSecret, loading } = useMutate<TypesSecret>({
|
const { mutate: updateSecret, loading } = useMutate<TypesSecret>({
|
||||||
verb: 'PATCH',
|
verb: 'PATCH',
|
||||||
path: `/api/v1/secrets/${space}/${secret?.uid}/+`
|
path: `/api/v1/secrets/${space}/${secret?.identifier}/+`
|
||||||
})
|
})
|
||||||
|
|
||||||
const handleSubmit = async (formData: SecretFormData) => {
|
const handleSubmit = async (formData: SecretFormData) => {
|
||||||
@ -59,7 +59,7 @@ const useUpdateSecretModal = () => {
|
|||||||
const payload: OpenapiUpdateSecretRequest = {
|
const payload: OpenapiUpdateSecretRequest = {
|
||||||
data: formData.value,
|
data: formData.value,
|
||||||
description: formData.description,
|
description: formData.description,
|
||||||
uid: formData.name
|
identifier: formData.name
|
||||||
}
|
}
|
||||||
await updateSecret(payload)
|
await updateSecret(payload)
|
||||||
hideModal()
|
hideModal()
|
||||||
@ -97,7 +97,7 @@ const useUpdateSecretModal = () => {
|
|||||||
<Container>
|
<Container>
|
||||||
<Formik
|
<Formik
|
||||||
initialValues={{
|
initialValues={{
|
||||||
name: secret?.uid || '',
|
name: secret?.identifier || '',
|
||||||
description: secret?.description || '',
|
description: secret?.description || '',
|
||||||
value: '',
|
value: '',
|
||||||
showValue: false
|
showValue: false
|
||||||
|
@ -18,7 +18,7 @@ import { useEffect, useMemo } from 'react'
|
|||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
import { useGet } from 'restful-react'
|
import { useGet } from 'restful-react'
|
||||||
import type { CODEProps } from 'RouteDefinitions'
|
import type { CODEProps } from 'RouteDefinitions'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
import { diffRefsToRefs, makeDiffRefs } from 'utils/GitUtils'
|
import { diffRefsToRefs, makeDiffRefs } from 'utils/GitUtils'
|
||||||
import { getErrorMessage } from 'utils/Utils'
|
import { getErrorMessage } from 'utils/Utils'
|
||||||
import { newCacheStrategy } from 'utils/CacheStrategy'
|
import { newCacheStrategy } from 'utils/CacheStrategy'
|
||||||
@ -41,7 +41,7 @@ export function useGetRepositoryMetadata() {
|
|||||||
...otherPathParams
|
...otherPathParams
|
||||||
} = useParams<CODEProps>()
|
} = useParams<CODEProps>()
|
||||||
const repoPath = useMemo(() => `${space}/${repoName}`, [space, repoName])
|
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}/+/`,
|
path: `/api/v1/repos/${repoPath}/+/`,
|
||||||
lazy: true
|
lazy: true
|
||||||
})
|
})
|
||||||
|
@ -21,7 +21,7 @@ import { useHistory, useRouteMatch } from 'react-router-dom'
|
|||||||
import { FingerprintLockCircle, BookmarkBook, UserSquare, Settings } from 'iconoir-react'
|
import { FingerprintLockCircle, BookmarkBook, UserSquare, Settings } from 'iconoir-react'
|
||||||
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import type { TypesSpace } from 'services/code'
|
import type { SpaceSpaceOutput } from 'services/code'
|
||||||
import { SpaceSelector } from 'components/SpaceSelector/SpaceSelector'
|
import { SpaceSelector } from 'components/SpaceSelector/SpaceSelector'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import { isGitRev } from 'utils/GitUtils'
|
import { isGitRev } from 'utils/GitUtils'
|
||||||
@ -31,7 +31,7 @@ import css from './DefaultMenu.module.scss'
|
|||||||
export const DefaultMenu: React.FC = () => {
|
export const DefaultMenu: React.FC = () => {
|
||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const { routes, standalone } = useAppContext()
|
const { routes, standalone } = useAppContext()
|
||||||
const [selectedSpace, setSelectedSpace] = useState<TypesSpace | undefined>()
|
const [selectedSpace, setSelectedSpace] = useState<SpaceSpaceOutput | undefined>()
|
||||||
const { repoMetadata, gitRef, commitRef } = useGetRepositoryMetadata()
|
const { repoMetadata, gitRef, commitRef } = useGetRepositoryMetadata()
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const repoPath = useMemo(() => repoMetadata?.path || '', [repoMetadata])
|
const repoPath = useMemo(() => repoMetadata?.path || '', [repoMetadata])
|
||||||
|
@ -50,7 +50,7 @@ import type {
|
|||||||
TypesCommit,
|
TypesCommit,
|
||||||
TypesDiffStats,
|
TypesDiffStats,
|
||||||
TypesPullReq,
|
TypesPullReq,
|
||||||
TypesRepository
|
RepoRepositoryOutput
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
||||||
import { TabTitleWithCount, tabContainerCSS } from 'components/TabTitleWithCount/TabTitleWithCount'
|
import { TabTitleWithCount, tabContainerCSS } from 'components/TabTitleWithCount/TabTitleWithCount'
|
||||||
@ -365,7 +365,7 @@ export default function Compare() {
|
|||||||
),
|
),
|
||||||
panel: (
|
panel: (
|
||||||
<CompareCommits
|
<CompareCommits
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
sourceSha={sourceGitRef}
|
sourceSha={sourceGitRef}
|
||||||
targetSha={targetGitRef}
|
targetSha={targetGitRef}
|
||||||
/>
|
/>
|
||||||
|
@ -59,7 +59,7 @@ export function CompareContentHeader({
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -92,7 +92,7 @@ const ExecutionList = () => {
|
|||||||
|
|
||||||
const onEvent = useCallback(
|
const onEvent = useCallback(
|
||||||
data => {
|
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) {
|
if (repoMetadata?.id === data?.repo_id && pipelineData?.id === data?.pipeline_id) {
|
||||||
//TODO - revisit full refresh - can I use the message to update the execution?
|
//TODO - revisit full refresh - can I use the message to update the execution?
|
||||||
executionsRefetch()
|
executionsRefetch()
|
||||||
|
@ -148,7 +148,7 @@ const PipelineList = () => {
|
|||||||
inExecution
|
inExecution
|
||||||
/>
|
/>
|
||||||
<Text className={css.repoName}>
|
<Text className={css.repoName}>
|
||||||
<Keywords value={searchTerm}>{record.uid}</Keywords>
|
<Keywords value={searchTerm}>{record.identifier}</Keywords>
|
||||||
</Text>
|
</Text>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
)
|
)
|
||||||
@ -243,14 +243,14 @@ const PipelineList = () => {
|
|||||||
Cell: ({ row }: CellProps<TypesPipeline>) => {
|
Cell: ({ row }: CellProps<TypesPipeline>) => {
|
||||||
const [menuOpen, setMenuOpen] = useState(false)
|
const [menuOpen, setMenuOpen] = useState(false)
|
||||||
const record = row.original
|
const record = row.original
|
||||||
const { uid } = record
|
const { identifier } = record
|
||||||
const repoPath = repoMetadata?.path || ''
|
const repoPath = repoMetadata?.path || ''
|
||||||
|
|
||||||
const confirmDeletePipeline = useConfirmAct()
|
const confirmDeletePipeline = useConfirmAct()
|
||||||
const { showSuccess, showError } = useToaster()
|
const { showSuccess, showError } = useToaster()
|
||||||
const { mutate: deletePipeline } = useMutate<TypesPipeline>({
|
const { mutate: deletePipeline } = useMutate<TypesPipeline>({
|
||||||
verb: 'DELETE',
|
verb: 'DELETE',
|
||||||
path: `/api/v1/repos/${repoPath}/+/pipelines/${uid}`
|
path: `/api/v1/repos/${repoPath}/+/pipelines/${identifier}`
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -264,7 +264,7 @@ const PipelineList = () => {
|
|||||||
<Button
|
<Button
|
||||||
variation={ButtonVariation.ICON}
|
variation={ButtonVariation.ICON}
|
||||||
icon="Options"
|
icon="Options"
|
||||||
data-testid={`menu-${record.uid}`}
|
data-testid={`menu-${record.identifier}`}
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
setMenuOpen(true)
|
setMenuOpen(true)
|
||||||
@ -276,7 +276,7 @@ const PipelineList = () => {
|
|||||||
text={getString('edit')}
|
text={getString('edit')}
|
||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
history.push(routes.toCODEPipelineEdit({ repoPath, pipeline: uid as string }))
|
history.push(routes.toCODEPipelineEdit({ repoPath, pipeline: identifier as string }))
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<MenuItem
|
<MenuItem
|
||||||
@ -292,7 +292,7 @@ const PipelineList = () => {
|
|||||||
<String
|
<String
|
||||||
useRichText
|
useRichText
|
||||||
stringID="pipelines.deletePipelineConfirm"
|
stringID="pipelines.deletePipelineConfirm"
|
||||||
vars={{ pipeline: row.original.uid }}
|
vars={{ pipeline: row.original.identifier }}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
action: async () => {
|
action: async () => {
|
||||||
@ -302,7 +302,7 @@ const PipelineList = () => {
|
|||||||
<StringSubstitute
|
<StringSubstitute
|
||||||
str={getString('pipelines.deletePipelineSuccess')}
|
str={getString('pipelines.deletePipelineSuccess')}
|
||||||
vars={{
|
vars={{
|
||||||
pipeline: row.original.uid
|
pipeline: row.original.identifier
|
||||||
}}
|
}}
|
||||||
/>,
|
/>,
|
||||||
5000
|
5000
|
||||||
@ -322,7 +322,10 @@ const PipelineList = () => {
|
|||||||
onClick={e => {
|
onClick={e => {
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
history.push(
|
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(
|
history.push(
|
||||||
routes.toCODEExecutions({
|
routes.toCODEExecutions({
|
||||||
repoPath: repoMetadata?.path as string,
|
repoPath: repoMetadata?.path as string,
|
||||||
pipeline: pipelineInfo.uid as string
|
pipeline: pipelineInfo.identifier as string
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ export const Checks: React.FC<ChecksProps> = ({ repoMetadata, pullReqMetadata, p
|
|||||||
if (selectedStage) {
|
if (selectedStage) {
|
||||||
return routes.toCODEExecution({
|
return routes.toCODEExecution({
|
||||||
repoPath: repoMetadata?.path as string,
|
repoPath: repoMetadata?.path as string,
|
||||||
pipeline: selectedItemData?.uid as string,
|
pipeline: selectedItemData?.identifier as string,
|
||||||
execution: get(selectedItemData, 'payload.data.execution_number', '')
|
execution: get(selectedItemData, 'payload.data.execution_number', '')
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@ -211,7 +211,7 @@ export const Checks: React.FC<ChecksProps> = ({ repoMetadata, pullReqMetadata, p
|
|||||||
color={Color.WHITE}
|
color={Color.WHITE}
|
||||||
lineClamp={1}
|
lineClamp={1}
|
||||||
tooltipProps={{ portalClassName: css.popover }}>
|
tooltipProps={{ portalClassName: css.popover }}>
|
||||||
{selectedItemData?.uid}
|
{selectedItemData?.identifier}
|
||||||
{selectedStage ? ` / ${selectedStage.name}` : ''}
|
{selectedStage ? ` / ${selectedStage.name}` : ''}
|
||||||
</Text>
|
</Text>
|
||||||
<FlexExpander />
|
<FlexExpander />
|
||||||
@ -246,7 +246,7 @@ export const Checks: React.FC<ChecksProps> = ({ repoMetadata, pullReqMetadata, p
|
|||||||
<CheckPipelineSteps
|
<CheckPipelineSteps
|
||||||
repoMetadata={repoMetadata}
|
repoMetadata={repoMetadata}
|
||||||
pullReqMetadata={pullReqMetadata}
|
pullReqMetadata={pullReqMetadata}
|
||||||
pipelineName={selectedItemData?.uid as string}
|
pipelineName={selectedItemData?.identifier as string}
|
||||||
stage={selectedStage as TypesStage}
|
stage={selectedStage as TypesStage}
|
||||||
executionNumber={get(selectedItemData, 'payload.data.execution_number', '')}
|
executionNumber={get(selectedItemData, 'payload.data.execution_number', '')}
|
||||||
/>
|
/>
|
||||||
|
@ -67,7 +67,7 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
|
|||||||
const checksData = useMemo(() => sortBy(prChecksDecisionResult?.data || [], ['uid']), [prChecksDecisionResult?.data])
|
const checksData = useMemo(() => sortBy(prChecksDecisionResult?.data || [], ['uid']), [prChecksDecisionResult?.data])
|
||||||
useMemo(() => {
|
useMemo(() => {
|
||||||
if (selectedUID) {
|
if (selectedUID) {
|
||||||
const selectedDataItem = checksData.find(item => item.uid === selectedUID)
|
const selectedDataItem = checksData.find(item => item.identifier === selectedUID)
|
||||||
if (selectedDataItem) {
|
if (selectedDataItem) {
|
||||||
onDataItemChanged(selectedDataItem)
|
onDataItemChanged(selectedDataItem)
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (uid) {
|
if (uid) {
|
||||||
if (uid !== selectedUID && checksData.find(item => item.uid === uid)) {
|
if (uid !== selectedUID && checksData.find(item => item.identifier === uid)) {
|
||||||
setSelectedUID(uid)
|
setSelectedUID(uid)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -84,13 +84,13 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
|
|||||||
|
|
||||||
if (defaultSelectedItem) {
|
if (defaultSelectedItem) {
|
||||||
onDataItemChanged(defaultSelectedItem)
|
onDataItemChanged(defaultSelectedItem)
|
||||||
setSelectedUID(defaultSelectedItem.uid)
|
setSelectedUID(defaultSelectedItem.identifier)
|
||||||
history.replace(
|
history.replace(
|
||||||
routes.toCODEPullRequest({
|
routes.toCODEPullRequest({
|
||||||
repoPath: repoMetadata.path as string,
|
repoPath: repoMetadata.path as string,
|
||||||
pullRequestId: String(pullReqMetadata.number),
|
pullRequestId: String(pullReqMetadata.number),
|
||||||
pullRequestSection: PullRequestSection.CHECKS
|
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>
|
</Layout.Horizontal>
|
||||||
)}
|
)}
|
||||||
{(checks as TypesCheck[]).map((itemData: TypesCheck) => (
|
{(checks as TypesCheck[]).map((itemData: TypesCheck) => (
|
||||||
<Container key={`container_${itemData.uid}`} className={css.checkMenuItemContainer}>
|
<Container key={`container_${itemData.identifier}`} className={css.checkMenuItemContainer}>
|
||||||
<CheckMenuItem
|
<CheckMenuItem
|
||||||
repoMetadata={repoMetadata}
|
repoMetadata={repoMetadata}
|
||||||
pullReqMetadata={pullReqMetadata}
|
pullReqMetadata={pullReqMetadata}
|
||||||
prChecksDecisionResult={prChecksDecisionResult}
|
prChecksDecisionResult={prChecksDecisionResult}
|
||||||
key={itemData.uid}
|
key={itemData.identifier}
|
||||||
itemData={itemData}
|
itemData={itemData}
|
||||||
customFormatter={customFormatter}
|
customFormatter={customFormatter}
|
||||||
isPipeline={itemData.payload?.kind === PullRequestCheckType.PIPELINE}
|
isPipeline={itemData.payload?.kind === PullRequestCheckType.PIPELINE}
|
||||||
isSelected={itemData.uid === selectedUID}
|
isSelected={itemData.identifier === selectedUID}
|
||||||
onClick={stage => {
|
onClick={stage => {
|
||||||
setSelectedUID(itemData.uid)
|
setSelectedUID(itemData.identifier)
|
||||||
setSelectedStage(stage || null)
|
setSelectedStage(stage || null)
|
||||||
setSelectedStageFromProps(stage || null)
|
setSelectedStageFromProps(stage || null)
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ export const ChecksMenu: React.FC<ChecksMenuProps> = ({
|
|||||||
repoPath: repoMetadata.path as string,
|
repoPath: repoMetadata.path as string,
|
||||||
pullRequestId: String(pullReqMetadata.number),
|
pullRequestId: String(pullReqMetadata.number),
|
||||||
pullRequestSection: PullRequestSection.CHECKS
|
pullRequestSection: PullRequestSection.CHECKS
|
||||||
}) + `?uid=${itemData.uid}${stage ? `&stageId=${stage.name}` : ''}`
|
}) + `?uid=${itemData.identifier}${stage ? `&stageId=${stage.name}` : ''}`
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
setSelectedStage={stage => {
|
setSelectedStage={stage => {
|
||||||
@ -301,11 +301,11 @@ const CheckMenuItem: React.FC<CheckMenuItemProps> = ({
|
|||||||
}
|
}
|
||||||
}, [isSelected])
|
}, [isSelected])
|
||||||
const name =
|
const name =
|
||||||
itemData?.uid &&
|
itemData?.identifier &&
|
||||||
itemData?.uid.includes('-') &&
|
itemData?.identifier.includes('-') &&
|
||||||
(itemData.payload?.kind as TypesCheckPayloadExtended) === CheckKindPayload.HARNESS_STAGE
|
(itemData.payload?.kind as TypesCheckPayloadExtended) === CheckKindPayload.HARNESS_STAGE
|
||||||
? itemData.uid.split('-')[1]
|
? itemData.identifier.split('-')[1]
|
||||||
: itemData.uid
|
: itemData.identifier
|
||||||
return (
|
return (
|
||||||
<Container className={css.menuItem}>
|
<Container className={css.menuItem}>
|
||||||
<Layout.Horizontal
|
<Layout.Horizontal
|
||||||
@ -356,7 +356,7 @@ const CheckMenuItem: React.FC<CheckMenuItemProps> = ({
|
|||||||
|
|
||||||
<Render when={isPipeline}>
|
<Render when={isPipeline}>
|
||||||
<CheckPipelineStages
|
<CheckPipelineStages
|
||||||
pipelineName={itemData.uid as string}
|
pipelineName={itemData.identifier as string}
|
||||||
executionNumber={get(itemData, 'payload.data.execution_number', '')}
|
executionNumber={get(itemData, 'payload.data.execution_number', '')}
|
||||||
expanded={expanded}
|
expanded={expanded}
|
||||||
repoMetadata={repoMetadata}
|
repoMetadata={repoMetadata}
|
||||||
|
@ -146,8 +146,8 @@ const CheckSection: React.FC<CheckSectionsProps & { isPipeline?: boolean }> = ({
|
|||||||
{getString(isPipeline ? 'pageTitle.pipelines' : 'checks')}
|
{getString(isPipeline ? 'pageTitle.pipelines' : 'checks')}
|
||||||
</Text>
|
</Text>
|
||||||
<Container className={css.table}>
|
<Container className={css.table}>
|
||||||
{data.map(({ uid, status, summary, created, ended, started }) => (
|
{data.map(({ identifier, status, summary, created, ended, started }) => (
|
||||||
<Container className={css.row} key={uid}>
|
<Container className={css.row} key={identifier}>
|
||||||
<Layout.Horizontal className={css.rowLayout}>
|
<Layout.Horizontal className={css.rowLayout}>
|
||||||
<Container className={css.status}>
|
<Container className={css.status}>
|
||||||
<ExecutionStatus status={status as ExecutionState} />
|
<ExecutionStatus status={status as ExecutionState} />
|
||||||
@ -159,10 +159,10 @@ const CheckSection: React.FC<CheckSectionsProps & { isPipeline?: boolean }> = ({
|
|||||||
repoPath: repoMetadata.path as string,
|
repoPath: repoMetadata.path as string,
|
||||||
pullRequestId: String(pullReqMetadata.number),
|
pullRequestId: String(pullReqMetadata.number),
|
||||||
pullRequestSection: PullRequestSection.CHECKS
|
pullRequestSection: PullRequestSection.CHECKS
|
||||||
}) + `?uid=${uid}`
|
}) + `?uid=${identifier}`
|
||||||
}>
|
}>
|
||||||
<Text font={{ variation: FontVariation.SMALL_BOLD }} className={css.name} lineClamp={1}>
|
<Text font={{ variation: FontVariation.SMALL_BOLD }} className={css.name} lineClamp={1}>
|
||||||
{uid}
|
{identifier}
|
||||||
</Text>
|
</Text>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ import type {
|
|||||||
TypesPullReq,
|
TypesPullReq,
|
||||||
TypesPullReqActivity,
|
TypesPullReqActivity,
|
||||||
TypesPullReqReviewer,
|
TypesPullReqReviewer,
|
||||||
TypesRepository,
|
RepoRepositoryOutput,
|
||||||
TypesRuleViolations
|
TypesRuleViolations
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { PanelSectionOutletPosition } from 'pages/PullRequest/PullRequestUtils'
|
import { PanelSectionOutletPosition } from 'pages/PullRequest/PullRequestUtils'
|
||||||
@ -41,7 +41,7 @@ import CommentsSection from './sections/CommentsSection'
|
|||||||
import ChangesSection from './sections/ChangesSection'
|
import ChangesSection from './sections/ChangesSection'
|
||||||
import css from './PullRequestOverviewPanel.module.scss'
|
import css from './PullRequestOverviewPanel.module.scss'
|
||||||
interface PullRequestOverviewPanelProps {
|
interface PullRequestOverviewPanelProps {
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
pullReqMetadata: TypesPullReq
|
pullReqMetadata: TypesPullReq
|
||||||
onPRStateChanged: () => void
|
onPRStateChanged: () => void
|
||||||
refetchReviewers: () => void
|
refetchReviewers: () => void
|
||||||
|
@ -38,7 +38,7 @@ import type {
|
|||||||
TypesCodeOwnerEvaluationEntry,
|
TypesCodeOwnerEvaluationEntry,
|
||||||
TypesPullReq,
|
TypesPullReq,
|
||||||
TypesPullReqReviewer,
|
TypesPullReqReviewer,
|
||||||
TypesRepository
|
RepoRepositoryOutput
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { capitalizeFirstLetter } from 'pages/PullRequest/Checks/ChecksUtils'
|
import { capitalizeFirstLetter } from 'pages/PullRequest/Checks/ChecksUtils'
|
||||||
import greyCircle from '../../../../../icons/greyCircle.svg?url'
|
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'
|
import css from '../PullRequestOverviewPanel.module.scss'
|
||||||
|
|
||||||
interface ChangesSectionProps {
|
interface ChangesSectionProps {
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
pullReqMetadata: TypesPullReq
|
pullReqMetadata: TypesPullReq
|
||||||
codeOwners: TypesCodeOwnerEvaluation | null
|
codeOwners: TypesCodeOwnerEvaluation | null
|
||||||
atLeastOneReviewerRule: boolean
|
atLeastOneReviewerRule: boolean
|
||||||
|
@ -32,7 +32,7 @@ import { isEmpty } from 'lodash-es'
|
|||||||
import { useShowRequestError } from 'hooks/useShowRequestError'
|
import { useShowRequestError } from 'hooks/useShowRequestError'
|
||||||
import { ExecutionState, ExecutionStatus } from 'components/ExecutionStatus/ExecutionStatus'
|
import { ExecutionState, ExecutionStatus } from 'components/ExecutionStatus/ExecutionStatus'
|
||||||
import { useAppContext } from 'AppContext'
|
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 { useStrings } from 'framework/strings'
|
||||||
import { CheckStatus, PullRequestSection, timeDistance } from 'utils/Utils'
|
import { CheckStatus, PullRequestSection, timeDistance } from 'utils/Utils'
|
||||||
import { usePRChecksDecision } from 'hooks/usePRChecksDecision3'
|
import { usePRChecksDecision } from 'hooks/usePRChecksDecision3'
|
||||||
@ -41,7 +41,7 @@ import Timeout from '../../../../../icons/code-timeout.svg?url'
|
|||||||
import css from '../PullRequestOverviewPanel.module.scss'
|
import css from '../PullRequestOverviewPanel.module.scss'
|
||||||
|
|
||||||
interface ChecksSectionProps {
|
interface ChecksSectionProps {
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
pullReqMetadata: TypesPullReq
|
pullReqMetadata: TypesPullReq
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ const ChecksSection = (props: ChecksSectionProps) => {
|
|||||||
color={Color.GREY_700}
|
color={Color.GREY_700}
|
||||||
className={cx(css.checkName, css.textSize)}
|
className={cx(css.checkName, css.textSize)}
|
||||||
font={{ variation: FontVariation.BODY }}>
|
font={{ variation: FontVariation.BODY }}>
|
||||||
{check.check.uid}
|
{check.check.identifier}
|
||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
padding={{ left: 'small' }}
|
padding={{ left: 'small' }}
|
||||||
@ -324,7 +324,7 @@ const ChecksSection = (props: ChecksSectionProps) => {
|
|||||||
repoPath: repoMetadata.path as string,
|
repoPath: repoMetadata.path as string,
|
||||||
pullRequestId: String(pullReqMetadata.number),
|
pullRequestId: String(pullReqMetadata.number),
|
||||||
pullRequestSection: PullRequestSection.CHECKS
|
pullRequestSection: PullRequestSection.CHECKS
|
||||||
}) + `?uid=${check.check.uid}`
|
}) + `?uid=${check.check.identifier}`
|
||||||
}>
|
}>
|
||||||
<Text padding={{ left: 'medium' }} color={Color.PRIMARY_7} className={css.blueText}>
|
<Text padding={{ left: 'medium' }} color={Color.PRIMARY_7} className={css.blueText}>
|
||||||
{getString('details')}
|
{getString('details')}
|
||||||
|
@ -18,13 +18,13 @@ import cx from 'classnames'
|
|||||||
import { Color } from '@harnessio/design-system'
|
import { Color } from '@harnessio/design-system'
|
||||||
import { Button, ButtonSize, ButtonVariation, Container, Layout, SelectOption, Text } from '@harnessio/uicore'
|
import { Button, ButtonSize, ButtonVariation, Container, Layout, SelectOption, Text } from '@harnessio/uicore'
|
||||||
import { useStrings } from 'framework/strings'
|
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 { PRCommentFilterType } from 'utils/Utils'
|
||||||
import Success from '../../../../../icons/code-success.svg?url'
|
import Success from '../../../../../icons/code-success.svg?url'
|
||||||
import Fail from '../../../../../icons/code-fail.svg?url'
|
import Fail from '../../../../../icons/code-fail.svg?url'
|
||||||
import css from '../PullRequestOverviewPanel.module.scss'
|
import css from '../PullRequestOverviewPanel.module.scss'
|
||||||
interface MergeSectionProps {
|
interface MergeSectionProps {
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
pullReqMetadata: TypesPullReq
|
pullReqMetadata: TypesPullReq
|
||||||
resolvedCommentArr?: TypesViolation
|
resolvedCommentArr?: TypesViolation
|
||||||
requiresCommentApproval: boolean
|
requiresCommentApproval: boolean
|
||||||
|
@ -24,7 +24,7 @@ import { Icon, IconName } from '@harnessio/icons'
|
|||||||
import { Color, FontVariation } from '@harnessio/design-system'
|
import { Color, FontVariation } from '@harnessio/design-system'
|
||||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||||
import { useStrings } from 'framework/strings'
|
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 { getErrorMessage } from 'utils/Utils'
|
||||||
import { ReviewerSelect } from 'components/ReviewerSelect/ReviewerSelect'
|
import { ReviewerSelect } from 'components/ReviewerSelect/ReviewerSelect'
|
||||||
import { PullReqReviewDecision, processReviewDecision } from 'pages/PullRequest/PullRequestUtils'
|
import { PullReqReviewDecision, processReviewDecision } from 'pages/PullRequest/PullRequestUtils'
|
||||||
@ -33,7 +33,7 @@ import css from './PullRequestSideBar.module.scss'
|
|||||||
|
|
||||||
interface PullRequestSideBarProps {
|
interface PullRequestSideBarProps {
|
||||||
reviewers?: Unknown
|
reviewers?: Unknown
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
pullRequestMetadata: TypesPullReq
|
pullRequestMetadata: TypesPullReq
|
||||||
refetchReviewers: () => void
|
refetchReviewers: () => void
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ import { useStrings } from 'framework/strings'
|
|||||||
import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader'
|
import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader'
|
||||||
import { getErrorMessage, PullRequestSection } from 'utils/Utils'
|
import { getErrorMessage, PullRequestSection } from 'utils/Utils'
|
||||||
import { CodeIcon } from 'utils/GitUtils'
|
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 { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
||||||
import { TabTitleWithCount, tabContainerCSS } from 'components/TabTitleWithCount/TabTitleWithCount'
|
import { TabTitleWithCount, tabContainerCSS } from 'components/TabTitleWithCount/TabTitleWithCount'
|
||||||
import { ExecutionStatus } from 'components/ExecutionStatus/ExecutionStatus'
|
import { ExecutionStatus } from 'components/ExecutionStatus/ExecutionStatus'
|
||||||
@ -117,7 +117,7 @@ export default function PullRequest() {
|
|||||||
|
|
||||||
<Render when={repoMetadata && pullReqMetadata}>
|
<Render when={repoMetadata && pullReqMetadata}>
|
||||||
<>
|
<>
|
||||||
<PullRequestMetaLine repoMetadata={repoMetadata as TypesRepository} {...pullReqMetadata} />
|
<PullRequestMetaLine repoMetadata={repoMetadata as RepoRepositoryOutput} {...pullReqMetadata} />
|
||||||
|
|
||||||
<Container className={tabContainerCSS.tabsContainer}>
|
<Container className={tabContainerCSS.tabsContainer}>
|
||||||
<Tabs
|
<Tabs
|
||||||
@ -148,7 +148,7 @@ export default function PullRequest() {
|
|||||||
<Conversation
|
<Conversation
|
||||||
routingId={routingId}
|
routingId={routingId}
|
||||||
standalone={standalone}
|
standalone={standalone}
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
pullReqMetadata={pullReqMetadata as TypesPullReq}
|
pullReqMetadata={pullReqMetadata as TypesPullReq}
|
||||||
prChecksDecisionResult={pullReqChecksDecision}
|
prChecksDecisionResult={pullReqChecksDecision}
|
||||||
onDescriptionSaved={() => {
|
onDescriptionSaved={() => {
|
||||||
@ -173,7 +173,7 @@ export default function PullRequest() {
|
|||||||
),
|
),
|
||||||
panel: (
|
panel: (
|
||||||
<PullRequestCommits
|
<PullRequestCommits
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
pullReqMetadata={pullReqMetadata as TypesPullReq}
|
pullReqMetadata={pullReqMetadata as TypesPullReq}
|
||||||
pullReqCommits={pullReqCommits}
|
pullReqCommits={pullReqCommits}
|
||||||
/>
|
/>
|
||||||
@ -250,7 +250,7 @@ export default function PullRequest() {
|
|||||||
),
|
),
|
||||||
panel: (
|
panel: (
|
||||||
<Checks
|
<Checks
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
pullReqMetadata={pullReqMetadata as TypesPullReq}
|
pullReqMetadata={pullReqMetadata as TypesPullReq}
|
||||||
prChecksDecisionResult={pullReqChecksDecision}
|
prChecksDecisionResult={pullReqChecksDecision}
|
||||||
/>
|
/>
|
||||||
|
@ -33,7 +33,7 @@ import { usePageIndex } from 'hooks/usePageIndex'
|
|||||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||||
import { useUpdateQueryParams } from 'hooks/useUpdateQueryParams'
|
import { useUpdateQueryParams } from 'hooks/useUpdateQueryParams'
|
||||||
import { useQueryParams } from 'hooks/useQueryParams'
|
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 { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
|
||||||
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
|
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
|
||||||
import { PipeSeparator } from 'components/PipeSeparator/PipeSeparator'
|
import { PipeSeparator } from 'components/PipeSeparator/PipeSeparator'
|
||||||
@ -118,7 +118,7 @@ export default function PullRequests() {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
@ -245,7 +245,7 @@ export default function PullRequests() {
|
|||||||
<Layout.Vertical>
|
<Layout.Vertical>
|
||||||
<PullRequestsContentHeader
|
<PullRequestsContentHeader
|
||||||
loading={prLoading && searchTerm !== undefined}
|
loading={prLoading && searchTerm !== undefined}
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
activePullRequestFilterOption={filter}
|
activePullRequestFilterOption={filter}
|
||||||
onPullRequestFilterChanged={_filter => {
|
onPullRequestFilterChanged={_filter => {
|
||||||
setFilter(_filter)
|
setFilter(_filter)
|
||||||
|
@ -71,7 +71,7 @@ export function PullRequestsContentHeader({
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -37,7 +37,7 @@ import { useHistory } from 'react-router-dom'
|
|||||||
import { useStrings, String } from 'framework/strings'
|
import { useStrings, String } from 'framework/strings'
|
||||||
import { voidFn, formatDate, getErrorMessage, LIST_FETCHING_LIMIT, PageBrowserProps } from 'utils/Utils'
|
import { voidFn, formatDate, getErrorMessage, LIST_FETCHING_LIMIT, PageBrowserProps } from 'utils/Utils'
|
||||||
import { NewRepoModalButton } from 'components/NewRepoModalButton/NewRepoModalButton'
|
import { NewRepoModalButton } from 'components/NewRepoModalButton/NewRepoModalButton'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
import { useDeleteRepository } from 'services/code'
|
import { useDeleteRepository } from 'services/code'
|
||||||
import { usePageIndex } from 'hooks/usePageIndex'
|
import { usePageIndex } from 'hooks/usePageIndex'
|
||||||
import { useQueryParams } from 'hooks/useQueryParams'
|
import { useQueryParams } from 'hooks/useQueryParams'
|
||||||
@ -57,7 +57,7 @@ import { getUsingFetch, getConfig } from 'services/config'
|
|||||||
import noRepoImage from './no-repo.svg?url'
|
import noRepoImage from './no-repo.svg?url'
|
||||||
import css from './RepositoriesListing.module.scss'
|
import css from './RepositoriesListing.module.scss'
|
||||||
|
|
||||||
interface TypesRepoExtended extends TypesRepository {
|
interface TypesRepoExtended extends RepoRepositoryOutput {
|
||||||
importing?: boolean
|
importing?: boolean
|
||||||
importProgress?: string
|
importProgress?: string
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ export default function RepositoriesListing() {
|
|||||||
const pageBrowser = useQueryParams<PageBrowserProps>()
|
const pageBrowser = useQueryParams<PageBrowserProps>()
|
||||||
const pageInit = pageBrowser.page ? parseInt(pageBrowser.page) : 1
|
const pageInit = pageBrowser.page ? parseInt(pageBrowser.page) : 1
|
||||||
const [page, setPage] = usePageIndex(pageInit)
|
const [page, setPage] = usePageIndex(pageInit)
|
||||||
const [updatedRepositories, setUpdatedRepositories] = useState<TypesRepository[]>()
|
const [updatedRepositories, setUpdatedRepositories] = useState<RepoRepositoryOutput[]>()
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: repositories,
|
data: repositories,
|
||||||
@ -90,7 +90,7 @@ export default function RepositoriesListing() {
|
|||||||
loading,
|
loading,
|
||||||
refetch,
|
refetch,
|
||||||
response
|
response
|
||||||
} = useGet<TypesRepository[]>({
|
} = useGet<RepoRepositoryOutput[]>({
|
||||||
path: `/api/v1/spaces/${space}/+/repos`,
|
path: `/api/v1/spaces/${space}/+/repos`,
|
||||||
queryParams: { page, limit: LIST_FETCHING_LIMIT, query: searchTerm },
|
queryParams: { page, limit: LIST_FETCHING_LIMIT, query: searchTerm },
|
||||||
debounce: 500
|
debounce: 500
|
||||||
@ -125,7 +125,7 @@ export default function RepositoriesListing() {
|
|||||||
|
|
||||||
const bearerToken = hooks?.useGetToken?.() || ''
|
const bearerToken = hooks?.useGetToken?.() || ''
|
||||||
|
|
||||||
const addImportProgressToData = async (repos: TypesRepository[]) => {
|
const addImportProgressToData = async (repos: RepoRepositoryOutput[]) => {
|
||||||
const updatedData = await Promise.all(
|
const updatedData = await Promise.all(
|
||||||
repos.map(async repo => {
|
repos.map(async repo => {
|
||||||
if (repo.importing) {
|
if (repo.importing) {
|
||||||
@ -172,7 +172,7 @@ export default function RepositoriesListing() {
|
|||||||
<Layout.Horizontal spacing="small" style={{ flexGrow: 1 }}>
|
<Layout.Horizontal spacing="small" style={{ flexGrow: 1 }}>
|
||||||
<Layout.Vertical flex className={css.name} ref={rowContainerRef}>
|
<Layout.Vertical flex className={css.name} ref={rowContainerRef}>
|
||||||
<Text className={css.repoName} width={nameTextWidth} lineClamp={2}>
|
<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' }} />
|
<RepoPublicLabel isPublic={row.original.is_public} margin={{ left: 'small' }} />
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
@ -243,7 +243,7 @@ export default function RepositoriesListing() {
|
|||||||
<String
|
<String
|
||||||
useRichText
|
useRichText
|
||||||
stringID="deleteFailedImport"
|
stringID="deleteFailedImport"
|
||||||
vars={{ name: row.original?.uid }}
|
vars={{ name: row.original?.identifier }}
|
||||||
tagName="div"
|
tagName="div"
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
@ -282,7 +282,7 @@ export default function RepositoriesListing() {
|
|||||||
<String
|
<String
|
||||||
useRichText
|
useRichText
|
||||||
stringID="cancelImportConfirm"
|
stringID="cancelImportConfirm"
|
||||||
vars={{ name: row.original?.uid }}
|
vars={{ name: row.original?.identifier }}
|
||||||
tagName="div"
|
tagName="div"
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
@ -329,7 +329,7 @@ export default function RepositoriesListing() {
|
|||||||
history.push(routes.toCODERepositories({ space: space as string }))
|
history.push(routes.toCODERepositories({ space: space as string }))
|
||||||
refetch()
|
refetch()
|
||||||
} else {
|
} else {
|
||||||
history.push(routes.toCODERepository({ repoPath: (repoInfo as TypesRepository).path as string }))
|
history.push(routes.toCODERepository({ repoPath: (repoInfo as RepoRepositoryOutput).path as string }))
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
@ -48,7 +48,7 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
@ -159,7 +159,7 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
|
|||||||
className={css.divContainer}>
|
className={css.divContainer}>
|
||||||
<MarkdownViewer
|
<MarkdownViewer
|
||||||
source={getString('repoEmptyMarkdownClonePush')
|
source={getString('repoEmptyMarkdownClonePush')
|
||||||
.replace(/REPO_NAME/g, repoMetadata.uid || '')
|
.replace(/REPO_NAME/g, repoMetadata.identifier || '')
|
||||||
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
|
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
|
||||||
/>
|
/>
|
||||||
</Container>
|
</Container>
|
||||||
@ -170,7 +170,7 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
|
|||||||
<MarkdownViewer
|
<MarkdownViewer
|
||||||
source={getString('repoEmptyMarkdownExisting')
|
source={getString('repoEmptyMarkdownExisting')
|
||||||
.replace(/REPO_URL/g, repoMetadata.git_url || '')
|
.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(/CREATE_API_TOKEN_URL/g, standalone ? routes.toCODEUserProfile() : currentUserProfileURL || '')
|
||||||
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
|
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
|
||||||
/>
|
/>
|
||||||
|
@ -23,7 +23,7 @@ import { getErrorMessage } from 'utils/Utils'
|
|||||||
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
||||||
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import type { OpenapiGetContentOutput, TypesRepository } from 'services/code'
|
import type { OpenapiGetContentOutput, RepoRepositoryOutput } from 'services/code'
|
||||||
import { Images } from 'images'
|
import { Images } from 'images'
|
||||||
import { useSetPageContainerWidthVar } from 'hooks/useSetPageContainerWidthVar'
|
import { useSetPageContainerWidthVar } from 'hooks/useSetPageContainerWidthVar'
|
||||||
import { normalizeGitRef, isDir } from 'utils/GitUtils'
|
import { normalizeGitRef, isDir } from 'utils/GitUtils'
|
||||||
@ -58,14 +58,14 @@ export default function Repository() {
|
|||||||
<Container className={cx(css.main, !!resourceContent && css.withFileViewer)} ref={domRef}>
|
<Container className={cx(css.main, !!resourceContent && css.withFileViewer)} ref={domRef}>
|
||||||
<Match expr={fileNotExist}>
|
<Match expr={fileNotExist}>
|
||||||
<Truthy>
|
<Truthy>
|
||||||
<RepositoryHeader isFile={false} repoMetadata={repoMetadata as TypesRepository} />
|
<RepositoryHeader isFile={false} repoMetadata={repoMetadata as RepoRepositoryOutput} />
|
||||||
<Layout.Vertical>
|
<Layout.Vertical>
|
||||||
<Container className={css.bannerContainer} padding={{ left: 'xlarge' }}>
|
<Container className={css.bannerContainer} padding={{ left: 'xlarge' }}>
|
||||||
<Text font={'small'} padding={{ left: 'large' }}>
|
<Text font={'small'} padding={{ left: 'large' }}>
|
||||||
<StringSubstitute
|
<StringSubstitute
|
||||||
str={getString('branchDoesNotHaveFile')}
|
str={getString('branchDoesNotHaveFile')}
|
||||||
vars={{
|
vars={{
|
||||||
repoName: repoMetadata?.uid,
|
repoName: repoMetadata?.identifier,
|
||||||
fileName: resourcePath,
|
fileName: resourcePath,
|
||||||
branchName: gitRef
|
branchName: gitRef
|
||||||
}}
|
}}
|
||||||
@ -74,7 +74,7 @@ export default function Repository() {
|
|||||||
</Container>
|
</Container>
|
||||||
<Container padding={{ left: 'xlarge' }}>
|
<Container padding={{ left: 'xlarge' }}>
|
||||||
<ContentHeader
|
<ContentHeader
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
gitRef={gitRef}
|
gitRef={gitRef}
|
||||||
resourcePath={resourcePath}
|
resourcePath={resourcePath}
|
||||||
resourceContent={resourceContent as OpenapiGetContentOutput}
|
resourceContent={resourceContent as OpenapiGetContentOutput}
|
||||||
|
@ -47,14 +47,14 @@ export function ContentHeader({
|
|||||||
const history = useHistory()
|
const history = useHistory()
|
||||||
const _isDir = isDir(resourceContent)
|
const _isDir = isDir(resourceContent)
|
||||||
const space = useGetSpaceParam()
|
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('/'))
|
useDocumentTitle(isEmpty(resourceContent?.path) ? getString('pageTitle.repository') : repoPath.join('/'))
|
||||||
|
|
||||||
const permPushResult = hooks?.usePermissionTranslate?.(
|
const permPushResult = hooks?.usePermissionTranslate?.(
|
||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -123,7 +123,7 @@ export function FileContent({
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -24,7 +24,7 @@ import ReactTimeago from 'react-timeago'
|
|||||||
import { useGet } from 'restful-react'
|
import { useGet } from 'restful-react'
|
||||||
import { Render } from 'react-jsx-match'
|
import { Render } from 'react-jsx-match'
|
||||||
import { noop } from 'lodash-es'
|
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 { normalizeGitRef, type GitInfoProps } from 'utils/GitUtils'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { getErrorMessage } from 'utils/Utils'
|
import { getErrorMessage } from 'utils/Utils'
|
||||||
@ -45,7 +45,7 @@ interface BlameBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface BlameBlockExtended extends BlameBlock {
|
interface BlameBlockExtended extends BlameBlock {
|
||||||
repoMetaData?: TypesRepository
|
repoMetaData?: RepoRepositoryOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
type BlameBlockRecord = Record<number, BlameBlock>
|
type BlameBlockRecord = Record<number, BlameBlock>
|
||||||
@ -223,7 +223,7 @@ interface GitBlameRendererProps {
|
|||||||
source: string
|
source: string
|
||||||
onViewUpdate?: (update: ViewUpdate) => void
|
onViewUpdate?: (update: ViewUpdate) => void
|
||||||
blameBlocks: BlameBlockRecord
|
blameBlocks: BlameBlockRecord
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
standalone: boolean
|
standalone: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ import cx from 'classnames'
|
|||||||
import { ThreadSection } from 'components/ThreadSection/ThreadSection'
|
import { ThreadSection } from 'components/ThreadSection/ThreadSection'
|
||||||
import { LIST_FETCHING_LIMIT, RenameDetails } from 'utils/Utils'
|
import { LIST_FETCHING_LIMIT, RenameDetails } from 'utils/Utils'
|
||||||
import { usePageIndex } from 'hooks/usePageIndex'
|
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 { useStrings } from 'framework/strings'
|
||||||
import { CommitsView } from 'components/CommitsView/CommitsView'
|
import { CommitsView } from 'components/CommitsView/CommitsView'
|
||||||
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
|
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
|
||||||
@ -33,7 +33,7 @@ const SingleFileRenameHistory = (props: {
|
|||||||
details: RenameDetails
|
details: RenameDetails
|
||||||
fileVisibility: { [key: string]: boolean }
|
fileVisibility: { [key: string]: boolean }
|
||||||
setFileVisibility: React.Dispatch<React.SetStateAction<{ [key: string]: boolean }>>
|
setFileVisibility: React.Dispatch<React.SetStateAction<{ [key: string]: boolean }>>
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
page: number
|
page: number
|
||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
response: any
|
response: any
|
||||||
@ -122,7 +122,7 @@ const SingleFileRenameHistory = (props: {
|
|||||||
|
|
||||||
const AllFilesRenameHistory = (props: {
|
const AllFilesRenameHistory = (props: {
|
||||||
rename_details: RenameDetails[]
|
rename_details: RenameDetails[]
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
fileVisibility: { [key: string]: boolean }
|
fileVisibility: { [key: string]: boolean }
|
||||||
setFileVisibility: React.Dispatch<React.SetStateAction<{ [key: string]: boolean }>>
|
setFileVisibility: React.Dispatch<React.SetStateAction<{ [key: string]: boolean }>>
|
||||||
setActiveTab: React.Dispatch<React.SetStateAction<string>>
|
setActiveTab: React.Dispatch<React.SetStateAction<string>>
|
||||||
@ -155,7 +155,7 @@ const AllFilesRenameHistory = (props: {
|
|||||||
|
|
||||||
const RenameContentHistory = (props: {
|
const RenameContentHistory = (props: {
|
||||||
rename_details: RenameDetails[]
|
rename_details: RenameDetails[]
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
setActiveTab: React.Dispatch<React.SetStateAction<string>>
|
setActiveTab: React.Dispatch<React.SetStateAction<string>>
|
||||||
}) => {
|
}) => {
|
||||||
const { rename_details, repoMetadata, setActiveTab } = props
|
const { rename_details, repoMetadata, setActiveTab } = props
|
||||||
|
@ -24,7 +24,7 @@ import { useGet } from 'restful-react'
|
|||||||
import cx from 'classnames'
|
import cx from 'classnames'
|
||||||
import { MarkdownViewer } from 'components/MarkdownViewer/MarkdownViewer'
|
import { MarkdownViewer } from 'components/MarkdownViewer/MarkdownViewer'
|
||||||
import { useAppContext } from 'AppContext'
|
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 { useStrings } from 'framework/strings'
|
||||||
import { useShowRequestError } from 'hooks/useShowRequestError'
|
import { useShowRequestError } from 'hooks/useShowRequestError'
|
||||||
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
||||||
@ -35,7 +35,7 @@ import { permissionProps } from 'utils/Utils'
|
|||||||
import css from './Readme.module.scss'
|
import css from './Readme.module.scss'
|
||||||
|
|
||||||
interface FolderContentProps {
|
interface FolderContentProps {
|
||||||
metadata: TypesRepository
|
metadata: RepoRepositoryOutput
|
||||||
gitRef?: string
|
gitRef?: string
|
||||||
readmeInfo: OpenapiContentInfo
|
readmeInfo: OpenapiContentInfo
|
||||||
contentOnly?: boolean
|
contentOnly?: boolean
|
||||||
@ -76,7 +76,7 @@ function ReadmeViewer({ metadata, gitRef, readmeInfo, contentOnly, maxWidth }: F
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -22,13 +22,13 @@ import { useHistory } from 'react-router-dom'
|
|||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { CodeIcon, RepositorySummaryData } from 'utils/GitUtils'
|
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 { permissionProps, formatDate } from 'utils/Utils'
|
||||||
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
||||||
import css from './RepositorySummary.module.scss'
|
import css from './RepositorySummary.module.scss'
|
||||||
|
|
||||||
interface RepositorySummaryProps {
|
interface RepositorySummaryProps {
|
||||||
metadata: TypesRepository
|
metadata: RepoRepositoryOutput
|
||||||
gitRef?: string
|
gitRef?: string
|
||||||
repoSummaryData: RepositorySummaryData | null
|
repoSummaryData: RepositorySummaryData | null
|
||||||
loadingSummaryData: boolean
|
loadingSummaryData: boolean
|
||||||
@ -108,7 +108,7 @@ const RepositorySummary = (props: RepositorySummaryProps) => {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: metadata?.uid as string
|
resourceIdentifier: metadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
|
@ -22,10 +22,10 @@ import { FontVariation } from '@harnessio/design-system'
|
|||||||
import { RepoPublicLabel } from 'components/RepoPublicLabel/RepoPublicLabel'
|
import { RepoPublicLabel } from 'components/RepoPublicLabel/RepoPublicLabel'
|
||||||
import type { GitInfoProps } from 'utils/GitUtils'
|
import type { GitInfoProps } from 'utils/GitUtils'
|
||||||
import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader'
|
import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
import css from './RepositoryHeader.module.scss'
|
import css from './RepositoryHeader.module.scss'
|
||||||
interface RepositoryHeaderProps extends Pick<GitInfoProps, 'repoMetadata'> {
|
interface RepositoryHeaderProps extends Pick<GitInfoProps, 'repoMetadata'> {
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
className?: string
|
className?: string
|
||||||
isFile: boolean
|
isFile: boolean
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ export function RepositoryHeader(props: RepositoryHeaderProps) {
|
|||||||
</span>
|
</span>
|
||||||
{/* <Icon name={CodeIcon.Repo} size={20} /> */}
|
{/* <Icon name={CodeIcon.Repo} size={20} /> */}
|
||||||
<Text inline className={css.repoDropdown} font={{ variation: FontVariation.H4 }}>
|
<Text inline className={css.repoDropdown} font={{ variation: FontVariation.H4 }}>
|
||||||
{repoMetadata.uid}
|
{repoMetadata.identifier}
|
||||||
</Text>
|
</Text>
|
||||||
<RepoPublicLabel isPublic={repoMetadata.is_public} />
|
<RepoPublicLabel isPublic={repoMetadata.is_public} />
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
|
@ -41,7 +41,7 @@ import type {
|
|||||||
OpenapiCalculateCommitDivergenceRequest,
|
OpenapiCalculateCommitDivergenceRequest,
|
||||||
RepoBranch,
|
RepoBranch,
|
||||||
RepoCommitDivergence,
|
RepoCommitDivergence,
|
||||||
TypesRepository
|
RepoRepositoryOutput
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { CommitActions } from 'components/CommitActions/CommitActions'
|
import { CommitActions } from 'components/CommitActions/CommitActions'
|
||||||
import { formatDate, getErrorMessage } from 'utils/Utils'
|
import { formatDate, getErrorMessage } from 'utils/Utils'
|
||||||
@ -54,7 +54,7 @@ import css from './BranchesContent.module.scss'
|
|||||||
|
|
||||||
interface BranchesContentProps {
|
interface BranchesContentProps {
|
||||||
searchTerm?: string
|
searchTerm?: string
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
branches: RepoBranch[]
|
branches: RepoBranch[]
|
||||||
onDeleteSuccess: () => void
|
onDeleteSuccess: () => void
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import { Container } from '@harnessio/uicore'
|
|||||||
import { useGet } from 'restful-react'
|
import { useGet } from 'restful-react'
|
||||||
import { Render } from 'react-jsx-match'
|
import { Render } from 'react-jsx-match'
|
||||||
import { useHistory } from 'react-router-dom'
|
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 { usePageIndex } from 'hooks/usePageIndex'
|
||||||
import { LIST_FETCHING_LIMIT, PageBrowserProps } from 'utils/Utils'
|
import { LIST_FETCHING_LIMIT, PageBrowserProps } from 'utils/Utils'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
@ -76,7 +76,7 @@ export function RepositoryBranchesContent({ repoMetadata }: Partial<Pick<GitInfo
|
|||||||
<Container padding="xlarge" className={css.resourceContent}>
|
<Container padding="xlarge" className={css.resourceContent}>
|
||||||
<BranchesContentHeader
|
<BranchesContentHeader
|
||||||
loading={loading && searchTerm !== undefined}
|
loading={loading && searchTerm !== undefined}
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
onBranchTypeSwitched={gitRef => {
|
onBranchTypeSwitched={gitRef => {
|
||||||
setPage(1)
|
setPage(1)
|
||||||
history.push(
|
history.push(
|
||||||
@ -96,7 +96,7 @@ export function RepositoryBranchesContent({ repoMetadata }: Partial<Pick<GitInfo
|
|||||||
{!!branches?.length && (
|
{!!branches?.length && (
|
||||||
<BranchesContent
|
<BranchesContent
|
||||||
branches={branches}
|
branches={branches}
|
||||||
repoMetadata={repoMetadata as TypesRepository}
|
repoMetadata={repoMetadata as RepoRepositoryOutput}
|
||||||
searchTerm={searchTerm}
|
searchTerm={searchTerm}
|
||||||
onDeleteSuccess={refetch}
|
onDeleteSuccess={refetch}
|
||||||
/>
|
/>
|
||||||
|
@ -47,7 +47,7 @@ export const RepositoryFileEditHeader: React.FC<RepositoryFileEditHeaderProps> =
|
|||||||
<Layout.Horizontal spacing="small" className={css.breadcrumb}>
|
<Layout.Horizontal spacing="small" className={css.breadcrumb}>
|
||||||
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
<Link to={routes.toCODERepositories({ space })}>{getString('repositories')}</Link>
|
||||||
<Icon name="main-chevron-right" size={10} color={Color.GREY_500} />
|
<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>
|
</Layout.Horizontal>
|
||||||
<Container padding={{ top: 'medium', bottom: 'medium' }}>
|
<Container padding={{ top: 'medium', bottom: 'medium' }}>
|
||||||
<Text font={{ variation: FontVariation.H4 }}>
|
<Text font={{ variation: FontVariation.H4 }}>
|
||||||
|
@ -53,7 +53,7 @@ const useDeleteRepoModal = () => {
|
|||||||
<Layout.Vertical flex={{ justifyContent: 'center' }}>
|
<Layout.Vertical flex={{ justifyContent: 'center' }}>
|
||||||
<Icon name="nav-project" size={32} />
|
<Icon name="nav-project" size={32} />
|
||||||
<Text font={{ size: 'large' }} color="grey900" padding={{ top: 'small', bottom: 'medium' }}>
|
<Text font={{ size: 'large' }} color="grey900" padding={{ top: 'small', bottom: 'medium' }}>
|
||||||
{repoMetadata?.uid}
|
{repoMetadata?.identifier}
|
||||||
</Text>
|
</Text>
|
||||||
</Layout.Vertical>
|
</Layout.Vertical>
|
||||||
<Divider />
|
<Divider />
|
||||||
@ -76,7 +76,7 @@ const useDeleteRepoModal = () => {
|
|||||||
</Container>
|
</Container>
|
||||||
<Text padding={{ top: 'small' }} color="grey500">
|
<Text padding={{ top: 'small' }} color="grey500">
|
||||||
{getString('repoDelete.deleteConfirm1', {
|
{getString('repoDelete.deleteConfirm1', {
|
||||||
repo: repoMetadata?.uid
|
repo: repoMetadata?.identifier
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
<Button
|
<Button
|
||||||
@ -93,11 +93,11 @@ const useDeleteRepoModal = () => {
|
|||||||
<>
|
<>
|
||||||
<Text padding={{ top: 'small', bottom: 'small' }} color="grey500">
|
<Text padding={{ top: 'small', bottom: 'small' }} color="grey500">
|
||||||
{getString('repoDelete.deleteConfirm2', {
|
{getString('repoDelete.deleteConfirm2', {
|
||||||
repo: repoMetadata?.uid
|
repo: repoMetadata?.identifier
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
<TextInput
|
<TextInput
|
||||||
placeholder={repoMetadata?.uid}
|
placeholder={repoMetadata?.identifier}
|
||||||
value={deleteConfirmString}
|
value={deleteConfirmString}
|
||||||
onInput={e => {
|
onInput={e => {
|
||||||
setDeleteConfirmString(e.currentTarget.value)
|
setDeleteConfirmString(e.currentTarget.value)
|
||||||
@ -107,7 +107,7 @@ const useDeleteRepoModal = () => {
|
|||||||
variation={ButtonVariation.SECONDARY}
|
variation={ButtonVariation.SECONDARY}
|
||||||
intent="danger"
|
intent="danger"
|
||||||
loading
|
loading
|
||||||
disabled={deleteConfirmString !== repoMetadata?.uid || loading}
|
disabled={deleteConfirmString !== repoMetadata?.identifier || loading}
|
||||||
margin={{ top: 'small' }}
|
margin={{ top: 'small' }}
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -36,7 +36,7 @@ import { useMutate, useGet } from 'restful-react'
|
|||||||
import { Render } from 'react-jsx-match'
|
import { Render } from 'react-jsx-match'
|
||||||
import { ACCESS_MODES, getErrorMessage, permissionProps, voidFn } from 'utils/Utils'
|
import { ACCESS_MODES, getErrorMessage, permissionProps, voidFn } from 'utils/Utils'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||||
import { RepoVisibility } from 'utils/GitUtils'
|
import { RepoVisibility } from 'utils/GitUtils'
|
||||||
@ -48,7 +48,7 @@ import Private from '../../../icons/private.svg?url'
|
|||||||
import css from '../RepositorySettings.module.scss'
|
import css from '../RepositorySettings.module.scss'
|
||||||
|
|
||||||
interface GeneralSettingsProps {
|
interface GeneralSettingsProps {
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
refetch: () => void
|
refetch: () => void
|
||||||
gitRef: string
|
gitRef: string
|
||||||
isRepositoryEmpty: boolean
|
isRepositoryEmpty: boolean
|
||||||
@ -84,7 +84,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
@ -94,7 +94,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_delete']
|
permissions: ['code_repo_delete']
|
||||||
},
|
},
|
||||||
@ -186,7 +186,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
|
|||||||
<Formik
|
<Formik
|
||||||
formName="repoGeneralSettings"
|
formName="repoGeneralSettings"
|
||||||
initialValues={{
|
initialValues={{
|
||||||
name: repoMetadata?.uid,
|
name: repoMetadata?.identifier,
|
||||||
desc: repoMetadata?.description,
|
desc: repoMetadata?.description,
|
||||||
defaultBranch: repoMetadata?.default_branch,
|
defaultBranch: repoMetadata?.default_branch,
|
||||||
isPublic: currRepoVisibility
|
isPublic: currRepoVisibility
|
||||||
@ -204,7 +204,7 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
|
|||||||
</Container>
|
</Container>
|
||||||
<Container className={css.content}>
|
<Container className={css.content}>
|
||||||
<Text color={Color.GREY_800} className={css.textSize}>
|
<Text color={Color.GREY_800} className={css.textSize}>
|
||||||
{repoMetadata?.uid}
|
{repoMetadata?.identifier}
|
||||||
</Text>
|
</Text>
|
||||||
</Container>
|
</Container>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
|
@ -31,7 +31,7 @@ import { useGet, useMutate } from 'restful-react'
|
|||||||
import { Render } from 'react-jsx-match'
|
import { Render } from 'react-jsx-match'
|
||||||
import type { FormikState } from 'formik'
|
import type { FormikState } from 'formik'
|
||||||
import { Color, FontVariation } from '@harnessio/design-system'
|
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 { useStrings } from 'framework/strings'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||||
@ -42,7 +42,7 @@ import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
|||||||
import css from './SecurityScanSettings.module.scss'
|
import css from './SecurityScanSettings.module.scss'
|
||||||
|
|
||||||
interface SecurityScanProps {
|
interface SecurityScanProps {
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
activeTab: string
|
activeTab: string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ const SecurityScanSettings = (props: SecurityScanProps) => {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
|
@ -87,7 +87,7 @@ export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repo
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_push']
|
permissions: ['code_repo_push']
|
||||||
},
|
},
|
||||||
|
@ -26,7 +26,7 @@ import { noop } from 'lodash-es'
|
|||||||
import { String, useStrings } from 'framework/strings'
|
import { String, useStrings } from 'framework/strings'
|
||||||
import { useAppContext } from 'AppContext'
|
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 { formatDate, getErrorMessage, voidFn } from 'utils/Utils'
|
||||||
import { useConfirmAction } from 'hooks/useConfirmAction'
|
import { useConfirmAction } from 'hooks/useConfirmAction'
|
||||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||||
@ -37,7 +37,7 @@ import css from './TagsContent.module.scss'
|
|||||||
|
|
||||||
interface TagsContentProps {
|
interface TagsContentProps {
|
||||||
searchTerm?: string
|
searchTerm?: string
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
branches: RepoBranch[]
|
branches: RepoBranch[]
|
||||||
onDeleteSuccess: () => void
|
onDeleteSuccess: () => void
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ import { useGet } from 'restful-react'
|
|||||||
|
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
|
|
||||||
import css from './Search.module.scss'
|
import css from './Search.module.scss'
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ const KeywordSearchFilters: React.FC<KeywordSearchFiltersProps> = ({
|
|||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const space = useGetSpaceParam()
|
const space = useGetSpaceParam()
|
||||||
|
|
||||||
const { data } = useGet<TypesRepository[]>({
|
const { data } = useGet<RepoRepositoryOutput[]>({
|
||||||
path: `/api/v1/spaces/${space}/+/repos`,
|
path: `/api/v1/spaces/${space}/+/repos`,
|
||||||
debounce: 500,
|
debounce: 500,
|
||||||
lazy: isRepoLevelSearch
|
lazy: isRepoLevelSearch
|
||||||
@ -52,7 +52,7 @@ const KeywordSearchFilters: React.FC<KeywordSearchFiltersProps> = ({
|
|||||||
|
|
||||||
const repositoryOptions =
|
const repositoryOptions =
|
||||||
data?.map(repository => ({
|
data?.map(repository => ({
|
||||||
label: String(repository.uid),
|
label: String(repository.identifier),
|
||||||
value: String(repository.path)
|
value: String(repository.path)
|
||||||
})) || []
|
})) || []
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ import { useQueryParams } from 'hooks/useQueryParams'
|
|||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
|
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
|
||||||
import { voidFn, getErrorMessage, ButtonRoleProps } from 'utils/Utils'
|
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 { useShowRequestError } from 'hooks/useShowRequestError'
|
||||||
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
|
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
|
||||||
import { useGetResourceContent } from 'hooks/useGetResourceContent'
|
import { useGetResourceContent } from 'hooks/useGetResourceContent'
|
||||||
@ -291,7 +291,7 @@ export default function Search() {
|
|||||||
interface SearchResultsProps {
|
interface SearchResultsProps {
|
||||||
data: SearchResultType[]
|
data: SearchResultType[]
|
||||||
onSelect: (fileName: string, filePath: string, content: string, highlightedLines: number[]) => void
|
onSelect: (fileName: string, filePath: string, content: string, highlightedLines: number[]) => void
|
||||||
repoMetadata: TypesRepository | undefined
|
repoMetadata: RepoRepositoryOutput | undefined
|
||||||
standalone: boolean
|
standalone: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ const Execution = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.main}>
|
<Container className={css.main}>
|
||||||
<PageHeader title={`THIS IS A SECRET = ${secret?.uid}`} />
|
<PageHeader title={`THIS IS A SECRET = ${secret?.identifier}`} />
|
||||||
</Container>
|
</Container>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -92,7 +92,7 @@ const SecretList = () => {
|
|||||||
<Layout.Horizontal spacing="small" style={{ flexGrow: 1 }}>
|
<Layout.Horizontal spacing="small" style={{ flexGrow: 1 }}>
|
||||||
<Layout.Vertical flex className={css.name}>
|
<Layout.Vertical flex className={css.name}>
|
||||||
<Text className={css.repoName} lineClamp={1}>
|
<Text className={css.repoName} lineClamp={1}>
|
||||||
<Keywords value={searchTerm}>{record.uid}</Keywords>
|
<Keywords value={searchTerm}>{record.identifier}</Keywords>
|
||||||
</Text>
|
</Text>
|
||||||
{record.description && (
|
{record.description && (
|
||||||
<Text className={css.desc} lineClamp={1}>
|
<Text className={css.desc} lineClamp={1}>
|
||||||
@ -125,7 +125,7 @@ const SecretList = () => {
|
|||||||
Cell: ({ row }: CellProps<TypesSecret>) => {
|
Cell: ({ row }: CellProps<TypesSecret>) => {
|
||||||
const { mutate: deleteSecret } = useMutate({
|
const { mutate: deleteSecret } = useMutate({
|
||||||
verb: 'DELETE',
|
verb: 'DELETE',
|
||||||
path: `/api/v1/secrets/${space}/${row.original.uid}/+`
|
path: `/api/v1/secrets/${space}/${row.original.identifier}/+`
|
||||||
})
|
})
|
||||||
const { showSuccess, showError } = useToaster()
|
const { showSuccess, showError } = useToaster()
|
||||||
const confirmDeleteSecret = useConfirmAct()
|
const confirmDeleteSecret = useConfirmAct()
|
||||||
@ -150,7 +150,11 @@ const SecretList = () => {
|
|||||||
confirmText: getString('delete'),
|
confirmText: getString('delete'),
|
||||||
intent: Intent.DANGER,
|
intent: Intent.DANGER,
|
||||||
message: (
|
message: (
|
||||||
<String useRichText stringID="secrets.deleteSecretConfirm" vars={{ uid: row.original.uid }} />
|
<String
|
||||||
|
useRichText
|
||||||
|
stringID="secrets.deleteSecretConfirm"
|
||||||
|
vars={{ uid: row.original.identifier }}
|
||||||
|
/>
|
||||||
),
|
),
|
||||||
action: async () => {
|
action: async () => {
|
||||||
deleteSecret({})
|
deleteSecret({})
|
||||||
@ -159,7 +163,7 @@ const SecretList = () => {
|
|||||||
<StringSubstitute
|
<StringSubstitute
|
||||||
str={getString('secrets.secretDeleted')}
|
str={getString('secrets.secretDeleted')}
|
||||||
vars={{
|
vars={{
|
||||||
uid: truncateString(row.original.uid as string, 20)
|
uid: truncateString(row.original.identifier as string, 20)
|
||||||
}}
|
}}
|
||||||
/>,
|
/>,
|
||||||
5000
|
5000
|
||||||
|
@ -35,7 +35,7 @@ import {
|
|||||||
stringSubstitute
|
stringSubstitute
|
||||||
} from '@harnessio/uicore'
|
} from '@harnessio/uicore'
|
||||||
import { Icon } from '@harnessio/icons'
|
import { Icon } from '@harnessio/icons'
|
||||||
import type { TypesRepository } from 'services/code'
|
import type { RepoRepositoryOutput } from 'services/code'
|
||||||
|
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import type { ExportFormDataExtended } from 'utils/GitUtils'
|
import type { ExportFormDataExtended } from 'utils/GitUtils'
|
||||||
@ -73,7 +73,7 @@ const ExportForm = (props: ExportFormProps) => {
|
|||||||
organization: yup.string().trim().required(getString('importSpace.orgRequired')),
|
organization: yup.string().trim().required(getString('importSpace.orgRequired')),
|
||||||
name: yup.string().trim().required(getString('importSpace.spaceNameRequired'))
|
name: yup.string().trim().required(getString('importSpace.spaceNameRequired'))
|
||||||
})
|
})
|
||||||
const { data: repositories } = useGet<TypesRepository[]>({
|
const { data: repositories } = useGet<RepoRepositoryOutput[]>({
|
||||||
path: `/api/v1/spaces/${space}/+/repos`
|
path: `/api/v1/spaces/${space}/+/repos`
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ export default function SpaceSettings() {
|
|||||||
<Formik
|
<Formik
|
||||||
formName="spaceGeneralSettings"
|
formName="spaceGeneralSettings"
|
||||||
initialValues={{
|
initialValues={{
|
||||||
name: data?.uid,
|
name: data?.identifier,
|
||||||
desc: data?.description
|
desc: data?.description
|
||||||
}}
|
}}
|
||||||
onSubmit={voidFn(() => {
|
onSubmit={voidFn(() => {
|
||||||
@ -354,7 +354,7 @@ export default function SpaceSettings() {
|
|||||||
<Layout.Horizontal>
|
<Layout.Horizontal>
|
||||||
<TextInput
|
<TextInput
|
||||||
name="name"
|
name="name"
|
||||||
value={formik.values.name || data?.uid}
|
value={formik.values.name || data?.identifier}
|
||||||
className={cx(css.textContainer, css.textSize)}
|
className={cx(css.textContainer, css.textSize)}
|
||||||
onChange={evt => {
|
onChange={evt => {
|
||||||
formik.setFieldValue('name', (evt.currentTarget as HTMLInputElement)?.value)
|
formik.setFieldValue('name', (evt.currentTarget as HTMLInputElement)?.value)
|
||||||
@ -385,7 +385,7 @@ export default function SpaceSettings() {
|
|||||||
variation={ButtonVariation.TERTIARY}
|
variation={ButtonVariation.TERTIARY}
|
||||||
size={ButtonSize.SMALL}
|
size={ButtonSize.SMALL}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
formik.setFieldValue('name', data?.uid)
|
formik.setFieldValue('name', data?.identifier)
|
||||||
setEditName(ACCESS_MODES.VIEW)
|
setEditName(ACCESS_MODES.VIEW)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -393,7 +393,7 @@ export default function SpaceSettings() {
|
|||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
) : (
|
) : (
|
||||||
<Text color={Color.GREY_800} className={css.textSize}>
|
<Text color={Color.GREY_800} className={css.textSize}>
|
||||||
{formik?.values?.name || data?.uid}
|
{formik?.values?.name || data?.identifier}
|
||||||
<Button
|
<Button
|
||||||
className={css.textSize}
|
className={css.textSize}
|
||||||
text={getString('edit')}
|
text={getString('edit')}
|
||||||
@ -490,7 +490,7 @@ export default function SpaceSettings() {
|
|||||||
padding={{ left: 'large', right: 'large', top: 'small', bottom: 'small' }}
|
padding={{ left: 'large', right: 'large', top: 'small', bottom: 'small' }}
|
||||||
color={Color.WARNING}>
|
color={Color.WARNING}>
|
||||||
{getString('spaceSetting.intentText', {
|
{getString('spaceSetting.intentText', {
|
||||||
space: data?.uid
|
space: data?.identifier
|
||||||
})}
|
})}
|
||||||
</Text>
|
</Text>
|
||||||
</Container>
|
</Container>
|
||||||
|
@ -75,10 +75,10 @@ const useNewToken = ({ onClose }: { onClose: () => void }) => {
|
|||||||
<Dialog isOpen enforceFocus={false} onClose={onModalClose} title={getString('createNewToken')}>
|
<Dialog isOpen enforceFocus={false} onClose={onModalClose} title={getString('createNewToken')}>
|
||||||
<Formik<OpenapiCreateTokenRequest>
|
<Formik<OpenapiCreateTokenRequest>
|
||||||
initialValues={{
|
initialValues={{
|
||||||
uid: ''
|
identifier: ''
|
||||||
}}
|
}}
|
||||||
validationSchema={Yup.object().shape({
|
validationSchema={Yup.object().shape({
|
||||||
uid: Yup.string()
|
identifier: Yup.string()
|
||||||
.required(getString('validation.nameIsRequired'))
|
.required(getString('validation.nameIsRequired'))
|
||||||
.matches(REGEX_VALID_REPO_NAME, getString('validation.nameInvalid')),
|
.matches(REGEX_VALID_REPO_NAME, getString('validation.nameInvalid')),
|
||||||
lifetime: Yup.number().required(getString('validation.expirationDateRequired'))
|
lifetime: Yup.number().required(getString('validation.expirationDateRequired'))
|
||||||
@ -102,7 +102,7 @@ const useNewToken = ({ onClose }: { onClose: () => void }) => {
|
|||||||
return (
|
return (
|
||||||
<FormikForm>
|
<FormikForm>
|
||||||
<FormInputWithCopyButton
|
<FormInputWithCopyButton
|
||||||
name="uid"
|
name="identifier"
|
||||||
label={getString('name')}
|
label={getString('name')}
|
||||||
placeholder={getString('newToken.namePlaceholder')}
|
placeholder={getString('newToken.namePlaceholder')}
|
||||||
disabled={isTokenGenerated}
|
disabled={isTokenGenerated}
|
||||||
|
@ -190,7 +190,7 @@ const UserProfile = () => {
|
|||||||
Cell: ({ row }: CellProps<TypesToken>) => {
|
Cell: ({ row }: CellProps<TypesToken>) => {
|
||||||
return (
|
return (
|
||||||
<Text font={{ variation: FontVariation.SMALL_SEMI }} lineClamp={1}>
|
<Text font={{ variation: FontVariation.SMALL_SEMI }} lineClamp={1}>
|
||||||
{row.original.uid}
|
{row.original.identifier}
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -236,7 +236,7 @@ const UserProfile = () => {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessor: 'uid',
|
accessor: 'identifier',
|
||||||
Header: '',
|
Header: '',
|
||||||
width: '5%',
|
width: '5%',
|
||||||
Cell: ({ row }: CellProps<TypesToken>) => {
|
Cell: ({ row }: CellProps<TypesToken>) => {
|
||||||
@ -246,7 +246,7 @@ const UserProfile = () => {
|
|||||||
items={[
|
items={[
|
||||||
{
|
{
|
||||||
text: getString('deleteToken'),
|
text: getString('deleteToken'),
|
||||||
onClick: () => handleDeleteToken(row.original.uid as string)
|
onClick: () => handleDeleteToken(row.original.identifier as string)
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
@ -97,7 +97,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
|
|||||||
const { routes } = useAppContext()
|
const { routes } = useAppContext()
|
||||||
const { mutate, loading } = useMutate<OpenapiWebhookType>({
|
const { mutate, loading } = useMutate<OpenapiWebhookType>({
|
||||||
verb: isEdit ? 'PATCH' : 'POST',
|
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 { hooks, standalone } = useAppContext()
|
||||||
const space = useGetSpaceParam()
|
const space = useGetSpaceParam()
|
||||||
@ -105,7 +105,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
@ -116,7 +116,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
|
|||||||
<Layout.Vertical className={css.form}>
|
<Layout.Vertical className={css.form}>
|
||||||
<Formik<FormData>
|
<Formik<FormData>
|
||||||
initialValues={{
|
initialValues={{
|
||||||
name: webhook?.display_name || '',
|
name: webhook?.identifier || '',
|
||||||
description: webhook?.description || '',
|
description: webhook?.description || '',
|
||||||
url: webhook?.url || '',
|
url: webhook?.url || '',
|
||||||
secret: isEdit && webhook?.has_secret ? SECRET_MASK : '',
|
secret: isEdit && webhook?.has_secret ? SECRET_MASK : '',
|
||||||
@ -194,7 +194,7 @@ export function WehookForm({ repoMetadata, isEdit, webhook }: WebHookFormProps)
|
|||||||
const secret = (formData.secret || '').trim()
|
const secret = (formData.secret || '').trim()
|
||||||
|
|
||||||
const data: OpenapiUpdateWebhookRequest = {
|
const data: OpenapiUpdateWebhookRequest = {
|
||||||
display_name: formData.name,
|
identifier: formData.name,
|
||||||
description: formData.description,
|
description: formData.description,
|
||||||
url: formData.url,
|
url: formData.url,
|
||||||
secret: secret !== SECRET_MASK ? secret : undefined,
|
secret: secret !== SECRET_MASK ? secret : undefined,
|
||||||
|
@ -101,7 +101,7 @@ export default function Webhooks() {
|
|||||||
|
|
||||||
const { mutate } = useMutate<OpenapiWebhookType>({
|
const { mutate } = useMutate<OpenapiWebhookType>({
|
||||||
verb: 'PATCH',
|
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)
|
const [popoverDialogOpen, setPopoverDialogOpen] = useState(false)
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ export default function Webhooks() {
|
|||||||
<StringSubstitute
|
<StringSubstitute
|
||||||
str={checked ? getString('disableWebhookContent') : getString('enableWebhookContent')}
|
str={checked ? getString('disableWebhookContent') : getString('enableWebhookContent')}
|
||||||
vars={{
|
vars={{
|
||||||
name: <strong>{row.original?.display_name}</strong>
|
name: <strong>{row.original?.identifier}</strong>
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
@ -163,7 +163,7 @@ export default function Webhooks() {
|
|||||||
interactionKind="click">
|
interactionKind="click">
|
||||||
<Toggle
|
<Toggle
|
||||||
{...permissionProps(permPushResult, standalone)}
|
{...permissionProps(permPushResult, standalone)}
|
||||||
key={row.original.id}
|
key={row.original.identifier}
|
||||||
className={cx(css.toggle, checked ? css.toggleEnable : css.toggleDisable)}
|
className={cx(css.toggle, checked ? css.toggleEnable : css.toggleDisable)}
|
||||||
checked={checked}></Toggle>
|
checked={checked}></Toggle>
|
||||||
</Popover>
|
</Popover>
|
||||||
@ -176,7 +176,7 @@ export default function Webhooks() {
|
|||||||
lineClamp={1}
|
lineClamp={1}
|
||||||
width={300}
|
width={300}
|
||||||
className={css.title}>
|
className={css.title}>
|
||||||
{row.original.display_name}
|
{row.original.identifier}
|
||||||
</Text>
|
</Text>
|
||||||
{!!row.original.triggers?.length && (
|
{!!row.original.triggers?.length && (
|
||||||
<Text padding={{ left: 'small', right: 'small' }} color={Color.GREY_500}>
|
<Text padding={{ left: 'small', right: 'small' }} color={Color.GREY_500}>
|
||||||
@ -212,7 +212,7 @@ export default function Webhooks() {
|
|||||||
Cell: ({ row }: CellProps<OpenapiWebhookType>) => {
|
Cell: ({ row }: CellProps<OpenapiWebhookType>) => {
|
||||||
const { mutate: deleteWebhook } = useMutate({
|
const { mutate: deleteWebhook } = useMutate({
|
||||||
verb: 'DELETE',
|
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()
|
const confirmDelete = useConfirmAct()
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ export default function Webhooks() {
|
|||||||
history.push(
|
history.push(
|
||||||
routes.toCODEWebhookDetails({
|
routes.toCODEWebhookDetails({
|
||||||
repoPath: repoMetadata?.path as string,
|
repoPath: repoMetadata?.path as string,
|
||||||
webhookId: String(row.original?.id)
|
webhookId: String(row.original?.identifier)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -272,7 +272,7 @@ export default function Webhooks() {
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
@ -307,7 +307,7 @@ export default function Webhooks() {
|
|||||||
history.push(
|
history.push(
|
||||||
routes.toCODEWebhookDetails({
|
routes.toCODEWebhookDetails({
|
||||||
repoPath: repoMetadata.path as string,
|
repoPath: repoMetadata.path as string,
|
||||||
webhookId: String(row.id)
|
webhookId: String(row.identifier)
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
|
@ -43,7 +43,7 @@ export function WebhooksHeader({ repoMetadata, loading, onSearchTermChanged }: W
|
|||||||
{
|
{
|
||||||
resource: {
|
resource: {
|
||||||
resourceType: 'CODE_REPOSITORY',
|
resourceType: 'CODE_REPOSITORY',
|
||||||
resourceIdentifier: repoMetadata?.uid as string
|
resourceIdentifier: repoMetadata?.identifier as string
|
||||||
},
|
},
|
||||||
permissions: ['code_repo_edit']
|
permissions: ['code_repo_edit']
|
||||||
},
|
},
|
||||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -27,14 +27,14 @@ import type {
|
|||||||
OpenapiGetContentOutput,
|
OpenapiGetContentOutput,
|
||||||
TypesCommit,
|
TypesCommit,
|
||||||
TypesPullReq,
|
TypesPullReq,
|
||||||
TypesRepository,
|
RepoRepositoryOutput,
|
||||||
TypesRuleViolations
|
TypesRuleViolations
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { getConfig } from 'services/config'
|
import { getConfig } from 'services/config'
|
||||||
import { PullRequestSection, getErrorMessage } from './Utils'
|
import { PullRequestSection, getErrorMessage } from './Utils'
|
||||||
|
|
||||||
export interface GitInfoProps {
|
export interface GitInfoProps {
|
||||||
repoMetadata: TypesRepository
|
repoMetadata: RepoRepositoryOutput
|
||||||
gitRef: string
|
gitRef: string
|
||||||
resourcePath: string
|
resourcePath: string
|
||||||
resourceContent: OpenapiGetContentOutput
|
resourceContent: OpenapiGetContentOutput
|
||||||
@ -287,7 +287,7 @@ export function formatTriggers(triggers: EnumWebhookTrigger[]) {
|
|||||||
export const handleUpload = (
|
export const handleUpload = (
|
||||||
blob: File,
|
blob: File,
|
||||||
setMarkdownContent: (data: string) => void,
|
setMarkdownContent: (data: string) => void,
|
||||||
repoMetadata: TypesRepository | undefined,
|
repoMetadata: RepoRepositoryOutput | undefined,
|
||||||
showError: (message: React.ReactNode, timeout?: number | undefined, key?: string | undefined) => void,
|
showError: (message: React.ReactNode, timeout?: number | undefined, key?: string | undefined) => void,
|
||||||
standalone: boolean,
|
standalone: boolean,
|
||||||
routingId?: string
|
routingId?: string
|
||||||
@ -305,7 +305,7 @@ export const uploadImage = async (
|
|||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
fileBlob: any,
|
fileBlob: any,
|
||||||
showError: (message: React.ReactNode, timeout?: number | undefined, key?: string | undefined) => void,
|
showError: (message: React.ReactNode, timeout?: number | undefined, key?: string | undefined) => void,
|
||||||
repoMetadata: TypesRepository | undefined,
|
repoMetadata: RepoRepositoryOutput | undefined,
|
||||||
standalone: boolean,
|
standalone: boolean,
|
||||||
routingId?: string
|
routingId?: string
|
||||||
) => {
|
) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user