mirror of
https://github.com/harness/drone.git
synced 2025-05-10 07:30:33 +08:00
feat: [code-286]: fix yarn checks
This commit is contained in:
parent
0f4b58adcb
commit
070b739c6f
@ -17,7 +17,7 @@ export interface CODEQueryProps {
|
|||||||
query?: string
|
query?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pathProps: Readonly<Omit<Required<CODEProps>, 'repoPath' | 'branch' | 'tags' >> = {
|
export const pathProps: Readonly<Omit<Required<CODEProps>, 'repoPath' | 'branch' | 'tags'>> = {
|
||||||
space: ':space',
|
space: ':space',
|
||||||
repoName: ':repoName',
|
repoName: ':repoName',
|
||||||
gitRef: ':gitRef*',
|
gitRef: ':gitRef*',
|
||||||
|
@ -50,7 +50,7 @@ export function CommitsView({
|
|||||||
return (
|
return (
|
||||||
<Layout.Horizontal spacing="small" flex={{ alignItems: 'center' }} style={{ display: 'inline-flex' }}>
|
<Layout.Horizontal spacing="small" flex={{ alignItems: 'center' }} style={{ display: 'inline-flex' }}>
|
||||||
<Avatar hoverCard={false} size="small" name={row.original.author?.identity?.name || ''} />
|
<Avatar hoverCard={false} size="small" name={row.original.author?.identity?.name || ''} />
|
||||||
<Text icon='code-tag' iconProps={{size:22}} className={css.rowText} color={Color.BLACK}>
|
<Text icon="code-tag" iconProps={{ size: 22 }} className={css.rowText} color={Color.BLACK}>
|
||||||
{row.original.author?.identity?.name}
|
{row.original.author?.identity?.name}
|
||||||
</Text>
|
</Text>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
|
@ -8,9 +8,8 @@
|
|||||||
font-size: var(--form-input-font-size) !important;
|
font-size: var(--form-input-font-size) !important;
|
||||||
font-weight: 500 !important;
|
font-weight: 500 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.extendedDescription textarea {
|
.extendedDescription textarea {
|
||||||
height: 100px !important;
|
height: 100px !important;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ import { get } from 'lodash-es'
|
|||||||
import { useModalHook } from '@harness/use-modal'
|
import { useModalHook } from '@harness/use-modal'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { getErrorMessage, permissionProps } from 'utils/Utils'
|
import { getErrorMessage, permissionProps } from 'utils/Utils'
|
||||||
import { CodeIcon, GitInfoProps, isGitBranchNameValid } from 'utils/GitUtils'
|
import { GitInfoProps, isGitBranchNameValid } from 'utils/GitUtils'
|
||||||
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
|
import { BranchTagSelect } from 'components/BranchTagSelect/BranchTagSelect'
|
||||||
import type { RepoBranch } from 'services/code'
|
import type { RepoBranch } from 'services/code'
|
||||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||||
@ -112,7 +112,6 @@ export function useCreateTagModal({
|
|||||||
name: branchName,
|
name: branchName,
|
||||||
sourceBranch: suggestedSourceBranch,
|
sourceBranch: suggestedSourceBranch,
|
||||||
description: ''
|
description: ''
|
||||||
|
|
||||||
}}
|
}}
|
||||||
formName="createGitTag"
|
formName="createGitTag"
|
||||||
enableReinitialize={true}
|
enableReinitialize={true}
|
||||||
|
@ -71,7 +71,10 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
|
|||||||
<Button variation={ButtonVariation.TERTIARY} size={ButtonSize.SMALL} text={'Add +'}></Button>
|
<Button variation={ButtonVariation.TERTIARY} size={ButtonSize.SMALL} text={'Add +'}></Button>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
<Container padding={{ top: 'medium', bottom: 'large' }}>
|
<Container padding={{ top: 'medium', bottom: 'large' }}>
|
||||||
<Text className={css.semiBoldText} padding={{ bottom: 'medium' }} font={{ variation: FontVariation.FORM_LABEL, size: 'small' }}>
|
<Text
|
||||||
|
className={css.semiBoldText}
|
||||||
|
padding={{ bottom: 'medium' }}
|
||||||
|
font={{ variation: FontVariation.FORM_LABEL, size: 'small' }}>
|
||||||
{getString('required')}
|
{getString('required')}
|
||||||
</Text>
|
</Text>
|
||||||
{reviewers && reviewers?.length !== 0 ? (
|
{reviewers && reviewers?.length !== 0 ? (
|
||||||
@ -119,9 +122,7 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
<Text
|
<Text color={Color.GREY_300} font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
||||||
color={Color.GREY_300}
|
|
||||||
font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
|
||||||
{getString('noRequiredReviewers')}
|
{getString('noRequiredReviewers')}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
@ -174,9 +175,7 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
|
|||||||
)
|
)
|
||||||
})
|
})
|
||||||
) : (
|
) : (
|
||||||
<Text
|
<Text color={Color.GREY_300} font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
||||||
color={Color.GREY_300}
|
|
||||||
font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
|
||||||
{getString('noOptionalReviewers')}
|
{getString('noOptionalReviewers')}
|
||||||
</Text>
|
</Text>
|
||||||
)}
|
)}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
.main {
|
.main {
|
||||||
min-height: var(--page-min-height, 100%);
|
min-height: var(--page-min-height, 100%);
|
||||||
background-color: var(--primary-bg) !important;
|
background-color: var(--primary-bg) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,11 +14,7 @@ export default function RepositoryTags() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.main}>
|
<Container className={css.main}>
|
||||||
<RepositoryPageHeader
|
<RepositoryPageHeader repoMetadata={repoMetadata} title={getString('tags')} dataTooltipId="repositoryTags" />
|
||||||
repoMetadata={repoMetadata}
|
|
||||||
title={getString('tags')}
|
|
||||||
dataTooltipId="repositoryTags"
|
|
||||||
/>
|
|
||||||
<PageBody error={getErrorMessage(error)} retryOnError={voidFn(refetch)}>
|
<PageBody error={getErrorMessage(error)} retryOnError={voidFn(refetch)}>
|
||||||
<LoadingSpinner visible={loading} />
|
<LoadingSpinner visible={loading} />
|
||||||
|
|
||||||
|
@ -4,5 +4,4 @@
|
|||||||
.noData > div {
|
.noData > div {
|
||||||
height: calc(100vh - var(--page-header-height, 64px) - 120px) !important;
|
height: calc(100vh - var(--page-header-height, 64px) - 120px) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ import React, { useState } from 'react'
|
|||||||
import { Container } from '@harness/uicore'
|
import { Container } from '@harness/uicore'
|
||||||
import { useGet } from 'restful-react'
|
import { useGet } from 'restful-react'
|
||||||
import { useHistory } from 'react-router-dom'
|
import { useHistory } from 'react-router-dom'
|
||||||
import type { RepoBranch, RepoCommitTag } from 'services/code'
|
import type { RepoCommitTag } from 'services/code'
|
||||||
import { usePageIndex } from 'hooks/usePageIndex'
|
import { usePageIndex } from 'hooks/usePageIndex'
|
||||||
import { LIST_FETCHING_LIMIT } from 'utils/Utils'
|
import { LIST_FETCHING_LIMIT } from 'utils/Utils'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
@ -10,10 +10,9 @@ import type { GitInfoProps } from 'utils/GitUtils'
|
|||||||
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
|
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
|
||||||
import { useShowRequestError } from 'hooks/useShowRequestError'
|
import { useShowRequestError } from 'hooks/useShowRequestError'
|
||||||
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
|
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
|
||||||
import { BranchesContent } from '../../RepositoryBranches/RepositoryBranchesContent/BranchesContent/BranchesContent'
|
|
||||||
import css from './RepositoryTagsContent.module.scss'
|
|
||||||
import { RepositoryTagsContentHeader } from '../RepositoryTagsContentHeader/RepositoryTagsContentHeader'
|
import { RepositoryTagsContentHeader } from '../RepositoryTagsContentHeader/RepositoryTagsContentHeader'
|
||||||
import { TagsContent } from '../TagsContent/TagsContent'
|
import { TagsContent } from '../TagsContent/TagsContent'
|
||||||
|
import css from './RepositoryTagsContent.module.scss'
|
||||||
|
|
||||||
export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repoMetadata'>) {
|
export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repoMetadata'>) {
|
||||||
const { routes } = useAppContext()
|
const { routes } = useAppContext()
|
||||||
|
@ -13,9 +13,8 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
padding-bottom: var(--spacing-xlarge) !important;
|
padding-bottom: var(--spacing-xlarge) !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.branchDropdown {
|
.branchDropdown {
|
||||||
background-color: var(--white);
|
background-color: var(--white);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
import React, { useMemo, useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import { Container, Layout, FlexExpander, DropDown, ButtonVariation } from '@harness/uicore'
|
import { Container, Layout, FlexExpander, ButtonVariation } from '@harness/uicore'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { GitBranchType, CodeIcon, GitInfoProps } from 'utils/GitUtils'
|
import { GitBranchType, CodeIcon, GitInfoProps } from 'utils/GitUtils'
|
||||||
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
|
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
|
||||||
import { CreateBranchModalButton } from 'components/CreateBranchModal/CreateBranchModal'
|
|
||||||
import css from './RepositoryTagsContentHeader.module.scss'
|
|
||||||
import { CreateTagModalButton } from 'components/CreateTagModal/CreateTagModal'
|
import { CreateTagModalButton } from 'components/CreateTagModal/CreateTagModal'
|
||||||
|
import css from './RepositoryTagsContentHeader.module.scss'
|
||||||
|
|
||||||
interface RepositoryTagsContentHeaderProps extends Pick<GitInfoProps, 'repoMetadata'> {
|
interface RepositoryTagsContentHeaderProps extends Pick<GitInfoProps, 'repoMetadata'> {
|
||||||
loading?: boolean
|
loading?: boolean
|
||||||
@ -16,30 +15,18 @@ interface RepositoryTagsContentHeaderProps extends Pick<GitInfoProps, 'repoMetad
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function RepositoryTagsContentHeader({
|
export function RepositoryTagsContentHeader({
|
||||||
onBranchTypeSwitched,
|
|
||||||
onSearchTermChanged,
|
onSearchTermChanged,
|
||||||
activeBranchType = GitBranchType.ALL,
|
|
||||||
repoMetadata,
|
repoMetadata,
|
||||||
onNewBranchCreated,
|
onNewBranchCreated,
|
||||||
loading
|
loading
|
||||||
}: RepositoryTagsContentHeaderProps) {
|
}: RepositoryTagsContentHeaderProps) {
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const [branchType, setBranchType] = useState(activeBranchType)
|
|
||||||
const [searchTerm, setSearchTerm] = useState('')
|
const [searchTerm, setSearchTerm] = useState('')
|
||||||
const items = useMemo(
|
|
||||||
() => [
|
|
||||||
{ label: getString('activeBranches'), value: GitBranchType.ACTIVE },
|
|
||||||
{ label: getString('inactiveBranches'), value: GitBranchType.INACTIVE },
|
|
||||||
// { label: getString('yourBranches'), value: GitBranchType.YOURS },
|
|
||||||
{ label: getString('allBranches'), value: GitBranchType.ALL }
|
|
||||||
],
|
|
||||||
[getString]
|
|
||||||
)
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.main}>
|
<Container className={css.main}>
|
||||||
<Layout.Horizontal spacing="medium">
|
<Layout.Horizontal spacing="medium">
|
||||||
|
|
||||||
<SearchInputWithSpinner
|
<SearchInputWithSpinner
|
||||||
loading={loading}
|
loading={loading}
|
||||||
query={searchTerm}
|
query={searchTerm}
|
||||||
|
@ -57,4 +57,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,32 +5,31 @@ import {
|
|||||||
TableV2 as Table,
|
TableV2 as Table,
|
||||||
Text,
|
Text,
|
||||||
Avatar,
|
Avatar,
|
||||||
Tag,
|
|
||||||
Intent,
|
Intent,
|
||||||
useToaster,
|
useToaster,
|
||||||
ButtonVariation
|
|
||||||
} from '@harness/uicore'
|
} from '@harness/uicore'
|
||||||
import type { CellProps, Column } from 'react-table'
|
import type { CellProps, Column } from 'react-table'
|
||||||
import { Link, useHistory } from 'react-router-dom'
|
import { Link, useHistory } from 'react-router-dom'
|
||||||
import cx from 'classnames'
|
import cx from 'classnames'
|
||||||
import Keywords from 'react-keywords'
|
import Keywords from 'react-keywords'
|
||||||
import { useMutate } from 'restful-react'
|
import { useMutate } from 'restful-react'
|
||||||
|
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 {
|
import type {
|
||||||
OpenapiCalculateCommitDivergenceRequest,
|
OpenapiCalculateCommitDivergenceRequest,
|
||||||
RepoBranch,
|
RepoBranch,
|
||||||
RepoCommitDivergence,
|
RepoCommitDivergence,
|
||||||
TypesRepository
|
TypesRepository
|
||||||
} from 'services/code'
|
} from 'services/code'
|
||||||
import { formatDate, getErrorMessage } 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'
|
||||||
import { CommitDivergence } from 'components/CommitDivergence/CommitDivergence'
|
import { useCreateBranchModal } from 'components/CreateBranchModal/CreateBranchModal'
|
||||||
import { CodeIcon, makeDiffRefs } from 'utils/GitUtils'
|
|
||||||
import css from './TagsContent.module.scss'
|
|
||||||
import { CreateBranchModalButton, useCreateBranchModal } from 'components/CreateBranchModal/CreateBranchModal'
|
|
||||||
import { CommitActions } from 'components/CommitActions/CommitActions'
|
import { CommitActions } from 'components/CommitActions/CommitActions'
|
||||||
|
import { CodeIcon } from 'utils/GitUtils'
|
||||||
|
import css from './TagsContent.module.scss'
|
||||||
|
|
||||||
interface TagsContentProps {
|
interface TagsContentProps {
|
||||||
searchTerm?: string
|
searchTerm?: string
|
||||||
@ -63,7 +62,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [getBranchDivergence, branchDivergenceRequestBody])
|
}, [getBranchDivergence, branchDivergenceRequestBody])
|
||||||
const onSuccess = () => {}
|
const onSuccess = voidFn(noop)
|
||||||
const openModal = useCreateBranchModal({ repoMetadata, onSuccess })
|
const openModal = useCreateBranchModal({ repoMetadata, onSuccess })
|
||||||
|
|
||||||
const columns: Column<RepoBranch>[] = useMemo(
|
const columns: Column<RepoBranch>[] = useMemo(
|
||||||
|
Loading…
Reference in New Issue
Block a user