FLUID-6603: Define the relay direction between the parent component and a conditional component

Metadata

Source
FLUID-6603
Type
Bug
Priority
Major
Status
Closed
Resolution
Not A Bug
Assignee
Antranig Basman
Reporter
Cindy Li
Created
2021-03-15T13:44:38.527-0400
Updated
2024-07-22T10:35:08.027-0400
Versions
N/A
Fixed Versions
N/A
Component
  1. Data Binder

Description

When a model relay is:

1. Defined in a conditional sub-component that is constructed by a boolean model value in the parent component;
2. Define the initial model value in the sub-component;
3. Use "modelRelay" block to relay the model value between the parent component and the conditional sub-component.

Check model values after the construction, model values are all set to the initial value of the parent component rather than that of the sub-component. This seems making sense in some sort because the relay definition didn't tell which direction the relay should occur at the instantiation so the framework picks one which is from the parent to the sub.

A pull request is issued against Antranig's FLUID-6580 branch to demonstrate this problem.

Comments

  • Antranig Basman commented 2021-03-17T09:08:18.455-0400

    As the pull request was written, the annotation was written in the wrong direction

    forward: {
       excludeSource: "init"
    }
    

    acts to prevent the source value flowing towards the target on initialisation (forward direction). However, the source value is the one on the subcomponent, and the target is on the parent. The rule should instead read

    backward: {
       excludeSource: "init"
    }
    

    Therefore this feature is "working as designed" - however I have merged the test case in the pull request with the required fix since it supplies helpful extra coverage.