mirror of
https://github.com/desktop/desktop
synced 2024-11-05 20:49:32 +00:00
Remove enableSideBySideDiffs
This commit is contained in:
parent
4cd51221bb
commit
b761cbdfce
4 changed files with 28 additions and 72 deletions
|
@ -57,15 +57,6 @@ export function enableDesktopTrampoline(): boolean {
|
|||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Should we show the checkbox to enable side by side diffs?
|
||||
*
|
||||
* Note: side by side diffs will use the new diff viewer.
|
||||
*/
|
||||
export function enableSideBySideDiffs(): boolean {
|
||||
return true
|
||||
}
|
||||
|
||||
/**
|
||||
* Should we use the new diff viewer for unified diffs?
|
||||
*/
|
||||
|
|
|
@ -4,7 +4,6 @@ import { AppFileStatus } from '../../models/status'
|
|||
import { IDiff, DiffType } from '../../models/diff'
|
||||
import { Octicon, OcticonSymbol, iconForStatus } from '../octicons'
|
||||
import { mapStatus } from '../../lib/status'
|
||||
import { enableSideBySideDiffs } from '../../lib/feature-flag'
|
||||
import { DiffOptions } from '../diff/diff-options'
|
||||
import { RepositorySectionTab } from '../../lib/app-state'
|
||||
|
||||
|
@ -43,18 +42,16 @@ export class ChangedFileDetails extends React.Component<
|
|||
<PathLabel path={this.props.path} status={this.props.status} />
|
||||
{this.renderDecorator()}
|
||||
|
||||
{enableSideBySideDiffs() && (
|
||||
<DiffOptions
|
||||
sourceTab={RepositorySectionTab.Changes}
|
||||
onHideWhitespaceChangesChanged={
|
||||
this.props.onHideWhitespaceInDiffChanged
|
||||
}
|
||||
hideWhitespaceChanges={this.props.hideWhitespaceInDiff}
|
||||
onShowSideBySideDiffChanged={this.props.onShowSideBySideDiffChanged}
|
||||
showSideBySideDiff={this.props.showSideBySideDiff}
|
||||
onDiffOptionsOpened={this.props.onDiffOptionsOpened}
|
||||
/>
|
||||
)}
|
||||
<DiffOptions
|
||||
sourceTab={RepositorySectionTab.Changes}
|
||||
onHideWhitespaceChangesChanged={
|
||||
this.props.onHideWhitespaceInDiffChanged
|
||||
}
|
||||
hideWhitespaceChanges={this.props.hideWhitespaceInDiff}
|
||||
onShowSideBySideDiffChanged={this.props.onShowSideBySideDiffChanged}
|
||||
showSideBySideDiff={this.props.showSideBySideDiff}
|
||||
onDiffOptionsOpened={this.props.onDiffOptionsOpened}
|
||||
/>
|
||||
|
||||
<Octicon
|
||||
symbol={iconForStatus(status)}
|
||||
|
|
|
@ -32,7 +32,6 @@ import { SideBySideDiff } from './side-by-side-diff'
|
|||
import {
|
||||
enableHideWhitespaceInDiffOption,
|
||||
enableExperimentalDiffViewer,
|
||||
enableSideBySideDiffs,
|
||||
} from '../../lib/feature-flag'
|
||||
|
||||
// image used when no diff is displayed
|
||||
|
@ -247,10 +246,7 @@ export class Diff extends React.Component<IDiffProps, IDiffState> {
|
|||
}
|
||||
|
||||
private renderTextDiff(diff: ITextDiff) {
|
||||
if (
|
||||
enableExperimentalDiffViewer() ||
|
||||
(enableSideBySideDiffs() && this.props.showSideBySideDiff)
|
||||
) {
|
||||
if (enableExperimentalDiffViewer() || this.props.showSideBySideDiff) {
|
||||
return (
|
||||
<SideBySideDiff
|
||||
repository={this.props.repository}
|
||||
|
|
|
@ -9,8 +9,6 @@ import { Commit } from '../../models/commit'
|
|||
import { getAvatarUsersForCommit, IAvatarUser } from '../../models/avatar'
|
||||
import { AvatarStack } from '../lib/avatar-stack'
|
||||
import { CommitAttribution } from '../lib/commit-attribution'
|
||||
import { Checkbox, CheckboxValue } from '../lib/checkbox'
|
||||
import { enableSideBySideDiffs } from '../../lib/feature-flag'
|
||||
import { Tokenizer, TokenResult } from '../../lib/text-token-parser'
|
||||
import { wrapRichTextCommitMessage } from '../../lib/wrap-rich-text-commit-message'
|
||||
import { DiffOptions } from '../diff/diff-options'
|
||||
|
@ -154,13 +152,6 @@ export class CommitSummary extends React.Component<
|
|||
}
|
||||
}
|
||||
|
||||
private onHideWhitespaceInDiffChanged = (
|
||||
event: React.FormEvent<HTMLInputElement>
|
||||
) => {
|
||||
const value = event.currentTarget.checked
|
||||
return this.props.onHideWhitespaceInDiffChanged(value)
|
||||
}
|
||||
|
||||
private onResized = () => {
|
||||
if (this.descriptionRef) {
|
||||
const descriptionBottom = this.descriptionRef.getBoundingClientRect()
|
||||
|
@ -354,42 +345,23 @@ export class CommitSummary extends React.Component<
|
|||
</li>
|
||||
{this.renderTags()}
|
||||
|
||||
{enableSideBySideDiffs() || (
|
||||
<li
|
||||
className="commit-summary-meta-item without-truncation"
|
||||
title="Hide Whitespace"
|
||||
>
|
||||
<Checkbox
|
||||
label="Hide Whitespace"
|
||||
value={
|
||||
this.props.hideWhitespaceInDiff
|
||||
? CheckboxValue.On
|
||||
: CheckboxValue.Off
|
||||
}
|
||||
onChange={this.onHideWhitespaceInDiffChanged}
|
||||
/>
|
||||
</li>
|
||||
)}
|
||||
|
||||
{enableSideBySideDiffs() && (
|
||||
<li
|
||||
className="commit-summary-meta-item without-truncation"
|
||||
title="Diff Options"
|
||||
>
|
||||
<DiffOptions
|
||||
sourceTab={RepositorySectionTab.History}
|
||||
hideWhitespaceChanges={this.props.hideWhitespaceInDiff}
|
||||
onHideWhitespaceChangesChanged={
|
||||
this.props.onHideWhitespaceInDiffChanged
|
||||
}
|
||||
showSideBySideDiff={this.props.showSideBySideDiff}
|
||||
onShowSideBySideDiffChanged={
|
||||
this.props.onShowSideBySideDiffChanged
|
||||
}
|
||||
onDiffOptionsOpened={this.props.onDiffOptionsOpened}
|
||||
/>
|
||||
</li>
|
||||
)}
|
||||
<li
|
||||
className="commit-summary-meta-item without-truncation"
|
||||
title="Diff Options"
|
||||
>
|
||||
<DiffOptions
|
||||
sourceTab={RepositorySectionTab.History}
|
||||
hideWhitespaceChanges={this.props.hideWhitespaceInDiff}
|
||||
onHideWhitespaceChangesChanged={
|
||||
this.props.onHideWhitespaceInDiffChanged
|
||||
}
|
||||
showSideBySideDiff={this.props.showSideBySideDiff}
|
||||
onShowSideBySideDiffChanged={
|
||||
this.props.onShowSideBySideDiffChanged
|
||||
}
|
||||
onDiffOptionsOpened={this.props.onDiffOptionsOpened}
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in a new issue