-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Web Tutorial PR: trcaz #967
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
Open
trcazier
wants to merge
33
commits into
odoo:18.0
Choose a base branch
from
odoo-dev:18.0-web-tutorial-trcaz
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
dfc2387
[IMP] awesome_owl: free me from this pain
trcazier f7b4680
[IMP] awesome_owl: save this counter implementation because I like it…
trcazier dc2211e
[IMP] awesome_owl: add up to section 7
trcazier a22285a
[IMP] awesome_owl: apply PR suggestions
trcazier 8611d61
[IMP] awesome_owl: add sections 8-10
trcazier 70e3c05
[IMP] awesome_owl: add section 11
trcazier aa4125a
[IMP] awesome_owl: replace redundant ternary operator with ||
trcazier bf99024
[IMP] awesome_owl: replace redundant ternary operator with if
trcazier 03af1db
[IMP] awesome_owl: add missing ;
trcazier 86806ec
[IMP] awesome_owl: add section 12 and missing ;s
trcazier 143eec9
[IMP] awesome_owl: add section 13
trcazier 3156e29
[IMP] awesome_owl: set the starting todo index as 1
trcazier 60483e6
[IMP] awesome_owl: add section 14
trcazier 2209933
[IMP] awesome_dashboard: add section 1
trcazier adf412a
[IMP] awesome_dashboard: add section 2
trcazier ac47f9b
[IMP] awesome_dashboard: add sections 3-4
trcazier 71636b1
[IMP] awesome_dashboard: add section 5
trcazier 4115506
[IMP] awesome_dashboard: section 6
trcazier 82f496d
[IMP] awesome_dashboard: add section 7
trcazier cabcad9
[IMP] awesome_dashboard: add section 8
trcazier 036b648
[IMP] awesome_dashboard: add section 9
trcazier 164bc52
[IMP] awesome_dashboard: remove console logs
trcazier a502aa5
[IMP] awesome_dashboard: add section 10
trcazier 292c7b8
[IMP] awesome_dashboard: add section 10
trcazier 9f7c018
[MERGE] branch '18.0-web-tutorial-trcaz' of github.com:odoo-dev/tutor…
trcazier 82c0d40
[IMP] awesome_dashboard: move buttons into layout button bar
trcazier b62f551
[IMP] awesome_dashboard: rewrite xml ids using PascalCase
trcazier 113773f
[IMP] awesome_dashboard: apply PR feedback
trcazier 6f4a297
[IMP] awesome_dashboard: add section 11
trcazier 0ad1da4
[IMP] awesome_dashboard: refactor settings dialog props
trcazier 6aacfbe
[IMP] awesome_dashboard: change var name for clarity
trcazier 3231834
[IMP] awesome_dashboard: add newline to file end
trcazier 44e0d49
[IMP] awesome_dashboard: apply PR suggestion
trcazier File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Component, useState } from "@odoo/owl"; | ||
|
||
export class Card extends Component { | ||
static template = "awesome_owl.card"; | ||
static props = { title: {type: String}, content: {type: String}} | ||
|
||
setup() { | ||
this.title = this.props.title; | ||
this.content = this.props.content; | ||
} | ||
} | ||
trcazier marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates xml:space="preserve"> | ||
|
||
<t t-name="awesome_owl.card"> | ||
<div class="card d-inline-block m-2" style="width: 18rem;"> | ||
<div class="card-body"> | ||
<h5 class="card-title"><t t-esc="title"/></h5> | ||
<p class="card-text"> | ||
<t t-out="content"/> | ||
</p> | ||
</div> | ||
</div> | ||
</t> | ||
|
||
</templates> | ||
trcazier marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Component, useState } from "@odoo/owl"; | ||
|
||
export class Counter extends Component { | ||
static template = "awesome_owl.counter"; | ||
static props = { | ||
value: {optional: true}, | ||
side_effect: {type: Function, optional: true} | ||
} | ||
|
||
setup() { | ||
this.state = useState({ value: this.props.value? this.props.value : 0 }); | ||
trcazier marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
} | ||
|
||
increment() { | ||
this.props.side_effect ? this.props.side_effect() : true; | ||
trcazier marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
this.state.value++; | ||
} | ||
} | ||
trcazier marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates xml:space="preserve"> | ||
|
||
<t t-name="awesome_owl.counter"> | ||
<div class="p-3"> | ||
<p>Counter: <t t-esc="state.value"/></p> | ||
<button class="btn btn-primary" t-on-click="increment">Increment</button> | ||
</div> | ||
</t> | ||
|
||
</templates> | ||
trcazier marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,19 @@ | ||
/** @odoo-module **/ | ||
|
||
import { Component } from "@odoo/owl"; | ||
import { Component, markup, useState } from "@odoo/owl"; | ||
import { Counter } from "./counter/counter"; | ||
import { Card } from "./card/card"; | ||
|
||
export class Playground extends Component { | ||
static template = "awesome_owl.playground"; | ||
static components = { Counter, Card } | ||
|
||
setup() { | ||
this.str1 = "<div class='text-primary'>some content</div>"; | ||
this.str2 = markup("<div class='text-primary'>some content</div>"); | ||
this.state = useState({ val1: 0, val2: 10 }) | ||
} | ||
|
||
get sum() { | ||
return this.state.val1 + this.state.val2 | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.