Skip to content

Commit

Permalink
Merge branch 'code-241' of _OKE5H2PQKOUfzFFDuD4FA/default/CODE/gitness (
Browse files Browse the repository at this point in the history
  • Loading branch information
cjlee01 authored and Harness committed Apr 20, 2023
2 parents 961cf14 + 7134529 commit ae0afc4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion web/src/components/Changes/Changes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ export const Changes: React.FC<ChangesProps> = ({

return (
<Container className={cx(css.container, className)} {...(!!loading || !!error ? { flex: true } : {})}>
<LoadingSpinner visible={loading || loadingActivities} />
<LoadingSpinner visible={loading || loadingActivities} withBorder={true} />
<Render when={error}>
<PageError message={getErrorMessage(error || errorActivities)} onClick={voidFn(refetch)} />
</Render>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
align-items: center;
justify-content: center;

z-index: 3;
z-index: 4;

&.withBorder {
background: var(--white) !important;
Expand Down
1 change: 1 addition & 0 deletions web/src/pages/PullRequest/Conversation/Conversation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ export const Conversation: React.FC<ConversationProps> = ({
className={css.selectButton}
onChange={newState => {
setPrShowState(newState)
refetchActivities()
}}
/>
</Container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
--background-color-active: var(--grey-100) !important;
}

button {
a, button {
--background-color: var(--green-800) !important;
--background-color-hover: var(--green-900) !important;
--background-color-active: var(--green-900) !important;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ import type {
} from 'services/code'
import { useStrings } from 'framework/strings'
import { CodeIcon, GitInfoProps, PullRequestFilterOption, PullRequestState } from 'utils/GitUtils'
import { getErrorMessage } from 'utils/Utils'
import { useGetSpaceParam } from 'hooks/useGetSpaceParam'
import { useAppContext } from 'AppContext'
import { getErrorMessage, permissionProps } from 'utils/Utils'
import ReviewSplitButton from 'components/Changes/ReviewSplitButton/ReviewSplitButton'
import css from './PullRequestActionsBox.module.scss'

Expand Down Expand Up @@ -86,6 +88,18 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
if (pullRequestMetadata.state === PullRequestFilterOption.MERGED) {
return <MergeInfo pullRequestMetadata={pullRequestMetadata} />
}
const { hooks, standalone } = useAppContext()
const space = useGetSpaceParam()

const permPushResult = hooks?.usePermissionTranslate?.(
{
resource: {
resourceType: 'CODE_REPO'
},
permissions: ['code_repo_push']
},
[space]
)

return (
<Container
Expand Down Expand Up @@ -174,6 +188,7 @@ export const PullRequestActionsBox: React.FC<PullRequestActionsBoxProps> = ({
position: PopoverPosition.BOTTOM_RIGHT,
transitionDuration: 1000
}}
{...permissionProps(permPushResult, standalone)}
onClick={() => {
if (mergeOption.method !== 'close') {
const payload: OpenapiMergePullReq = { method: mergeOption.method }
Expand Down
16 changes: 9 additions & 7 deletions web/src/pages/PullRequest/PullRequestTabContentWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ export const PullRequestTabContentWrapper: React.FC<PullRequestTabContentWrapper
error,
onRetry,
children
}) => (
<Container className={className} padding="xlarge" {...(!!loading || !!error ? { flex: true } : {})}>
<LoadingSpinner visible={loading} />
{error && <PageError message={getErrorMessage(error)} onClick={onRetry} />}
{!loading && !error && children}
</Container>
)
}) => {
return (
<Container className={className} padding="xlarge">
<LoadingSpinner visible={loading} withBorder={true} />
{error && <PageError message={getErrorMessage(error)} onClick={onRetry} />}
{!error && children}
</Container>
)
}

0 comments on commit ae0afc4

Please sign in to comment.