History log of /external/autotest/frontend/client/src/autotest/common/table/DataTable.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
d58f008bca8c2d70c3f36d93a9fc1f76f25b4d3f 18-Jul-2014 Jiaxi Luo <jiaxiluo@chromium.org> [autotest] New AFE UI migration.

Migrate AFE to the new UI design including:
* A sharper and more organized UI,
* Organize info on View Job and View Host pages into tables.

BUG=chromium:394145
TEST=ran afe
DEPLOY=afe,apache
Change-Id: I4deb61893888d06ed720e8eb19cdaa1de0270877
Reviewed-on: https://chromium-review.googlesource.com/208159
Tested-by: Jiaxi Luo <jiaxiluo@chromium.org>
Reviewed-by: Simran Basi <sbasi@chromium.org>
Commit-Queue: Jiaxi Luo <jiaxiluo@chromium.org>
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
26dd6aa23eb2771acefa611c029c06f6ee6f1b11 17-Jul-2010 jamesren <jamesren@592f7852-d20e-0410-864c-8624ca9c26a4> Prevent NullPointerException when clicking on a test in Create Job.

No functional effect, just keeps the exception from showing up in DevMode.

Signed-off-by: James Ren <jamesren@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@4721 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
3adac3671a998be8421238d3a08a7ffd2c3cbe1c 13-Jan-2010 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Display the text required for filtering on custom fields in the TKO UI.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4113 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
669624aad9c77060f706fde7c8e717cb636f9be8 12-Jan-2010 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Fix rendering of empty cells in Job Details host table

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4097 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
8b0ea2285c1327a686ff0b6ab245915e7fd20094 23-Dec-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Overhaul how we deal with related data in TKO -- test labels, test attributes, machine labels, and iteration results.

This has proven one of the trickiest areas of TKO. The first foray into this area was machine label headers, an early feature request implemented in a pretty ad-hoc manner in spreadsheet view which allowed them to be used as header fields. (Ironically, this was closest to the right approach on the server side, but I didn't appreciate it at the time. The original client-side implementation was a mess.) Next was filtering on test attributes and test labels, implemented with the include_labels, exclude_labels, include_attributes_where, and exclude_attributes_where options. This server-side implementation supported filtering but not viewing, grouping or sorting at all. Furthermore, even the filtering support was weak -- it only supporting ORing of inclusion requests and ANDing of exclusion requests. The client-side implementation was still pretty messy but was moving towards correctness. Finally, support was recently added for viewing iteration results in table view, but
grouping and filtering were excluded since they would've been very difficult to fit into the design. This was again a limited server-side approach, though the client-side implementation continued improving, albeit still using the trouble "generator items" in the mutliple list selector widget.

When I started working on support for test iterations and attributes in TKO table view, I finally hit upon the right server-side approach: specify the attributes that you're interested in, have the server perform a separate JOIN for each one, so that there's now a new column for each one, NULL if the attribute didn't exist and having the attribute's value if it did. Once it's created as a normal column, the user can do selection, grouping, sorting and filtering using the regular mechanisms. Everything just works. (For labels, it's slightly different, since whether or not a label is attached to a test is a boolean value. I opted to have the column's value be either NULL or the name of the label.)

Well, not quite perfectly. MySQL lets us define column aliases in a SELECT which are then usable in GROUP BY and ORDER BY. They aren't however, usable in the WHERE clause, because certain select expressions may not exist at the time the WHERE is applied. (Our expressions happen to be fine, but MySQL will have none of it.) There's absolutely no way I can see to define aliases for use in the WHERE clause. And unfortunately, our current interface allows users to provide a WHERE clause directly, so we can't perform translations or substitutions. As a result, filtering must be performed a little differently for these fields. You can't just say <field_name> = "<value>", like you can for most fields. For test attributes and iteration results, you say <field_name>.value = "<value>". For test labels and machine labels, you say <field_name>.id IS [NOT] NULL.

The first part of this CL is changing the server to use this new approach. get_test_views() now accepts test_label_fields, test_attribute_fields, machine_label_fields, and iteration_result_fields parameters, which allow the user to add extra fields based on these data types.

At the same time, I've changed how the TKO web clients deals with these data types in a way that mirrors the new way of handling these features on the server. There is now a global widget for adding custom fields based on any of the four data types. Once one is created, it can be used just like any other field in spreadsheet view, table view, and the global condition. This vastly simplifies most pieces of the code that previously dealt with these features, and it greatly expands the available space of features. Where we formerly had spreadsheet grouping/filtering on machine labels, table viewing of iteration results, and limited filtering on test labels and attributes, we now have viewing, grouping sorting, and filtering on all four.

High-level changes involved:

Server side
* added code to TestViewManager to handle the new options for creating fields, documented them, and documented that these options are supported and the rest are deprecated (we can probably delete them but we should check, they might be in use)
* added thorough unit tests for all of the above. on a side note, i discovered a neat feature of SQLite where you can add any function you've defined at a callable function from SQL statements. I used this to add some functions emulating MySQL-only functions. This could be used to good effect elsewhere, but this CL is big enough :)
* got rid of now-obsolete code for machine_label_headers option and iteration views

Client side:
* made HeaderFields immutable. Mutable HeaderFields turned out to be way too much of a nightmare. Users can specify values for ParameterizedFields at creation time, and if they want to modify them, they can delete and add.
* made all parts of the application (namely SpreadsheetView (both header selectors), TableView, and CommonPanel) use a single global HeaderFieldCollection
* changed ParameterizedFieldListPresenter to handle the new job of allowing creation and deletion of any kind of ParameterizedField. This new widget replaces the label/attribute filtering widget in the CommonPanel -- I got rid of all the code for that widget.
* removed the now-obsolete code for "generator items" in the MultiListSelectPresenter.
* finally made TableView use HeaderSelect. Since HeaderSelect plays a more significant role and it's role is more unified, it made sense to finally do this (TableView was previously duplicating logic from HeaderSelect, which was only used in SpreadsheetView). Since the HeaderSelect used in TableView is much simpler than the one used in SpreadsheetView, I extracted a new class SpreadsheetHeaderSelect, using composition rather than inheritance (it didn't really follow an is-a relationship).

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4049 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
4879914c122f4ed97eae3b08c5af1930fd75b39d 13-Nov-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Fix a bug where hosts in a cloned job weren't removed when deselecting the host from the "browse hosts" table. This again turned out to be a relatively large change for the size of the problem, because I chose to make some refactorings to attack some of the design problems the were behind the issue in the first place.

The core issue was that the ArrayDataSource was using a plain SortedSet<JSONObject> to hold the selected hosts. This is good because we want to keep them sorted, but it's bad because it uses the default object equality for JSONObjects, but we want to use a special equality based on ID or hostname. We normally accomplish that with JSONObjectSet, but that doesn't get us the sorting. JSONObjectSet is sort of a hack in the first place; the proper solution is to use custom objects that override equality.

As a first step towards that approach, I created a Host class under the models autotest.afe.models package. In order to minimize the scope of this change, I made it override JSONObject, so that we can move incrementally. I made it override equality and made HostDataSource convert the results to Host objects before returning them.

Unfortunately, I ran into a second problem. DataSource passes back results in a JSONArray. Since JSONArrays use native JS objects for storage, the objects you get out of them are always real JSONObjects, constructed on the fly -- not just declared type, but actual type. Even if you put Hosts in, they'll effectively be converted back to plain JSONObjects when you take them out. This is a reflection of a second design problem -- we shouldn't use JSONArrays to pass data around within the program. So I changed DataSource to convert results to List<JSONObject> and pass the data back that way. This required minor changes across many files, but nothing drastic anywhere.

Signed-off-by: Steve Howard <showard@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3943 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
4cd4763a855d8eb7d25fd4963babc432eb4d25e6 12-Oct-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Remove deprecated uses of TableListener, and implement proper
oncontextmenu handling

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3828 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
eb0fd4c76ee70e68d907e542423ae249489552c2 21-Aug-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Clicking any part of the row in the hosts table in AFE View Job tab
should take us to the AFE View Host tab. Previously, the right side of
the row would do nothing upon click if the "Status Log" and "Debug Log"
links were not present.

Risk: low
Visibility: low

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3566 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
3ed34fd6fa69b0d1faba7b67ab32225b63b64781 06-Jul-2009 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Expand the test name column in the AFE Create Job tests list to fit the
table, if the test names are all too short to reach the end of the table
column.

Risk: low
Visibility: medium (UI bug fix)

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@3371 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
8579ea343f8d4c74b44d5b5cb2df3ef7552b2f6e 18-Aug-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Snazzy new interface for select tests in Create Job view. Tests are now presented in a scrollable table, with descriptions displayed in a resizable pane on the right.
-new TestSelector widget displays table + description
-move some basic input handling from DynamicTable into DataTable, so that plain DataTables can handle clicks
-make DataTable capable of refreshing the widgets in a table without refreshing the entire table - this is useful for updating selections
-pull out the one bit of SelectionManager that depends on DynamicTable (as opposed to DataTable). This is now in DynamicTableSelectionManager, and the orignal SelectionManager can work with a plain DataTable.
-make SelectionManager capable of acting as the TableWidgetFactory for producing row selection checkboxes
-fix a couple minor bugs in (Site)CreateJobView, where some controls (skip verify, custom tests) would not be disabled when they should be
-pull out ArrayDataSource.JSONObjectComparator into a top-level class, so it could be used elsewhere to sort JSONObjects



git-svn-id: http://test.kernel.org/svn/autotest/trunk@2004 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
585c2abb80648f80e7cb649b06dc9f6a8690a790 23-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> -fix query_count to support flexible filtering like everything else
-ensure DataTable always escapes HTML in contents, and use whitespace: pre so that newlines can still be included (i.e. in JobTable)




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1882 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
ef37eccb66c415fdb6a8fe63244fe8545463719f 21-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> support real right-click events. GWT doesn't support this but will in the next 1.5 RC, but until then, we'll need this hackery to make it work. this is also definitely not cross-browser compatible, but it could be made so if necessary.




git-svn-id: http://test.kernel.org/svn/autotest/trunk@1874 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
35dbd8414c0e7022a6a4b54f7ef16b5ff51ae53b 16-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> introduced distinction between clickable and non-clickable widgets in DataTable; this allows read-only widgets that will still generate a row click event when clicked. this was necessary for new TKO development.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1839 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
9d821ab7d97c677a63589e6d71ee3c9da46f7077 11-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Made use of the new Widget functionality in DataTable and added checkboxes to
JobTable. JobListView now makes use of the SelectionManager and its checkboxes
to allow mulitple persistent selection of entries. This required some small
change to the behvavior of SelectionManager -- namely that it no longer
subscribes to the table itsef. This required some change to HostSelector which
acts on HostTable (it now does the listening to the table and calls the
SelectionManager methods directly). Added hyperlinks for "Select All" "DeSelect
All" and "Abort Selected" to the JobListView. Added a new rpc call "abort_jobs"
which takes a list of ids of jobs to abort.

Signed-off-by: Travis Miller <raphtee@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1809 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
94b698cacab819b42104ce0db68aa63b68f4d1d1 08-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Added the ability to insert widgets into a column of DataTable.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1778 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
6bc47015cce0ebc2fc255d3950bfeaf4851f36fd 03-Jul-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> Refactoring to eliminate warnings and (slightly) improve performance.
Added @Override annotations, and added parameterizations for generic
collections. Made small performance tweaks.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1761 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
e3f6868dac3b4c4714637d12b93d97823011a35c 05-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> GWT reorg part 3


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1614 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java
ee4baa6495590c14c933f1fafa37d1843bbee996 05-Jun-2008 showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> GWT reorg step 1. This is just too difficult to do in one step. This temporarily breaks GWT but we'll just have to accept that. It'll be fixed soon.


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1612 592f7852-d20e-0410-864c-8624ca9c26a4
/external/autotest/frontend/client/src/autotest/common/table/DataTable.java