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

Fix deprioritize-marketplace-link #3725

Merged
merged 6 commits into from
Nov 17, 2020
Merged

Fix deprioritize-marketplace-link #3725

merged 6 commits into from
Nov 17, 2020

Conversation

yakov116
Copy link
Member

  1. LINKED ISSUES:
    profile-hotkey is broken since the dropdown is lazy loaded #3720 (comment)

  2. TEST URLS:
    all over

  3. SCREENSHOT:
    None

@yakov116 yakov116 added the bug label Nov 15, 2020
@yakov116
Copy link
Member Author

@busches can you double check this on enterprise?

Co-authored-by: Federico <me@fregante.com>
@yakov116
Copy link
Member Author

Oh my... that applied bad. 🤣

@fregante fregante mentioned this pull request Nov 15, 2020
?.closest('.border-top, .mr-3')!.remove();

(await elementReady('[aria-label="View profile and more"]'))
?.closest('details')!
Copy link
Member

Choose a reason for hiding this comment

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

Actually, is the ?. needed in either one? If Enterprise doesn't have the link, it should just be excluded

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not sure.

I think it was added because some pages, like the enter password dont have the links. I dont know if its still relevant

Copy link
Member

Choose a reason for hiding this comment

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

like the enter password dont have the links

Let's find out because I don't care about password pages. They have nothing so, if anything, RGH should not run there at all.

Copy link
Member Author

@yakov116 yakov116 Nov 15, 2020

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

So the code should be updated to use a regular if:

If there’s a marketplace link, move it to the dropdown.

Copy link
Member

Choose a reason for hiding this comment

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

With a comment

@busches
Copy link
Member

busches commented Nov 16, 2020

@yakov116 This is not always a thing on Enterprise, I believe it's opt-in only at this point, keeping the if like was there before will be fine. I would suggest that we only add the link if we actual move it, right now we always add the link even if one didn't exist before.


await domLoaded;

function handleMenuOpening(): void {
select.last('.header-nav-current-user ~ .dropdown-divider')!.before(
<div className="dropdown-divider"/>,
<a className="dropdown-item" href="/marketplace">Marketplace</a>
Copy link
Member

@fregante fregante Nov 16, 2020

Choose a reason for hiding this comment

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

@busches Does GHE link here or always to github.com? If github.com, let's use this:

Suggested change
<a className="dropdown-item" href="/marketplace">Marketplace</a>
<a className="dropdown-item" href="https://github.com/marketplace">Marketplace</a>

Copy link
Member

Choose a reason for hiding this comment

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

Not sure, I've not seen it activated in the wild, just sounds possible from the release notes.

Copy link
Member

Choose a reason for hiding this comment

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

Who knows then. The selector only specifically selects local links (.Header-link[href="/marketplace"]) so if this change is required, the selector also needs to be changed.

Since nobody complained, I'll leave it as is.

Copy link
Member

@fregante fregante left a comment

Choose a reason for hiding this comment

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

If the current implementation works for you, it can be merged

@yakov116 yakov116 merged commit 38fb7b0 into master Nov 17, 2020
@yakov116 yakov116 deleted the marketplace branch November 17, 2020 05:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants