mirror of
https://github.com/harness/drone.git
synced 2025-05-09 17:42:13 +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
|
||||
}
|
||||
|
||||
export const pathProps: Readonly<Omit<Required<CODEProps>, 'repoPath' | 'branch' | 'tags' >> = {
|
||||
export const pathProps: Readonly<Omit<Required<CODEProps>, 'repoPath' | 'branch' | 'tags'>> = {
|
||||
space: ':space',
|
||||
repoName: ':repoName',
|
||||
gitRef: ':gitRef*',
|
||||
|
@ -50,7 +50,7 @@ export function CommitsView({
|
||||
return (
|
||||
<Layout.Horizontal spacing="small" flex={{ alignItems: 'center' }} style={{ display: 'inline-flex' }}>
|
||||
<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}
|
||||
</Text>
|
||||
</Layout.Horizontal>
|
||||
|
@ -1,16 +1,15 @@
|
||||
.main {
|
||||
.title {
|
||||
--typography-size: 20px !important;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: var(--grey-600) !important;
|
||||
font-size: var(--form-input-font-size) !important;
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
.title {
|
||||
--typography-size: 20px !important;
|
||||
}
|
||||
|
||||
.label {
|
||||
color: var(--grey-600) !important;
|
||||
font-size: var(--form-input-font-size) !important;
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.extendedDescription textarea {
|
||||
height: 100px !important;
|
||||
}
|
||||
height: 100px !important;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import { get } from 'lodash-es'
|
||||
import { useModalHook } from '@harness/use-modal'
|
||||
import { useStrings } from 'framework/strings'
|
||||
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 type { RepoBranch } from 'services/code'
|
||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||
@ -112,7 +112,6 @@ export function useCreateTagModal({
|
||||
name: branchName,
|
||||
sourceBranch: suggestedSourceBranch,
|
||||
description: ''
|
||||
|
||||
}}
|
||||
formName="createGitTag"
|
||||
enableReinitialize={true}
|
||||
@ -156,7 +155,7 @@ export function useCreateTagModal({
|
||||
</Layout.Horizontal>
|
||||
</Container>
|
||||
<FormInput.TextArea
|
||||
label={getString('description')}
|
||||
label={getString('description')}
|
||||
className={css.extendedDescription}
|
||||
name="description"
|
||||
placeholder={getString('tagDescription')}
|
||||
|
@ -71,7 +71,10 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
|
||||
<Button variation={ButtonVariation.TERTIARY} size={ButtonSize.SMALL} text={'Add +'}></Button>
|
||||
</Layout.Horizontal>
|
||||
<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')}
|
||||
</Text>
|
||||
{reviewers && reviewers?.length !== 0 ? (
|
||||
@ -119,14 +122,12 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
|
||||
}
|
||||
)
|
||||
) : (
|
||||
<Text
|
||||
color={Color.GREY_300}
|
||||
font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
||||
<Text color={Color.GREY_300} font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
||||
{getString('noRequiredReviewers')}
|
||||
</Text>
|
||||
)}
|
||||
<Text
|
||||
className={css.semiBoldText}
|
||||
className={css.semiBoldText}
|
||||
padding={{ top: 'medium', bottom: 'medium' }}
|
||||
font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
||||
{getString('optional')}
|
||||
@ -174,9 +175,7 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => {
|
||||
)
|
||||
})
|
||||
) : (
|
||||
<Text
|
||||
color={Color.GREY_300}
|
||||
font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
||||
<Text color={Color.GREY_300} font={{ variation: FontVariation.BODY2_SEMI, size: 'small' }}>
|
||||
{getString('noOptionalReviewers')}
|
||||
</Text>
|
||||
)}
|
||||
|
@ -156,7 +156,7 @@ export default function PullRequests() {
|
||||
setSearchTerm(value)
|
||||
setPage(1)
|
||||
}}
|
||||
/>
|
||||
/>
|
||||
<Container padding="xlarge">
|
||||
<Match expr={data?.length}>
|
||||
<Truthy>
|
||||
|
@ -1,5 +1,4 @@
|
||||
.main {
|
||||
min-height: var(--page-min-height, 100%);
|
||||
background-color: var(--primary-bg) !important;
|
||||
}
|
||||
|
||||
min-height: var(--page-min-height, 100%);
|
||||
background-color: var(--primary-bg) !important;
|
||||
}
|
||||
|
@ -14,11 +14,7 @@ export default function RepositoryTags() {
|
||||
|
||||
return (
|
||||
<Container className={css.main}>
|
||||
<RepositoryPageHeader
|
||||
repoMetadata={repoMetadata}
|
||||
title={getString('tags')}
|
||||
dataTooltipId="repositoryTags"
|
||||
/>
|
||||
<RepositoryPageHeader repoMetadata={repoMetadata} title={getString('tags')} dataTooltipId="repositoryTags" />
|
||||
<PageBody error={getErrorMessage(error)} retryOnError={voidFn(refetch)}>
|
||||
<LoadingSpinner visible={loading} />
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
.resourceContent {
|
||||
background-color: var(--primary-bg);
|
||||
|
||||
.noData > div {
|
||||
height: calc(100vh - var(--page-header-height, 64px) - 120px) !important;
|
||||
}
|
||||
background-color: var(--primary-bg);
|
||||
|
||||
.noData > div {
|
||||
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 { useGet } from 'restful-react'
|
||||
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 { LIST_FETCHING_LIMIT } from 'utils/Utils'
|
||||
import { useAppContext } from 'AppContext'
|
||||
@ -10,10 +10,9 @@ import type { GitInfoProps } from 'utils/GitUtils'
|
||||
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
|
||||
import { useShowRequestError } from 'hooks/useShowRequestError'
|
||||
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 { TagsContent } from '../TagsContent/TagsContent'
|
||||
import css from './RepositoryTagsContent.module.scss'
|
||||
|
||||
export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repoMetadata'>) {
|
||||
const { routes } = useAppContext()
|
||||
|
@ -1,21 +1,20 @@
|
||||
.main {
|
||||
div[class*='TextInput'] {
|
||||
margin-bottom: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
|
||||
// input {
|
||||
// background: transparent !important;
|
||||
// border: none;
|
||||
// }
|
||||
}
|
||||
|
||||
> div {
|
||||
align-items: center;
|
||||
padding-bottom: var(--spacing-xlarge) !important;
|
||||
}
|
||||
div[class*='TextInput'] {
|
||||
margin-bottom: 0 !important;
|
||||
margin-left: 0 !important;
|
||||
|
||||
// input {
|
||||
// background: transparent !important;
|
||||
// border: none;
|
||||
// }
|
||||
}
|
||||
|
||||
.branchDropdown {
|
||||
background-color: var(--white);
|
||||
|
||||
> div {
|
||||
align-items: center;
|
||||
padding-bottom: var(--spacing-xlarge) !important;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.branchDropdown {
|
||||
background-color: var(--white);
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
import React, { useMemo, useState } from 'react'
|
||||
import { Container, Layout, FlexExpander, DropDown, ButtonVariation } from '@harness/uicore'
|
||||
import React, { useState } from 'react'
|
||||
import { Container, Layout, FlexExpander, ButtonVariation } from '@harness/uicore'
|
||||
import { useStrings } from 'framework/strings'
|
||||
import { GitBranchType, CodeIcon, GitInfoProps } from 'utils/GitUtils'
|
||||
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 css from './RepositoryTagsContentHeader.module.scss'
|
||||
|
||||
interface RepositoryTagsContentHeaderProps extends Pick<GitInfoProps, 'repoMetadata'> {
|
||||
loading?: boolean
|
||||
@ -16,39 +15,27 @@ interface RepositoryTagsContentHeaderProps extends Pick<GitInfoProps, 'repoMetad
|
||||
}
|
||||
|
||||
export function RepositoryTagsContentHeader({
|
||||
onBranchTypeSwitched,
|
||||
onSearchTermChanged,
|
||||
activeBranchType = GitBranchType.ALL,
|
||||
repoMetadata,
|
||||
onNewBranchCreated,
|
||||
loading
|
||||
}: RepositoryTagsContentHeaderProps) {
|
||||
const { getString } = useStrings()
|
||||
const [branchType, setBranchType] = useState(activeBranchType)
|
||||
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 (
|
||||
<Container className={css.main}>
|
||||
<Layout.Horizontal spacing="medium">
|
||||
|
||||
<SearchInputWithSpinner
|
||||
loading={loading}
|
||||
query={searchTerm}
|
||||
setQuery={value => {
|
||||
setSearchTerm(value)
|
||||
onSearchTermChanged(value)
|
||||
}}
|
||||
setSearchTerm(value)
|
||||
onSearchTermChanged(value)
|
||||
}}
|
||||
/>
|
||||
<FlexExpander />
|
||||
<FlexExpander />
|
||||
<CreateTagModalButton
|
||||
text={getString('createTag')}
|
||||
icon={CodeIcon.Add}
|
||||
|
@ -1,60 +1,60 @@
|
||||
.container {
|
||||
.table {
|
||||
background-color: var(--white) !important;
|
||||
|
||||
[class*='TableV2--header'] {
|
||||
box-shadow: 0px 0px 1px rgb(40 41 61 / 8%), 0px 0.5px 2px rgb(96 97 112 / 16%);
|
||||
border-bottom: 1px solid var(--grey-100);
|
||||
|
||||
[class*='variation-table-headers'] {
|
||||
text-transform: none;
|
||||
color: var(--grey-400);
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
.table {
|
||||
background-color: var(--white) !important;
|
||||
|
||||
[class*='TableV2--header'] {
|
||||
box-shadow: 0px 0px 1px rgb(40 41 61 / 8%), 0px 0.5px 2px rgb(96 97 112 / 16%);
|
||||
border-bottom: 1px solid var(--grey-100);
|
||||
|
||||
[class*='variation-table-headers'] {
|
||||
text-transform: none;
|
||||
color: var(--grey-400);
|
||||
font-weight: 500;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
justify-content: center;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0px;
|
||||
height: 40px;
|
||||
box-shadow: 0px 0px 1px rgba(40, 41, 61, 0.08), 0px 0.5px 2px rgba(96, 97, 112, 0.16);
|
||||
overflow: hidden;
|
||||
border-radius: 0;
|
||||
margin-bottom: 0;
|
||||
|
||||
&.odd {
|
||||
background-color: var(--grey-50);
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #0092e40a !important;
|
||||
}
|
||||
|
||||
.rowText {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
|
||||
&.defaultBranch .commitLink {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.row {
|
||||
justify-content: center;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0px;
|
||||
height: 40px;
|
||||
box-shadow: 0px 0px 1px rgba(40, 41, 61, 0.08), 0px 0.5px 2px rgba(96, 97, 112, 0.16);
|
||||
overflow: hidden;
|
||||
border-radius: 0;
|
||||
margin-bottom: 0;
|
||||
|
||||
&.odd {
|
||||
background-color: var(--grey-50);
|
||||
}
|
||||
|
||||
|
||||
.commitLink {
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
color: var(--black);
|
||||
|
||||
&:hover {
|
||||
background-color: #0092e40a !important;
|
||||
}
|
||||
|
||||
.rowText {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
|
||||
&.defaultBranch .commitLink {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
}
|
||||
}
|
||||
|
||||
.commitLink {
|
||||
font-weight: 400;
|
||||
font-size: 13px;
|
||||
color: var(--black);
|
||||
|
||||
&:hover {
|
||||
color: var(--primary-8);
|
||||
}
|
||||
color: var(--primary-8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,32 +5,31 @@ import {
|
||||
TableV2 as Table,
|
||||
Text,
|
||||
Avatar,
|
||||
Tag,
|
||||
Intent,
|
||||
useToaster,
|
||||
ButtonVariation
|
||||
} from '@harness/uicore'
|
||||
import type { CellProps, Column } from 'react-table'
|
||||
import { Link, useHistory } from 'react-router-dom'
|
||||
import cx from 'classnames'
|
||||
import Keywords from 'react-keywords'
|
||||
import { useMutate } from 'restful-react'
|
||||
import { noop } from 'lodash-es'
|
||||
import { String, useStrings } from 'framework/strings'
|
||||
import { useAppContext } from 'AppContext'
|
||||
|
||||
import type {
|
||||
OpenapiCalculateCommitDivergenceRequest,
|
||||
RepoBranch,
|
||||
RepoCommitDivergence,
|
||||
TypesRepository
|
||||
} from 'services/code'
|
||||
import { formatDate, getErrorMessage } from 'utils/Utils'
|
||||
import { formatDate, getErrorMessage, voidFn } from 'utils/Utils'
|
||||
import { useConfirmAction } from 'hooks/useConfirmAction'
|
||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||
import { CommitDivergence } from 'components/CommitDivergence/CommitDivergence'
|
||||
import { CodeIcon, makeDiffRefs } from 'utils/GitUtils'
|
||||
import css from './TagsContent.module.scss'
|
||||
import { CreateBranchModalButton, useCreateBranchModal } from 'components/CreateBranchModal/CreateBranchModal'
|
||||
import { useCreateBranchModal } from 'components/CreateBranchModal/CreateBranchModal'
|
||||
import { CommitActions } from 'components/CommitActions/CommitActions'
|
||||
import { CodeIcon } from 'utils/GitUtils'
|
||||
import css from './TagsContent.module.scss'
|
||||
|
||||
interface TagsContentProps {
|
||||
searchTerm?: string
|
||||
@ -63,7 +62,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
||||
})
|
||||
}
|
||||
}, [getBranchDivergence, branchDivergenceRequestBody])
|
||||
const onSuccess = () => {}
|
||||
const onSuccess = voidFn(noop)
|
||||
const openModal = useCreateBranchModal({ repoMetadata, onSuccess })
|
||||
|
||||
const columns: Column<RepoBranch>[] = useMemo(
|
||||
|
Loading…
Reference in New Issue
Block a user