mirror of
https://github.com/harness/drone.git
synced 2025-05-17 01:20:13 +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 { useMutate } from 'restful-react'
|
||||
import * as yup from 'yup'
|
||||
import { capitalize } from 'lodash'
|
||||
import { capitalize } from 'lodash-es'
|
||||
import {
|
||||
Button,
|
||||
ButtonVariation,
|
||||
|
@ -2,10 +2,10 @@ import React, { useCallback, useEffect, useState } from 'react'
|
||||
import { Formik } from 'formik'
|
||||
import { capitalize, get } from 'lodash-es'
|
||||
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 { 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 type { TypesPlugin } from 'services/code'
|
||||
import { YamlVersion } from 'pages/AddUpdatePipeline/Constants'
|
||||
@ -104,19 +104,19 @@ export const PluginsPanel = ({ version = YamlVersion.V0, onPluginAddUpdate }: Pl
|
||||
return (
|
||||
<>
|
||||
{PluginCategories.map((item: PluginInterface) => {
|
||||
const { name, category, description, icon } = item
|
||||
const { name, category: pluginCategory, description, icon } = item
|
||||
return (
|
||||
<Layout.Horizontal
|
||||
onClick={() => {
|
||||
setCategory(category)
|
||||
if (category === PluginCategory.Drone) {
|
||||
setCategory(pluginCategory)
|
||||
if (pluginCategory === PluginCategory.Drone) {
|
||||
setPanelView(PluginPanelView.Listing)
|
||||
} else if (category === PluginCategory.Harness) {
|
||||
} else if (pluginCategory === PluginCategory.Harness) {
|
||||
setPlugin({ uid: getString('run') })
|
||||
setPanelView(PluginPanelView.Configuration)
|
||||
}
|
||||
}}
|
||||
key={category}
|
||||
key={pluginCategory}
|
||||
padding={{ left: 'medium', right: 'medium', top: 'medium', bottom: 'medium' }}
|
||||
flex={{ justifyContent: 'flex-start' }}
|
||||
className={css.plugin}>
|
||||
@ -160,8 +160,8 @@ export const PluginsPanel = ({ version = YamlVersion.V0, onPluginAddUpdate }: Pl
|
||||
</Text>
|
||||
</Layout.Horizontal>
|
||||
<Container>
|
||||
{plugins?.map((plugin: TypesPlugin) => {
|
||||
const { uid, description } = plugin
|
||||
{plugins?.map((_plugin: TypesPlugin) => {
|
||||
const { uid, description } = _plugin
|
||||
return (
|
||||
<Layout.Horizontal
|
||||
flex={{ justifyContent: 'flex-start' }}
|
||||
@ -169,8 +169,9 @@ export const PluginsPanel = ({ version = YamlVersion.V0, onPluginAddUpdate }: Pl
|
||||
className={css.plugin}
|
||||
onClick={() => {
|
||||
setPanelView(PluginPanelView.Configuration)
|
||||
setPlugin(plugin)
|
||||
}}>
|
||||
setPlugin(_plugin)
|
||||
}}
|
||||
key={uid}>
|
||||
<Icon name={'gear'} size={25} />
|
||||
<Layout.Vertical padding={{ left: 'small' }}>
|
||||
<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 { useMutate } from 'restful-react'
|
||||
import * as yup from 'yup'
|
||||
import { capitalize } from 'lodash'
|
||||
import { capitalize } from 'lodash-es'
|
||||
import { FontVariation } from '@harnessio/design-system'
|
||||
import {
|
||||
Button,
|
||||
@ -118,9 +118,9 @@ const useRunPipelineModal = () => {
|
||||
}, [repo?.default_branch, pipeline])
|
||||
|
||||
return {
|
||||
openModal: ({ repoMetadata, pipeline }: { repoMetadata: TypesRepository; pipeline: string }) => {
|
||||
openModal: ({ repoMetadata, pipeline: pipelineUid }: { repoMetadata: TypesRepository; pipeline: string }) => {
|
||||
setRepo(repoMetadata)
|
||||
setPipeline(pipeline)
|
||||
setPipeline(pipelineUid)
|
||||
openModal()
|
||||
},
|
||||
hideModal
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
||||
import { useGet, useMutate } from 'restful-react'
|
||||
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 { Menu, PopoverPosition } from '@blueprintjs/core'
|
||||
import {
|
||||
@ -222,7 +222,9 @@ const AddUpdatePipeline = (): JSX.Element => {
|
||||
const updatedPipelineAsObj = updatePipeline(pluginFormData)
|
||||
setPipelineAsObj(updatedPipelineAsObj)
|
||||
setPipelineAsYaml(stringify(updatedPipelineAsObj))
|
||||
} catch (ex) {}
|
||||
} catch (ex) {
|
||||
// ignore exception
|
||||
}
|
||||
}
|
||||
|
||||
const renderCTA = useCallback(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user