Yep, thanks folks. Apart from the existing styleguide arguing with my preferred approach, it seems like we agree on something that should be pretty consistent. Thanks for putting up that consistency patch Rajat.
On 8 January 2016 at 06:49, Rajat Vig <[email protected]> wrote: > I created a patch based off what Richard used as an example to highlight > inconsistencies and made it consistent. > > https://review.openstack.org/#/c/264942/ > > Have a look and if it feels fine, we can start changing what else exists > on similar lines. > Suggestions welcome. > > -Rajat > > On Thu, Jan 7, 2016 at 10:14 AM Thai Q Tran <[email protected]> wrote: > >> I 2nd that, should rename the file to delete.service.js to match service >> name. >> >> >> ----- Original message ----- >> From: Rajat Vig <[email protected]> >> To: "OpenStack Development Mailing List (not for usage questions)" < >> [email protected]> >> Cc: >> Subject: Re: [openstack-dev] [Horizon] naming of Javascript bits >> Date: Thu, Jan 7, 2016 12:03 AM >> >> Richard >> >> My preference is the same as what you've got there. >> Fully namespaced Services and Controller allow for better reusability and >> possibly maintainability. >> If all "deleteService" were named just that, it'll be mighty confusing to >> use it in other places. >> >> With regards to tying the folder path and the Service/Controller I'd >> mostly go with that as that encourages simpler rules on how to namespace. >> >> For the particular patch you mentioned, the namespaces had a bit of churn >> which is sort of reflected in what exists in the patch now. >> >> If we decide a convention, then we can go and change the bits when the >> files change next. >> >> -Rajat >> >> >> >> On Wed, Jan 6, 2016 at 10:30 PM Richard Jones <[email protected]> >> wrote: >> >> Hi Horizon folks, >> >> We've been pretty good about namespacing the new angular code (to the >> extreme of having a bunch of very similar module files littered around, but >> that's angular/JS for you, so I'm not going to go on about it <wink>). >> >> Anyhoo. One thing I've noticed is that the services, factories and >> controllers inside those modules aren't being consistently named. We have >> got a mix of: >> >> Launch Instance: >> >> .module('horizon.dashboard.project.workflow.launch-instance') >> .factory('launchInstanceModel', launchInstanceModel); >> >> The new Images panel: >> >> .module('horizon.app.core.images') >> .factory('horizon.app.core.images.row-actions.service', rowActions); >> >> and in the same patch: >> >> .module('horizon.app.core.images') >> .factory('horizon.app.core.images.actions.deleteService', >> deleteService); >> >> I actually prefer the second form because it matches the filename >> ("row-actions.service.js") even though the module namespace doesn't match >> the file path ("/static/app/core/images/table/"). >> >> Your thoughts? >> >> >> Richard >> __________________________________________________________________________ >> OpenStack Development Mailing List (not for usage questions) >> Unsubscribe: >> [email protected]?subject:unsubscribe >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev >> >> __________________________________________________________________________ >> OpenStack Development Mailing List (not for usage questions) >> Unsubscribe: >> [email protected]?subject:unsubscribe >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev >> >> >> >> __________________________________________________________________________ >> OpenStack Development Mailing List (not for usage questions) >> Unsubscribe: >> [email protected]?subject:unsubscribe >> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev >> > > __________________________________________________________________________ > OpenStack Development Mailing List (not for usage questions) > Unsubscribe: [email protected]?subject:unsubscribe > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev > >
__________________________________________________________________________ OpenStack Development Mailing List (not for usage questions) Unsubscribe: [email protected]?subject:unsubscribe http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
