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

core: routing - params inherited from parent state are not saved in the state history #769

Closed
christophercr opened this issue Oct 15, 2018 · 0 comments · Fixed by #784
Closed

Comments

@christophercr
Copy link
Collaborator

christophercr commented Oct 15, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[X] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

After navigating a state that inherits some params from his parent, the state history saved by the Routing Service does not contain such inherited params. This makes the navigateToPrevious() and the getStateTreeParams() methods to return wrong results since they rely on such state history.

Expected behavior

The state history saved by the Routing Service should contain also the inherited params so that they are also reflected in the results of the navigateToPrevious() and the getStateTreeParams() methods.

Minimal reproduction of the problem with instructions

  • Declare 3 states:
    -- state A: define param1
    -- state B: child of state A and with no params defined (it will inherit the one from A)
    -- state C: child of state B and with no params defined (it will inherit the one from A)
    -- state D: completely isolated state (no parent)
  • Navigate to A passing no params
  • Navigate to B passing param1 = "some value"
  • Navigate to C passing no params
  • Navigate to D passing no params
  • Navigate to previous (calling the navigateToPrevious() method)
  • As a result of navigateToPrevious(), the end state should be C and param1 = "some value" should have been passed, since it is the inherited param from state B which was set on the transition to such state.

What is the motivation / use case for changing the behavior?

Accurate information stored in the state history for the navigateToPrevious() and the getStateTreeParams() methods.

Environment


Angular version: X.Y.Z
Stark version: 10.0.0-beta.0

@christophercr christophercr added this to the 10.0.0-beta.1 milestone Oct 15, 2018
@christophercr christophercr self-assigned this Oct 15, 2018
christophercr referenced this issue in christophercr/stark Oct 23, 2018
…s in navigation history. Adapt Routing Service isCurrentUiState() to take into account inherited params.

ISSUES CLOSED: #769
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant