Conversation
make a counter that adds 1 every time a button is pressed
making sure the counter can be reused
have a view of how properties can be used to customize components
make it possible to use markup in cards
make sure the correct properties are defined, can be validated in developer mode
make it possible to have the total of different counters together
bring an option to the user to have a todolist visible
make it visually clear when is task is completed
| @@ -0,0 +1,15 @@ | |||
| <?xml version="1.0" encoding="UTF-8" ?> | |||
| import { Component } from "@odoo/owl"; | ||
|
|
||
| export class Card extends Component { | ||
| static template = "awesome_owl.card"; |
There was a problem hiding this comment.
Name for the template is usually camel case
| static template = "awesome_owl.card"; | |
| static template = "awesome_owl.Card"; |
| @@ -0,0 +1,11 @@ | |||
| <?xml version="1.0" encoding="UTF-8" ?> | |||
There was a problem hiding this comment.
| <?xml version="1.0" encoding="UTF-8" ?> |
| import { Component } from "@odoo/owl"; | ||
|
|
||
| export class TodoItem extends Component { | ||
| static template = "awesome_owl.todo_item"; |
There was a problem hiding this comment.
| static template = "awesome_owl.todo_item"; | |
| static template = "awesome_owl.TodoItem"; |
make the list of todo's interactive by adding the option to add items
when loading the page automatically focus the input as this improves the speed of adding a new item when loading the page
make it possible to toggle a todo to completed
make code in line with teh current standard
make it possible to delete wrong todo items
make it possible to delete wrong todo items
add option to hide card content
make the app follow the common layout to keep the same look and feel over the complete environment
make it easier to navigate between the different parts
cgun-odoo
left a comment
There was a problem hiding this comment.
Couldn't find anything to complain about nice job
| <div class="border d-inline-block p-2 m-2" style="width: 18rem;"> | ||
| <t t-foreach="todos" t-as="todo" t-key="todo"> | ||
| <TodoItem todo="todo"/> | ||
| <input t-ref="add_todo_input" t-on-keyup="addToDo" placeholder="Add a todo"/> |
There was a problem hiding this comment.
from what i see in Odoo, t-ref values are also camelCase rather than snake_case
make it possible to see some content on the page
it is better to show requested data over dummy data
by caching results through a service you don't need to call backend every time you want to show the statistics
add visualization for the statistic data of sizes
code convention
code convention filename needs to be like element inside
…g next one the order of first deleting the old canvas and only then adding a new chart is important!
making sure the data is in line with the data from the backend
| if (this.chart) { | ||
| this.chart.destroy(); | ||
| } |
There was a problem hiding this comment.
you could also do this.chart?.destroy();
| type: "pie", data: { | ||
| labels: Object.keys(this.props.data), | ||
| datasets: [ | ||
| { | ||
| data: Object.values(this.props.data), | ||
| }, | ||
| ], | ||
| } |
There was a problem hiding this comment.
| type: "pie", data: { | |
| labels: Object.keys(this.props.data), | |
| datasets: [ | |
| { | |
| data: Object.values(this.props.data), | |
| }, | |
| ], | |
| } | |
| type: "pie", | |
| data: { | |
| labels: Object.keys(this.props.data), | |
| datasets: [ | |
| { | |
| data: Object.values(this.props.data), | |
| }, | |
| ], | |
| } |
only load the dashboards when they need to be shown
change hardcode cards to a list of dashboard_items to make customization possible in a later stage
help with readability of code
dashboard items are shown from a registry making it possible for other addons to add more items to show
make it possible to hide dashboarditems through a dialog
| id: "average_quantity", | ||
| description: "Average amount of t-shirt", | ||
| Component: NumberCard, | ||
| // size and props are optionals |
| }, | ||
| { | ||
| id: "total_amount", | ||
| description: "Smount of orders this month", |
make sure that every item is correctly translatable
| this.dialogService = useService("dialog"); | ||
| this.items = registry.category("awesome_dashboard").getAll(); | ||
| this.state = useState({ | ||
| disabled: localStorage.getItem("awesome_dashboard_disabled")?.split(',') || [] |
There was a problem hiding this comment.
I assume this was the disabled items on the menu. In that case I would name the variable disabledItems / disabledMenus or something. disabled sounds like it's a boolean.
| } | ||
| } | ||
|
|
||
| class DashboardConfiguration extends Component { |
| } | ||
|
|
||
| updateDisabled(item, checked) { | ||
| item.disabled = !checked; |
There was a problem hiding this comment.
see here disabled is used as a boolean for the item. but at the same time it's the list of items that are disabled. It's a bit confusing

No description provided.