Skip to content

Commit

Permalink
merge upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieudutour committed Jun 29, 2018
2 parents 3eb07b2 + f5462d1 commit 432b6f2
Show file tree
Hide file tree
Showing 43 changed files with 1,003 additions and 236 deletions.
16 changes: 8 additions & 8 deletions .github/CONTRIBUTING.md
Expand Up @@ -77,7 +77,7 @@ The information we are interested in includes:
- details about your environment - which build, which operating system
- details about reproducing the issue - what steps to take, what happens, how
often it happens
- other relevant information - log files, screenshots, etc.
- other relevant information - log files, screenshots, etc

### Suggesting Enhancements

Expand Down Expand Up @@ -109,17 +109,16 @@ and fill out the provided issue template.

Some additional advice:

* **Use a clear and descriptive title** for the issue to identify the
suggestion.
* **Provide a step-by-step description of the suggested enhancement** in as
much detail as possible. This additional context helps the maintainers to
understand the enhancement from your perspective
* **Use a clear and descriptive title** for the feature request
* **Provide a step-by-step description of the suggested enhancement**
This additional context helps the maintainers understand the enhancement from
your perspective
* **Explain why this enhancement would be useful** to Kactus users.
* **Include screenshots and animated GIFs** if relevent to help you demonstrate
the steps or point out the part of Kactus which the suggestion is
related to. You can use [this tool](http://www.cockos.com/licecap/) to record
GIFs on macOS and Windows.
* **List some other applications where this enhancement exists, if applicable.**
GIFs on macOS and Windows
* **List some other applications where this enhancement exists, if applicable**

### Help Wanted

Expand Down Expand Up @@ -164,4 +163,5 @@ pull requests.

| Label name | :mag_right: | Description |
| --- | --- | --- |
| `infrastructure` | [search](https://github.com/kactus-io/kactus/labels/infrastructure) | Pull requests not related to the core application - documentation, dependencies, tooling, etc |
| `ready-for-review` | [search](https://github.com/kactus-io/kactus/labels/ready-for-review) | Pull Requests that are ready to be reviewed by the maintainers. |
5 changes: 5 additions & 0 deletions .prettierrc.yml
Expand Up @@ -2,3 +2,8 @@ singleQuote: true
trailingComma: es5
semi: false
proseWrap: always

overrides:
- files: "*.scss"
options:
printWidth: 200
2 changes: 1 addition & 1 deletion app/.npmrc
@@ -1,4 +1,4 @@
runtime = electron
disturl = https://atom.io/download/electron
target = 1.8.3
target = 1.8.7
arch = x64
3 changes: 1 addition & 2 deletions app/package.json
Expand Up @@ -25,7 +25,7 @@
"codemirror-mode-elixir": "1.1.1",
"deep-equal": "^1.0.1",
"dexie": "^2.0.0",
"dugite": "^1.66.0",
"dugite": "^1.67.0",
"electron-window-state": "^4.0.2",
"event-kit": "^2.0.0",
"file-uri-to-path": "0.0.2",
Expand Down Expand Up @@ -64,7 +64,6 @@
"devtron": "^1.4.0",
"electron-debug": "^1.1.0",
"electron-devtools-installer": "^2.2.3",
"style-loader": "^0.13.2",
"temp": "^0.8.3",
"webpack-hot-middleware": "^2.10.0"
}
Expand Down
16 changes: 16 additions & 0 deletions app/src/lib/app-state.ts
Expand Up @@ -29,6 +29,7 @@ import { BranchesTab } from '../models/branches-tab'
import { PullRequest } from '../models/pull-request'
import { IAuthor } from '../models/author'
import { ComparisonCache } from './comparison-cache'
import { ApplicationTheme } from '../ui/lib/application-theme'

export { ICommitMessage }

Expand Down Expand Up @@ -196,6 +197,11 @@ export interface IAppState {

/** The currently selected tab for the Branches foldout. */
readonly selectedBranchesTab: BranchesTab

/** Show the diverging notification banner */
readonly isDivergingBranchBannerVisible: boolean
/** The currently selected appearance (aka theme) */
readonly selectedTheme: ApplicationTheme
}

export enum PopupType {
Expand Down Expand Up @@ -730,6 +736,16 @@ export interface ICompareState {
* A local cache of ahead/behind computations to compare other refs to the current branch
*/
readonly aheadBehindCache: ComparisonCache

/**
* The best candidate branch to compare the current branch to.
* Also includes the ahead/behind info for the inferred branch
* relative to the current branch.
*/
readonly inferredComparisonBranch: {
branch: Branch | null
aheadBehind: IAheadBehind | null
}
}

export interface ICompareFormUpdate {
Expand Down
21 changes: 16 additions & 5 deletions app/src/lib/dispatcher/dispatcher.ts
Expand Up @@ -59,6 +59,7 @@ import { PullRequest } from '../../models/pull-request'
import { IAuthor } from '../../models/author'
import { ITrailer } from '../git/interpret-trailers'
import { isGitRepository } from '../git'
import { ApplicationTheme } from '../../ui/lib/application-theme'

/**
* An error handler function.
Expand Down Expand Up @@ -122,11 +123,6 @@ export class Dispatcher {
return this.appStore._updateRepositoryMissing(repository, missing)
}

/** Load the history for the repository. */
public loadHistory(repository: Repository): Promise<void> {
return this.appStore._loadHistory(repository)
}

/** Load the next batch of history for the repository. */
public loadNextHistoryBatch(repository: Repository): Promise<void> {
return this.appStore._loadNextHistoryBatch(repository)
Expand Down Expand Up @@ -512,6 +508,13 @@ export class Dispatcher {
return this.appStore._setUpdateBannerVisibility(isVisible)
}

/**
* Set the divering branch notification banner's visibility
*/
public setDivergingBranchBannerVisibility(isVisible: boolean) {
return this.appStore._setDivergingBranchBannerVisibility(isVisible)
}

/**
* Reset the width of the repository sidebar to its default
* value. This affects the changes and history sidebar
Expand Down Expand Up @@ -1444,4 +1447,12 @@ export class Dispatcher {
) {
return this.appStore._updateCompareForm(repository, newState)
}

/**
* Set the application-wide theme
*/
public setSelectedTheme(theme: ApplicationTheme) {
return this.appStore._setSelectedTheme(theme)
}

}
14 changes: 14 additions & 0 deletions app/src/lib/editors/utils.ts
Expand Up @@ -14,6 +14,7 @@ export enum ExternalEditor {
RubyMine = 'RubyMine',
TextMate = 'TextMate',
Brackets = 'Brackets',
WebStorm = 'WebStorm',
}

export function parse(label: string): ExternalEditor | null {
Expand Down Expand Up @@ -47,6 +48,9 @@ export function parse(label: string): ExternalEditor | null {
if (label === ExternalEditor.Brackets) {
return ExternalEditor.Brackets
}
if (label === ExternalEditor.WebStorm) {
return ExternalEditor.WebStorm
}
return null
}

Expand Down Expand Up @@ -77,6 +81,8 @@ function getBundleIdentifiers(editor: ExternalEditor): ReadonlyArray<string> {
return ['com.macromates.TextMate']
case ExternalEditor.Brackets:
return ['io.brackets.appshell']
case ExternalEditor.WebStorm:
return ['com.jetbrains.WebStorm']
default:
return assertNever(editor, `Unknown external editor: ${editor}`)
}
Expand Down Expand Up @@ -113,6 +119,8 @@ function getExecutableShim(
return Path.join(installPath, 'Contents', 'Resources', 'mate')
case ExternalEditor.Brackets:
return Path.join(installPath, 'Contents', 'MacOS', 'Brackets')
case ExternalEditor.WebStorm:
return Path.join(installPath, 'Contents', 'MacOS', 'WebStorm')
default:
return assertNever(editor, `Unknown external editor: ${editor}`)
}
Expand Down Expand Up @@ -158,6 +166,7 @@ export async function getAvailableEditors(): Promise<
rubyMinePath,
textMatePath,
bracketsPath,
webStormPath,
] = await Promise.all([
findApplication(ExternalEditor.Atom),
findApplication(ExternalEditor.MacVim),
Expand All @@ -169,6 +178,7 @@ export async function getAvailableEditors(): Promise<
findApplication(ExternalEditor.RubyMine),
findApplication(ExternalEditor.TextMate),
findApplication(ExternalEditor.Brackets),
findApplication(ExternalEditor.WebStorm),
])

if (atomPath) {
Expand Down Expand Up @@ -214,6 +224,10 @@ export async function getAvailableEditors(): Promise<
results.push({ editor: ExternalEditor.Brackets, path: bracketsPath })
}

if (webStormPath) {
results.push({ editor: ExternalEditor.WebStorm, path: webStormPath })
}

return results
}

Expand Down
7 changes: 1 addition & 6 deletions app/src/lib/feature-flag.ts
Expand Up @@ -32,12 +32,7 @@ export function enableMergeTool(): boolean {
return enableDevelopmentFeatures()
}

/** Should the new Compare view be enabled? */
export function enableCompareSidebar(): boolean {
return true
}

/** Should the Notification of Diverging From Default Branch (NDDB) feature be enabled? */
export function enableNotificationOfBranchUpdates(): boolean {
return enableDevelopmentFeatures()
return enableBetaFeatures()
}
15 changes: 12 additions & 3 deletions app/src/lib/progress/from-process.ts
@@ -1,5 +1,6 @@
import { ChildProcess } from 'child_process'
import * as Fs from 'fs'
import * as Path from 'path'
import * as byline from 'byline'

import { GitProgressParser, IGitProgress, IGitOutput } from './git'
Expand Down Expand Up @@ -62,9 +63,17 @@ function createProgressProcessCallback(

process.on('close', () => {
disposable.dispose()
// NB: We don't really care about errors deleting the file, but Node
// gets kinda bothered if we don't provide a callback.
Fs.unlink(lfsProgressPath, () => {})
// the order of these callbacks is important because
// - unlink can only be done on files
// - rmdir can only be done when the directory is empty
// - we don't want to surface errors to the user if something goes
// wrong (these files can stay in TEMP and be cleaned up eventually)
Fs.unlink(lfsProgressPath, err => {
if (err == null) {
const directory = Path.dirname(lfsProgressPath)
Fs.rmdir(directory, () => {})
}
})
})
}

Expand Down

0 comments on commit 432b6f2

Please sign in to comment.