Merge pull request #6630 from desktop/clean-up-no-changes-blankslate-feature-flag

Clean up no changes blankslate feature flag
This commit is contained in:
Brendan Forster 2019-01-18 08:37:48 -04:00 committed by GitHub
commit a229d899a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 82 deletions

View file

@ -56,15 +56,6 @@ export function enableReadmeOverwriteWarning(): boolean {
return enableBetaFeatures()
}
/**
* Whether or not to activate the new, improved, blank slate
* shown when the user doesn't have any local changes in their
* repository.
*/
export function enableNewNoChangesBlankslate(): boolean {
return true
}
/**
* Whether or not to activate the "Create PR" blankslate action.
*

View file

@ -1,15 +1,10 @@
import * as React from 'react'
import * as classNames from 'classnames'
import * as ReactCSSTransitionReplace from 'react-css-transition-replace'
import { encodePathAsUrl } from '../../lib/path'
import { revealInFileManager } from '../../lib/app-shell'
import { Repository } from '../../models/repository'
import { LinkButton } from '../lib/link-button'
import {
enableNewNoChangesBlankslate,
enableNoChangesCreatePRBlankslateAction,
} from '../../lib/feature-flag'
import { enableNoChangesCreatePRBlankslateAction } from '../../lib/feature-flag'
import { MenuIDs } from '../../main-process/menu'
import { IMenu, MenuItem } from '../../models/app-menu'
import memoizeOne from 'memoize-one'
@ -22,11 +17,6 @@ import { Ref } from '../lib/ref'
import { IAheadBehind } from '../../models/branch'
import { IRemote } from '../../models/remote'
const BlankSlateImage = encodePathAsUrl(
__dirname,
'static/empty-no-file-selected.svg'
)
function formatMenuItemLabel(text: string) {
if (__WIN32__ || __LINUX__) {
return text.replace('&', '')
@ -192,53 +182,6 @@ export class NoChanges extends React.Component<
return this.getMenuInfoMap(this.props.appMenu).get(menuItemId)
}
private renderClassicBlankSlate() {
const opener = __DARWIN__
? 'Finder'
: __WIN32__
? 'Explorer'
: 'your File Manager'
return (
<div className="panel blankslate" id="no-changes">
<img src={BlankSlateImage} className="blankslate-image" />
<div>No local changes</div>
<div>
Would you like to{' '}
<LinkButton onClick={this.open}>open this repository</LinkButton> in{' '}
{opener}?
</div>
</div>
)
}
private renderNewNoChangesBlankSlate() {
const className = classNames({
// This is unneccessary but serves as a reminder to drop
// the ng class from here and change the scss when we
// remove the feature flag.
ng: enableNewNoChangesBlankslate(),
})
return (
<div id="no-changes" className={className}>
<div className="content">
<div className="header">
<div className="text">
<h1>No local changes</h1>
<p>
You have no uncommitted changes in your repository! Here are
some friendly suggestions for what to do next.
</p>
</div>
<img src={PaperStackImage} className="blankslate-image" />
</div>
{this.renderActions()}
</div>
</div>
)
}
private getPlatformFileManagerName() {
if (__DARWIN__) {
return 'Finder'
@ -640,14 +583,22 @@ export class NoChanges extends React.Component<
}
public render() {
if (enableNewNoChangesBlankslate()) {
return this.renderNewNoChangesBlankSlate()
}
return this.renderClassicBlankSlate()
}
private open = () => {
revealInFileManager(this.props.repository, '')
return (
<div id="no-changes">
<div className="content">
<div className="header">
<div className="text">
<h1>No local changes</h1>
<p>
You have no uncommitted changes in your repository! Here are
some friendly suggestions for what to do next.
</p>
</div>
<img src={PaperStackImage} className="blankslate-image" />
</div>
{this.renderActions()}
</div>
</div>
)
}
}

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 6.7 KiB

View file

@ -1,9 +1,4 @@
#no-changes {
display: flex;
flex-direction: column;
}
#no-changes.ng {
padding: var(--spacing-quad);
width: 100%;
min-height: 100%;