mirror of https://github.com/harness/drone.git
feat: [code-1625]: fix comments - hitesh
parent
1d194fb35c
commit
24f9f2bf24
|
@ -41,7 +41,7 @@ import type {
|
|||
} from 'services/code'
|
||||
import { CommentAction, CommentBox, CommentBoxOutletPosition, CommentItem } from 'components/CommentBox/CommentBox'
|
||||
import { useConfirmAct } from 'hooks/useConfirmAction'
|
||||
import { getErrorMessage, orderSortDate, ButtonRoleProps, PullRequestSection } from 'utils/Utils'
|
||||
import { getErrorMessage, orderSortDate, ButtonRoleProps, PullRequestSection, PRCommentFilterType } from 'utils/Utils'
|
||||
import { activityToCommentItem } from 'components/DiffViewer/DiffViewerUtils'
|
||||
import { NavigationCheck } from 'components/NavigationCheck/NavigationCheck'
|
||||
import { ThreadSection } from 'components/ThreadSection/ThreadSection'
|
||||
|
@ -413,6 +413,7 @@ export const Conversation: React.FC<ConversationProps> = ({
|
|||
prChecksDecisionResult={prChecksDecisionResult}
|
||||
codeOwners={codeOwners}
|
||||
reviewers={reviewers}
|
||||
setActivityFilter={setActivityFilter}
|
||||
/>
|
||||
</Container>
|
||||
)}
|
||||
|
@ -485,14 +486,6 @@ export const Conversation: React.FC<ConversationProps> = ({
|
|||
)
|
||||
}
|
||||
|
||||
export enum PRCommentFilterType {
|
||||
SHOW_EVERYTHING = 'showEverything',
|
||||
ALL_COMMENTS = 'allComments',
|
||||
MY_COMMENTS = 'myComments',
|
||||
RESOLVED_COMMENTS = 'resolvedComments',
|
||||
UNRESOLVED_COMMENTS = 'unresolvedComments'
|
||||
}
|
||||
|
||||
function useActivityFilters() {
|
||||
const { getString } = useStrings()
|
||||
|
||||
|
|
|
@ -191,7 +191,11 @@ const MergeSideDialogBox = (props: MergeSideDialogBoxProps) => {
|
|||
{getString('commitMessage')}
|
||||
</Text>
|
||||
<Container>
|
||||
<FormInput.TextArea placeholder={getString('writeDownCommit')} name={'commitMessage'} />
|
||||
<FormInput.TextArea
|
||||
className={css.textArea}
|
||||
placeholder={getString('writeDownCommit')}
|
||||
name={'commitMessage'}
|
||||
/>
|
||||
</Container>
|
||||
</Layout.Vertical>
|
||||
)}
|
||||
|
|
|
@ -250,3 +250,9 @@
|
|||
.optionMenuButton {
|
||||
padding-right: var(--spacing-medium) !important;
|
||||
}
|
||||
|
||||
.textArea {
|
||||
:global(.bp3-input) {
|
||||
min-height: 150px !important;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ export declare const ruleViolate: string
|
|||
export declare const ruleViolation: string
|
||||
export declare const secondaryButton: string
|
||||
export declare const sub: string
|
||||
export declare const textArea: string
|
||||
export declare const unchecked: string
|
||||
export declare const unmergeable: string
|
||||
export declare const viewDetailsBtn: string
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React, { useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { Container, Layout, useIsMounted, useToaster } from '@harnessio/uicore'
|
||||
import { Container, Layout, SelectOption, useIsMounted, useToaster } from '@harnessio/uicore'
|
||||
import cx from 'classnames'
|
||||
import { useGet, useMutate } from 'restful-react'
|
||||
import type {
|
||||
|
@ -30,10 +30,19 @@ interface PullRequestOverviewPanelProps {
|
|||
prChecksDecisionResult: PRChecksDecisionResult
|
||||
codeOwners: TypesCodeOwnerEvaluation | null
|
||||
reviewers: TypesPullReqReviewer[] | null
|
||||
setActivityFilter: (val: SelectOption) => void
|
||||
}
|
||||
|
||||
const PullRequestOverviewPanel = (props: PullRequestOverviewPanelProps) => {
|
||||
const { codeOwners, repoMetadata, pullReqMetadata, onPRStateChanged, refetchReviewers, reviewers } = props
|
||||
const {
|
||||
setActivityFilter,
|
||||
codeOwners,
|
||||
repoMetadata,
|
||||
pullReqMetadata,
|
||||
onPRStateChanged,
|
||||
refetchReviewers,
|
||||
reviewers
|
||||
} = props
|
||||
const { getString } = useStrings()
|
||||
const { showError } = useToaster()
|
||||
|
||||
|
@ -176,6 +185,7 @@ const PullRequestOverviewPanel = (props: PullRequestOverviewPanelProps) => {
|
|||
repoMetadata={repoMetadata}
|
||||
resolvedCommentArr={resolvedCommentArr}
|
||||
requiresCommentApproval={requiresCommentApproval}
|
||||
setActivityFilter={setActivityFilter}
|
||||
/>
|
||||
</Container>
|
||||
),
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
import React from 'react'
|
||||
import cx from 'classnames'
|
||||
import { Color } from '@harnessio/design-system'
|
||||
import { Button, ButtonSize, ButtonVariation, Container, Layout, Text } from '@harnessio/uicore'
|
||||
import { Button, ButtonSize, ButtonVariation, Container, Layout, SelectOption, Text } from '@harnessio/uicore'
|
||||
import { useStrings } from 'framework/strings'
|
||||
import type { TypesRepository, TypesPullReq, TypesViolation } from 'services/code'
|
||||
import Success from '../../../../../icons/code-success.svg?url'
|
||||
import Fail from '../../../../../icons/code-fail.svg?url'
|
||||
import css from '../PullRequestOverviewPanel.module.scss'
|
||||
import { PRCommentFilterType } from 'utils/Utils'
|
||||
interface MergeSectionProps {
|
||||
repoMetadata: TypesRepository
|
||||
pullReqMetadata: TypesPullReq
|
||||
resolvedCommentArr?: TypesViolation
|
||||
requiresCommentApproval: boolean
|
||||
setActivityFilter: (val: SelectOption) => void
|
||||
}
|
||||
const CommentsSection = (props: MergeSectionProps) => {
|
||||
const { resolvedCommentArr, requiresCommentApproval } = props
|
||||
const { resolvedCommentArr, requiresCommentApproval, setActivityFilter } = props
|
||||
const resolvedComments = requiresCommentApproval && !resolvedCommentArr?.params ? true : false
|
||||
const { getString } = useStrings()
|
||||
|
||||
|
@ -51,6 +53,10 @@ const CommentsSection = (props: MergeSectionProps) => {
|
|||
padding={{ bottom: 'medium' }}
|
||||
iconProps={{ size: 10, margin: { left: 'xsmall' } }}
|
||||
onClick={() => {
|
||||
setActivityFilter({
|
||||
label: getString('unrsolvedComment'),
|
||||
value: PRCommentFilterType.UNRESOLVED_COMMENTS
|
||||
})
|
||||
document.querySelectorAll('.bp3-input[value="Active"]')[0].scrollIntoView({ behavior: 'smooth' })
|
||||
}}
|
||||
/>
|
||||
|
|
|
@ -422,6 +422,14 @@ export enum CheckStatus {
|
|||
KILLED = 'killed'
|
||||
}
|
||||
|
||||
export enum PRCommentFilterType {
|
||||
SHOW_EVERYTHING = 'showEverything',
|
||||
ALL_COMMENTS = 'allComments',
|
||||
MY_COMMENTS = 'myComments',
|
||||
RESOLVED_COMMENTS = 'resolvedComments',
|
||||
UNRESOLVED_COMMENTS = 'unresolvedComments'
|
||||
}
|
||||
|
||||
const MONACO_SUPPORTED_LANGUAGES = [
|
||||
'abap',
|
||||
'apex',
|
||||
|
|
Loading…
Reference in New Issue