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