Commit Graph

31 Commits

Author SHA1 Message Date
David Reyna d8be835e28 bitbake: toaster: Toaster filters are broken
A syntax fix inadvertantly broke the Toaster filter feature.

[YOCTO #11317]

(Bitbake rev: 29c9fa31d0f03553e24391568d2a5cb588595420)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-11 18:05:09 +01:00
Michael Wood bb9cf5f0f7 bitbake: toaster: tablejs Add visual indicator for table data loading
Add a visual indicator when the data is changing in the table, for instance if
it's being re-ordered, searched or paginated.

[YOCTO #10104]

(Bitbake rev: 554c4992b33b77526b4b37c7484f1dd00032ddef)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-12-12 20:44:53 +00:00
Reyna, David c57533b83b bitbake: toaster: tablejs Fix missing close square bracket
There is a missing close square bracket.

[YOCTO #10631]

(Bitbake rev: f3da9f85e6036e6f43377172cbcfe701e0efca7f)

Signed-off-by: David Reyna <David.Reyna@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30 15:48:10 +00:00
Elliot Smith dd784598cd bitbake: toaster: reset table to default orderby when orderby column is hidden
When a ToasterTable is sorted by a column, and that column is
hidden from view, the sort doesn't revert to the default for the
table.

Modify the JS responsible for reloading the table data so that
it doesn't rely on clicking a table column heading (as this is
inflexible and error-prone). Instead, use a function to apply
the sort to the table; and call that function when column
headings are clicked.

This means that the ordering can be changed programmatically
to a specified default ordering when a column is hidden, without
having to click on a column heading.

Use this function when the current sort column is hidden, to
apply the default sort for the table.

[YOCTO #9836]

(Bitbake rev: a28377067b6f381bbc98db82f5c45fca6620f7ad)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-11 00:09:27 +01:00
Michael Wood c42f1cc81d bitbake: toaster: table.js Add the ability to highlight a particular row
As in the old build tables it's useful to jump and highlight a
particular row in the table using the #hash in the URL.

(Bitbake rev: 927bfc26ffcb0eb6c0a5b3c0905b7efc2f19b9a2)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:04 +01:00
Belen Barros Pena 443f7b3915 bitbake: toaster: Migrate project configuration from bootstrap 2 to bootstrap 3
Convert all the HTML templates, JS and CSS in the project parts of
toaster to use bootstrap 3.

(Bitbake rev: 69527a731eada699d3f604ff8f3ae9410981ba9b)

Signed-off-by: Belen Barros Pena <belen.barros.pena@linux.intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-06-15 08:35:03 +01:00
Michael Wood 54bf7cce48 bitbake: toaster: toastertables: Clean up and fix up a number of items
- Remove the unused 'computation' field
 - Remove the code to try to make the tables behave like an api
 - Remove custom JSON encoder in favour of DjangoJSONEncoder
 - Simplify get_data and add comments
 - Add exception type instead of using generic Exception
 - Clean up python style warnings

(Bitbake rev: 16d8198e8f6668c5fa5467ff4bda86c5d66a6cad)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-05-17 14:43:30 +01:00
Michael Wood 1b11b79f50 bitbake: toaster: ensure ToasterTable headings are reset when order by changes
If a ToasterTable is ordered by an optional column and that
column is subsequently hidden, the table ordering switches back
to the default ordering for the table. However, the table headings
don't update to reflect the new ordering. This is because the
code which sets the heading weight and hides/shows the caret symbols
only runs when the table is first loaded.

Store the default order by and re-apply it when the data is updated.

[YOCTO #9011]

(Bitbake rev: 820761e664cd2d62cc6c333a0e59580b0c4a034d)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-19 21:11:25 +01:00
Dave Lerner 52cfdb6a88 bitbake: toaster: fixes for customimage package not found
For a custom image, if a search for a package results in no packages
found, then additional information should be presented to the user.
This is different than a 'no results' found for a search in other
contexts, for example, a search for a package in a non-customised build.
For a custom image, a package search failure can happen because the
package was not added to the custom image. This commit presents more
information to the user, suggesting why the package was not found in the
custom image.
The generic table view handling js changes to handle a new div
element no-results-special-... such that, if present, that template
section is shown rather than the default no-results-... section.

[YOCTO #9154]

(Bitbake rev: 66b7c7ef61058b52031d71b10effcfe69afbd57b)

Signed-off-by: Dave Lerner <dave.lerner@windriver.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-04-09 23:00:46 +01:00
Michael Wood a92fc3025b bitbake: toaster: tablejs Add an event handler to manually trigger a data reload
Allow users of ToasterTable to manually trigger a refresh of the data.
This can be useful if an action has happened in-page and the data is now
invalid. Such as new data being added or removed from the model.

(Bitbake rev: 6e42070d8abc80dacd8094c4f5019577453a9d49)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: brian avery <avery.brian@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-02-10 13:29:16 +00:00
Elliot Smith 4103e0cb74 bitbake: toastergui: make "Apply" button state depend on filter range
If a range filter action had an empty from/to field, the range
filter could still be applied. This was confusing, as an invalid
filter range caused all records to display, even though a filter
appeared to have been applied (by the highlighted state of
the filter button).

Change the state of the "Apply" button, disabling it if the radio
button for a range filter action is selected but the range is
incomplete (from or to field is empty).

When a non-range filter is selected, the "Apply" button always
enable the "Apply" button.

[YOCTO #8738]

(Bitbake rev: 168184b28165d7aa354b9092b5986f91c58d550d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 6c2d88fda5 bitbake: toastergui: mute label for filter actions with no records
The radio button for a filter action is disabled if that filter
action has no associated records. However, the label retains
the normal font styling, so it's unclear that the action is
not available.

Add the "muted" class to the label for a filter action (and still
disable its radio button) if it has no records associated with it.

[YOCTO #8738]

(Bitbake rev: b7f7ff095c9c4c922e608f776713f17acc1f150d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith fcb20f9dfd bitbake: toastergui: ensure filter_value updates
Clicking on the radio button for a date range filter action
populates the from and to fields for that action if they are empty.

However, because this doesn't fire "change" events, clicking on
the radio button doesn't update the filter_value hidden field. This
means that the date range action's filter_value parameter isn't
set correctly when the filter popup is submitted.

Manually call the changeHandler() to set the filter_value whenever
the radio for a date range filter is clicked.

[YOCTO #8738]

(Bitbake rev: 1a3038cf8d9b32532f1fe92cd3472b4473ffc0c4)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f9c46f5e5e bitbake: toastergui: don't hide all elements with .col class
Disabling the "project" column in a ToasterTable for builds
causes the recent builds area to be hidden. This is because
the column hiding code hides all elements with a class matching
".<column>", regardless of where they occur on the page; and
the recent builds area was using the ".project-name" class,
which means it is included in the set of elements which are hidden.

Scope the element search to the table so that only elements
within the table are hidden or shown.

[YOCTO #8792]

(Bitbake rev: 151bc20daf51e0ab8baf11ea29244b7fec1f8a22)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith eaae82a19a bitbake: toastergui: convert project builds page to ToasterTable
Use the all builds ToasterTable as the basis for the project builds
ToasterTable.

[YOCTO #8738]

(Bitbake rev: 87bcfb740dd2d9944e35a2a1f71cbf8ff3b266e9)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 33b011c158 bitbake: toastergui: implement "today" and "yesterday" filters
Add the "today" and "yesterday" filters to the started_on
and completed_on columns in the builds table.

During this work, some minor adjustments were made to the
behaviour of the builds table:

* Amend filter action variable names so they're more succinct.
* Retain order in which actions are added to a filter, as this
ordering is used in the UI when displaying the filter actions.
* Always show the table chrome, otherwise it's not possible
to edit the columns shown until there are 10 or more results.
* Because date range searches may return no results, make sure
that the search bar and "show all results" link are visible
when the query returns no results.

[YOCTO #8738]

(Bitbake rev: f17cfa009e58833e0e55884fa04de8abd522b6bc)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith f8d383d87f bitbake: toastergui: implement date range filters for builds
Implement the completed_on and started_on filtering for
builds.

Also separate the name of a filter ("filter" in the querystring)
from its value ("filter_value" in the querystring). This enables
filtering to be defined in the querystring more intuitively,
and also makes it easier to add other types of filter (e.g.
by day).

[YOCTO #8738]

(Bitbake rev: d47c32e88c2d4a423f4d94d49759e557f425a539)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:30:00 +00:00
Elliot Smith 1a4b203ca5 bitbake: toastergui: switch off filter highlights when inactive
In ToasterTables with multiple columns which allow filtering
(e.g. all builds), selecting one filter, then a second filter
(e.g. selecting "failed builds" then "outcome" for all builds),
would result in both filters being highlighted at the same time.

Fix this by removing the "active" highlight on all column filter
buttons when a new filter value is submitted (via the filter modal).

NB to enable this, added a data-filter-on attribute to all
column filter buttons to make them easy to select.

[YOCTO #8738]

(Bitbake rev: 7347ad0d4baace593751b44a86ab8e11a04a02b6)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Elliot Smith 809046c6fb bitbake: toastergui: refactor ToasterTable filtering
The filter code for ToasterTable was difficult to follow
and inflexible (not allowing different types of filter, for example).

Refactor to a set of filter classes to make the structure cleaner
and provide the flexibility needed for other filter types
(e.g. date range filter).

[YOCTO #8738]

(Bitbake rev: 94031bb30bdaf665d0c8c68b591fcb7a17b6674d)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-15 16:29:59 +00:00
Michael Wood b90a8dca99 bitbake: toaster: tablejs Make sure click handlers consume click event
Avoid the click event from propagating and causing strange side effects
in toaster tables.

[YOCTO #8527]
[YOCTO #8148]

(Bitbake rev: f23e54292a673b2fd3f17d317c21984c753727c7)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-12-07 17:01:20 +00:00
Michael Wood ab896df63b bitbake: toaster: Fix stale layer state buttons
Move the "is available to the project" state computation to the template
for the Layer add/remove buttons, Recipe build/Add layer as done for the
Package add/remove. This is more reliable as we can get an inconsistent
state on the front end JS as there are many opportunities for hitting
out of date project information.

[YOCTO #8294]

(Bitbake rev: 43469c3360566ad4897785f14f8717a9bc8b6078)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 08:11:29 +01:00
Elliot Smith a3742a0f68 bitbake: toaster: Don't add new history entries when table data loads
When ToasterTable data is loaded into the UI, a new entry is
added to the browser history. This means that pressing the back
button appears to have no effect, as you end up at the same page,
possibly with slightly different data.

Instead, use replaceState(), so that the browser history doesn't
grow, but the page context still gets updated.

[YOCTO #7660]

(Bitbake rev: 70c5e40a0f77ae4835fb95275621c345f8190240)

Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-10-11 05:33:02 +01:00
Michael Wood da4c66385d bitbake: toastergui: Fix toastertable table header reference
A header id was mistakenly added to the table template which was not
also added to the simple version of the toaster template. We don't need
this id so remove it.

(Bitbake rev: daf902e2a6f736b9c8ef6492143fdbf856451559)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-08-06 16:04:48 -05:00
Michael Wood 4013784b45 bitbake: toaster: table.js fix filter visual indicator and interaction
- Fix the id of the filter modal dialog.
- Fix the visual indicator toggle button
- Add check to see if the number of items to filter on is !=0 if it is
  then don't allow applying this filter.

(Bitbake rev: a73f08c79077b6ded0c08ea7d36032f4568d12e3)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-26 09:27:33 +01:00
Michael Wood 4f459fca79 bitbake: toaster: Add global ajaxError handler
If any ajax calls fail and debug is enabled log the error to the console.

(Bitbake rev: 978ab17033ec48ee0a82016b7e4d6a2fe5d21dbb)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-12 00:01:50 +01:00
Alexandru DAMIAN c941743c9a bitbake: toaster: ToasterTables add computational fields
This patch adds the ability to pass a function to be computed
for generating a field value in setting up a column in
ToasterTables.

Also adding "displayable" property that can be turned False for
columns that are present in JSON data but are not part of the UI.

Add the "id" column by default for all rows.

(Bitbake rev: fb683135348b074412da154585c75865aad1eab0)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-12 00:01:48 +01:00
Alexandru DAMIAN 58600cf8e7 bitbake: toaster: toaster table add raw data
We add in a JSON response both the raw data and the rendered
version for display. The rendered fields start with "static:"
to mark a different "namespace".

The toaster.js is updated to always display the "static:" version
of a field, if it exists (and ignore the raw data unless the
static rendering is missing).

(Bitbake rev: 928ee3fd4b52ea14b7eb704f1f27351362a9d27a)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-12 00:01:48 +01:00
Alexandru DAMIAN d9341d1a77 bitbake: toaster: toastertables REST refactoring
This patch refactors the ToasterTables to bring them in line
with REST principles -

- all table pages now support the "format=json" GET parameter
that returns the data in JSON format
- the tables themselves

This cleans up the URL namespace by aleviating the need to
have two URLS for each table (one for the template and one for
the data loading), and fixes minor things in the ToasterTable
implementation.

(Bitbake rev: 1778dac9fd39dae75c55bf2cf836cdd488dbc265)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-06-12 00:01:47 +01:00
Michael Wood 2de01a68eb bitbake: toaster: Port layerdetails to ToasterTables
This ports the layerdetails page to using ToasterTables
Also some whitespace and strict clean ups in the existing layerdetails
js and html template.

(Bitbake rev: 8ce35f81631e31539aeb82f8a85abbb3312e5097)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:45 +01:00
Alexandru DAMIAN 9dcfa32cf1 bitbake: toastergui: table header bring back
This patch brings back the table header, which I mistakenly
took out when fixing HTML5 compliance.

(Bitbake rev: 9855e0b9735ebf0a6c622bee6ec787dfc1d9e474)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-29 11:59:44 +01:00
Michael Wood 7f8c44771c bitbake: toaster: Add toaster table widget
This widget provides a common client and backend widget to support
presenting data tables in Toaster.

It provides; data loading, paging, page size, ordering, filtering,
column toggling, caching, column defaults, counts and search.

(Bitbake rev: b3a6fa4861bf4495fbd39e2abb18b3a46c6eac18)

Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2015-05-14 18:04:09 +01:00