Skip to content

Conversation

@lucymtc
Copy link
Contributor

@lucymtc lucymtc commented Jun 25, 2019

Summary

This PR can be summarized in the following changelog entry:

  • Fix analytics setup flow empty render for accounts with only shared properties or views.

Fixes #11

Relevant technical choices

Checklist:

ivankristianto
ivankristianto previously approved these changes Jun 25, 2019
Copy link
Contributor

@ivankristianto ivankristianto left a comment

Choose a reason for hiding this comment

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

Code looks good and It works.


// Accounts will always include Set up New Account option unless existing tag matches property.
if ( ( 1 >= accounts.length && ! existingTag ) || ( 0 >= accounts.length && existingTag ) || setupNewAccount ) {
if ( 0 >= accounts.length ) {
Copy link
Member

Choose a reason for hiding this comment

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

@lucymtc Can you provide some context on why exactly you changed this the way you did, with background on the individual checks?

I would like to have more insight since the previous conditions were quite complex, and now those were removed, so I want to make sure we don't run into regressions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@felixarntz in property and profile dropdown we have the options "Set a new property" and "Set a new profile", we used to have also "Set a new account" in account dropdown only when existingTag was false. so 1 >= accounts.length was actually taking into count "Set a new account" option.
This option was removed from the dropdown, so for users that only have 1 analytics account 1 >= accounts.length && ! existingTag returns true and it shouldn't, this should only return true now when accounts.length = 0

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the response. Wouldn't we need to keep the setupNewAccount condition though?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, that can be removed. I have pushed an update

Copy link
Member

Choose a reason for hiding this comment

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

Great, thanks for this! Let's make sure we always clean up after ourselves when making such changes, otherwise we'll end up with a cluttered codebase, and in the future nobody will know why that property exists.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

Awesome!

Copy link
Contributor

@ivankristianto ivankristianto left a comment

Choose a reason for hiding this comment

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

Code looks good to me.

@felixarntz felixarntz merged commit b3613d3 into develop Jun 26, 2019
@felixarntz felixarntz deleted the fix/analytics-setup-flow branch July 4, 2019 11:35
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.

Analytics module fails set up flow

3 participants