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

Inventory controllers uses lastCycle, if available, or the first cycle given #2070

Merged
merged 6 commits into from
Jan 27, 2020

Conversation

adrian-lara
Copy link
Contributor

@adrian-lara adrian-lara commented Jan 7, 2020

Any background context you want to provide?

There were rare cases where the inventory list, inventory map, and pairing pages did not load with a default Cycle.

See the attached issue for more details.

What's this PR do?

Refactors the logic that applies the last Cycle chosen on the inventory list, inventory map, and pairing pages to ensure a Cycle is always chosen.

Before, the logic for applying the last Cycle relied on there existing any "lastCycle" ID (whether or not that ID was for a Cycle known to that Organization). This PR updates that logic to always try to "find" the Cycle associated to the "lastCycle" ID provided before applying it. This validates whether it is, in fact, a Cycle associated to the current organization.

How should this be manually tested?

Go through the steps described in the relevant tickets, and see that a default Cycle is always chosen.
OR alternatively
Manually update the localStorage lastCycle entries to apply a random/invalid Cycle ID to your current org. Then, visit the inventory list, inventory map, or pairing page to see that a default Cycle is chosen regardless of that invalid ID.

What are the relevant tickets?

#2069

@coveralls
Copy link

coveralls commented Jan 14, 2020

Coverage Status

Coverage remained the same at 76.473% when pulling f2dc102 on 2069_default_cycle into 080ba83 on develop.

@nllong nllong self-requested a review January 27, 2020 17:26
Copy link
Member

@nllong nllong left a comment

Choose a reason for hiding this comment

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

Tested on inventory, map, and pairing by resetting localStorage cycles. Worked as expected.

@nllong nllong merged commit b620b69 into develop Jan 27, 2020
@nllong nllong deleted the 2069_default_cycle branch January 27, 2020 19:45
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.

None yet

3 participants