Skip to content

Commit

Permalink
Merge branch 'master' into changelog-for-1-1-1
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftkey committed Mar 26, 2018
2 parents b0966a2 + 469c887 commit d98f3bc
Show file tree
Hide file tree
Showing 11 changed files with 159 additions and 143 deletions.
1 change: 1 addition & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,5 @@ pull requests.

| Label name | :mag_right: | Description |
| --- | --- | --- |
| `infrastructure` | [search](https://github.com/desktop/desktop/labels/infrastructure) | Pull requests not related to the core application - documentation, dependencies, tooling, etc. |
| `ready-for-review` | [search](https://github.com/desktop/desktop/labels/ready-for-review) | Pull Requests that are ready to be reviewed by the maintainers. |
16 changes: 14 additions & 2 deletions app/src/lib/dispatcher/dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -487,8 +487,8 @@ export class Dispatcher {
}

/** Update the repository's issues from GitHub. */
public updateIssues(repository: GitHubRepository): Promise<void> {
return this.appStore._updateIssues(repository)
public refreshIssues(repository: GitHubRepository): Promise<void> {
return this.appStore._refreshIssues(repository)
}

/** End the Welcome flow. */
Expand Down Expand Up @@ -806,6 +806,18 @@ export class Dispatcher {
} catch (e) {
rejectOAuthRequest(e)
}

if (__DARWIN__) {
// workaround for user reports that the application doesn't receive focus
// after completing the OAuth signin in the browser
const window = remote.getCurrentWindow()
if (!window.isFocused()) {
log.info(
`refocusing the main window after the OAuth flow is completed`
)
window.focus()
}
}
break

case 'open-repository-from-url':
Expand Down
9 changes: 6 additions & 3 deletions app/src/lib/stores/app-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
const gitHubRepository = repository.gitHubRepository

if (gitHubRepository != null) {
this._updateIssues(gitHubRepository)
this._refreshIssues(gitHubRepository)
this.loadPullRequests(repository, async () => {
const promiseForPRs = this.pullRequestStore.fetchPullRequestsFromCache(
gitHubRepository
Expand Down Expand Up @@ -871,14 +871,14 @@ export class AppStore extends TypedBaseStore<IAppState> {
return this._repositoryWithRefreshedGitHubRepository(repository)
}

public async _updateIssues(repository: GitHubRepository) {
public async _refreshIssues(repository: GitHubRepository) {
const user = getAccountForEndpoint(this.accounts, repository.endpoint)
if (!user) {
return
}

try {
await this._issuesStore.fetchIssues(repository, user)
await this._issuesStore.refreshIssues(repository, user)
} catch (e) {
log.warn(`Unable to fetch issues for ${repository.fullName}`, e)
}
Expand Down Expand Up @@ -2439,6 +2439,9 @@ export class AppStore extends TypedBaseStore<IAppState> {

if (fetchType === FetchType.UserInitiatedTask) {
this._refreshPullRequests(repository)
if (repository.gitHubRepository != null) {
this._refreshIssues(repository.gitHubRepository)
}
}
}
})
Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/stores/issues-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ export class IssuesStore {
}

/**
* Fetch the issues for the repository. This will delete any issues that have
* Refresh the issues for the current repository. This will delete any issues that have
* been closed and update or add any issues that have changed or been added.
*/
public async fetchIssues(repository: GitHubRepository, account: Account) {
public async refreshIssues(repository: GitHubRepository, account: Account) {
const api = API.fromAccount(account)
const lastUpdatedAt = await this.getLatestUpdatedAt(repository)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class IssuesAutocompletionProvider
text: string
): Promise<ReadonlyArray<IIssueHit>> {
this.updateIssuesScheduler.queue(() => {
this.dispatcher.updateIssues(this.repository)
this.dispatcher.refreshIssues(this.repository)
})

return this.issuesStore.getIssuesMatching(this.repository, text)
Expand Down
2 changes: 1 addition & 1 deletion changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"[Improved] Electron 1.8.3 upgrade (again)"
],
"1.1.1-test1": [
"[Improved] Electron 1.8.3 upgrade"
"[Improved] Forcing a focus on the window after the OAuth dance is done"
],
"1.1.1-beta1": [

Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"compile:prod": "cross-env NODE_ENV=production parallel-webpack --config app/webpack.production.js",
"build:dev": "yarn compile:dev && cross-env NODE_ENV=development ts-node script/build.ts",
"build:prod": "yarn compile:prod && cross-env NODE_ENV=production ts-node script/build.ts",
"package": "ts-node -P script script/package.ts",
"package": "ts-node -P script/tsconfig.json script/package.ts",
"generate-octicons": "ts-node script/generate-octicons.ts",
"clean:tslint": "rimraf tslint-rules/*.js",
"compile:tslint": "tsc -p tslint-rules",
Expand Down Expand Up @@ -62,37 +62,37 @@
"clean-webpack-plugin": "^0.1.16",
"cross-env": "^5.0.5",
"css-loader": "^0.28.5",
"eslint": "^4.15.0",
"eslint": "^4.19.1",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-babel": "^4.1.2",
"eslint-plugin-prettier": "^2.4.0",
"eslint-plugin-react": "^7.5.1",
"eslint-plugin-typescript": "^0.8.1",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^7.7.0",
"eslint-plugin-typescript": "^0.10.0",
"express": "^4.15.0",
"extract-text-webpack-plugin": "^3.0.0",
"fs-extra": "^2.1.2",
"html-webpack-plugin": "^2.30.1",
"json-pretty": "^0.0.1",
"klaw-sync": "^3.0.0",
"legal-eagle": "0.15.0",
"mocha": "^4.0.1",
"mocha": "^5.0.4",
"node-native-loader": "^1.1.1",
"node-sass": "^4.7.2",
"octicons": "^7.0.1",
"parallel-webpack": "^2.1.0",
"prettier": "1.11.0",
"prettier": "1.11.1",
"request": "^2.72.0",
"rimraf": "^2.5.2",
"sass-loader": "^6.0.6",
"semver": "^5.5.0",
"spectron": "^3.8.0",
"style-loader": "^0.19.1",
"to-camel-case": "^1.0.0",
"ts-node": "^3.2.0",
"tslint": "^5.8.0",
"tslint-config-prettier": "^1.6.0",
"tslint-microsoft-contrib": "^5.0.1",
"tslint-react": "~3.2.0",
"ts-node": "^5.0.1",
"tslint": "^5.9.1",
"tslint-config-prettier": "^1.10.0",
"tslint-microsoft-contrib": "^5.0.3",
"tslint-react": "^3.5.1",
"typescript": "2.7.2",
"typescript-eslint-parser": "^14.0.0",
"webpack": "^3.10.0",
Expand All @@ -104,7 +104,7 @@
},
"devDependencies": {
"@types/byline": "^4.2.31",
"@types/chai": "^4.0.5",
"@types/chai": "^4.1.2",
"@types/chai-datetime": "^0.0.31",
"@types/classnames": "^2.2.2",
"@types/codemirror": "0.0.55",
Expand All @@ -115,7 +115,7 @@
"@types/fs-extra": "2.1.0",
"@types/fuzzaldrin-plus": "^0.0.1",
"@types/keytar": "^4.0.0",
"@types/mocha": "^2.2.29",
"@types/mocha": "^2.2.48",
"@types/mri": "^1.1.0",
"@types/node": "^7.0.18",
"@types/react": "^16.0.40",
Expand All @@ -134,8 +134,8 @@
"@types/xml2js": "^0.4.0",
"electron": "1.8.3",
"electron-builder": "20.2.0",
"electron-mocha": "^5.0.0",
"electron-mocha": "^6.0.1",
"electron-packager": "^11.0.0",
"electron-winstaller": "2.5.2"
}
}
}
4 changes: 4 additions & 0 deletions script/changelog/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,9 @@ export async function getLogLines(
'--',
])

if (log.length === 0) {
return []
}

return log.split('\0')
}
3 changes: 2 additions & 1 deletion script/generate-octicons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,6 @@ generateIconData().then(result => {

console.log('Ensuring generated file is formatted correctly...')
const root = Path.dirname(__dirname)
return cp.spawn('yarn', ['lint:fix'], { cwd: root, stdio: 'inherit' })
const yarnExecutable = process.platform === 'win32' ? 'yarn.cmd' : 'yarn'
return cp.spawn(yarnExecutable, ['lint:fix'], { cwd: root, stdio: 'inherit' })
})
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"static-before-instance",
"variables-before-functions"
],
"no-stateless-class": true,
"no-unnecessary-class": true,
"promise-must-complete": true,
"react-no-unbound-dispatcher-props": true,
"react-proper-lifecycle-methods": true,
Expand Down
Loading

0 comments on commit d98f3bc

Please sign in to comment.