mirror of
https://github.com/harness/drone.git
synced 2025-05-20 19:09:59 +08:00
Disable shared monaco lib completely (#273)
Co-authored-by: Tan Nhu <tnhu@users.noreply.github.com>
This commit is contained in:
parent
ce4bdd504f
commit
5a170f9345
@ -12,13 +12,13 @@ const ExactSharedPackages = [
|
||||
'@blueprintjs/core',
|
||||
'@blueprintjs/select',
|
||||
'@blueprintjs/datetime',
|
||||
'restful-react',
|
||||
'@harness/monaco-yaml',
|
||||
'monaco-editor',
|
||||
'monaco-editor-core',
|
||||
'restful-react'
|
||||
// '@harness/monaco-yaml',
|
||||
// 'monaco-editor',
|
||||
// 'monaco-editor-core',
|
||||
// 'monaco-languages',
|
||||
'monaco-plugin-helpers',
|
||||
'react-monaco-editor'
|
||||
// 'monaco-plugin-helpers',
|
||||
// 'react-monaco-editor'
|
||||
]
|
||||
|
||||
/**
|
||||
|
@ -2,7 +2,8 @@ import { useCallback, useState } from 'react'
|
||||
|
||||
export enum UserPreference {
|
||||
DIFF_VIEW_STYLE = 'DIFF_VIEW_STYLE',
|
||||
DIFF_LINE_BREAKS = 'DIFF_LINE_BREAKS'
|
||||
DIFF_LINE_BREAKS = 'DIFF_LINE_BREAKS',
|
||||
PULL_REQUESTS_FILTER_SELECTED_OPTIONS = 'PULL_REQUESTS_FILTER_SELECTED_OPTIONS'
|
||||
}
|
||||
|
||||
export function useUserPreference<T = string>(key: UserPreference, defaultValue: T): [T, (val: T) => void] {
|
||||
|
@ -14,6 +14,7 @@ import { voidFn, getErrorMessage, LIST_FETCHING_LIMIT } from 'utils/Utils'
|
||||
import { usePageIndex } from 'hooks/usePageIndex'
|
||||
import type { TypesPullReq, TypesRepository } from 'services/code'
|
||||
import { ResourceListingPagination } from 'components/ResourceListingPagination/ResourceListingPagination'
|
||||
import { UserPreference, useUserPreference } from 'hooks/useUserPreference'
|
||||
import { NoResultCard } from 'components/NoResultCard/NoResultCard'
|
||||
import { PullRequestStateLabel } from 'components/PullRequestStateLabel/PullRequestStateLabel'
|
||||
import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner'
|
||||
@ -25,7 +26,10 @@ export default function PullRequests() {
|
||||
const history = useHistory()
|
||||
const { routes } = useAppContext()
|
||||
const [searchTerm, setSearchTerm] = useState('')
|
||||
const [filter, setFilter] = useState<string>(PullRequestFilterOption.OPEN)
|
||||
const [filter, setFilter] = useUserPreference<string>(
|
||||
UserPreference.PULL_REQUESTS_FILTER_SELECTED_OPTIONS,
|
||||
PullRequestFilterOption.OPEN
|
||||
)
|
||||
const [page, setPage] = usePageIndex()
|
||||
const { repoMetadata, error, loading, refetch } = useGetRepositoryMetadata()
|
||||
const {
|
||||
@ -45,6 +49,7 @@ export default function PullRequests() {
|
||||
},
|
||||
lazy: !repoMetadata
|
||||
})
|
||||
|
||||
const columns: Column<TypesPullReq>[] = useMemo(
|
||||
() => [
|
||||
{
|
||||
@ -101,6 +106,7 @@ export default function PullRequests() {
|
||||
<PullRequestsContentHeader
|
||||
loading={prLoading}
|
||||
repoMetadata={repoMetadata as TypesRepository}
|
||||
activePullRequestFilterOption={filter}
|
||||
onPullRequestFilterChanged={_filter => {
|
||||
setFilter(_filter)
|
||||
setPage(1)
|
||||
|
@ -3,6 +3,7 @@ import React, { useMemo, useState } from 'react'
|
||||
import { Container, Layout, FlexExpander, DropDown, ButtonVariation, Button } from '@harness/uicore'
|
||||
import { useStrings } from 'framework/strings'
|
||||
import { CodeIcon, GitInfoProps, makeDiffRefs, PullRequestFilterOption } from 'utils/GitUtils'
|
||||
import { UserPreference, useUserPreference } from 'hooks/useUserPreference'
|
||||
import { useAppContext } from 'AppContext'
|
||||
import { SearchInputWithSpinner } from 'components/SearchInputWithSpinner/SearchInputWithSpinner'
|
||||
import css from './PullRequestsContentHeader.module.scss'
|
||||
@ -24,7 +25,10 @@ export function PullRequestsContentHeader({
|
||||
const history = useHistory()
|
||||
const { routes } = useAppContext()
|
||||
const { getString } = useStrings()
|
||||
const [filterOption, setFilterOption] = useState(activePullRequestFilterOption)
|
||||
const [filterOption, setFilterOption] = useUserPreference(
|
||||
UserPreference.PULL_REQUESTS_FILTER_SELECTED_OPTIONS,
|
||||
activePullRequestFilterOption
|
||||
)
|
||||
const [searchTerm, setSearchTerm] = useState('')
|
||||
const items = useMemo(
|
||||
() => [
|
||||
|
Loading…
Reference in New Issue
Block a user