Skip to content

Commit

Permalink
[REF] runbot: rewrite stats page using owl
Browse files Browse the repository at this point in the history
Removing very old javascript and using new tools will allow us to more
efficiently change and maintain the stat page in the futur.
This commit is meant to produce a 1:1 copy of the stats page like it was
before.
Further refactoring will happen to improve performance, layout and
component logic.
  • Loading branch information
Williambraecky committed Jan 9, 2025
1 parent 86810df commit e43827a
Show file tree
Hide file tree
Showing 17 changed files with 790 additions and 393 deletions.
14 changes: 14 additions & 0 deletions runbot/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@
'runbot/static/src/libs/diff_match_patch/diff_match_patch.js',
'runbot/static/src/js/fields/*',
],
'runbot.assets_stats': [
# Required for module loading
('include', 'web.assets_frontend_minimal'),
# Required for separate js and xml files
'/web/static/src/core/template_inheritance.js',
'/web/static/src/core/templates.js', # ^
# Owl
'web/static/lib/owl/owl.js',
'web/static/lib/owl/odoo_module.js',
# Runbot
'/runbot/static/src/utils.js',
'/runbot/static/src/chartjs_module.js',
'/runbot/static/src/stats/**/*',
],
'runbot.assets_frontend': [
'/web/static/lib/bootstrap/dist/css/bootstrap.css',
'/web/static/src/libs/fontawesome/css/font-awesome.css',
Expand Down
5 changes: 5 additions & 0 deletions runbot/static/src/chartjs_module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
odoo.define("@runbot/chartjs", [], function () {
"use strict";

return Chart;
});
29 changes: 0 additions & 29 deletions runbot/static/src/css/runbot.css
Original file line number Diff line number Diff line change
Expand Up @@ -352,35 +352,6 @@ body, .table {
margin-left: -1px;
}*/

.chart-legend {
max-height: calc(100vh - 160px);
overflow-y: scroll;
overflow-x: hidden;
cursor: pointer;
padding: 5px;
}

.chart-legend .label {
margin-left: 5px;
font-weight: bold;
}

.chart-legend .disabled .color {
visibility: hidden;
}

.chart-legend .disabled .label {
font-weight: normal;
text-decoration: line-through;
margin-left: 5px;
}

.chart-legend ul {
list-style-type: none;
margin: 0;
padding: 0;
}

.limited-height {
max-height: 180px;
overflow: scroll;
Expand Down
298 changes: 0 additions & 298 deletions runbot/static/src/js/stats.js

This file was deleted.

34 changes: 34 additions & 0 deletions runbot/static/src/stats/stats.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#wrapwrap:empty {
content: 'This page required javascript to work';
}

.chart-legend {
max-height: calc(100vh - 160px);
overflow-y: scroll;
overflow-x: hidden;
cursor: pointer;
padding: 5px;

.label {
margin-left: 5px;
font-weight: bold;
}

.disabled {
.color {
visibility: hidden;
}

.label {
font-weight: normal;
text-decoration: line-through;
margin-left: 5px;
}
}

ul {
list-style-type: none;
margin: 0;
padding: 0;
}
}
Loading

0 comments on commit e43827a

Please sign in to comment.