-
Notifications
You must be signed in to change notification settings - Fork 2.6k
chapter1-No.6 #976
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 18.0-oBoarding-yoahm
Are you sure you want to change the base?
chapter1-No.6 #976
Conversation
This PR targets the un-managed branch odoo/tutorials:18.0-oBoarding-yoahm, it needs to be retargeted before it can be merged. |
Hey @usseif97 you're targeting your own branch here. Edit the PR to target 18.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job overall 🙂 but don't use AI 💢 if you have any questions just come to me and we can solve it better
awesome_dashboard/static/src/dashboard/configuration_dialog/configuration_dialog.js
Outdated
Show resolved
Hide resolved
|
||
|
||
setup() { | ||
this.checkBoxItems = useState(this.props.items.map((item) => { // Add 'enabled' field to Item -> return Array of Objects |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.checkBoxItems = useState(this.props.items.map((item) => { // Add 'enabled' field to Item -> return Array of Objects | |
this.checkBoxItems = useState(this.props.items.map((item) => { |
what's that comment for 😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just a note for me, that item object have a new field now
awesome_dashboard/static/src/dashboard/configuration_dialog/configuration_dialog.js
Outdated
Show resolved
Hide resolved
awesome_dashboard/static/src/dashboard/number_card/number_card.js
Outdated
Show resolved
Hide resolved
awesome_dashboard/static/src/dashboard/number_card/number_card.js
Outdated
Show resolved
Hide resolved
|
||
addTodo(event) { | ||
if(event.key === "Enter" && event.target.value.trim() !== ""){ | ||
const newId = this.todos.length ? Math.max(...this.todos.map(t => t.id)) +1 : 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can keep a state variable called nextId
or currentId
which keeps track of this value I think it would look better
/** | ||
* useAutofocus - helper to focus an input element | ||
* @param {Component} component - the component instance | ||
* @param {string} refName - the t-ref name of the input element | ||
*/ | ||
export function useAutofocus(component, refName) { | ||
// Store original mounted method | ||
const originalMounted = component.mounted; | ||
|
||
component.mounted = function () { | ||
// Call original mounted() if it exists | ||
if (originalMounted) { | ||
originalMounted.call(this); | ||
} | ||
|
||
// Focus the element | ||
if (this.refs && this.refs[refName]) { | ||
this.refs[refName].focus(); | ||
} | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks a bit ai generated to me huh 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it didn’t work, so I moved on and continued with the next step
No description provided.