mirror of
https://github.com/harness/drone.git
synced 2025-05-10 05:01:41 +08:00
Merge branch 'code-286-comments' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#105)
This commit is contained in:
commit
b6d0a97f19
@ -147,7 +147,6 @@ export function useCreateTagModal({
|
|||||||
repoMetadata={repoMetadata}
|
repoMetadata={repoMetadata}
|
||||||
disableBranchCreation
|
disableBranchCreation
|
||||||
disableViewAllBranches
|
disableViewAllBranches
|
||||||
forBranchesOnly
|
|
||||||
gitRef={sourceBranch}
|
gitRef={sourceBranch}
|
||||||
onSelect={setSourceBranch}
|
onSelect={setSourceBranch}
|
||||||
/>
|
/>
|
||||||
|
@ -23,11 +23,11 @@ export function RepositoryTagsContentHeader({
|
|||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const [searchTerm, setSearchTerm] = useState('')
|
const [searchTerm, setSearchTerm] = useState('')
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.main}>
|
<Container className={css.main}>
|
||||||
<Layout.Horizontal spacing="medium">
|
<Layout.Horizontal spacing="medium">
|
||||||
<SearchInputWithSpinner
|
<SearchInputWithSpinner
|
||||||
|
spinnerPosition="right"
|
||||||
loading={loading}
|
loading={loading}
|
||||||
query={searchTerm}
|
query={searchTerm}
|
||||||
setQuery={value => {
|
setQuery={value => {
|
||||||
|
@ -21,6 +21,7 @@ import type {
|
|||||||
OpenapiCalculateCommitDivergenceRequest,
|
OpenapiCalculateCommitDivergenceRequest,
|
||||||
RepoBranch,
|
RepoBranch,
|
||||||
RepoCommitDivergence,
|
RepoCommitDivergence,
|
||||||
|
RepoCommitTag,
|
||||||
TypesRepository
|
TypesRepository
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { formatDate, getErrorMessage, voidFn } from 'utils/Utils'
|
import { formatDate, getErrorMessage, voidFn } from 'utils/Utils'
|
||||||
@ -28,7 +29,7 @@ import { useConfirmAction } from 'hooks/useConfirmAction'
|
|||||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||||
import { useCreateBranchModal } from 'components/CreateBranchModal/CreateBranchModal'
|
import { useCreateBranchModal } from 'components/CreateBranchModal/CreateBranchModal'
|
||||||
import { CommitActions } from 'components/CommitActions/CommitActions'
|
import { CommitActions } from 'components/CommitActions/CommitActions'
|
||||||
import { CodeIcon } from 'utils/GitUtils'
|
import { CodeIcon, REFS_TAGS_PREFIX } from 'utils/GitUtils'
|
||||||
import css from './TagsContent.module.scss'
|
import css from './TagsContent.module.scss'
|
||||||
|
|
||||||
interface TagsContentProps {
|
interface TagsContentProps {
|
||||||
@ -63,7 +64,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
}
|
}
|
||||||
}, [getBranchDivergence, branchDivergenceRequestBody])
|
}, [getBranchDivergence, branchDivergenceRequestBody])
|
||||||
const onSuccess = voidFn(noop)
|
const onSuccess = voidFn(noop)
|
||||||
const openModal = useCreateBranchModal({ repoMetadata, onSuccess })
|
const openModal = useCreateBranchModal({ repoMetadata, onSuccess,showSuccessMessage: true })
|
||||||
|
|
||||||
const columns: Column<RepoBranch>[] = useMemo(
|
const columns: Column<RepoBranch>[] = useMemo(
|
||||||
() => [
|
() => [
|
||||||
@ -110,12 +111,12 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
{
|
{
|
||||||
Header: getString('tagger'),
|
Header: getString('tagger'),
|
||||||
width: '20%',
|
width: '20%',
|
||||||
Cell: ({ row }: CellProps<RepoBranch>) => {
|
Cell: ({ row }: CellProps<RepoCommitTag>) => {
|
||||||
return (
|
return (
|
||||||
<Text className={css.rowText} color={Color.BLACK} tag="div">
|
<Text className={css.rowText} color={Color.BLACK} tag="div">
|
||||||
<Avatar hoverCard={false} size="small" name={row.original.commit?.author?.identity?.name || ''} />
|
<Avatar hoverCard={false} size="small" name={row.original.commit?.author?.identity?.name || ''} />
|
||||||
<span className={css.spacer} />
|
<span className={css.spacer} />
|
||||||
{row.original.commit?.author?.identity?.name || ''}
|
{row.original.tagger?.identity?.name || ''}
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -123,11 +124,11 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
{
|
{
|
||||||
Header: getString('creationDate'),
|
Header: getString('creationDate'),
|
||||||
width: '200px',
|
width: '200px',
|
||||||
Cell: ({ row }: CellProps<RepoBranch>) => {
|
Cell: ({ row }: CellProps<RepoCommitTag>) => {
|
||||||
return (
|
return (
|
||||||
<Text className={css.rowText} color={Color.BLACK} tag="div">
|
<Text className={css.rowText} color={Color.BLACK} tag="div">
|
||||||
<span className={css.spacer} />
|
<span className={css.spacer} />
|
||||||
{formatDate(row.original.commit?.author?.when as string)}
|
{formatDate(row.original.tagger?.when as string)}
|
||||||
</Text>
|
</Text>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -179,7 +180,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
history.push(
|
history.push(
|
||||||
routes.toCODERepository({
|
routes.toCODERepository({
|
||||||
repoPath: repoMetadata.path as string,
|
repoPath: repoMetadata.path as string,
|
||||||
gitRef: row.original?.name
|
gitRef: `${REFS_TAGS_PREFIX}${row.original?.name}`
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user