Skip to content

Add link to forked repo below the original - #2141

Closed
jerone wants to merge 24 commits into
refined-github:masterfrom
jerone:#1129-forked-to
Closed

jerone wants to merge 24 commits into
refined-github:masterfrom
jerone:#1129-forked-to

Conversation

@jerone

@jerone jerone commented Jun 9, 2019 •

Copy link
Copy Markdown
Contributor

Description

Add links to the forked repos below the original repo. For users and organizations.

Closes

Closes #1129
Supersedes attempt 1 #1108
Supersedes attempt 2 #2105

Screenshots

Original repo:
image

User forked repo:
image

Organization forked repo:
image

Hover card:
image
Feature removed

Test

  1. Open any repo and click on the Fork button.
  2. Fork the repo.
  3. Go back to the original repo.
  4. Below the repo name, a link to your fork will presented.

@jerone

jerone commented Jun 9, 2019 •

Copy link
Copy Markdown
Contributor Author

@bfred-it Before I going to fix every linting error, can you review if this PR satisfies the way you like to see this implemented.

@jerone

jerone commented Jun 9, 2019 •

Copy link
Copy Markdown
Contributor Author
  • When you visit a repo
    1. it checks for cached forks
    2. and validates if forks still exists
    3. and add fork links.
  • When you visit a fork (user or org)
    1. it caches the fork.
  • When you open the fork dialog
    1. it caches all forks.

@fregante

fregante commented Jun 9, 2019

Copy link
Copy Markdown
Member

Looks about right, the only issue is ensuring that the forked page you visit is actually your fork, so you might need to look for the Settings tab or something like that to double check.

@jerone jerone changed the title Add link to forked repo below the original [WIP] Add link to forked repo below the original Jun 9, 2019
@jerone jerone changed the title [WIP] Add link to forked repo below the original Add link to forked repo below the original Jun 9, 2019
@jerone

jerone commented Jun 9, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it Ok, this is ready for review. 👀

Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
@fregante

fregante commented Jun 9, 2019 •

Copy link
Copy Markdown
Member

This can be cleaned up further, do a couple of simplification passes

@jerone

jerone commented Jun 9, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it Feedback round 1 done.

@fregante fregante left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs a pass or two. Merge the short functions that are used once or always together, you’ll find further simplification possible. Can be brought to 110 likes probably

Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
@jerone

jerone commented Jun 10, 2019

Copy link
Copy Markdown
Contributor Author

Brought it back to 122 LOC.

@jerone

jerone commented Jun 10, 2019

Copy link
Copy Markdown
Contributor Author

Found one issue, that I'm not sure is related to this new feature...

  1. Go to the global PR's.
  2. Find any PR repo that you know has forks.
  3. See no forks being loaded!
  4. Navigate to issues or any other page on the repo (or refresh page) and it works.

I can only reproduce the issue via above route. Any other route, the forks are loaded correctly.

@jerone

jerone commented Jun 12, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it All feedback resolved.

Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
Comment thread source/features/forked-to.tsx Resolved
@jerone

jerone commented Jun 12, 2019

Copy link
Copy Markdown
Contributor Author

@bfred-it Feedback processed again.


async function validateFork(repo: string): Promise<boolean> {
const response = await fetch(location.origin + '/' + repo,
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not the suggested indentation

}

function watchForkDialog(): void {
const forkDialog = select<HTMLElement>('details-dialog[src*="/fork"]')!;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the feedback I sent before applies to other parts of the file as well. I can’t review every single line. This PR has been sloppy. Please clean it up and open a new PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Webpack compiles, lint succeeds, the PR does exactly what it should do, in the way you specified it should be done, without code style guide. I try to follow other features syntax, but you have a very opinionated way of writing code. I'm not saying that that is bad, and the feedback is great.

See #2153

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't followed the review here, but what @bfred-it means is that when he reviews some change, and you fix it, you should look for other places where the same fix or similar fix could be applied. You should also look if there's any way to improve/simplify the code after the changes.

@fregante fregante closed this Jun 13, 2019
@jerone
jerone deleted the #1129-forked-to branch July 3, 2019 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Add link to forked repo below the original

3 participants