mirror of
https://github.com/harness/drone.git
synced 2025-05-17 09:30:00 +08:00
Merge branch 'ui/nav-height-fix' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (#236)
This commit is contained in:
commit
c24d2d1795
@ -12,9 +12,7 @@ const { RetryChunkLoadPlugin } = require('webpack-retry-chunk-load-plugin')
|
|||||||
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
|
const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin')
|
||||||
const moduleFederationConfig = require('./moduleFederation.config')
|
const moduleFederationConfig = require('./moduleFederation.config')
|
||||||
const CONTEXT = process.cwd()
|
const CONTEXT = process.cwd()
|
||||||
|
|
||||||
const DEV = process.env.NODE_ENV === 'development'
|
const DEV = process.env.NODE_ENV === 'development'
|
||||||
const ON_PREM = `${process.env.ON_PREM}` === 'true'
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
target: 'web',
|
target: 'web',
|
||||||
@ -159,8 +157,7 @@ module.exports = {
|
|||||||
new ModuleFederationPlugin(moduleFederationConfig),
|
new ModuleFederationPlugin(moduleFederationConfig),
|
||||||
new DefinePlugin({
|
new DefinePlugin({
|
||||||
'process.env': '{}', // required for @blueprintjs/core
|
'process.env': '{}', // required for @blueprintjs/core
|
||||||
__DEV__: DEV,
|
__DEV__: DEV
|
||||||
__ON_PREM__: ON_PREM
|
|
||||||
}),
|
}),
|
||||||
new GenerateStringTypesPlugin(),
|
new GenerateStringTypesPlugin(),
|
||||||
new RetryChunkLoadPlugin({
|
new RetryChunkLoadPlugin({
|
||||||
|
@ -1,13 +1,15 @@
|
|||||||
const { merge } = require('webpack-merge')
|
const { merge } = require('webpack-merge')
|
||||||
|
const path = require('path')
|
||||||
const HTMLWebpackPlugin = require('html-webpack-plugin')
|
const HTMLWebpackPlugin = require('html-webpack-plugin')
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||||
const { DefinePlugin } = require('webpack')
|
const { DefinePlugin } = require('webpack')
|
||||||
|
|
||||||
const commonConfig = require('./webpack.common')
|
const commonConfig = require('./webpack.common')
|
||||||
|
const CONTEXT = process.cwd()
|
||||||
const ON_PREM = `${process.env.ON_PREM}` === 'true'
|
|
||||||
|
|
||||||
const prodConfig = {
|
const prodConfig = {
|
||||||
|
context: CONTEXT,
|
||||||
|
entry: path.resolve(CONTEXT, '/src/index.tsx'),
|
||||||
mode: 'production',
|
mode: 'production',
|
||||||
devtool: 'source-map',
|
devtool: 'source-map',
|
||||||
output: {
|
output: {
|
||||||
@ -39,9 +41,7 @@ const prodConfig = {
|
|||||||
filename: 'index.html',
|
filename: 'index.html',
|
||||||
favicon: 'src/favicon.svg',
|
favicon: 'src/favicon.svg',
|
||||||
minify: false,
|
minify: false,
|
||||||
templateParameters: {
|
templateParameters: {}
|
||||||
__ON_PREM__: ON_PREM
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
1
web/src/global.d.ts
vendored
1
web/src/global.d.ts
vendored
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
declare const __DEV__: boolean
|
declare const __DEV__: boolean
|
||||||
declare const __ON_PREM__: booelan
|
|
||||||
|
|
||||||
declare module '*.png' {
|
declare module '*.png' {
|
||||||
const value: string
|
const value: string
|
||||||
|
@ -12,10 +12,16 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
.profile {
|
.settings {
|
||||||
margin: 0 var(--spacing-medium);
|
margin: 0 var(--spacing-medium);
|
||||||
padding: var(--spacing-small) 0;
|
padding: var(--spacing-small) 0;
|
||||||
border-top: 1px solid var(--grey-200);
|
border-top: 1px solid var(--grey-200);
|
||||||
|
border-bottom: 1px solid var(--grey-200);
|
||||||
|
}
|
||||||
|
|
||||||
|
.profile {
|
||||||
|
margin: 0 var(--spacing-medium);
|
||||||
|
padding: var(--spacing-medium) 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -23,5 +29,6 @@
|
|||||||
.content {
|
.content {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
background-color: var(--page-background);
|
background-color: var(--page-background);
|
||||||
|
overflow: auto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
web/src/layouts/layout.module.scss.d.ts
vendored
1
web/src/layouts/layout.module.scss.d.ts
vendored
@ -4,6 +4,7 @@ declare const styles: {
|
|||||||
readonly main: string
|
readonly main: string
|
||||||
readonly layout: string
|
readonly layout: string
|
||||||
readonly menu: string
|
readonly menu: string
|
||||||
|
readonly settings: string
|
||||||
readonly profile: string
|
readonly profile: string
|
||||||
readonly content: string
|
readonly content: string
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { Avatar, Container, FlexExpander, Layout } from '@harness/uicore'
|
import { Avatar, Container, FlexExpander, Layout } from '@harness/uicore'
|
||||||
|
import { Render } from 'react-jsx-match'
|
||||||
import { routes } from 'RouteDefinitions'
|
import { routes } from 'RouteDefinitions'
|
||||||
import { useAppContext } from 'AppContext'
|
import { useAppContext } from 'AppContext'
|
||||||
|
import { useStrings } from 'framework/strings'
|
||||||
import { useDocumentTitle } from 'hooks/useDocumentTitle'
|
import { useDocumentTitle } from 'hooks/useDocumentTitle'
|
||||||
import { NavMenuItem } from './menu/NavMenuItem'
|
import { NavMenuItem } from './menu/NavMenuItem'
|
||||||
import { GitnessLogo } from '../components/GitnessLogo/GitnessLogo'
|
import { GitnessLogo } from '../components/GitnessLogo/GitnessLogo'
|
||||||
@ -15,6 +17,7 @@ interface LayoutWithSideNavProps {
|
|||||||
|
|
||||||
export const LayoutWithSideNav: React.FC<LayoutWithSideNavProps> = ({ title, children, menu = <DefaultMenu /> }) => {
|
export const LayoutWithSideNav: React.FC<LayoutWithSideNavProps> = ({ title, children, menu = <DefaultMenu /> }) => {
|
||||||
const { currentUser } = useAppContext()
|
const { currentUser } = useAppContext()
|
||||||
|
const { getString } = useStrings()
|
||||||
|
|
||||||
useDocumentTitle(title)
|
useDocumentTitle(title)
|
||||||
|
|
||||||
@ -29,6 +32,12 @@ export const LayoutWithSideNav: React.FC<LayoutWithSideNavProps> = ({ title, chi
|
|||||||
|
|
||||||
<FlexExpander />
|
<FlexExpander />
|
||||||
|
|
||||||
|
<Render when={currentUser?.admin}>
|
||||||
|
<Container className={css.settings}>
|
||||||
|
<NavMenuItem icon="user-groups" label={getString('userManagement.text')} to={routes.toCODEUsers()} />
|
||||||
|
</Container>
|
||||||
|
</Render>
|
||||||
|
|
||||||
<Container className={css.profile}>
|
<Container className={css.profile}>
|
||||||
<NavMenuItem
|
<NavMenuItem
|
||||||
label={currentUser?.display_name || currentUser?.email}
|
label={currentUser?.display_name || currentUser?.email}
|
||||||
|
@ -47,6 +47,11 @@
|
|||||||
padding-top: 3px;
|
padding-top: 3px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.repoLinks {
|
||||||
|
border-left: 1px solid var(--grey-200);
|
||||||
|
margin-left: 17px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.popoverPortal {
|
.popoverPortal {
|
||||||
|
@ -8,6 +8,7 @@ declare const styles: {
|
|||||||
readonly label: string
|
readonly label: string
|
||||||
readonly spaceLabel: string
|
readonly spaceLabel: string
|
||||||
readonly spaceName: string
|
readonly spaceName: string
|
||||||
|
readonly repoLinks: string
|
||||||
readonly popoverPortal: string
|
readonly popoverPortal: string
|
||||||
readonly popoverTarget: string
|
readonly popoverTarget: string
|
||||||
readonly popoverContent: string
|
readonly popoverContent: string
|
||||||
|
@ -3,7 +3,6 @@ import { Container, Layout } from '@harness/uicore'
|
|||||||
import { Render } from 'react-jsx-match'
|
import { Render } from 'react-jsx-match'
|
||||||
import { useHistory, useRouteMatch } from 'react-router-dom'
|
import { useHistory, useRouteMatch } from 'react-router-dom'
|
||||||
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
import { useGetRepositoryMetadata } from 'hooks/useGetRepositoryMetadata'
|
||||||
import { useAppContext } from 'AppContext'
|
|
||||||
import { useStrings } from 'framework/strings'
|
import { useStrings } from 'framework/strings'
|
||||||
import { routes } from 'RouteDefinitions'
|
import { routes } from 'RouteDefinitions'
|
||||||
import type { TypesSpace } from 'services/code'
|
import type { TypesSpace } from 'services/code'
|
||||||
@ -16,7 +15,6 @@ export const DefaultMenu: React.FC = () => {
|
|||||||
const [selectedSpace, setSelectedSpace] = useState<TypesSpace | undefined>()
|
const [selectedSpace, setSelectedSpace] = useState<TypesSpace | undefined>()
|
||||||
const { repoMetadata, gitRef, commitRef } = useGetRepositoryMetadata()
|
const { repoMetadata, gitRef, commitRef } = useGetRepositoryMetadata()
|
||||||
const { getString } = useStrings()
|
const { getString } = useStrings()
|
||||||
const { currentUser } = useAppContext()
|
|
||||||
const repoPath = useMemo(() => repoMetadata?.path || '', [repoMetadata])
|
const repoPath = useMemo(() => repoMetadata?.path || '', [repoMetadata])
|
||||||
const routeMatch = useRouteMatch()
|
const routeMatch = useRouteMatch()
|
||||||
const isFilesSelected = useMemo(
|
const isFilesSelected = useMemo(
|
||||||
@ -59,11 +57,7 @@ export const DefaultMenu: React.FC = () => {
|
|||||||
</Render>
|
</Render>
|
||||||
|
|
||||||
<Render when={repoMetadata}>
|
<Render when={repoMetadata}>
|
||||||
<Container
|
<Container className={css.repoLinks}>
|
||||||
style={{
|
|
||||||
borderLeft: '1px solid var(--grey-200)',
|
|
||||||
marginLeft: '17px'
|
|
||||||
}}>
|
|
||||||
<Layout.Vertical spacing="small">
|
<Layout.Vertical spacing="small">
|
||||||
<NavMenuItem
|
<NavMenuItem
|
||||||
data-code-repo-section="files"
|
data-code-repo-section="files"
|
||||||
@ -131,10 +125,6 @@ export const DefaultMenu: React.FC = () => {
|
|||||||
</Container>
|
</Container>
|
||||||
</Render>
|
</Render>
|
||||||
|
|
||||||
<Render when={currentUser?.admin}>
|
|
||||||
<NavMenuItem icon="user-groups" label={getString('userManagement.text')} to={routes.toCODEUsers()} />
|
|
||||||
</Render>
|
|
||||||
|
|
||||||
<Render when={selectedSpace}>
|
<Render when={selectedSpace}>
|
||||||
<NavMenuItem
|
<NavMenuItem
|
||||||
icon="nav-project"
|
icon="nav-project"
|
||||||
|
Loading…
Reference in New Issue
Block a user