Refactor angular cloud services utilities

Bug #1450150 reported by Travis Tripp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Travis Tripp

Bug Description

A nova-extensions and settings-service services and directives were implemented at the very end of Kilo. The directives created for needsto be able to be attribute based and investigated for how it might be combined with other conditional behavior based directives.

The Nova Extension check needs to also make use of the Service Catalog (check if service is even enabled before checking extensions). This should include that works as well.

See here: https://review.openstack.org/#/c/164359/12/horizon/static/horizon/js/angular/services/hz.api.keystone.js

See line 12 here for example of directive using extensions that we want to enhance using the service catalog.

https://review.openstack.org/#/c/166708/22/openstack_dashboard/static/dashboard/launch-instance/configuration/configuration.html

See line 110 here:
https://review.openstack.org/#/c/171418/13/openstack_dashboard/static/dashboard/launch-instance/source/source.html

See also:
https://review.openstack.org/#/c/170351/

This all introduced a new cloud services.js which created some unwanted extra dependency injection. This can be refactored to its own new utility.
Support attributes vs elements.
Review naming.
Consider using lazy loading via the compile function
https://www.youtube.com/watch?v=UMkd0nYmLzY&t=24m30s

Changed in horizon:
assignee: nobody → Travis Tripp (travis-tripp)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/179516

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/212125

Changed in horizon:
assignee: Travis Tripp (travis-tripp) → Rajat Vig (rajatv)
Changed in horizon:
assignee: Rajat Vig (rajatv) → Travis Tripp (travis-tripp)
Changed in horizon:
assignee: Travis Tripp (travis-tripp) → Rajat Vig (rajatv)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/214057

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/214815

Changed in horizon:
assignee: Rajat Vig (rajatv) → Thai Tran (tqtran)
Changed in horizon:
assignee: Thai Tran (tqtran) → Rajat Vig (rajatv)
Changed in horizon:
assignee: Rajat Vig (rajatv) → Travis Tripp (travis-tripp)
Changed in horizon:
assignee: Travis Tripp (travis-tripp) → Rajat Vig (rajatv)
Changed in horizon:
assignee: Rajat Vig (rajatv) → Travis Tripp (travis-tripp)
Changed in horizon:
assignee: Travis Tripp (travis-tripp) → Rajat Vig (rajatv)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/179516
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=9eb471c59528ae1bea56ab109053836f61c166e4
Submitter: Jenkins
Branch: master

commit 9eb471c59528ae1bea56ab109053836f61c166e4
Author: Travis Tripp <email address hidden>
Date: Wed Aug 5 18:08:11 2015 -0600

    Refactor angular cloud services utilities

    A nova-extensions and settings-service services and directives
    were implemented at the very end of Kilo.

    The directive implementation required a dependency tree that
    should have to be maintained. This removes that dependency
    tree. It also greatly improves the ability to customize
    the directives, while improving readability, by using the
    angular.extend way of creating directives from a template.

    Ultimately, this leads to much better decoupling of the
    functionality which makes it easier for future plugins
    and deployers to write their own directives with similar
    functionality.

    This is the recommended way by angular docs.
    See the bottom of this page for more on extending directives:

      https://github.com/angular/angular.js/wiki/Understanding-Directives

    This change also enables the directive to be attribute based,
    rather than element based, making it more flexible in usage.

    In addition, this takes advantage of compilation that improves
    performance by ensuring that non-enabled features are not
    compiled, meaning any nested directives will not be processed.

    To manually test this with Launch Instance NG:

    hz-settings-toggle:
      In local_settings.py the following between True and False
         'can_set_mount_point': True,

      On the first step of Launch Instance, notice that when you select
      Create New Volume that when the above is True, that you'll have
      and input box for setting the device name. When it is false,
      you won't have the input box.

    hz-nova-extensions:
      In openstack_dashboard/dashboards/project/static/dashboard/
         project/workflow/launch-instance/configuration/configuration.html

      Find <div hz-nova-extensions='["ConfigDrive"]'>
      Change to <div hz-nova-extensions='["NON_EXISTENT_EXTENSION"]'>

      Launch the Launch Instance NG. Go to the Configuration step.
      Note that when the extension is ConfigDrive, you'll see the
      checkbox for config drive. When you set NON_EXISTENT_EXTENSION,
      the checkbox won't exist.

    Change-Id: I56b52288d18a2558d2a60878c88714d2672bf783
    Partial-Bug: #1450150
    Co-Authored-By: Rajat Vig <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/216949

Changed in horizon:
assignee: Rajat Vig (rajatv) → Travis Tripp (travis-tripp)
Changed in horizon:
assignee: Travis Tripp (travis-tripp) → Thai Tran (tqtran)
Changed in horizon:
assignee: Thai Tran (tqtran) → Rajat Vig (rajatv)
Changed in horizon:
assignee: Rajat Vig (rajatv) → Travis Tripp (travis-tripp)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/217952

Changed in horizon:
assignee: Travis Tripp (travis-tripp) → Rajat Vig (rajatv)
Changed in horizon:
assignee: Rajat Vig (rajatv) → Thai Tran (tqtran)
Changed in horizon:
assignee: Thai Tran (tqtran) → Rajat Vig (rajatv)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/216949
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=9effa6db2528b79edbf457299facc32d5f72b015
Submitter: Jenkins
Branch: master

commit 9effa6db2528b79edbf457299facc32d5f72b015
Author: Travis Tripp <email address hidden>
Date: Tue Aug 25 15:50:29 2015 -0600

    Improve Cloud Service Directive Documentation

    Upon reading the code for additional directives, the descriptions
    on these directives stood out as being unclear. This patch provides
    improved descriptions.

    Change-Id: Icefbdc6e39d3b8ea608089cfe275b983210383e4
    Partial-Bug: #1450150

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/217952
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=e070d1334888ddf0da5e17c58c274d06fd3412e0
Submitter: Jenkins
Branch: master

commit e070d1334888ddf0da5e17c58c274d06fd3412e0
Author: Travis Tripp <email address hidden>
Date: Thu Aug 27 16:38:58 2015 -0600

    hz-if prefix change to promise directives

    Based on the following patch discussion and some IRC discussion,
    we decided that the directives being refactored as part of this
    bug could use a better naming pattern.

    Basically hz-if-<target>, similar to ng-if.

    See:

    https://review.openstack.org/#/c/212125/7/openstack_dashboard/
    static/app/core/cloud-services/hz-service-enabled.directive.js

    Change-Id: I4d6ec6bc0a1d69f9c77659c98c875a50b81d30e5
    Partial-Bug: #1450150

Changed in horizon:
assignee: Rajat Vig (rajatv) → Travis Tripp (travis-tripp)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/212125
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=ae771ba2a166cd33dfcb0e7f771f01822409f7b8
Submitter: Jenkins
Branch: master

commit ae771ba2a166cd33dfcb0e7f771f01822409f7b8
Author: Rajat Vig <email address hidden>
Date: Wed Aug 12 10:52:31 2015 -0700

    Cloud Service directive to check if Service is enabled

    This directive checks if the given service is enabled
    in the Service Catalog.

    Change-Id: Iaffb9d738e94ef25bca4938405ac9f2f4aa7b368
    Partial-Bug: #1450150

Changed in horizon:
assignee: Travis Tripp (travis-tripp) → Kyle Olivo (kyleolivo)
Changed in horizon:
assignee: Kyle Olivo (kyleolivo) → Thai Tran (tqtran)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Reviewed: https://review.openstack.org/214815
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=8d5eebbdf6eb3d4c55fb933f1d3e5f77204f3880
Submitter: Jenkins
Branch: master

commit 8d5eebbdf6eb3d4c55fb933f1d3e5f77204f3880
Author: Thai Tran <email address hidden>
Date: Thu Oct 22 13:15:15 2015 -0700

    Directive to check if policy check passes

    A directive to check for policies. If it passes, the contents enclosed are
    shown to the user, otherwise it will remain hidden.

    Change-Id: I41607f587641927e2f77ae50625d92959d6d541e
    Partial-Bug: #1450150

Revision history for this message
Rob Cresswell (robcresswell-deactivatedaccount) wrote :

There are so many attachments and reassignments that I can't tell what is being addressed/ has been addressed. Marked incomplete; please either update the bug report to indicate specifically what is being addressed, or open new, more specific bugs to address.

Changed in horizon:
status: In Progress → Incomplete
Revision history for this message
Travis Tripp (travis-tripp) wrote :

This is done. It was primarily completed when I refactored to the hz-if directive which all the hz-if-services hz-if-policies etc, etc were based on.

Changed in horizon:
status: Incomplete → Fix Released
assignee: Thai Tran (tqtran) → Travis Tripp (travis-tripp)
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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