[Buildbot-devel] [buildbot] Bootstrap latest does not work with buildbot-www. (#828)
Luis Lloret
luislloret at gmail.com
Thu Aug 15 17:14:04 UTC 2013
Ok, yet another update.
This seems to work too, if I remove the [0] from the views code (which I
think is the correct thing to do) and I add a [0] in the BuildbotService,
like below:
p.then((v) ->
$scope[scope_key] = v[0] # this was = v. before
elem.on("new", onEvent)
return v
Does that make sense? I reached this conclusion after seeing what v was in
the debugger. It had all the methods from Restangular, which I guess are
not necessary to pass the views.
If useful, I can update into my fork and someone can have a look at the
diffs to see if they make sense at all...
Luis
On Thu, Aug 15, 2013 at 4:31 PM, Luis Lloret <luislloret at gmail.com> wrote:
> An update: I can make this kind of work, by doing the follwoing on the
> template:
> tr(ng-repeat='changesource in changesources[0]')
> td {{changesource.name}}
>
> So I use changesources[0]... but I am not sure that's the right way to do
> it. I guess it should be returned differently as part of the restangular
> call.
>
> BTW, by doing the equivalent change in the builders template, it gets the
> right thing too: "tr(ng-repeat='builder in builders[0]')" instead of
> "tr(ng-repeat='builder in builders')".
>
> Another thought: I would expect that the return from restangular would be
> very much like what you get on the REST itself, but it is not the case. Are
> my expectations wrong. Keep in mind that I am pretty new to all this
> technology, so I may be very very off-track.
>
> Thanks,
> Luis
>
>
>
> On Thu, Aug 15, 2013 at 3:55 PM, Luis Lloret <luislloret at gmail.com> wrote:
>
>> Hi,
>>
>> I have been having a look at trying to start contributing to buildbot-www
>> and decided that the easiest way to start (and learn) was to create a new
>> page, something like the old Changesources one. So there I went, and this
>> is what I have seen and done so far:
>> - I made a simple jade template (with an ng-repeat, like the one in
>> builders)
>> - I made a simple controller
>> - I added the new route to the angularjs route component
>> - ...
>>
>> So, now I am at the point where I can see my new page, nicely rendered,
>> but the data that it shows in the table does not make any sense. I think it
>> is showing the methods that restangular objects get added when they are
>> restangularized. This is in the buildbotService component, I think.
>>
>> I see that this happens as well in the builders page, so I am thinking:
>> are we sure that the buildbotService is returning the right data?
>>
>> This is what I see it is returning (for changesources) (you can see that
>> the element 0 holds the 2 valid changesources I have configured, element 1
>> contains something else, and then there is a lot of things that I am not
>> sure what they are doing there):
>>
>> ************
>> {
>> changesources: {
>> 0:
>> [ {
>> changesourceid: 1
>> link: http://localhost:8020/api/v2/changesource/1
>> master: {
>> active: true
>> last_active: 1376575201
>> link: http://localhost:8020/api/v2/master/1
>> masterid: 1
>> name: luis-minmate:/home/luis/buildbot/master9
>> }
>> name: http://myserver.com/svn/is/trunk/
>> } , {
>> changesourceid: 2
>> link: http://localhost:8020/api/v2/changesource/2
>> master: {
>> active: true
>> last_active: 1376575201
>> link: http://localhost:8020/api/v2/master/1
>> masterid: 1
>> name: luis-minmate:/home/luis/buildbot/master9
>> }
>> name: http://myserver.com/svn/is/branches/Virtua/
>> } ]
>> 1: {
>> links:
>> [ {
>> href: http://localhost:8020/api/v2/changesource
>> rel: self
>> } ]
>> total: 2
>> route: changesource
>> getRestangularUrl: null
>> addRestangularMethod: null
>> one: null
>> all: null
>> parentResource: null
>> restangularCollection: false
>> get: null
>> getList: null
>> put: null
>> post: null
>> remove: null
>> head: null
>> trace: null
>> options: null
>> patch: null
>> customOperation: null
>> doPUT: null
>> customPUT: null
>> doPOST: null
>> customPOST: null
>> doGET: null
>> customGET: null
>> doDELETE: null
>> customDELETE: null
>> customGETLIST: null
>> doGETLIST: null
>> bind: null
>> unbind: null
>> on: null
>> }
>> changesources: {
>> $ref: $["0"]
>> }
>> meta: {
>> $ref: $["1"]
>> }
>> route: changesource
>> getRestangularUrl: null
>> addRestangularMethod: null
>> one: null
>> all: null
>> parentResource: null
>> restangularCollection: true
>> post: null
>> head: null
>> trace: null
>> putElement: null
>> options: null
>> patch: null
>> getList: null
>> customOperation: null
>> doPUT: null
>> customPUT: null
>> doPOST: null
>> customPOST: null
>> doGET: null
>> customGET: null
>> doDELETE: null
>> customDELETE: null
>> customGETLIST: null
>> doGETLIST: null
>> bind: null
>> unbind: null
>> on: null
>> }
>> }
>>
>> **********************************
>>
>> Am I missing something in here? Let me know if you need any more info.
>> Thanks,
>> Luis
>>
>>
>> On Wed, Aug 14, 2013 at 10:45 PM, Pierre Tardy <notifications at github.com>wrote:
>>
>>> And the data is not hardcoded. It s auto generated from spec. :)
>>> Le 14 août 2013 23:24, "Dustin J. Mitchell" <notifications at github.com>
>>> a
>>> écrit :
>>>
>>> > Yes - there's a nice REST API to the data API - see
>>> > `master/docs/developer/{data,www}.rst`.
>>> >
>>> > —
>>> > Reply to this email directly or view it on GitHub<
>>> https://github.com/buildbot/buildbot/pull/828#issuecomment-22668148>
>>> > .
>>> >
>>>
>>> —
>>> Reply to this email directly or view it on GitHub<https://github.com/buildbot/buildbot/pull/828#issuecomment-22669720>
>>> .
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20130815/8bd129e8/attachment.html>
More information about the devel
mailing list