mirror of
https://github.com/harness/drone.git
synced 2025-05-30 19:23:07 +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(
|
||||
event => {
|
||||
const { target } = event
|
||||
|
||||
const imageArray = source.split('\n').filter(string => string.includes('![image]'))
|
||||
const imgPattern = /!\[.*?\]\((.*?)\)/;
|
||||
const imageArray = source.split('\n').filter(string => imgPattern.test(string))
|
||||
const imageStringArray = imageArray.map(string => {
|
||||
const imageSrc = string.split('![image]')[1]
|
||||
return imageSrc.slice(1, imageSrc.length - 1)
|
||||
const match = string.match(imgPattern);
|
||||
return match ? match[1] : '';
|
||||
})
|
||||
|
||||
setImageEvent(imageStringArray)
|
||||
|
@ -40,7 +40,7 @@ export const ResourceListingPagination: React.FC<ResourceListingPaginationProps>
|
||||
setPage(_page)
|
||||
updateQueryParams({ page: _page.toString() })
|
||||
},
|
||||
[setPage, scrollTop]
|
||||
[setPage, scrollTop] // eslint-disable-line react-hooks/exhaustive-deps
|
||||
)
|
||||
|
||||
return totalItems ? (
|
||||
|
@ -54,7 +54,7 @@ export default function PullRequests() {
|
||||
|
||||
useEffect(() => {
|
||||
updateQueryParams({ page: page.toString() })
|
||||
}, [setPage])
|
||||
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata()
|
||||
const {
|
||||
|
@ -60,7 +60,7 @@ export default function RepositoriesListing() {
|
||||
useEffect(() => {
|
||||
setSearchTerm(undefined)
|
||||
updateQueryParams({ page: page.toString() })
|
||||
}, [space, setPage])
|
||||
}, [space, setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const columns: Column<TypesRepository>[] = useMemo(
|
||||
() => [
|
||||
|
@ -29,10 +29,10 @@ import { useCommitModal } from 'components/CommitModalButton/CommitModalButton'
|
||||
import { useStrings } from 'framework/strings'
|
||||
import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton'
|
||||
import { PlainButton } from 'components/PlainButton/PlainButton'
|
||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||
import { Readme } from '../FolderContent/Readme'
|
||||
import { GitBlame } from './GitBlame'
|
||||
import css from './FileContent.module.scss'
|
||||
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
|
||||
|
||||
enum FileSection {
|
||||
CONTENT = 'content',
|
||||
@ -104,7 +104,7 @@ export function FileContent({
|
||||
return { disabled: perms.disabled, tooltip: perms.tooltip }
|
||||
}
|
||||
return { disabled: isRefATag(gitRef) || false, tooltip: undefined }
|
||||
}, [permPushResult, gitRef])
|
||||
}, [permPushResult, gitRef]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
return (
|
||||
<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: (gitRef && isRefATag(gitRef)) || false, tooltip: undefined }
|
||||
}, [permPushResult, gitRef])
|
||||
}, [permPushResult, gitRef]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
return (
|
||||
<Container
|
||||
|
@ -45,7 +45,7 @@ export function RepositoryBranchesContent({ repoMetadata }: Pick<GitInfoProps, '
|
||||
|
||||
useEffect(() => {
|
||||
updateQueryParams({ page: page.toString() })
|
||||
}, [setPage])
|
||||
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
useShowRequestError(error)
|
||||
|
||||
|
@ -44,7 +44,7 @@ export default function RepositoryCommits() {
|
||||
|
||||
useEffect(() => {
|
||||
updateQueryParams({ page: page.toString() })
|
||||
}, [setPage])
|
||||
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
return (
|
||||
<Container className={css.main}>
|
||||
|
@ -2,10 +2,9 @@ import React, { useEffect, useState } from 'react'
|
||||
import { Container } from '@harness/uicore'
|
||||
import { useGet } from 'restful-react'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { noop } from 'lodash-es'
|
||||
import type { RepoCommitTag } from 'services/code'
|
||||
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 { useUpdateQueryParams } from 'hooks/useUpdateQueryParams'
|
||||
import { useAppContext } from 'AppContext'
|
||||
@ -51,7 +50,7 @@ export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repo
|
||||
|
||||
useEffect(() => {
|
||||
updateQueryParams({ page: page.toString() })
|
||||
}, [setPage])
|
||||
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
useShowRequestError(error)
|
||||
const space = useGetSpaceParam()
|
||||
|
@ -201,7 +201,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
||||
}
|
||||
}
|
||||
],
|
||||
[
|
||||
[ // eslint-disable-line react-hooks/exhaustive-deps
|
||||
getString,
|
||||
repoMetadata.default_branch,
|
||||
repoMetadata.path,
|
||||
@ -210,7 +210,7 @@ export function TagsContent({ repoMetadata, searchTerm = '', branches, onDeleteS
|
||||
history,
|
||||
onDeleteSuccess,
|
||||
divergence
|
||||
]
|
||||
] // eslint-disable-line react-hooks/exhaustive-deps
|
||||
)
|
||||
|
||||
return (
|
||||
|
@ -70,7 +70,7 @@ export default function Webhooks() {
|
||||
})
|
||||
useEffect(() => {
|
||||
updateQueryParams({ page: page.toString() })
|
||||
}, [setPage])
|
||||
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||
|
||||
const columns: Column<OpenapiWebhookType>[] = useMemo(
|
||||
() => [
|
||||
|
Loading…
x
Reference in New Issue
Block a user