mirror of
https://github.com/harness/drone.git
synced 2025-05-17 09:30:00 +08:00
fix eslint errors
This commit is contained in:
parent
2f380f80ac
commit
c7714aafea
@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react'
|
|||||||
import { useHistory } from 'react-router-dom'
|
import { useHistory } from 'react-router-dom'
|
||||||
import { useMutate } from 'restful-react'
|
import { useMutate } from 'restful-react'
|
||||||
import * as yup from 'yup'
|
import * as yup from 'yup'
|
||||||
import { capitalize } from 'lodash'
|
import { capitalize } from 'lodash-es'
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
ButtonVariation,
|
ButtonVariation,
|
||||||
|
@ -2,10 +2,10 @@ import React, { useCallback, useEffect, useState } from 'react'
|
|||||||
import { Formik } from 'formik'
|
import { Formik } from 'formik'
|
||||||
import { capitalize, get } from 'lodash-es'
|
import { capitalize, get } from 'lodash-es'
|
||||||
import { useGet } from 'restful-react'
|
import { useGet } from 'restful-react'
|
||||||
import { useStrings } from 'framework/strings'
|
|
||||||
import { Button, ButtonVariation, Container, FormInput, FormikForm, Layout, Tab, Tabs, Text } from '@harnessio/uicore'
|
|
||||||
import { Color, FontVariation } from '@harnessio/design-system'
|
import { Color, FontVariation } from '@harnessio/design-system'
|
||||||
import { Icon, type IconName } from '@harnessio/icons'
|
import { Icon, type IconName } from '@harnessio/icons'
|
||||||
|
import { Button, ButtonVariation, Container, FormInput, FormikForm, Layout, Tab, Tabs, Text } from '@harnessio/uicore'
|
||||||
|
import { useStrings } from 'framework/strings'
|
||||||
import { LIST_FETCHING_LIMIT } from 'utils/Utils'
|
import { LIST_FETCHING_LIMIT } from 'utils/Utils'
|
||||||
import type { TypesPlugin } from 'services/code'
|
import type { TypesPlugin } from 'services/code'
|
||||||
import { YamlVersion } from 'pages/AddUpdatePipeline/Constants'
|
import { YamlVersion } from 'pages/AddUpdatePipeline/Constants'
|
||||||
@ -104,19 +104,19 @@ export const PluginsPanel = ({ version = YamlVersion.V0, onPluginAddUpdate }: Pl
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{PluginCategories.map((item: PluginInterface) => {
|
{PluginCategories.map((item: PluginInterface) => {
|
||||||
const { name, category, description, icon } = item
|
const { name, category: pluginCategory, description, icon } = item
|
||||||
return (
|
return (
|
||||||
<Layout.Horizontal
|
<Layout.Horizontal
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCategory(category)
|
setCategory(pluginCategory)
|
||||||
if (category === PluginCategory.Drone) {
|
if (pluginCategory === PluginCategory.Drone) {
|
||||||
setPanelView(PluginPanelView.Listing)
|
setPanelView(PluginPanelView.Listing)
|
||||||
} else if (category === PluginCategory.Harness) {
|
} else if (pluginCategory === PluginCategory.Harness) {
|
||||||
setPlugin({ uid: getString('run') })
|
setPlugin({ uid: getString('run') })
|
||||||
setPanelView(PluginPanelView.Configuration)
|
setPanelView(PluginPanelView.Configuration)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
key={category}
|
key={pluginCategory}
|
||||||
padding={{ left: 'medium', right: 'medium', top: 'medium', bottom: 'medium' }}
|
padding={{ left: 'medium', right: 'medium', top: 'medium', bottom: 'medium' }}
|
||||||
flex={{ justifyContent: 'flex-start' }}
|
flex={{ justifyContent: 'flex-start' }}
|
||||||
className={css.plugin}>
|
className={css.plugin}>
|
||||||
@ -160,8 +160,8 @@ export const PluginsPanel = ({ version = YamlVersion.V0, onPluginAddUpdate }: Pl
|
|||||||
</Text>
|
</Text>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
<Container>
|
<Container>
|
||||||
{plugins?.map((plugin: TypesPlugin) => {
|
{plugins?.map((_plugin: TypesPlugin) => {
|
||||||
const { uid, description } = plugin
|
const { uid, description } = _plugin
|
||||||
return (
|
return (
|
||||||
<Layout.Horizontal
|
<Layout.Horizontal
|
||||||
flex={{ justifyContent: 'flex-start' }}
|
flex={{ justifyContent: 'flex-start' }}
|
||||||
@ -169,8 +169,9 @@ export const PluginsPanel = ({ version = YamlVersion.V0, onPluginAddUpdate }: Pl
|
|||||||
className={css.plugin}
|
className={css.plugin}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setPanelView(PluginPanelView.Configuration)
|
setPanelView(PluginPanelView.Configuration)
|
||||||
setPlugin(plugin)
|
setPlugin(_plugin)
|
||||||
}}>
|
}}
|
||||||
|
key={uid}>
|
||||||
<Icon name={'gear'} size={25} />
|
<Icon name={'gear'} size={25} />
|
||||||
<Layout.Vertical padding={{ left: 'small' }}>
|
<Layout.Vertical padding={{ left: 'small' }}>
|
||||||
<Text font={{ variation: FontVariation.BODY2 }} color={Color.PRIMARY_7}>
|
<Text font={{ variation: FontVariation.BODY2 }} color={Color.PRIMARY_7}>
|
||||||
|
@ -2,7 +2,7 @@ import React, { useMemo, useState } from 'react'
|
|||||||
import { useHistory } from 'react-router'
|
import { useHistory } from 'react-router'
|
||||||
import { useMutate } from 'restful-react'
|
import { useMutate } from 'restful-react'
|
||||||
import * as yup from 'yup'
|
import * as yup from 'yup'
|
||||||
import { capitalize } from 'lodash'
|
import { capitalize } from 'lodash-es'
|
||||||
import { FontVariation } from '@harnessio/design-system'
|
import { FontVariation } from '@harnessio/design-system'
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
@ -118,9 +118,9 @@ const useRunPipelineModal = () => {
|
|||||||
}, [repo?.default_branch, pipeline])
|
}, [repo?.default_branch, pipeline])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
openModal: ({ repoMetadata, pipeline }: { repoMetadata: TypesRepository; pipeline: string }) => {
|
openModal: ({ repoMetadata, pipeline: pipelineUid }: { repoMetadata: TypesRepository; pipeline: string }) => {
|
||||||
setRepo(repoMetadata)
|
setRepo(repoMetadata)
|
||||||
setPipeline(pipeline)
|
setPipeline(pipelineUid)
|
||||||
openModal()
|
openModal()
|
||||||
},
|
},
|
||||||
hideModal
|
hideModal
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
||||||
import { useGet, useMutate } from 'restful-react'
|
import { useGet, useMutate } from 'restful-react'
|
||||||
import { Link, useParams } from 'react-router-dom'
|
import { Link, useParams } from 'react-router-dom'
|
||||||
import { get, isEmpty, isUndefined, set } from 'lodash'
|
import { get, isEmpty, isUndefined, set } from 'lodash-es'
|
||||||
import { stringify } from 'yaml'
|
import { stringify } from 'yaml'
|
||||||
import { Menu, PopoverPosition } from '@blueprintjs/core'
|
import { Menu, PopoverPosition } from '@blueprintjs/core'
|
||||||
import {
|
import {
|
||||||
@ -222,7 +222,9 @@ const AddUpdatePipeline = (): JSX.Element => {
|
|||||||
const updatedPipelineAsObj = updatePipeline(pluginFormData)
|
const updatedPipelineAsObj = updatePipeline(pluginFormData)
|
||||||
setPipelineAsObj(updatedPipelineAsObj)
|
setPipelineAsObj(updatedPipelineAsObj)
|
||||||
setPipelineAsYaml(stringify(updatedPipelineAsObj))
|
setPipelineAsYaml(stringify(updatedPipelineAsObj))
|
||||||
} catch (ex) {}
|
} catch (ex) {
|
||||||
|
// ignore exception
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderCTA = useCallback(() => {
|
const renderCTA = useCallback(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user