Repository navigation
Conversation
…he filter is applied
…rent order than the link anchor element, the condition will never match
|
I've passed the linter to fix the previous errors, however there are some errors that right now I couldn't figure out how to solve. Can someone give me a hint, or if I need to find another approach to solve these errors. |
|
Did you try |
arrow function and variable renamed to a more meaningful name Co-Authored-By: Sindre Sorhus <[email protected]>
…. In addition, more unused comments have been removed
@yakov116 , there are some comments where I've run |
| linkMergedSearchParameters.set('q', linkMergedSearchString.replace(regexpQuery, 'is:merged').trim()); | ||
| } | ||
|
|
||
| linkIsMerged.search = String(linkMergedSearchParameters); |
There was a problem hiding this comment.
To generate this link, try:
- cloning the “closed” link with
cloneNode(true)instead of generating a new<a> - setting the
textContentto "Merged"` - running this on its query:
.replace('is:closed', 'is:merged')
There was a problem hiding this comment.
Nice, this way I would not get anymore the typescript error telling me that there are some attributes missing.
However, I doubt that your third point may work, because if the closed filter is ON, it's query would not have the is:closed filter, so the .replace('is:closed', 'is:merged') will not work. That's why I prefer the way it is.
Or maybe I must choose the open link to clone if the closed link is selected, and vice versa. This way, i will always have the /is:closed|is:open/ string to replace by is:merged... I'm gonna give it a try!
There was a problem hiding this comment.
I've done it. Before calling the function to create the merge link, I check which link I have available on the current page: open, closed or total, and which one is selected. After this check, I clone the appropiate link using cloneNode and send it to the function so it can make the right search query. The fix is uploaded.
There was a problem hiding this comment.
Always prefer less code, that's the point of using cloneNode instead of creating a new link. All those conditions aren't readable.
Also I suggested the function name addMergeLink because it should literally add the merge link, on its own, without external help. It's easier to reason about functions when they're self-contained.
Refer to 872cd8a
…dLing, removed unnecesary code that checks if container of anchors exists
…the comments guidelines received by the PR
|
I left a couple of review comments to help improve the code for future PRs ^_^ |
Thank you Fregante, very kind. I'm gonna review the new commits and comments. |
|
Thanks Karl 🦙 |
|
Happy to help! See you on the next commit 😄 |
|
Looks Like this stopped working :( OK looks like this will work if your screen is small enough since there are 2 bars. One for smaller screens and one for bigger (Like mine) The smaller one, the element above has the class |
Closes #2574 feature request.
Test
You can test it on any issues page. For example: here
IssueHunt Summary
Referenced issues
This pull request has been submitted to:
IssueHunt has been backed by the following sponsors. Become a sponsor