Skip to content

Integrate notification banner component into Compare View (NDDB) - #4874

Merged
shiftkey merged 99 commits into
masterfrom
integrate-banner-component
Jun 21, 2018
Merged

shiftkey merged 99 commits into
masterfrom
integrate-banner-component

Conversation

@iAmWillShepherd

@iAmWillShepherd iAmWillShepherd commented Jun 5, 2018 •

Copy link
Copy Markdown
Contributor

🌵 🌵 🌵 This PR depends on PRs #4794 and #4783 being merged first🌵 🌵 🌵

Fixes #4767

This PR is just a continuation of the work done in ☝️ and integrates it into the Compare view UI.

See the gifs 👇 to see it in action.

Testing If you notice the banner doesn't popup right away, try clicking on another tab or performing a manual fetch ([more info](https://github.com/desktop/desktop/projects/10#card-10732873))

Unpublished repository

  1. Create a new branch (it does not matter if you branch off master or another branch)
  2. Make some commits on master
  3. Checkout the new branch you created
  4. Notification dot and banner should be visible
  5. Comparison branch should be master

2018-06-19 16 08 33

Published repository (non-fork)

  1. Create and publish a new branch (it does not matter if you branch off the default branch or another branch)
  2. Make some commits on the default branch and push
  3. Checkout the new branch you created
  4. Notification dot and banner should be visible
  5. Comparison branch should be default branch (likely master)

2018-06-19 22 56 52

Published repository (non-fork) with PR

  1. Create a new pull request targeting a branch that’s not the default branch
  2. Make some commits on the target branch
  3. Checkout the PR branch
  4. Notification dot and banner should be visible
  5. Comparison branch should be the target branch

2018-06-20 09 59 02

Published repository (fork) - Starting point for new project (origin/default-branch is ahead of current branch)

  1. Fork a repo and clone the forked repo
  2. Create a new branch
  3. Make some commits on the default branch
  4. Checkout the branch you created
  5. Notification dot and banner should be visible
  6. Comparison branch should be the default branch of the forked repo

2018-06-20 14 14 37

Published repository (fork) - Contributing to another project (origin/default-branch is not ahead of current branch)

  1. Fork a repo and clone the forked repo
  2. Create a new branch
  3. Make some commits on the parent repo’s default branch
  4. Perform a manual fetch (or wait, your choice)
  5. Notification dot and banner should be visible
  6. Comparison branch should be the default branch of the parent repo (likely upstream/master)

2018-06-20 10 33 25

@iAmWillShepherd iAmWillShepherd added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jun 20, 2018
@meaghanlewis meaghanlewis mentioned this pull request Jun 20, 2018
20 tasks done
@shiftkey shiftkey self-assigned this Jun 21, 2018
Comment thread app/src/lib/stores/app-store.ts Outdated
getRemotes,
compareState.aheadBehindCache
)
aheadBehindOfInferredBranch =

This comment was marked as spam.

Comment thread app/src/lib/stores/app-store.ts Outdated

public _setDivergingBranchBannerVisibility(visibility: boolean) {
this.isDivergingBranchBannerVisible = visibility
this.emitUpdate()

This comment was marked as spam.

if (ghRepo.parent !== null && ghRepo.parent.defaultBranch !== null) {
return getDefaultBranchOfForkedGitHubRepo(repository, branches, getRemotes)
}
const potentialdefaultBranchOfParent = await getDefaultBranchOfForkedGitHubRepo(

This comment was marked as spam.

Comment thread app/src/lib/stores/app-store.ts Outdated
this.emitUpdate()
}

public _setDivergingBranchBannerVisibility(visibility: boolean) {

This comment was marked as spam.

const range = revRange(currentBranch.tip.sha, defaultBranch.tip.sha)
const aheadBehind = await getAheadBehind(repository, range)
if (aheadBehind !== null && aheadBehind.ahead > 0) {
// I need to keep track of ahead/behind of two branches and return based on which one has ahead > 0

This comment was marked as spam.

* from the current branch
*/
readonly baseBranch: Branch
readonly onDismiss: () => void

This comment was marked as spam.


let mockComparisonCache: ComparisonCache
beforeEach(() => {
mockComparisonCache = new ComparisonCache()

This comment was marked as spam.

@iAmWillShepherd

Copy link
Copy Markdown
Contributor Author

🥇

@shiftkey

Copy link
Copy Markdown
Member

Needs a merge from master as AppVeyor and Travis are testing the merge commit (not the tip of the branch).


let comparisonCache: ComparisonCache
beforeEach(() => {
comparisonCache = new ComparisonCache()

This comment was marked as spam.

@shiftkey

Copy link
Copy Markdown
Member

Nice work @iAmWillShepherd!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants