← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1616251] Re: hz-field breaks with late binding 'item'

 

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 <hudayou@xxxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1616251

Title:
  hz-field breaks with late binding 'item'

Status in OpenStack Dashboard (Horizon):
  Fix Released

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;
  }

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1616251/+subscriptions


References