Issue with the way we handle the next on solid-display

A bugfix had been tested by @matthieu here but I reverted it as it seems to have limitations.

Initially:

  • We were getting the closest element having the proper tag name from the click event and got its resource from there

With the bugfix:

  • We tried to pass the ID of the child resource when the child element was generated and bind them together on the click

Problem with inital version:

  • If we display a block being a solid-display with child solid-display but with a next on the parent of the parent, the click is binded on every element with their ids so a click on the child elements display a corrupted content (because of the closest)

Problem with version 2:

  • The only problem we got so far is with the circle and project entities in Hubl, which are using "through" models, like Circle-Members. The initialised solid-display bearing the next on clicks is actually associated with the CircleMembers entity, not the Circle entity, through the use of combined bind-user and nested-field. So a click on the element pass the CircleMember resource to the Circle route. Bad.

Generated HTML of the issue:

<solid-display class="circle-tab" bind-user="" nested-field="circles" fields="circle" 
  loader-id="loader-circles" empty-widget="hubl-create" empty-value="cercle" 
  widget-circle="hubl-menu-fix-url-circle" order-by="circle.name" next="circle" 
  data-src="http://localhost:8000/users/balessan/" order-asc="circle.name">
  <div>
    <solid-display data-src="http://localhost:8000/circle-members/3/" fields="circle" widget-circle="hubl-menu-fix-url-circle" active="">
      <div>
        <hubl-menu-fix-url-circle name="circle">
          <solid-display data-src="http://localhost:8000/circles/2/" 
             fields="status, name, jabberID, badge" value-badge="http://localhost:8000/circles/2/" 
             widget-status="hubl-menu-publicprivate" widget-badge="hubl-counter" widget-jabberid="hubl-menu-jabberid" 
             widget-name="solid-display-div" order-by="name">
            <div>
              <hubl-menu-publicprivate name="status"><div>#</div></hubl-menu-publicprivate>
              <solid-display-div name="name" value="Bienvenue">
                <div name="name">
                  Bienvenue
                </div>
              </solid-display-div>
              <hubl-menu-jabberid name="jabberID">
                <div class="hidden" data-jabberid="9m5lrhlqunuz@conference.happy-dev.fr"></div>
              </hubl-menu-jabberid>
              <hubl-counter name="badge">
                <solid-badge data-src="http://localhost:8000/circles/2/"></solid-badge>
              </hubl-counter>
            </div>
          </solid-display>
        </hubl-menu-fix-url-circle>
       </div>
     </solid-display>
   </div>
</solid-display>

The issue is that the closest is getting the <solid-display data-src="http://localhost:8000/circle-members/3/"> element instead of the <solid-display data-src="http://localhost:8000/circles/2/">

Ping @matthieu @clement ideas ?