From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id BF983E00922; Fri, 27 Mar 2015 06:51:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.212.180 listed in list.dnswl.org] Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 4EF4AE00906 for ; Fri, 27 Mar 2015 06:51:15 -0700 (PDT) Received: by wibg7 with SMTP id g7so27126782wib.1 for ; Fri, 27 Mar 2015 06:51:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=NYfSWSE7maV2CKC0dHl9Uyb4pb8PdP4r/fVHesB0QSc=; b=cs+zVZAf2VzLEgN3R4RGT7YW1E0utpENAWLGD8Jj/j6fC63SYXx+7UbCj3bm6FyGmB beQeQpq2YoAKKYpnSmqoPodO4bDxQJOMT5TjpltAhgKnCD4FhZKejXtpvM3ERuqyqd6G h57skZZ2NaBtwE+YM4OSXM/w0061Efj7uHfSv3Elx4AGWzOsMRWtU9B/tDHRnFhPzvx9 1O3BuudgY7V7eYJXyYx1abDLXJe0sqBglUCOjuvsbn8SL6MiNVnJ2F9/2NuBX1maoxOU SH8SqLvYvG/891/EXRbXJOtgzjfrqGGVPPnAzrT8ZH7fjguIfr5vEXfiYg+8eJQZ7lfi h0MQ== X-Gm-Message-State: ALoCoQnQGnmS5ZLojmZyql/0ZPYlOmCfVFPkRUmLbLCAlETPt+zOVIjmvb6wmP5APugf3E4hB1UQ X-Received: by 10.180.95.135 with SMTP id dk7mr22185346wib.64.1427464274187; Fri, 27 Mar 2015 06:51:14 -0700 (PDT) Received: from [192.168.2.26] ([83.217.123.106]) by mx.google.com with ESMTPSA id ge8sm2937870wjc.32.2015.03.27.06.51.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 27 Mar 2015 06:51:13 -0700 (PDT) Message-ID: <55156050.6000402@intel.com> Date: Fri, 27 Mar 2015 13:51:12 +0000 From: Michael Wood User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "Barros Pena, Belen" References: <55144E33.9020103@intel.com> In-Reply-To: Cc: "toaster@yoctoproject.org" Subject: Re: [RFC] Tables rework - michaelw/toaster-tables-poc X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Mar 2015 13:51:20 -0000 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit On 27/03/15 11:44, Barros Pena, Belen wrote: > Hi Michael, > > Thanks for this. I have a couple of questions, if that's ok. > > 1. Can you share some context about what is prompting this refactoring of > the front-end code? I know the background because I talk to you all the > time, but it might be useful to other people on the list. Sure, Currently we have a collection of defined ways to describe a table in Toaster on the back end and the front end. The first purpose is to consolidate this into a single object on the back-end and a single handler on the front end, doing this will hopefully mean fewer bugs and consistency in behaviour and look across all the tables. It also allows us to add features that can then be utilised across all tables, such as the one included in this patch which is an improvement to the user experience by avoiding having to do a page reload for every table operation. I also think it improves the speed of the page loading because we're only exposing the fields from the database that we require rather than an object that represents all the data and has an easy way to implement caching. > > 2. Can you provide more details about the "easy switch path"? :) When > would be a good time to do it, what kind of extra QA work would be > required (if any), etc Don't think there would be any extra QA work. If anything it may be simpler because we can write some tests that check the JSON output. The easy switch path is that it can be done gradually if we want. The best time would probably be after 1.8 -- nothing stopping us branching and starting now. > > 3. Do you think this approach can be expanded to the other UI components > (filters, sorting, edit values in forms, layer dependencies modal dialogs, > type ahead, etc)? Do you have a full list of what those components would > be? How much work / time will it take to create them and making the > switch, etc... No I don't have a list, (filters will be part of the table work I just didn't implement them for the POC) It'd be good to make one, then a better time estimate could be made. It took around 4 days to do the table stuff, but that included a lot of experimenting and reading around it. Yes I think we could expand this approach to other components, we have a few done already on the client side; typeahead and the layer dependency modal mechanism. We would need to do an audit and workout what other common components could be done. > > Sorry for all the questions: I am keen on doing this so that we have a > solid foundation for the impending feature creep, but I am having some > trouble picturing how much time / effort is involved. > > Thanks! > > Belén > > On 26/03/2015 18:21, "Michael Wood" wrote: > >> Here is the current WIP of the proof of concept of the Tables widget for >> toaster >> >> http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=michaelw/toa >> ster-tables-poc >> ( http://tinyurl.com/op63pgj ) >> >> >> I've tried to prefix/postfix 'poc' to make it easier to identify which >> are for the proof of concept >> >> Brief overview of the files/changes: >> >> ---------------------- >> poc_view.py: >> >> Table(View): >> - Handles the HTTP requests to get the table data >> - Adds some basic caching (future - this can be tied into the >> request but for now is just global) >> >> >> ToasterTable(object): >> - Adds a base class for common table functionality >> - A lot of this is bringing in all the parts we already have in >> views.py and standardising them in a single class >> - In many tables we have what I've named "static data" this is >> where we have a column that contains html data, for example a button. >> - Outputs the data for the page requested as a JSON document >> >> >> RecipeTable(ToasterTable): >> - Example of a table which has static data >> >> LayersTable(ToasterTable): >> - Example of a simple table >> >> ---------------------- >> >> tables.js: >> - This consumes the table data >> - Adds handlers for all the table chrome buttons >> - Implements the add/remove columns >> - Implements paging >> >> ---------------------- >> >> table-poc.html: >> - Template that just contains the html for the table layout (i.e. >> search bar, table, buttons etc) >> - can be considered the same as conflating the "basetable_top.html" >> + "basetable_bottom.html" templates >> >> ---------------------- >> >> generic-table-page-poc.html: >> - This is a normal table page in toaster with navigation, zone >> alert and which includes the table-poc.html template the context >> variable table_name is passed into this template to select which table >> to display >> >> ---------------------- >> >> two-tables-poc.html: >> - Exactly the same as generic-table-page-poc.html (above) but has >> two tables in it. >> >> ---------------------- >> >> changes to urls.py: >> - Add the poc-table this calls into to Table(View) to handle the >> requests made from the ajax calls (could be renamed xhr_table for >> consistency) >> - Add urls for the test pages: /layers-poc/ and /recipes-poc/ and >> /two-tables-poc/ note that they don't need their own views defined >> because the only thing changing is the table_name and that's passed in. >> >> ---------------------- >> >> Notes: >> >> The whole lot is 642 lines which means the maintenance burden shouldn't >> be too high >> There's a fairly easy path to switching our existing tables - one at a >> time if needed >> There are bugs and features missing - This is just the proof of concept! >> >> Thanks, >> >> Michael >> >> >> >> >> >> >> >> >> >> -- >> _______________________________________________ >> toaster mailing list >> toaster@yoctoproject.org >> https://lists.yoctoproject.org/listinfo/toaster