Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore `raw-file-link` feature #2101

Merged
merged 6 commits into from Jun 5, 2019

Conversation

Projects
None yet
3 participants
@gavinhenderson
Copy link
Contributor

commented May 30, 2019

@bfred-it bfred-it force-pushed the sindresorhus:master branch from 5df5c5f to 5f1a966 Jun 1, 2019

@gavinhenderson

This comment has been minimized.

Copy link
Contributor Author

commented Jun 3, 2019

@bfred-it Thanks for the feedback! I've made it less specific, using the href selector as suggested. Hopefully this makes it more robust to any future UI changes from upstream

gavinhenderson and others added some commits Jun 3, 2019

Added 'menuitem' role to the 'raw-file-link' anchor
Co-Authored-By: Laxman <notlmn@outlook.com>
@gavinhenderson

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2019

@bfred-it I initially removed it as it was duplicating as you said. Latest commit restores the call before the PR is loaded and makes sure not to duplicate the link.

</a>
);
for (const dropdown of select.all<HTMLElement>('.js-file-header-dropdown')) {
const anchor: HTMLAnchorElement | null = select('[data-ga-click^="View file"]', dropdown);

This comment has been minimized.

Copy link
@bfred-it

bfred-it Jun 5, 2019

Collaborator

In this case you can add a ! at the end instead of specifying |null, and can specify the expected type with <...>

const anchor = select<HTMLAnchorElement>('[data-ga-click^="View file"]', dropdown)!;

@bfred-it bfred-it changed the title Fixed issue with raw-file-link not being added to the page Restore `raw-file-link` feature Jun 5, 2019

@bfred-it bfred-it merged commit ff62ae6 into sindresorhus:master Jun 5, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bfred-it

This comment has been minimized.

Copy link
Collaborator

commented Jun 5, 2019

Thanks for the fix 🐛 , @gavinhenderson

@gavinhenderson

This comment has been minimized.

Copy link
Contributor Author

commented Jun 5, 2019

@bfred-it Thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.