mirror of
https://github.com/harness/drone.git
synced 2025-05-09 00:41:18 +08:00
fix: [code-886]: fix repo settings (#602)
This commit is contained in:
parent
f866dc3ab1
commit
ab3ce4bfed
@ -10,6 +10,7 @@ import {
|
|||||||
ButtonSize,
|
ButtonSize,
|
||||||
TextInput
|
TextInput
|
||||||
} from '@harnessio/uicore'
|
} from '@harnessio/uicore'
|
||||||
|
import cx from 'classnames'
|
||||||
import { Color, Intent } from '@harnessio/design-system'
|
import { Color, Intent } from '@harnessio/design-system'
|
||||||
import { useMutate } from 'restful-react'
|
import { useMutate } from 'restful-react'
|
||||||
import { ACCESS_MODES, permissionProps, voidFn } from 'utils/Utils'
|
import { ACCESS_MODES, permissionProps, voidFn } from 'utils/Utils'
|
||||||
@ -85,14 +86,14 @@ const GeneralSettingsContent = (props: GeneralSettingsProps) => {
|
|||||||
</Container>
|
</Container>
|
||||||
</Layout.Horizontal>
|
</Layout.Horizontal>
|
||||||
<Layout.Horizontal>
|
<Layout.Horizontal>
|
||||||
<Container className={css.label}>
|
<Container className={cx(css.label, css.descText)}>
|
||||||
<Text color={Color.GREY_600} font={{ size: 'small' }}>
|
<Text color={Color.GREY_600} font={{ size: 'small' }}>
|
||||||
{getString('description')}
|
{getString('description')}
|
||||||
</Text>
|
</Text>
|
||||||
</Container>
|
</Container>
|
||||||
<Container className={css.content}>
|
<Container className={css.content}>
|
||||||
{editDesc === ACCESS_MODES.EDIT ? (
|
{editDesc === ACCESS_MODES.EDIT ? (
|
||||||
<Layout.Horizontal>
|
<Layout.Horizontal className={css.editContainer}>
|
||||||
<TextInput
|
<TextInput
|
||||||
className={css.textContainer}
|
className={css.textContainer}
|
||||||
onChange={evt => {
|
onChange={evt => {
|
||||||
|
@ -61,12 +61,17 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.label {
|
.label {
|
||||||
width: 30%;
|
padding-top: var(--spacing-xsmall);
|
||||||
|
width: 120px;
|
||||||
padding-right: var(--spacing-medium);
|
padding-right: var(--spacing-medium);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.descText {
|
||||||
|
align-self: center !important;
|
||||||
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
width: 70%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.deleteContainer {
|
.deleteContainer {
|
||||||
@ -82,6 +87,12 @@
|
|||||||
width: 80%;
|
width: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.editContainer {
|
||||||
|
:global(.TextInput--main) {
|
||||||
|
margin-bottom: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.buttonContainer {
|
.buttonContainer {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
padding-top: var(--spacing-xsmall) !important;
|
padding-top: var(--spacing-xsmall) !important;
|
||||||
|
@ -5,6 +5,8 @@ export declare const buttonContainer: string
|
|||||||
export declare const content: string
|
export declare const content: string
|
||||||
export declare const contentContainer: string
|
export declare const contentContainer: string
|
||||||
export declare const deleteContainer: string
|
export declare const deleteContainer: string
|
||||||
|
export declare const descText: string
|
||||||
|
export declare const editContainer: string
|
||||||
export declare const generalContainer: string
|
export declare const generalContainer: string
|
||||||
export declare const label: string
|
export declare const label: string
|
||||||
export declare const main: string
|
export declare const main: string
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
import { PageBody, Container, Tabs } from '@harnessio/uicore'
|
import { PageBody, Container } from '@harnessio/uicore'
|
||||||
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
|
|
||||||
@ -10,15 +10,9 @@ import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
|||||||
import GeneralSettingsContent from './GeneralSettingsContent/GeneralSettingsContent'
|
import GeneralSettingsContent from './GeneralSettingsContent/GeneralSettingsContent'
|
||||||
import css from './RepositorySettings.module.scss'
|
import css from './RepositorySettings.module.scss'
|
||||||
|
|
||||||
enum SettingsTab {
|
|
||||||
webhooks = 'webhooks',
|
|
||||||
general = 'general'
|
|
||||||
}
|
|
||||||
export default function RepositorySettings() {
|
export default function RepositorySettings() {
|
||||||
const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata()
|
const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata()
|
||||||
|
|
||||||
const [activeTab, setActiveTab] = React.useState<string>(SettingsTab.general)
|
|
||||||
|
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
return (
|
return (
|
||||||
<Container className={css.main}>
|
<Container className={css.main}>
|
||||||
@ -31,21 +25,7 @@ export default function RepositorySettings() {
|
|||||||
<LoadingSpinner visible={loading} />
|
<LoadingSpinner visible={loading} />
|
||||||
{repoMetadata && (
|
{repoMetadata && (
|
||||||
<Container className={css.main} padding={'large'}>
|
<Container className={css.main} padding={'large'}>
|
||||||
<Tabs
|
<GeneralSettingsContent repoMetadata={repoMetadata} refetch={refetch} />
|
||||||
id="SettingsTabs"
|
|
||||||
vertical
|
|
||||||
large={false}
|
|
||||||
defaultSelectedTabId={activeTab}
|
|
||||||
animate={false}
|
|
||||||
onChange={(id: string) => setActiveTab(id)}
|
|
||||||
tabList={[
|
|
||||||
{
|
|
||||||
id: SettingsTab.general,
|
|
||||||
title: getString('general'),
|
|
||||||
panel: <GeneralSettingsContent repoMetadata={repoMetadata} refetch={refetch} />,
|
|
||||||
iconProps: { name: 'cog' }
|
|
||||||
}
|
|
||||||
]}></Tabs>
|
|
||||||
</Container>
|
</Container>
|
||||||
)}
|
)}
|
||||||
</PageBody>
|
</PageBody>
|
||||||
|
Loading…
Reference in New Issue
Block a user