diff --git a/web/src/components/Changes/ReviewSplitButton/ReviewSplitButton.tsx b/web/src/components/Changes/ReviewSplitButton/ReviewSplitButton.tsx index f133627fa..5b0e65a23 100644 --- a/web/src/components/Changes/ReviewSplitButton/ReviewSplitButton.tsx +++ b/web/src/components/Changes/ReviewSplitButton/ReviewSplitButton.tsx @@ -31,9 +31,10 @@ interface PrReviewOption { interface ReviewSplitButtonProps extends Pick { shouldHide: boolean pullRequestMetadata?: TypesPullReq + refreshPr: () => void } const ReviewSplitButton = (props: ReviewSplitButtonProps) => { - const { pullRequestMetadata, repoMetadata, shouldHide } = props + const { pullRequestMetadata, repoMetadata, shouldHide, refreshPr } = props const { getString } = useStrings() const { showError, showSuccess } = useToaster() @@ -69,6 +70,7 @@ const ReviewSplitButton = (props: ReviewSplitButtonProps) => { .then(() => { // setReset(true) showSuccess(getString('pr.reviewSubmitted')) + refreshPr() }) .catch(exception => showError(getErrorMessage(exception))) }, [decisionOption, mutate, showError, showSuccess, getString]) diff --git a/web/src/components/CommentBox/CommentBox.tsx b/web/src/components/CommentBox/CommentBox.tsx index d283d61f1..ea73243b7 100644 --- a/web/src/components/CommentBox/CommentBox.tsx +++ b/web/src/components/CommentBox/CommentBox.tsx @@ -1,7 +1,19 @@ import React, { useCallback, useRef, useState } from 'react' import { useResizeDetector } from 'react-resize-detector' import { Render, Match, Truthy, Falsy, Else } from 'react-jsx-match' -import { Container, Layout, Avatar, TextInput, Text, Color, FontVariation, FlexExpander } from '@harness/uicore' +import { + Container, + Layout, + Avatar, + TextInput, + Text, + Color, + FontVariation, + FlexExpander, + Button, + ButtonVariation, + ButtonSize +} from '@harness/uicore' import cx from 'classnames' import ReactTimeago from 'react-timeago' import { noop } from 'lodash-es' @@ -140,6 +152,10 @@ export const CommentBox = ({ + diff --git a/web/src/components/RepositoryPageHeader/RepositoryPageHeader.tsx b/web/src/components/RepositoryPageHeader/RepositoryPageHeader.tsx index 6319a3bee..6df8ca51b 100644 --- a/web/src/components/RepositoryPageHeader/RepositoryPageHeader.tsx +++ b/web/src/components/RepositoryPageHeader/RepositoryPageHeader.tsx @@ -48,7 +48,7 @@ export function RepositoryPageHeader({ ))} - + {typeof title === 'string' ? ( {title} diff --git a/web/src/framework/strings/stringTypes.ts b/web/src/framework/strings/stringTypes.ts index a1db8aa55..e690582c0 100644 --- a/web/src/framework/strings/stringTypes.ts +++ b/web/src/framework/strings/stringTypes.ts @@ -265,6 +265,7 @@ export interface StringsMap { requestChanges: string required: string resetZoom: string + resolve: string resolved: string reviewers: string samplePayloadUrl: string diff --git a/web/src/i18n/strings.en.yaml b/web/src/i18n/strings.en.yaml index 3fafda07d..46c46ffaf 100644 --- a/web/src/i18n/strings.en.yaml +++ b/web/src/i18n/strings.en.yaml @@ -361,3 +361,4 @@ dangerDeleteRepo: Danger, are you sure you want to delete it? repoUpdate: Repository Updated deleteRepoText: Are you sure you want to delete the repository '{REPONAME}'? deleteRepoTitle: Delete the repository +resolve: Resolve diff --git a/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/PullRequestActionsBox.tsx b/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/PullRequestActionsBox.tsx index 923e9b4c6..1f2dddb22 100644 --- a/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/PullRequestActionsBox.tsx +++ b/web/src/pages/PullRequest/Conversation/PullRequestActionsBox/PullRequestActionsBox.tsx @@ -147,6 +147,7 @@ export const PullRequestActionsBox: React.FC = ({ shouldHide={(pullRequestMetadata?.state as EnumPullReqState) === 'merged'} repoMetadata={repoMetadata} pullRequestMetadata={pullRequestMetadata} + refreshPr={onPRStateChanged} /> { - + {getString('required')} {reviewers && reviewers?.length !== 0 ? ( @@ -120,13 +120,13 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => { ) ) : ( {getString('noRequiredReviewers')} )} {getString('optional')} @@ -175,7 +175,6 @@ const PullRequestSideBar = (props: PullRequestSideBarProps) => { }) ) : ( {getString('noOptionalReviewers')} diff --git a/web/src/pages/PullRequest/PullRequest.module.scss b/web/src/pages/PullRequest/PullRequest.module.scss index 4c1fb3689..4015db1fb 100644 --- a/web/src/pages/PullRequest/PullRequest.module.scss +++ b/web/src/pages/PullRequest/PullRequest.module.scss @@ -35,6 +35,8 @@ display: flex; align-items: center; height: 24px; + margin-top: var(--spacing-8); + > svg { display: inline-block; @@ -52,6 +54,10 @@ padding: 3px 6px !important; } } + + .tabTitle:not:first-child { + margin-left: var(--spacing-8) !important; + } } } diff --git a/web/src/pages/PullRequest/PullRequest.tsx b/web/src/pages/PullRequest/PullRequest.tsx index 6cc316a4c..d4c2973d7 100644 --- a/web/src/pages/PullRequest/PullRequest.tsx +++ b/web/src/pages/PullRequest/PullRequest.tsx @@ -12,7 +12,9 @@ import { ButtonVariation, ButtonSize, TextInput, - useToaster + useToaster, + Spacing, + PaddingProps } from '@harness/uicore' import { useGet, useMutate } from 'restful-react' import { Render, Match, Truthy, Else } from 'react-jsx-match' @@ -167,6 +169,7 @@ export default function PullRequest() { icon={CodeIcon.Commit} title={getString('commits')} count={prData?.stats?.commits || 0} + padding={{ left: 'medium' }} /> ), panel: ( @@ -185,6 +188,7 @@ export default function PullRequest() { icon={CodeIcon.File} title={getString('filesChanged')} count={prData?.stats?.files_changed || 0} + padding={{ left: 'medium' }} /> ), panel: ( @@ -211,6 +215,7 @@ export default function PullRequest() { icon={CodeIcon.ChecksSuccess} title={getString('checks')} count={0} // TODO: Count for checks when API supports it + padding={{ left: 'medium' }} /> ), panel: @@ -311,13 +316,18 @@ const PullRequestTitle: React.FC = ({ repoMetadata, title ) } -const TabTitle: React.FC<{ icon: IconName; title: string; count?: number }> = ({ icon, title, count }) => { +const TabTitle: React.FC<{ icon: IconName; title: string; count?: number; padding?: Spacing | PaddingProps }> = ({ + icon, + title, + count, + padding +}) => { // Icon inside a tab got overriden-and-looked-bad styles from UICore // on hover. Use icon directly instead const TabIcon: React.ElementType = HarnessIcons[icon] return ( - + {title}