From 4e1c852a01a6b1157e9552d31d30015e8797df1f Mon Sep 17 00:00:00 2001 From: Tan Nhu Date: Wed, 9 Aug 2023 21:31:58 +0000 Subject: [PATCH] Improve PR Checks polling in case PR does not have any checks (#297) --- web/.env | 3 + web/src/App.module.scss | 8 +- web/src/components/Changes/Changes.tsx | 2 +- .../CommitRangeDropdown.tsx | 11 +- web/src/components/LogViewer/LogViewer.tsx | 28 +- web/src/hooks/usePRChecksDecision.tsx | 2 + web/src/i18n/strings.en.yaml | 2 +- web/src/layouts/menu/DefaultMenu.tsx | 2 +- .../ChangePassword/ChangePassword.module.scss | 2 +- web/src/pages/Compare/Compare.module.scss | 2 +- web/src/pages/Execution/Execution.module.scss | 2 +- .../ExecutionList/ExecutionList.module.scss | 2 +- web/src/pages/Home/Home.module.scss | 2 +- .../PipelineList/PipelineList.module.scss | 2 +- .../PullRequest/Checks/Checks.module.scss | 33 ++- .../Checks/Checks.module.scss.d.ts | 2 + web/src/pages/PullRequest/Checks/Checks.tsx | 38 ++- .../PullRequest/Checks/ChecksOverview.tsx | 15 +- .../pages/PullRequest/PullRequest.module.scss | 3 +- web/src/pages/PullRequest/PullRequest.tsx | 2 +- .../PullRequestMetaLine.module.scss | 2 + .../PullRequests/PullRequests.module.scss | 2 +- .../RepositoriesListing.module.scss | 2 +- .../pages/Repository/Repository.module.scss | 4 +- .../RepositoryContent.module.scss | 1 + .../RepositoryBranches.module.scss | 2 +- .../RepositoryCommit.module.scss | 2 +- .../RepositoryCommits.module.scss | 2 +- .../RepositorySettings.module.scss | 2 +- .../RepositoryTags/RepositoryTags.module.scss | 2 +- .../pages/SecretList/SecretList.module.scss | 2 +- .../AddNewMember/AddNewMember.tsx | 4 +- .../SpaceAccessControl.module.scss | 2 +- .../SpaceAccessControl/SpaceAccessControl.tsx | 12 +- .../SpaceSettings/SpaceSettings.module.scss | 4 +- .../pages/UserProfile/UserProfile.module.scss | 2 +- .../UsersListing/UsersListing.module.scss | 2 +- .../pages/WebhookNew/WehookForm.module.scss | 2 +- web/src/pages/Webhooks/Webhooks.module.scss | 2 +- web/src/services/code/index.tsx | 218 ++++++++-------- web/src/services/code/swagger.yaml | 247 ++++++++++-------- web/src/utils/Utils.ts | 12 +- web/src/utils/vars.scss | 2 + 43 files changed, 377 insertions(+), 318 deletions(-) create mode 100644 web/.env diff --git a/web/.env b/web/.env new file mode 100644 index 000000000..ceb9351b5 --- /dev/null +++ b/web/.env @@ -0,0 +1,3 @@ +STANDALONE=true +PORT=3020 +API_URL=http://localhost:3000 diff --git a/web/src/App.module.scss b/web/src/App.module.scss index 3cfed2d45..0cedaa961 100644 --- a/web/src/App.module.scss +++ b/web/src/App.module.scss @@ -4,12 +4,16 @@ @include vars; &.fullPage { - height: 100%; + height: var(--page-height); } :global { div[data-testid='page-body'] > div[data-testid='page-error'] { - height: 80vh !important; + height: 70vh !important; + } + + .PageBody--pageBody { + min-height: calc(var(--page-height) - var(--page-header-height, 64px)); } } } diff --git a/web/src/components/Changes/Changes.tsx b/web/src/components/Changes/Changes.tsx index be2ccb957..1f6d08ff7 100644 --- a/web/src/components/Changes/Changes.tsx +++ b/web/src/components/Changes/Changes.tsx @@ -227,7 +227,7 @@ export const Changes: React.FC = ({ - + diff --git a/web/src/components/Changes/CommitRangeDropdown/CommitRangeDropdown.tsx b/web/src/components/Changes/CommitRangeDropdown/CommitRangeDropdown.tsx index 9b885dd91..c9844ab38 100644 --- a/web/src/components/Changes/CommitRangeDropdown/CommitRangeDropdown.tsx +++ b/web/src/components/Changes/CommitRangeDropdown/CommitRangeDropdown.tsx @@ -112,22 +112,19 @@ const CommitRangeDropdown: React.FC = ({ margin={{ bottom: 'small' }} /> - + {allCommits?.map((prCommit, index) => { const isSelected = selectedCommits.includes(prCommit.sha || '') return ( handleCheckboxClick(e, prCommit.sha as string)}> - handleCheckboxClick(e, prCommit.sha as string)} - /> + handleCheckboxClick(e, prCommit.sha as string)} /> - {allCommits.length - index} {prCommit.title} + {`${allCommits.length - index} ${prCommit.title}`} diff --git a/web/src/components/LogViewer/LogViewer.tsx b/web/src/components/LogViewer/LogViewer.tsx index fb03c40d9..533a3cd5b 100644 --- a/web/src/components/LogViewer/LogViewer.tsx +++ b/web/src/components/LogViewer/LogViewer.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useRef } from 'react' +import React, { useEffect, useMemo, useRef } from 'react' import { Container } from '@harness/uicore' import { Terminal } from 'xterm' import { FitAddon } from 'xterm-addon-fit' @@ -6,8 +6,9 @@ import { CanvasAddon } from 'xterm-addon-canvas' import { SearchAddon } from 'xterm-addon-search' import { WebLinksAddon } from 'xterm-addon-web-links' import 'xterm/css/xterm.css' +import { useEventListener } from 'hooks/useEventListener' -const DEFAULT_SCROLLBACK_LINES = 1000 +const DEFAULT_SCROLLBACK_LINES = 100000 export type TermRefs = { term: Terminal; fitAddon: FitAddon } | undefined @@ -18,7 +19,7 @@ export interface LogViewerProps { /** Number of scrollback lines */ scrollbackLines?: number - /** Log content as string. Note that we can support streaming easily if backend has it */ + /** Log content as string */ content: string termRefs?: React.MutableRefObject @@ -26,8 +27,8 @@ export interface LogViewerProps { export const LogViewer: React.FC = ({ scrollbackLines, content, termRefs }) => { const ref = useRef(null) - const lines = content.split(/\r?\n/) - const term = useRef() + const lines = useMemo(() => content.split(/\r?\n/), [content]) + const term = useRef<{ term: Terminal; fitAddon: FitAddon }>() useEffect(() => { if (!term.current) { @@ -45,13 +46,12 @@ export const LogViewer: React.FC = ({ scrollbackLines, content, const searchAddon = new SearchAddon() const fitAddon = new FitAddon() const webLinksAddon = new WebLinksAddon() + _term.loadAddon(searchAddon) _term.loadAddon(fitAddon) - _term.loadAddon(webLinksAddon) _term.loadAddon(new CanvasAddon()) - _term.clear() _term.open(ref?.current as HTMLDivElement) fitAddon.fit() @@ -59,14 +59,22 @@ export const LogViewer: React.FC = ({ scrollbackLines, content, _term.write('\x1b[?25l') // disable cursor - lines.forEach((line, _index) => _term.writeln(line)) + term.current = { term: _term, fitAddon } - term.current = _term if (termRefs) { - termRefs.current = { term: _term, fitAddon } + termRefs.current = term.current } } }, []) // eslint-disable-line react-hooks/exhaustive-deps + useEffect(() => { + term.current?.term?.clear() + lines.forEach(line => term.current?.term?.writeln(line)) + }, [lines]) + + useEventListener('resize', () => { + term.current?.fitAddon?.fit() + }) + return } diff --git a/web/src/hooks/usePRChecksDecision.tsx b/web/src/hooks/usePRChecksDecision.tsx index 6d21cdc0b..0ef75ca42 100644 --- a/web/src/hooks/usePRChecksDecision.tsx +++ b/web/src/hooks/usePRChecksDecision.tsx @@ -70,6 +70,8 @@ export function usePRChecksDecision({ } setComplete(!_count.pending && !_count.running) + } else { + setComplete(false) } return _status diff --git a/web/src/i18n/strings.en.yaml b/web/src/i18n/strings.en.yaml index 9665d97e0..ed23d83a9 100644 --- a/web/src/i18n/strings.en.yaml +++ b/web/src/i18n/strings.en.yaml @@ -423,7 +423,7 @@ descending: Descending active: Active pending: Pending resolved: Resolved -showEverything: Everything +showEverything: Show Everything allComments: All comments whatsNew: What's new myComments: My comments/replies diff --git a/web/src/layouts/menu/DefaultMenu.tsx b/web/src/layouts/menu/DefaultMenu.tsx index 2f288030e..4f26ace38 100644 --- a/web/src/layouts/menu/DefaultMenu.tsx +++ b/web/src/layouts/menu/DefaultMenu.tsx @@ -21,7 +21,7 @@ export const DefaultMenu: React.FC = () => { const repoPath = useMemo(() => repoMetadata?.path || '', [repoMetadata]) const routeMatch = useRouteMatch() const isFilesSelected = useMemo( - () => routeMatch.path === '/:space/:repoName' || routeMatch.path.startsWith('/:space/:repoName/edit'), + () => routeMatch.path === '/:space*/:repoName' || routeMatch.path.startsWith('/:space*/:repoName/edit'), [routeMatch] ) const isPipelineSelected = routeMatch.path.startsWith('/pipelines/:space*/pipeline/:pipeline') diff --git a/web/src/pages/ChangePassword/ChangePassword.module.scss b/web/src/pages/ChangePassword/ChangePassword.module.scss index 8038111f2..4436ea7df 100644 --- a/web/src/pages/ChangePassword/ChangePassword.module.scss +++ b/web/src/pages/ChangePassword/ChangePassword.module.scss @@ -1,5 +1,5 @@ .mainCtn { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; .pageCtn { diff --git a/web/src/pages/Compare/Compare.module.scss b/web/src/pages/Compare/Compare.module.scss index e8a28c98d..de8537886 100644 --- a/web/src/pages/Compare/Compare.module.scss +++ b/web/src/pages/Compare/Compare.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--white) !important; display: flex; flex-direction: column; diff --git a/web/src/pages/Execution/Execution.module.scss b/web/src/pages/Execution/Execution.module.scss index d1b1df197..f1fb64bb6 100644 --- a/web/src/pages/Execution/Execution.module.scss +++ b/web/src/pages/Execution/Execution.module.scss @@ -1,4 +1,4 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } diff --git a/web/src/pages/ExecutionList/ExecutionList.module.scss b/web/src/pages/ExecutionList/ExecutionList.module.scss index 328cc4ede..9e2d12861 100644 --- a/web/src/pages/ExecutionList/ExecutionList.module.scss +++ b/web/src/pages/ExecutionList/ExecutionList.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; .layout { diff --git a/web/src/pages/Home/Home.module.scss b/web/src/pages/Home/Home.module.scss index 04468c9cf..4594e5b56 100644 --- a/web/src/pages/Home/Home.module.scss +++ b/web/src/pages/Home/Home.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } .container { diff --git a/web/src/pages/PipelineList/PipelineList.module.scss b/web/src/pages/PipelineList/PipelineList.module.scss index 328cc4ede..9e2d12861 100644 --- a/web/src/pages/PipelineList/PipelineList.module.scss +++ b/web/src/pages/PipelineList/PipelineList.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; .layout { diff --git a/web/src/pages/PullRequest/Checks/Checks.module.scss b/web/src/pages/PullRequest/Checks/Checks.module.scss index 0b74ce081..fc977ee48 100644 --- a/web/src/pages/PullRequest/Checks/Checks.module.scss +++ b/web/src/pages/PullRequest/Checks/Checks.module.scss @@ -1,10 +1,11 @@ .main { - --stage-title-height: 46px; - --stage-detail-section-height: 40px; + --stage-title-height: 54px; + --stage-detail-section-height: 48px; + --log-content-header-height: 64px; background-color: var(--white) !important; min-height: calc(var(--page-min-height) - 156px); - height: calc(100vh - 156px); + height: calc(var(--page-height) - 156px); overflow: hidden; > div { @@ -97,26 +98,21 @@ } } - overflow: auto; padding: 0 var(--spacing-large) var(--spacing-medium); + overflow: auto; } &.terminal { overflow: hidden; + .header { + padding: var(--spacing-medium) var(--spacing-large) 0; + } + :global { .terminal.xterm { - padding: var(--spacing-medium); + padding: var(--spacing-small) var(--spacing-large) 0; } - - // .terminal-container { - // overflow: hidden; - // } - - // .xterm .xterm-viewport { - // /* see : https://github.com/xtermjs/xterm.js/issues/3564#issuecomment-1004417440 */ - // width: initial !important; - // } } } @@ -125,6 +121,7 @@ position: sticky; top: 0; background-color: var(--black); + height: var(--log-content-header-height); .headerLayout { border-bottom: 1px solid var(--grey-800); @@ -132,6 +129,14 @@ align-items: center; } } + + .markdownContainer { + padding-top: var(--spacing-medium); + } + + .terminalContainer { + height: calc(100% - var(--log-content-header-height)); + } } } diff --git a/web/src/pages/PullRequest/Checks/Checks.module.scss.d.ts b/web/src/pages/PullRequest/Checks/Checks.module.scss.d.ts index 3c34ed379..7473ee894 100644 --- a/web/src/pages/PullRequest/Checks/Checks.module.scss.d.ts +++ b/web/src/pages/PullRequest/Checks/Checks.module.scss.d.ts @@ -17,6 +17,8 @@ declare const styles: { readonly terminal: string readonly header: string readonly headerLayout: string + readonly markdownContainer: string + readonly terminalContainer: string readonly status: string readonly invert: string readonly noShrink: string diff --git a/web/src/pages/PullRequest/Checks/Checks.tsx b/web/src/pages/PullRequest/Checks/Checks.tsx index 855c55508..9b04313a1 100644 --- a/web/src/pages/PullRequest/Checks/Checks.tsx +++ b/web/src/pages/PullRequest/Checks/Checks.tsx @@ -40,8 +40,8 @@ export const Checks: React.FC = props => { const termRefs = useRef() const onSplitPaneResized = useCallback(() => termRefs.current?.fitAddon?.fit(), []) const [selectedItemData, setSelectedItemData] = useState() - const shouldRenderMarkdown = useMemo( - () => selectedItemData?.payload?.kind === PullRequestCheckType.EXTERNAL, + const isCheckDataMarkdown = useMemo( + () => selectedItemData?.payload?.kind === PullRequestCheckType.MARKDOWN, [selectedItemData?.payload?.kind] ) const logContent = useMemo( @@ -64,11 +64,16 @@ export const Checks: React.FC = props => { maxSize="calc(100% - 900px)" onDragFinished={onSplitPaneResized} primary="second"> - + { + setTimeout(() => setSelectedItemData(data), 0) + }} + /> @@ -101,14 +106,16 @@ export const Checks: React.FC = props => { - + - + - + + + @@ -164,6 +171,7 @@ const ChecksMenu: React.FC = ({ prChecksDecisionResult?.data?.[0] if (defaultSelectedItem) { + onDataItemChanged(defaultSelectedItem) setSelectedUID(defaultSelectedItem.uid) history.replace( routes.toCODEPullRequest({ @@ -174,7 +182,16 @@ const ChecksMenu: React.FC = ({ ) } } - }, [uid, prChecksDecisionResult?.data, selectedUID, history, routes, repoMetadata.path, pullRequestMetadata.number]) + }, [ + uid, + prChecksDecisionResult?.data, + selectedUID, + history, + routes, + repoMetadata.path, + pullRequestMetadata.number, + onDataItemChanged + ]) return ( @@ -185,7 +202,7 @@ const ChecksMenu: React.FC = ({ prChecksDecisionResult={prChecksDecisionResult} key={itemData.uid} itemData={itemData} - expandable={itemData.payload?.kind !== PullRequestCheckType.EXTERNAL /* || itemData.uid === 'build'*/} + expandable={false} isSelected={itemData.uid === selectedUID} onClick={() => { history.replace( @@ -242,6 +259,7 @@ const CheckMenuItem: React.FC = ({ expandable, isSelected = {timeDistance(itemData.updated, itemData.created)} + - + /> */} = ({ repoMetadata, pullRequestMetadata, data, isPipeline }) => { const { getString } = useStrings() const { routes } = useAppContext() - const _data = data.filter( - check => check.payload?.kind === (isPipeline ? PullRequestCheckType.PIPELINE : PullRequestCheckType.EXTERNAL) - ) - return _data.length ? ( + return data.length ? ( = ({ repoMetadata, pullRequestMe {getString(isPipeline ? 'pageTitle.pipelines' : 'checks')} - {_data.map(({ uid, status, summary, created, updated }) => ( + {data.map(({ uid, status, summary, created, updated }) => ( diff --git a/web/src/pages/PullRequest/PullRequest.module.scss b/web/src/pages/PullRequest/PullRequest.module.scss index cbe928898..4db96ae41 100644 --- a/web/src/pages/PullRequest/PullRequest.module.scss +++ b/web/src/pages/PullRequest/PullRequest.module.scss @@ -1,6 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); - background-color: var(--white) !important; + min-height: var(--page-height); > div[class*='PageHeader'] { border-bottom: none !important; diff --git a/web/src/pages/PullRequest/PullRequest.tsx b/web/src/pages/PullRequest/PullRequest.tsx index 6bb2c1bcc..f653813c0 100644 --- a/web/src/pages/PullRequest/PullRequest.tsx +++ b/web/src/pages/PullRequest/PullRequest.tsx @@ -144,7 +144,7 @@ export default function PullRequest() { <> - + div:first-of-type { - min-height: var(--page-min-height, 100vh) !important; + min-height: var(--page-height) !important; } > div:first-of-type { diff --git a/web/src/pages/Repository/RepositoryContent/RepositoryContent.module.scss b/web/src/pages/Repository/RepositoryContent/RepositoryContent.module.scss index 1d6870d7a..4ac1e7ef6 100644 --- a/web/src/pages/Repository/RepositoryContent/RepositoryContent.module.scss +++ b/web/src/pages/Repository/RepositoryContent/RepositoryContent.module.scss @@ -1,4 +1,5 @@ .resourceContent { + background-color: var(--page-background) !important; flex-grow: 1; display: flex; flex-direction: column; diff --git a/web/src/pages/RepositoryBranches/RepositoryBranches.module.scss b/web/src/pages/RepositoryBranches/RepositoryBranches.module.scss index d1b1df197..f1fb64bb6 100644 --- a/web/src/pages/RepositoryBranches/RepositoryBranches.module.scss +++ b/web/src/pages/RepositoryBranches/RepositoryBranches.module.scss @@ -1,4 +1,4 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } diff --git a/web/src/pages/RepositoryCommit/RepositoryCommit.module.scss b/web/src/pages/RepositoryCommit/RepositoryCommit.module.scss index 19844121c..321c05559 100644 --- a/web/src/pages/RepositoryCommit/RepositoryCommit.module.scss +++ b/web/src/pages/RepositoryCommit/RepositoryCommit.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } diff --git a/web/src/pages/RepositoryCommits/RepositoryCommits.module.scss b/web/src/pages/RepositoryCommits/RepositoryCommits.module.scss index 33682b822..81062f6e3 100644 --- a/web/src/pages/RepositoryCommits/RepositoryCommits.module.scss +++ b/web/src/pages/RepositoryCommits/RepositoryCommits.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } diff --git a/web/src/pages/RepositorySettings/RepositorySettings.module.scss b/web/src/pages/RepositorySettings/RepositorySettings.module.scss index a180046a5..2412326fe 100644 --- a/web/src/pages/RepositorySettings/RepositorySettings.module.scss +++ b/web/src/pages/RepositorySettings/RepositorySettings.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; width: 100%; margin: var(--spacing-small); diff --git a/web/src/pages/RepositoryTags/RepositoryTags.module.scss b/web/src/pages/RepositoryTags/RepositoryTags.module.scss index d1b1df197..f1fb64bb6 100644 --- a/web/src/pages/RepositoryTags/RepositoryTags.module.scss +++ b/web/src/pages/RepositoryTags/RepositoryTags.module.scss @@ -1,4 +1,4 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } diff --git a/web/src/pages/SecretList/SecretList.module.scss b/web/src/pages/SecretList/SecretList.module.scss index d1b1df197..f1fb64bb6 100644 --- a/web/src/pages/SecretList/SecretList.module.scss +++ b/web/src/pages/SecretList/SecretList.module.scss @@ -1,4 +1,4 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } diff --git a/web/src/pages/SpaceAccessControl/AddNewMember/AddNewMember.tsx b/web/src/pages/SpaceAccessControl/AddNewMember/AddNewMember.tsx index 1c20da8f1..d852af703 100644 --- a/web/src/pages/SpaceAccessControl/AddNewMember/AddNewMember.tsx +++ b/web/src/pages/SpaceAccessControl/AddNewMember/AddNewMember.tsx @@ -9,7 +9,7 @@ import { useStrings } from 'framework/strings' import { useGetSpaceParam } from 'hooks/useGetSpaceParam' import { MembershipAddRequestBody, - TypesMembership, + TypesMembershipUser, TypesPrincipalInfo, useListPrincipals, useMembershipAdd, @@ -23,7 +23,7 @@ const roles = ['reader', 'executor', 'contributor', 'space_owner'] as const const useAddNewMember = ({ onClose }: { onClose: () => void }) => { const [isEditFlow, setIsEditFlow] = useState(false) - const [membershipDetails, setMembershipDetails] = useState() + const [membershipDetails, setMembershipDetails] = useState() const [searchTerm, setSearchTerm] = useState('') const space = useGetSpaceParam() diff --git a/web/src/pages/SpaceAccessControl/SpaceAccessControl.module.scss b/web/src/pages/SpaceAccessControl/SpaceAccessControl.module.scss index 8caa9ba8d..9842f74ef 100644 --- a/web/src/pages/SpaceAccessControl/SpaceAccessControl.module.scss +++ b/web/src/pages/SpaceAccessControl/SpaceAccessControl.module.scss @@ -1,5 +1,5 @@ .mainCtn { - height: var(--page-min-height, 100%); + height: var(--page-height); background-color: var(--primary-bg) !important; .roleBadge { diff --git a/web/src/pages/SpaceAccessControl/SpaceAccessControl.tsx b/web/src/pages/SpaceAccessControl/SpaceAccessControl.tsx index 2f73145b2..9bd8bcd3a 100644 --- a/web/src/pages/SpaceAccessControl/SpaceAccessControl.tsx +++ b/web/src/pages/SpaceAccessControl/SpaceAccessControl.tsx @@ -6,7 +6,7 @@ import type { CellProps, Column } from 'react-table' import { StringKeys, useStrings } from 'framework/strings' import { useConfirmAct } from 'hooks/useConfirmAction' import { useGetSpaceParam } from 'hooks/useGetSpaceParam' -import { EnumMembershipRole, TypesMembership, useMembershipDelete, useMembershipList } from 'services/code' +import { EnumMembershipRole, TypesMembershipUser, useMembershipDelete, useMembershipList } from 'services/code' import { getErrorMessage } from 'utils/Utils' import { LoadingSpinner } from 'components/LoadingSpinner/LoadingSpinner' import { OptionsMenuButton } from 'components/OptionsMenuButton/OptionsMenuButton' @@ -60,7 +60,7 @@ const SpaceAccessControl = () => { { Header: getString('user'), width: '30%', - Cell: ({ row }: CellProps) => ( + Cell: ({ row }: CellProps) => ( { { Header: getString('role'), width: '40%', - Cell: ({ row }: CellProps) => { + Cell: ({ row }: CellProps) => { const stringKey = row.original.role ? roleStringKeyMap[row.original.role] : undefined return ( @@ -91,7 +91,7 @@ const SpaceAccessControl = () => { { Header: getString('email'), width: '25%', - Cell: ({ row }: CellProps) => ( + Cell: ({ row }: CellProps) => ( {row.original.principal?.email} @@ -100,7 +100,7 @@ const SpaceAccessControl = () => { { accessor: 'action', width: '5%', - Cell: ({ row }: CellProps) => { + Cell: ({ row }: CellProps) => { return ( { ) } } - ] as Column[], + ] as Column[], [] ) diff --git a/web/src/pages/SpaceSettings/SpaceSettings.module.scss b/web/src/pages/SpaceSettings/SpaceSettings.module.scss index 5a485e353..12c3f3ba8 100644 --- a/web/src/pages/SpaceSettings/SpaceSettings.module.scss +++ b/web/src/pages/SpaceSettings/SpaceSettings.module.scss @@ -1,5 +1,5 @@ .mainCtn { - height: var(--page-min-height, 100%); + height: var(--page-height); background-color: var(--primary-bg) !important; .roleBadge { @@ -59,4 +59,4 @@ .verticalContainer { width: 100% !important; -} \ No newline at end of file +} diff --git a/web/src/pages/UserProfile/UserProfile.module.scss b/web/src/pages/UserProfile/UserProfile.module.scss index 4fa665ae8..9d33fbcec 100644 --- a/web/src/pages/UserProfile/UserProfile.module.scss +++ b/web/src/pages/UserProfile/UserProfile.module.scss @@ -1,5 +1,5 @@ .mainCtn { - height: var(--page-min-height, 100%); + height: var(--page-height); background-color: var(--primary-bg) !important; .pageCtn { diff --git a/web/src/pages/UsersListing/UsersListing.module.scss b/web/src/pages/UsersListing/UsersListing.module.scss index aff390be3..f14ba353f 100644 --- a/web/src/pages/UsersListing/UsersListing.module.scss +++ b/web/src/pages/UsersListing/UsersListing.module.scss @@ -1,5 +1,5 @@ .mainCtn { - height: var(--page-min-height, 100%); + height: var(--page-height); background-color: var(--primary-bg) !important; .adminBadge { diff --git a/web/src/pages/WebhookNew/WehookForm.module.scss b/web/src/pages/WebhookNew/WehookForm.module.scss index d7ebc7701..fd28c93ed 100644 --- a/web/src/pages/WebhookNew/WehookForm.module.scss +++ b/web/src/pages/WebhookNew/WehookForm.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; } diff --git a/web/src/pages/Webhooks/Webhooks.module.scss b/web/src/pages/Webhooks/Webhooks.module.scss index 5e82897f8..75244011d 100644 --- a/web/src/pages/Webhooks/Webhooks.module.scss +++ b/web/src/pages/Webhooks/Webhooks.module.scss @@ -1,5 +1,5 @@ .main { - min-height: var(--page-min-height, 100%); + min-height: var(--page-height); background-color: var(--primary-bg) !important; .table { diff --git a/web/src/services/code/index.tsx b/web/src/services/code/index.tsx index b14da41b7..c7e735dc5 100644 --- a/web/src/services/code/index.tsx +++ b/web/src/services/code/index.tsx @@ -7,7 +7,7 @@ import { getConfig } from '../config' export const SPEC_VERSION = '0.0.0' export type EnumAccessGrant = number -export type EnumCheckPayloadKind = 'external' +export type EnumCheckPayloadKind = '' | 'markdown' | 'raw' export type EnumCheckStatus = 'error' | 'failure' | 'pending' | 'running' | 'success' @@ -147,7 +147,7 @@ export type OpenapiContentType = 'file' | 'dir' | 'symlink' | 'submodule' export interface OpenapiCreateBranchRequest { name?: string - target?: string | null + target?: string } export interface OpenapiCreatePathRequest { @@ -187,9 +187,9 @@ export interface OpenapiCreateSpaceRequest { } export interface OpenapiCreateTagRequest { - message?: string | null + message?: string name?: string - target?: string | null + target?: string } export interface OpenapiCreateTokenRequest { @@ -250,14 +250,6 @@ export interface OpenapiRegisterRequest { uid?: string } -export interface OpenapiReportStatusCheckResultRequest { - check_uid?: string - link?: string - payload?: TypesCheckPayload - status?: EnumCheckStatus - summary?: string -} - export interface OpenapiReviewSubmitPullReqRequest { commit_sha?: string decision?: EnumPullReqReviewDecision @@ -394,7 +386,7 @@ export interface RepoSymlinkContent { target?: string } -export type TimeDuration = number +export type TimeDuration = number | null export interface TypesCheck { created?: number @@ -449,7 +441,15 @@ export interface TypesListCommitResponse { rename_details?: TypesRenameDetails[] | null } -export interface TypesMembership { +export interface TypesMembershipSpace { + added_by?: TypesPrincipalInfo + created?: number + role?: EnumMembershipRole + space?: TypesSpace + updated?: number +} + +export interface TypesMembershipUser { added_by?: TypesPrincipalInfo created?: number principal?: TypesPrincipalInfo @@ -457,6 +457,11 @@ export interface TypesMembership { updated?: number } +export interface TypesMergeResponse { + conflict_files?: string[] + sha?: string +} + export interface TypesPath { created?: number created_by?: number @@ -600,7 +605,7 @@ export interface TypesSpace { export interface TypesToken { created_by?: number - expires_at?: number + expires_at?: number | null grants?: EnumAccessGrant issued_at?: number principal_id?: number @@ -1224,19 +1229,30 @@ export const useGetBranch = ({ repo_ref, branch_name, ...props }: UseGetBranchPr { base: getConfig('code'), pathParams: { repo_ref, branch_name }, ...props } ) +export interface ListStatusCheckResultsQueryParams { + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + export interface ListStatusCheckResultsPathParams { repo_ref: string commit_sha: string } export type ListStatusCheckResultsProps = Omit< - GetProps, + GetProps, 'path' > & ListStatusCheckResultsPathParams export const ListStatusCheckResults = ({ repo_ref, commit_sha, ...props }: ListStatusCheckResultsProps) => ( - + path={`/repos/${repo_ref}/checks/commits/${commit_sha}`} base={getConfig('code')} {...props} @@ -1244,13 +1260,13 @@ export const ListStatusCheckResults = ({ repo_ref, commit_sha, ...props }: ListS ) export type UseListStatusCheckResultsProps = Omit< - UseGetProps, + UseGetProps, 'path' > & ListStatusCheckResultsPathParams export const useListStatusCheckResults = ({ repo_ref, commit_sha, ...props }: UseListStatusCheckResultsProps) => - useGet( + useGet( (paramsInPath: ListStatusCheckResultsPathParams) => `/repos/${paramsInPath.repo_ref}/checks/commits/${paramsInPath.commit_sha}`, { base: getConfig('code'), pathParams: { repo_ref, commit_sha }, ...props } @@ -1261,12 +1277,20 @@ export interface ReportStatusCheckResultsPathParams { commit_sha: string } +export interface ReportStatusCheckResultsRequestBody { + check_uid?: string + link?: string + payload?: TypesCheckPayload + status?: EnumCheckStatus + summary?: string +} + export type ReportStatusCheckResultsProps = Omit< MutateProps< TypesCheck, UsererrorError, void, - OpenapiReportStatusCheckResultRequest, + ReportStatusCheckResultsRequestBody, ReportStatusCheckResultsPathParams >, 'path' | 'verb' @@ -1274,7 +1298,7 @@ export type ReportStatusCheckResultsProps = Omit< ReportStatusCheckResultsPathParams export const ReportStatusCheckResults = ({ repo_ref, commit_sha, ...props }: ReportStatusCheckResultsProps) => ( - + verb="PUT" path={`/repos/${repo_ref}/checks/commits/${commit_sha}`} base={getConfig('code')} @@ -1287,7 +1311,7 @@ export type UseReportStatusCheckResultsProps = Omit< TypesCheck, UsererrorError, void, - OpenapiReportStatusCheckResultRequest, + ReportStatusCheckResultsRequestBody, ReportStatusCheckResultsPathParams >, 'path' | 'verb' @@ -1295,13 +1319,7 @@ export type UseReportStatusCheckResultsProps = Omit< ReportStatusCheckResultsPathParams export const useReportStatusCheckResults = ({ repo_ref, commit_sha, ...props }: UseReportStatusCheckResultsProps) => - useMutate< - TypesCheck, - UsererrorError, - void, - OpenapiReportStatusCheckResultRequest, - ReportStatusCheckResultsPathParams - >( + useMutate( 'PUT', (paramsInPath: ReportStatusCheckResultsPathParams) => `/repos/${paramsInPath.repo_ref}/checks/commits/${paramsInPath.commit_sha}`, @@ -1487,30 +1505,6 @@ export const useCalculateCommitDivergence = ({ repo_ref, ...props }: UseCalculat { base: getConfig('code'), pathParams: { repo_ref }, ...props } ) -export interface RawDiffPathParams { - repo_ref: string - range: string -} - -export type RawDiffProps = Omit, 'path'> & RawDiffPathParams - -export const RawDiff = ({ repo_ref, range, ...props }: RawDiffProps) => ( - - path={`/repos/${repo_ref}/diff/${range}`} - base={getConfig('code')} - {...props} - /> -) - -export type UseRawDiffProps = Omit, 'path'> & - RawDiffPathParams - -export const useRawDiff = ({ repo_ref, range, ...props }: UseRawDiffProps) => - useGet( - (paramsInPath: RawDiffPathParams) => `/repos/${paramsInPath.repo_ref}/diff/${paramsInPath.range}`, - { base: getConfig('code'), pathParams: { repo_ref, range }, ...props } - ) - export interface GetContentQueryParams { /** * The git reference (branch / tag / commitID) that will be used to retrieve the data. If no value is provided the default branch of the repository is used. @@ -1553,28 +1547,28 @@ export const useGetContent = ({ repo_ref, path, ...props }: UseGetContentProps) { base: getConfig('code'), pathParams: { repo_ref, path }, ...props } ) -export interface DiffStatsPathParams { +export interface RawDiffPathParams { repo_ref: string range: string } -export type DiffStatsProps = Omit, 'path'> & - DiffStatsPathParams +export type RawDiffProps = Omit, 'path'> & + RawDiffPathParams -export const DiffStats = ({ repo_ref, range, ...props }: DiffStatsProps) => ( - - path={`/repos/${repo_ref}/diff-stats/${range}`} +export const RawDiff = ({ repo_ref, range, ...props }: RawDiffProps) => ( + + path={`/repos/${repo_ref}/diff/${range}`} base={getConfig('code')} {...props} /> ) -export type UseDiffStatsProps = Omit, 'path'> & - DiffStatsPathParams +export type UseRawDiffProps = Omit, 'path'> & + RawDiffPathParams -export const useDiffStats = ({ repo_ref, range, ...props }: UseDiffStatsProps) => - useGet( - (paramsInPath: DiffStatsPathParams) => `/repos/${paramsInPath.repo_ref}/diff-stats/${paramsInPath.range}`, +export const useRawDiff = ({ repo_ref, range, ...props }: UseRawDiffProps) => + useGet( + (paramsInPath: RawDiffPathParams) => `/repos/${paramsInPath.repo_ref}/diff/${paramsInPath.range}`, { base: getConfig('code'), pathParams: { repo_ref, range }, ...props } ) @@ -2253,45 +2247,19 @@ export const useListPullReqCommits = ({ repo_ref, pullreq_number, ...props }: Us { base: getConfig('code'), pathParams: { repo_ref, pullreq_number }, ...props } ) -export interface RawPullReqDiffPathParams { - repo_ref: string - pullreq_number: number -} - -export type RawPullReqDiffProps = Omit, 'path'> & - RawPullReqDiffPathParams - -export const RawPullReqDiff = ({ repo_ref, pullreq_number, ...props }: RawPullReqDiffProps) => ( - - path={`/repos/${repo_ref}/pullreq/${pullreq_number}/diff`} - base={getConfig('code')} - {...props} - /> -) - -export type UseRawPullReqDiffProps = Omit, 'path'> & - RawPullReqDiffPathParams - -export const useRawPullReqDiff = ({ repo_ref, pullreq_number, ...props }: UseRawPullReqDiffProps) => - useGet( - (paramsInPath: RawPullReqDiffPathParams) => - `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/diff`, - { base: getConfig('code'), pathParams: { repo_ref, pullreq_number }, ...props } - ) - export interface MergePullReqOpPathParams { repo_ref: string pullreq_number: number } export type MergePullReqOpProps = Omit< - MutateProps, + MutateProps, 'path' | 'verb' > & MergePullReqOpPathParams export const MergePullReqOp = ({ repo_ref, pullreq_number, ...props }: MergePullReqOpProps) => ( - + verb="POST" path={`/repos/${repo_ref}/pullreq/${pullreq_number}/merge`} base={getConfig('code')} @@ -2300,13 +2268,13 @@ export const MergePullReqOp = ({ repo_ref, pullreq_number, ...props }: MergePull ) export type UseMergePullReqOpProps = Omit< - UseMutateProps, + UseMutateProps, 'path' | 'verb' > & MergePullReqOpPathParams export const useMergePullReqOp = ({ repo_ref, pullreq_number, ...props }: UseMergePullReqOpProps) => - useMutate( + useMutate( 'POST', (paramsInPath: MergePullReqOpPathParams) => `/repos/${paramsInPath.repo_ref}/pullreq/${paramsInPath.pullreq_number}/merge`, @@ -3117,18 +3085,41 @@ export const useUpdateSpace = ({ space_ref, ...props }: UseUpdateSpaceProps) => { base: getConfig('code'), pathParams: { space_ref }, ...props } ) +export interface MembershipListQueryParams { + /** + * The substring by which the space members are filtered. + */ + query?: string + /** + * The order of the output. + */ + order?: 'asc' | 'desc' + /** + * The field by which the space members are sorted. + */ + sort?: 'created' | 'name' + /** + * The page to return. + */ + page?: number + /** + * The maximum number of results to return. + */ + limit?: number +} + export interface MembershipListPathParams { space_ref: string } export type MembershipListProps = Omit< - GetProps, + GetProps, 'path' > & MembershipListPathParams export const MembershipList = ({ space_ref, ...props }: MembershipListProps) => ( - + path={`/spaces/${space_ref}/members`} base={getConfig('code')} {...props} @@ -3136,13 +3127,13 @@ export const MembershipList = ({ space_ref, ...props }: MembershipListProps) => ) export type UseMembershipListProps = Omit< - UseGetProps, + UseGetProps, 'path' > & MembershipListPathParams export const useMembershipList = ({ space_ref, ...props }: UseMembershipListProps) => - useGet( + useGet( (paramsInPath: MembershipListPathParams) => `/spaces/${paramsInPath.space_ref}/members`, { base: getConfig('code'), pathParams: { space_ref }, ...props } ) @@ -3157,13 +3148,13 @@ export interface MembershipAddRequestBody { } export type MembershipAddProps = Omit< - MutateProps, + MutateProps, 'path' | 'verb' > & MembershipAddPathParams export const MembershipAdd = ({ space_ref, ...props }: MembershipAddProps) => ( - + verb="POST" path={`/spaces/${space_ref}/members`} base={getConfig('code')} @@ -3172,13 +3163,13 @@ export const MembershipAdd = ({ space_ref, ...props }: MembershipAddProps) => ( ) export type UseMembershipAddProps = Omit< - UseMutateProps, + UseMutateProps, 'path' | 'verb' > & MembershipAddPathParams export const useMembershipAdd = ({ space_ref, ...props }: UseMembershipAddProps) => - useMutate( + useMutate( 'POST', (paramsInPath: MembershipAddPathParams) => `/spaces/${paramsInPath.space_ref}/members`, { base: getConfig('code'), pathParams: { space_ref }, ...props } @@ -3226,13 +3217,13 @@ export interface MembershipUpdateRequestBody { } export type MembershipUpdateProps = Omit< - MutateProps, + MutateProps, 'path' | 'verb' > & MembershipUpdatePathParams export const MembershipUpdate = ({ space_ref, user_uid, ...props }: MembershipUpdateProps) => ( - + verb="PATCH" path={`/spaces/${space_ref}/members/${user_uid}`} base={getConfig('code')} @@ -3241,13 +3232,13 @@ export const MembershipUpdate = ({ space_ref, user_uid, ...props }: MembershipUp ) export type UseMembershipUpdateProps = Omit< - UseMutateProps, + UseMutateProps, 'path' | 'verb' > & MembershipUpdatePathParams export const useMembershipUpdate = ({ space_ref, user_uid, ...props }: UseMembershipUpdateProps) => - useMutate( + useMutate( 'PATCH', (paramsInPath: MembershipUpdatePathParams) => `/spaces/${paramsInPath.space_ref}/members/${paramsInPath.user_uid}`, { base: getConfig('code'), pathParams: { space_ref, user_uid }, ...props } @@ -3559,6 +3550,21 @@ export const useUpdateUser = (props: UseUpdateUserProps) => ...props }) +export type MembershipSpacesProps = Omit, 'path'> + +export const MembershipSpaces = (props: MembershipSpacesProps) => ( + + path={`/user/memberships`} + base={getConfig('code')} + {...props} + /> +) + +export type UseMembershipSpacesProps = Omit, 'path'> + +export const useMembershipSpaces = (props: UseMembershipSpacesProps) => + useGet(`/user/memberships`, { base: getConfig('code'), ...props }) + export type CreateTokenProps = Omit< MutateProps, 'path' | 'verb' diff --git a/web/src/services/code/swagger.yaml b/web/src/services/code/swagger.yaml index aed4b9471..8ebb5dc1e 100644 --- a/web/src/services/code/swagger.yaml +++ b/web/src/services/code/swagger.yaml @@ -3,7 +3,7 @@ info: title: API Specification version: 0.0.0 servers: - - url: /api/v1/ + - url: /api/v1 security: - bearerAuth: [] paths: @@ -887,6 +887,23 @@ paths: get: operationId: listStatusCheckResults parameters: + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer - in: path name: repo_ref required: true @@ -949,7 +966,18 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/OpenapiReportStatusCheckResultRequest' + properties: + check_uid: + type: string + link: + type: string + payload: + $ref: '#/components/schemas/TypesCheckPayload' + status: + $ref: '#/components/schemas/EnumCheckStatus' + summary: + type: string + type: object responses: '200': content: @@ -1233,48 +1261,6 @@ paths: description: Internal Server Error tags: - repository - /repos/{repo_ref}/compare/{range}: - get: - operationId: rawDiff - parameters: - - in: path - name: repo_ref - required: true - schema: - type: string - - in: path - name: range - required: true - schema: - example: main..dev - type: string - responses: - '200': - content: - text/plain: - schema: - type: string - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - repository /repos/{repo_ref}/content/{path}: get: operationId: getContent @@ -1339,9 +1325,9 @@ paths: description: Internal Server Error tags: - repository - /repos/{repo_ref}/diff-stats/{range}: + /repos/{repo_ref}/diff/{range}: get: - operationId: diffStats + operationId: rawDiff parameters: - in: path name: repo_ref @@ -1360,6 +1346,9 @@ paths: application/json: schema: $ref: '#/components/schemas/TypesDiffStats' + text/plain: + schema: + type: string description: OK '401': content: @@ -2272,53 +2261,6 @@ paths: description: Internal Server Error tags: - pullreq - /repos/{repo_ref}/pullreq/{pullreq_number}/diff: - get: - operationId: rawPullReqDiff - parameters: - - in: path - name: repo_ref - required: true - schema: - type: string - - in: path - name: pullreq_number - required: true - schema: - type: integer - responses: - '200': - content: - text/plain: - schema: - type: string - description: OK - '401': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Unauthorized - '403': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Forbidden - '404': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Not Found - '500': - content: - application/json: - schema: - $ref: '#/components/schemas/UsererrorError' - description: Internal Server Error - tags: - - pullreq /repos/{repo_ref}/pullreq/{pullreq_number}/merge: post: operationId: mergePullReqOp @@ -2340,6 +2282,10 @@ paths: $ref: '#/components/schemas/OpenapiMergePullReq' responses: '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypesMergeResponse' description: OK '400': content: @@ -3628,6 +3574,49 @@ paths: get: operationId: membershipList parameters: + - description: The substring by which the space members are filtered. + in: query + name: query + required: false + schema: + type: string + - description: The order of the output. + in: query + name: order + required: false + schema: + default: asc + enum: + - asc + - desc + type: string + - description: The field by which the space members are sorted. + in: query + name: sort + required: false + schema: + default: name + enum: + - created + - name + type: string + - description: The page to return. + in: query + name: page + required: false + schema: + default: 1 + minimum: 1 + type: integer + - description: The maximum number of results to return. + in: query + name: limit + required: false + schema: + default: 30 + maximum: 100 + minimum: 1 + type: integer - in: path name: space_ref required: true @@ -3639,7 +3628,7 @@ paths: application/json: schema: items: - $ref: '#/components/schemas/TypesMembership' + $ref: '#/components/schemas/TypesMembershipUser' type: array description: OK '401': @@ -3691,7 +3680,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TypesMembership' + $ref: '#/components/schemas/TypesMembershipUser' description: Created '401': content: @@ -3788,7 +3777,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/TypesMembership' + $ref: '#/components/schemas/TypesMembershipUser' description: OK '401': content: @@ -4277,6 +4266,26 @@ paths: description: Internal Server Error tags: - user + /user/memberships: + get: + operationId: membershipSpaces + responses: + '200': + content: + application/json: + schema: + items: + $ref: '#/components/schemas/TypesMembershipSpace' + type: array + description: OK + '500': + content: + application/json: + schema: + $ref: '#/components/schemas/UsererrorError' + description: Internal Server Error + tags: + - user /user/token: post: operationId: createToken @@ -4306,7 +4315,9 @@ components: type: integer EnumCheckPayloadKind: enum: - - external + - '' + - markdown + - raw type: string EnumCheckStatus: enum: @@ -4574,7 +4585,6 @@ components: name: type: string target: - nullable: true type: string type: object OpenapiCreatePathRequest: @@ -4637,12 +4647,10 @@ components: OpenapiCreateTagRequest: properties: message: - nullable: true type: string name: type: string target: - nullable: true type: string type: object OpenapiCreateTokenRequest: @@ -4744,19 +4752,6 @@ components: uid: type: string type: object - OpenapiReportStatusCheckResultRequest: - properties: - check_uid: - type: string - link: - type: string - payload: - $ref: '#/components/schemas/TypesCheckPayload' - status: - $ref: '#/components/schemas/EnumCheckStatus' - summary: - type: string - type: object OpenapiReviewSubmitPullReqRequest: properties: commit_sha: @@ -4981,6 +4976,7 @@ components: type: string type: object TimeDuration: + nullable: true type: integer TypesCheck: properties: @@ -5071,7 +5067,20 @@ components: nullable: true type: array type: object - TypesMembership: + TypesMembershipSpace: + properties: + added_by: + $ref: '#/components/schemas/TypesPrincipalInfo' + created: + type: integer + role: + $ref: '#/components/schemas/EnumMembershipRole' + space: + $ref: '#/components/schemas/TypesSpace' + updated: + type: integer + type: object + TypesMembershipUser: properties: added_by: $ref: '#/components/schemas/TypesPrincipalInfo' @@ -5084,6 +5093,15 @@ components: updated: type: integer type: object + TypesMergeResponse: + properties: + conflict_files: + items: + type: string + type: array + sha: + type: string + type: object TypesPath: properties: created: @@ -5348,6 +5366,7 @@ components: created_by: type: integer expires_at: + nullable: true type: integer grants: $ref: '#/components/schemas/EnumAccessGrant' diff --git a/web/src/utils/Utils.ts b/web/src/utils/Utils.ts index 89d0b1afc..2ac9853eb 100644 --- a/web/src/utils/Utils.ts +++ b/web/src/utils/Utils.ts @@ -297,13 +297,6 @@ export enum MergeCheckStatus { CONFLICT = 'conflict' } -export enum PullRequestSection { - CONVERSATION = 'conversation', - COMMITS = 'commits', - FILES_CHANGED = 'changes', - CHECKS = 'checks' -} - /** * Convert number of bytes into human readable format * @@ -324,6 +317,7 @@ export function formatBytes(bytes: number, decimals = 2) { } export enum PullRequestCheckType { - EXTERNAL = 'external', - PIPELINE = 'pipeline' // TODO: This is not yet supported by backend + EMPTY = '', + RAW = 'raw', + MARKDOWN = 'markdown' } diff --git a/web/src/utils/vars.scss b/web/src/utils/vars.scss index 0294615c9..a608df464 100644 --- a/web/src/utils/vars.scss +++ b/web/src/utils/vars.scss @@ -5,4 +5,6 @@ --nav-menu-width: 232px; --nav-background: #f2f6fb; --page-background: #fbfcfd; + + --page-height: var(--page-min-height, max(100vh, 800px)); }