hz-field breaks with late binding 'item'

Bug #1616251 reported by Tyr Johanson
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Hengqing Hu

Bug Description

Normal usage of hz-resource-property-list will break hz-field because the "item" is loaded asynchronously. Notice the use of a link function which inspects the "item" attribute, but doesn't watch it.

NOTE: A simple work around until this can be made more dynamic is to use "ng-if='ctrl.item'" on the hz-resource-property-list.

Details:
Using hz-resource-property-list on a details view within a routed-details-view. The specific item is provided by the routed-details-view ctrl.context.loadPromise. The natural usage in my template is

<hz-resource-property-list
    resource-type-name="OS::Designate::FloatingIp"
    item="ctrl.item"
    property-groups="[
      ['address', 'ptrdname', 'description', 'id', 'ttl', 'status', 'action']
    ]">
</hz-resource-property-list>

where ctrl.item is set by the result of the context load promise.

$scope.context.loadPromise.then(onGetResponse);
function onGetResponse(response) {
  ctrl.item = response.data;
}

Tags: angularjs
tags: added: angularjs
Changed in horizon:
milestone: none → next
Changed in horizon:
importance: Undecided → Low
Revision history for this message
Hengqing Hu (hudayou) wrote :

I have met the same problem in octavia-dashboard, when use did some action, the detail page is not updated because of that.

https://storyboard.openstack.org/#!/story/1713841

Revision history for this message
Akihiro Motoki (amotoki) wrote :

This affects multiple repos as mentioned in comment #1. It sounds better to raise the priority.

Changed in horizon:
milestone: next → rocky-2
importance: Low → High
Revision history for this message
Akihiro Motoki (amotoki) wrote :
Changed in horizon:
assignee: nobody → Hengqing Hu (hudayou)
Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/561457
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=d175d33037abd8a9ec00c101718d80a6bb30d915
Submitter: Zuul
Branch: master

commit d175d33037abd8a9ec00c101718d80a6bb30d915
Author: Jacky Hu <email address hidden>
Date: Sun Apr 15 19:44:59 2018 +0800

    Watch field item changes

    To allow fields in hz-resource-property-list to be refreshed upon
    action.

    Change-Id: I8f2dffad0fb28bd5b8d0a019ed28268fb8cbcd60
    Closes-Bug: #1616251

Changed in horizon:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/horizon 14.0.0.0b2

This issue was fixed in the openstack/horizon 14.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.