mirror of
https://github.com/harness/drone.git
synced 2025-05-31 11:43:15 +00:00
fix: [code-421]: fix image carousel and yarn checks
This commit is contained in:
parent
674dcc11d2
commit
742beda319
@ -24,11 +24,11 @@ export function MarkdownViewer({ source, className, maxHeight }: MarkdownViewerP
|
|||||||
const interceptClickEventOnViewerContainer = useCallback(
|
const interceptClickEventOnViewerContainer = useCallback(
|
||||||
event => {
|
event => {
|
||||||
const { target } = event
|
const { target } = event
|
||||||
|
const imgPattern = /!\[.*?\]\((.*?)\)/;
|
||||||
const imageArray = source.split('\n').filter(string => string.includes('![image]'))
|
const imageArray = source.split('\n').filter(string => imgPattern.test(string))
|
||||||
const imageStringArray = imageArray.map(string => {
|
const imageStringArray = imageArray.map(string => {
|
||||||
const imageSrc = string.split('![image]')[1]
|
const match = string.match(imgPattern);
|
||||||
return imageSrc.slice(1, imageSrc.length - 1)
|
return match ? match[1] : '';
|
||||||
})
|
})
|
||||||
|
|
||||||
setImageEvent(imageStringArray)
|
setImageEvent(imageStringArray)
|
||||||
|
@ -40,7 +40,7 @@ export const ResourceListingPagination: React.FC<ResourceListingPaginationProps>
|
|||||||
setPage(_page)
|
setPage(_page)
|
||||||
updateQueryParams({ page: _page.toString() })
|
updateQueryParams({ page: _page.toString() })
|
||||||
},
|
},
|
||||||
[setPage, scrollTop]
|
[setPage, scrollTop] // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
)
|
)
|
||||||
|
|
||||||
return totalItems ? (
|
return totalItems ? (
|
||||||
|
@ -54,7 +54,7 @@ export default function PullRequests() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateQueryParams({ page: page.toString() })
|
updateQueryParams({ page: page.toString() })
|
||||||
}, [setPage])
|
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata()
|
const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata()
|
||||||
const {
|
const {
|
||||||
|
@ -60,7 +60,7 @@ export default function RepositoriesListing() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setSearchTerm(undefined)
|
setSearchTerm(undefined)
|
||||||
updateQueryParams({ page: page.toString() })
|
updateQueryParams({ page: page.toString() })
|
||||||
}, [space, setPage])
|
}, [space, setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const columns: Column<TypesRepository>[] = useMemo(
|
const columns: Column<TypesRepository>[] = useMemo(
|
||||||
() => [
|
() => [
|
||||||
|
@ -29,10 +29,10 @@ import { useCommitModal } from 'components/CommitModalButton/CommitModalButton'
|
|||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||||
import { PlainButton } from 'components/PlainButton/PlainButton'
|
import { PlainButton } from 'components/PlainButton/PlainButton'
|
||||||
|
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||||
import { Readme } from '../FolderContent/Readme'
|
import { Readme } from '../FolderContent/Readme'
|
||||||
import { GitBlame } from './GitBlame'
|
import { GitBlame } from './GitBlame'
|
||||||
import css from './FileContent.module.scss'
|
import css from './FileContent.module.scss'
|
||||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
|
||||||
|
|
||||||
enum FileSection {
|
enum FileSection {
|
||||||
CONTENT = 'content',
|
CONTENT = 'content',
|
||||||
@ -104,7 +104,7 @@ export function FileContent({
|
|||||||
return { disabled: perms.disabled, tooltip: perms.tooltip }
|
return { disabled: perms.disabled, tooltip: perms.tooltip }
|
||||||
}
|
}
|
||||||
return { disabled: isRefATag(gitRef) || false, tooltip: undefined }
|
return { disabled: isRefATag(gitRef) || false, tooltip: undefined }
|
||||||
}, [permPushResult, gitRef])
|
}, [permPushResult, gitRef]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.tabsContainer}>
|
<Container className={css.tabsContainer}>
|
||||||
|
@ -64,7 +64,7 @@ function ReadmeViewer({ metadata, gitRef, readmeInfo, contentOnly, maxWidth }: F
|
|||||||
return { disabled: perms.disabled, tooltip: perms.tooltip }
|
return { disabled: perms.disabled, tooltip: perms.tooltip }
|
||||||
}
|
}
|
||||||
return { disabled: (gitRef && isRefATag(gitRef)) || false, tooltip: undefined }
|
return { disabled: (gitRef && isRefATag(gitRef)) || false, tooltip: undefined }
|
||||||
}, [permPushResult, gitRef])
|
}, [permPushResult, gitRef]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container
|
<Container
|
||||||
|
@ -45,7 +45,7 @@ export function RepositoryBranchesContent({ repoMetadata }: Pick<GitInfoProps, '
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateQueryParams({ page: page.toString() })
|
updateQueryParams({ page: page.toString() })
|
||||||
}, [setPage])
|
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
useShowRequestError(error)
|
useShowRequestError(error)
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ export default function RepositoryCommits() {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateQueryParams({ page: page.toString() })
|
updateQueryParams({ page: page.toString() })
|
||||||
}, [setPage])
|
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container className={css.main}>
|
<Container className={css.main}>
|
||||||
|
@ -2,10 +2,9 @@ import React, { useEffect, 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 { noop } from 'lodash-es'
|
|
||||||
import type { RepoCommitTag } from 'services/code'
|
import type { RepoCommitTag } from 'services/code'
|
||||||
import { usePageIndex } from 'hooks/usePageIndex'
|
import { usePageIndex } from 'hooks/usePageIndex'
|
||||||
import { LIST_FETCHING_LIMIT, permissionProps, voidFn,PageBrowserProps } from 'utils/Utils'
|
import { LIST_FETCHING_LIMIT, permissionProps,PageBrowserProps } from 'utils/Utils'
|
||||||
import { useQueryParams } from 'hooks/useQueryParams'
|
import { useQueryParams } from 'hooks/useQueryParams'
|
||||||
import { useUpdateQueryParams } from 'hooks/useUpdateQueryParams'
|
import { useUpdateQueryParams } from 'hooks/useUpdateQueryParams'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
@ -51,7 +50,7 @@ export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repo
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateQueryParams({ page: page.toString() })
|
updateQueryParams({ page: page.toString() })
|
||||||
}, [setPage])
|
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
useShowRequestError(error)
|
useShowRequestError(error)
|
||||||
const space = useGetSpaceParam()
|
const space = useGetSpaceParam()
|
||||||
|
@ -201,7 +201,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
[
|
[ // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
getString,
|
getString,
|
||||||
repoMetadata.default_branch,
|
repoMetadata.default_branch,
|
||||||
repoMetadata.path,
|
repoMetadata.path,
|
||||||
@ -210,7 +210,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
|||||||
history,
|
history,
|
||||||
onDeleteSuccess,
|
onDeleteSuccess,
|
||||||
divergence
|
divergence
|
||||||
]
|
] // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
)
|
)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -70,7 +70,7 @@ export default function Webhooks() {
|
|||||||
})
|
})
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
updateQueryParams({ page: page.toString() })
|
updateQueryParams({ page: page.toString() })
|
||||||
}, [setPage])
|
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const columns: Column<OpenapiWebhookType>[] = useMemo(
|
const columns: Column<OpenapiWebhookType>[] = useMemo(
|
||||||
() => [
|
() => [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user