mirror of
https://github.com/harness/drone.git
synced 2025-05-12 23:20:10 +08:00
bug fixes
This commit is contained in:
parent
a96a55a75e
commit
2d918e1278
@ -10,7 +10,8 @@ import {
|
||||
FormInput,
|
||||
FlexExpander,
|
||||
Text,
|
||||
Checkbox
|
||||
Checkbox,
|
||||
ButtonVariation
|
||||
} from '@harnessio/uicore'
|
||||
import { Icon } from '@harnessio/icons'
|
||||
import { FontVariation, Intent } from '@harnessio/design-system'
|
||||
@ -85,7 +86,7 @@ export const NewTriggerModalButton: React.FC<NewTriggerModalButtonProps> = ({
|
||||
onClose={hideModal}
|
||||
title={modalTitle}
|
||||
style={{ width: 700, maxHeight: '95vh', overflow: 'auto' }}>
|
||||
<Layout.Vertical padding={'large'} style={{ height: '100%' }} data-testid="add-trigger-modal">
|
||||
<Layout.Vertical padding={{ top: 'xsmall' }} style={{ height: '100%' }} data-testid="add-trigger-modal">
|
||||
<Container>
|
||||
<Formik
|
||||
initialValues={formInitialValues}
|
||||
@ -138,9 +139,19 @@ export const NewTriggerModalButton: React.FC<NewTriggerModalButtonProps> = ({
|
||||
</Container>
|
||||
))}
|
||||
</Container>
|
||||
<Layout.Horizontal spacing="small" padding={{ top: 'large' }} style={{ alignItems: 'center' }}>
|
||||
<Button type="submit" text={getString('create')} intent={Intent.PRIMARY} disabled={loading} />
|
||||
<Button text={cancelButtonTitle || getString('cancel')} minimal onClick={hideModal} />
|
||||
<Layout.Horizontal spacing="small" padding={{ top: 'xlarge' }} style={{ alignItems: 'center' }}>
|
||||
<Button
|
||||
type="submit"
|
||||
text={getString('create')}
|
||||
variation={ButtonVariation.PRIMARY}
|
||||
disabled={loading}
|
||||
/>
|
||||
<Button
|
||||
text={cancelButtonTitle || getString('cancel')}
|
||||
variation={ButtonVariation.SECONDARY}
|
||||
minimal
|
||||
onClick={hideModal}
|
||||
/>
|
||||
<FlexExpander />
|
||||
{loading && <Icon intent={Intent.PRIMARY} name="steps-spinner" size={16} />}
|
||||
</Layout.Horizontal>
|
||||
|
@ -147,6 +147,10 @@ const TriggerDetails = ({
|
||||
disabled: initialDisabled
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <LoadingSpinner visible={true} />
|
||||
}
|
||||
|
||||
return (
|
||||
<Layout.Vertical className={cx(css.generalContainer, css.editTriggerContainer)} padding={'large'}>
|
||||
<Formik
|
||||
@ -281,9 +285,12 @@ const PipelineTriggersTabs = ({ repoPath, pipeline }: PipelineTriggersTabsProps)
|
||||
|
||||
const [selectedTrigger, setSelectedTrigger] = React.useState<number>(0)
|
||||
|
||||
if (loading) {
|
||||
return <LoadingSpinner visible={true} />
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<LoadingSpinner visible={loading} />
|
||||
<Layout.Horizontal padding={'large'}>
|
||||
<Layout.Vertical padding={'large'}>
|
||||
<NewTriggerModalButton
|
||||
|
@ -52,7 +52,14 @@ export function RepositoryPageHeader({
|
||||
{extraBreadcrumbLinks.map(link => (
|
||||
<Fragment key={link.url}>
|
||||
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
||||
{/* This allows for outer most entities to not necessarily be links */}
|
||||
{link.url ? (
|
||||
<Link to={link.url}>{link.label}</Link>
|
||||
) : (
|
||||
<Text font={{ variation: FontVariation.SMALL }} color={Color.GREY_500}>
|
||||
{link.label}
|
||||
</Text>
|
||||
)}
|
||||
</Fragment>
|
||||
))}
|
||||
</Layout.Horizontal>
|
||||
|
@ -61,7 +61,11 @@ const useRunPipelineModal = () => {
|
||||
hideModal()
|
||||
})
|
||||
.catch(error => {
|
||||
showError(getErrorMessage(error), 0, 'pipelines.executionCouldNotStart')
|
||||
const errorMssg = getErrorMessage(error)
|
||||
const pipelineDoesNotExistOnGit = errorMssg === getString('pipelines.failedToFindPath')
|
||||
pipelineDoesNotExistOnGit
|
||||
? showError(`${getString('pipelines.executionCouldNotStart')}, ${errorMssg}.`)
|
||||
: showError(getErrorMessage(error), 0, 'pipelines.executionCouldNotStart')
|
||||
})
|
||||
} catch (exception) {
|
||||
showError(getErrorMessage(exception), 0, 'pipelines.executionCouldNotStart')
|
||||
|
@ -403,6 +403,7 @@ export interface StringsMap {
|
||||
'pipelines.executionCouldNotStart': string
|
||||
'pipelines.executionStarted': string
|
||||
'pipelines.failedToCreatePipeline': string
|
||||
'pipelines.failedToFindPath': string
|
||||
'pipelines.failedToUpdatePipeline': string
|
||||
'pipelines.lastExecution': string
|
||||
'pipelines.name': string
|
||||
@ -561,6 +562,7 @@ export interface StringsMap {
|
||||
searchBranches: string
|
||||
searchResult: string
|
||||
secret: string
|
||||
'secrets.create': string
|
||||
'secrets.createSecret': string
|
||||
'secrets.createSuccess': string
|
||||
'secrets.deleteSecret': string
|
||||
|
@ -650,7 +650,7 @@ pipelines:
|
||||
created: Pipeline created successfully
|
||||
updated: Pipeline updated successfully
|
||||
executionStarted: Pipeline execution started successfully
|
||||
executionCouldNotStart: Failure while starting Pipeline execution
|
||||
executionCouldNotStart: Failure while starting pipeline execution
|
||||
deletePipelineWarning: This will permanently delete the {{pipeline}} pipeline and all executions.
|
||||
deletePipelineButton: Delete pipeline
|
||||
deletePipelineConfirm: Are you sure you want to delete the pipeline <strong>{{pipeline}}</strong>? You can't undo this action.
|
||||
@ -661,6 +661,7 @@ pipelines:
|
||||
settings: Pipeline Settings
|
||||
executionCancelled: Pipeline execution cancelled.
|
||||
executionCouldNotCancel: Failure while cancelling Pipeline execution.
|
||||
failedToFindPath: failed to find path
|
||||
executions:
|
||||
noData: There are no executions
|
||||
newExecutionButton: Run Pipeline
|
||||
@ -676,6 +677,7 @@ allCommits: All Commits
|
||||
secrets:
|
||||
noData: There are no secrets
|
||||
newSecretButton: New Secret
|
||||
create: Create a secret
|
||||
name: Secret Name
|
||||
failedToCreate: Failed to create Secret. Please try again.
|
||||
enterSecretName: Enter Secret name
|
||||
|
@ -1,21 +1,10 @@
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react'
|
||||
import { useGet, useMutate } from 'restful-react'
|
||||
import { Link, useParams } from 'react-router-dom'
|
||||
import { useParams } from 'react-router-dom'
|
||||
import { get, isEmpty, isUndefined, set } from 'lodash-es'
|
||||
import { parse, stringify } from 'yaml'
|
||||
import { Menu, PopoverPosition } from '@blueprintjs/core'
|
||||
import {
|
||||
Container,
|
||||
PageHeader,
|
||||
PageBody,
|
||||
Layout,
|
||||
ButtonVariation,
|
||||
Text,
|
||||
useToaster,
|
||||
SplitButton,
|
||||
Button
|
||||
} from '@harnessio/uicore'
|
||||
import { Icon } from '@harnessio/icons'
|
||||
import { Container, PageBody, Layout, ButtonVariation, Text, useToaster, SplitButton, Button } from '@harnessio/uicore'
|
||||
import { Color, FontVariation } from '@harnessio/design-system'
|
||||
import type { OpenapiCommitFilesRequest, RepoCommitFilesResponse, RepoFileContent, TypesPipeline } from 'services/code'
|
||||
import { useStrings } from 'framework/strings'
|
||||
@ -34,6 +23,7 @@ import pipelineSchemaV0 from './schema/pipeline-schema-v0.json'
|
||||
import { V1_SCHEMA_YAML_FILE_REGEX, YamlVersion } from './Constants'
|
||||
|
||||
import css from './AddUpdatePipeline.module.scss'
|
||||
import { RepositoryPageHeader } from 'components/RepositoryPageHeader/RepositoryPageHeader'
|
||||
|
||||
const StarterPipelineV1: Record<string, any> = {
|
||||
version: 1,
|
||||
@ -334,16 +324,25 @@ const AddUpdatePipeline = (): JSX.Element => {
|
||||
return (
|
||||
<>
|
||||
<Container className={css.main}>
|
||||
<PageHeader
|
||||
title={getString('pipelines.editPipeline', { pipeline })}
|
||||
breadcrumbs={
|
||||
<Container className={css.header}>
|
||||
<Layout.Horizontal spacing="small" className={css.breadcrumb}>
|
||||
<Link to={routes.toCODEPipelines({ repoPath })}>{getString('pageTitle.pipelines')}</Link>
|
||||
<Icon name="main-chevron-right" size={8} color={Color.GREY_500} />
|
||||
<Text font={{ size: 'small' }}>{pipeline}</Text>
|
||||
</Layout.Horizontal>
|
||||
</Container>
|
||||
<RepositoryPageHeader
|
||||
repoMetadata={repoMetadata}
|
||||
title={getString('pageTitle.executions')}
|
||||
dataTooltipId="repositoryExecutions"
|
||||
extraBreadcrumbLinks={
|
||||
repoMetadata && [
|
||||
{
|
||||
label: getString('pageTitle.pipelines'),
|
||||
url: routes.toCODEPipelines({ repoPath: repoMetadata.path as string })
|
||||
},
|
||||
...(pipeline
|
||||
? [
|
||||
{
|
||||
label: pipeline,
|
||||
url: ''
|
||||
}
|
||||
]
|
||||
: [])
|
||||
]
|
||||
}
|
||||
content={<Layout.Horizontal flex={{ justifyContent: 'space-between' }}>{renderCTA()}</Layout.Horizontal>}
|
||||
/>
|
||||
|
@ -55,7 +55,7 @@ const SecretList = () => {
|
||||
const NewSecretButton = (
|
||||
<NewSecretModalButton
|
||||
space={space}
|
||||
modalTitle={getString('secrets.newSecretButton')}
|
||||
modalTitle={getString('secrets.create')}
|
||||
text={getString('secrets.newSecretButton')}
|
||||
variation={ButtonVariation.PRIMARY}
|
||||
icon="plus"
|
||||
|
Loading…
Reference in New Issue
Block a user