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

Ensure Team Billing link is present on initial page load #2406

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

knolleary
Copy link
Member

Fixes #2398

Description

When loading any team page, the Billing link was missing. As soon as you navigated to another team view, the billing link would appear.

Having added a bunch of debug, I could see the checkFeatures call being made, and this.navigation.admin was being updated to add the billing link. However the rendered view wasn't changing in response. As soon as you click around, it rerenders the sidebar and displays the link correctly.

Exactly why vue isn't refreshing the component when one of its computed props changes, I'm not entirely sure. And why it has started happening now, when it doesn't happen on production is also unknown.

The fix is to do the this.features.billing check in the original computed property function - it was already doing that for the shared library. That means we don't do any mutation of the computed property outside of the function.

Have click tested this locally.

@knolleary knolleary requested a review from Pezmc July 4, 2023 16:42
checkFeatures () {
if (this.features.billing) {
// insert billing in second slot of admin
this.navigation.admin.splice(1, 0, {
Copy link
Contributor

Choose a reason for hiding this comment

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

I belive Vue doesn't always handle deep observations, i.e. this.navigation changing will trigger a re-render, but this.navigation.admin mutating will not

@Pezmc Pezmc merged commit 3e94b89 into main Jul 5, 2023
@Pezmc Pezmc deleted the 2398-fix-billing-team-link branch July 5, 2023 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Billing team menu item missing on first page load
2 participants