[openstack-dev] [Horizon][Tuskar-UI] Location for common dashboard code?

Tzu-Mainn Chen tzumainn at redhat.com
Mon Jun 9 12:45:21 UTC 2014


Hiya,

That makes sense.  Just to take a concrete example - in tuskar-ui, our
flavors' table code (https://github.com/openstack/tuskar-ui/blob/master/tuskar_ui/infrastructure/flavors/tables.py)
uses the following code from openstack_dashboard.dashboards.admin.flavors.tables
(https://github.com/openstack/horizon/blob/master/openstack_dashboard/dashboards/admin/flavors/tables.py):

1) extends CreateFlavor LinkAction to modify the linked url
2) extends DeleteFlavor DeleteAction to add an 'allowed' check
3) uses FlavorFilterAction FilterAction
4) uses get_size and get_disk_size methods for formatting a column value

Would it be suggested that all of the above from the admin dashboard go
into openstack_dashboard/common?

I could see arguments for tuskar-ui not to extend 1) and simply create a
new LinkAction since we're using an entirely new url.  4) seems to me
that it might possibly belong in the api code.  So would we just take
2) and 3) and stick it in openstack_dashboard/common/flavors/tables.py
or something. . . ?

Thanks,
Tzu-Mainn Chen


----- Original Message -----
> I think this falls inline with other items we are working toward in
> Horizon, namely more pluggable components on panels.
> 
> I think creating a directory in openstack_dashboard for these reusable
> components makes a lot of sense. And usage should eventually moved to
> there.
> I would suggest something as mundane as ³openstack_dashboard/common².
> 
> David
> 
> On 5/28/14, 10:36 AM, "Tzu-Mainn Chen" <tzumainn at redhat.com> wrote:
> 
> >Heya,
> >
> >Tuskar-UI is currently extending classes directly from
> >openstack-dashboard.  For example, right now
> >our UI for Flavors extends classes in both
> >openstack_dashboard.dashboards.admin.flavors.tables and
> >openstack_dashboard.dashboards.admin.flavors.workflows.  In the future,
> >this sort of pattern will
> >increase; we anticipate doing similar things with Heat code in
> >openstack-dashboard.
> >
> >However, since tuskar-ui is intended to be a separate dashboard that has
> >the potential to live
> >away from openstack-dashboard, it does feel odd to directly extend
> >openstack-dashboard dashboard
> >components.  Is there a separate place where such code might live?
> >Something similar in concept
> >to
> >https://github.com/openstack/horizon/tree/master/openstack_dashboard/usage
> > ?
> >
> >
> >Thanks,
> >Tzu-Mainn Chen
> >
> >_______________________________________________
> >OpenStack-dev mailing list
> >OpenStack-dev at lists.openstack.org
> >http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 



More information about the OpenStack-dev mailing list