CODE-520: Fixed text wrapping on buttons in Compare page

This commit is contained in:
“tan-nhu” 2023-08-10 10:41:25 -07:00
parent c1a23445dd
commit 11bd10f455
6 changed files with 14 additions and 9 deletions

View File

@ -8,6 +8,7 @@ html[class=''] {
--border: 1px solid var(--grey-200) !important;
--background-color-active: var(--white) !important;
--box-shadow: none !important;
white-space: nowrap !important;
&:active,
&:hover,

View File

@ -42,6 +42,7 @@ export const BranchTagSelect: React.FC<BranchTagSelectProps> = ({
forBranchesOnly,
labelPrefix,
placeHolder,
className,
...props
}) => {
const [query, onQuery] = useState('')
@ -50,7 +51,7 @@ export const BranchTagSelect: React.FC<BranchTagSelectProps> = ({
return (
<Button
className={css.button}
className={cx(css.button, className)}
text={
text ? (
labelPrefix ? (

View File

@ -5,10 +5,14 @@
> div {
align-items: center;
}
button {
white-space: nowrap !important;
}
}
.branchDropdown {
background-color: var(--white);
.branchTagDropdown {
--background-color: var(--white) !important;
}
.mergeText {

View File

@ -2,7 +2,7 @@
// this is an auto-generated file
declare const styles: {
readonly main: string
readonly branchDropdown: string
readonly branchTagDropdown: string
readonly mergeText: string
readonly popover: string
readonly menuItem: string

View File

@ -63,7 +63,7 @@ export function CompareContentHeader({
onSelect={onTargetGitRefChanged}
labelPrefix={getString('prefixBase')}
placeHolder={getString('selectBranchPlaceHolder')}
style={{ '--background-color': 'var(--white)' } as React.CSSProperties}
className={css.branchTagDropdown}
/>
<Icon name="arrow-left" size={14} />
<BranchTagSelect
@ -74,7 +74,7 @@ export function CompareContentHeader({
onSelect={onSourceGitRefChanged}
labelPrefix={getString('prefixCompare')}
placeHolder={getString('selectBranchPlaceHolder')}
style={{ '--background-color': 'var(--white)' } as React.CSSProperties}
className={css.branchTagDropdown}
/>
{!!targetGitRef && !!sourceGitRef && (
<MergeableLabel repoMetadata={repoMetadata} targetGitRef={targetGitRef} sourceGitRef={sourceGitRef} />
@ -146,7 +146,7 @@ const MergeableLabel: React.FC<Pick<CompareContentHeaderProps, 'repoMetadata' |
<Text
className={css.mergeText}
icon={loading ? 'spinner' : mergeable === true ? 'command-artifact-check' : 'cross'}
iconProps={{ color }}
iconProps={{ color, margin: { right: 'xsmall' } }}
color={color}>
{loading ? '' : error ? getErrorMessage(error) : getString(mergeable ? 'pr.ableToMerge' : 'pr.cantMerge')}
</Text>

View File

@ -12,7 +12,6 @@ import {
} from '@harness/uicore'
import ReactTimeago from 'react-timeago'
import { Render } from 'react-jsx-match'
import { Link } from 'react-router-dom'
import { CodeIcon, GitInfoProps } from 'utils/GitUtils'
import { MarkdownViewer } from 'components/MarkdownViewer/MarkdownViewer'
import { useStrings } from 'framework/strings'
@ -21,9 +20,9 @@ import type { CommentItem } from 'components/CommentBox/CommentBox'
import { formatDate, formatTime, PullRequestSection } from 'utils/Utils'
import { CommentType } from 'components/DiffViewer/DiffViewerUtils'
import { useAppContext } from 'AppContext'
import css from './Conversation.module.scss'
import { CommitActions } from 'components/CommitActions/CommitActions'
import { PipeSeparator } from 'components/PipeSeparator/PipeSeparator'
import css from './Conversation.module.scss'
interface SystemCommentProps extends Pick<GitInfoProps, 'pullRequestMetadata'> {
commentItems: CommentItem<TypesPullReqActivity>[]