-
-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] mail_activity_board: Migration to 17.0
- Loading branch information
Showing
7 changed files
with
49 additions
and
62 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
35 changes: 35 additions & 0 deletions
35
mail_activity_board/static/src/components/chatter/chatter.esm.js
This file contains 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,35 @@ | ||
/** @odoo-module **/ | ||
import {Chatter} from "@mail/core/web/chatter"; | ||
import {patch} from "@web/core/utils/patch"; | ||
|
||
patch(Chatter.prototype, { | ||
// -------------------------------------------------------------------------- | ||
// Handlers | ||
// -------------------------------------------------------------------------- | ||
|
||
/** | ||
* @private | ||
* @param {MouseEvent} ev | ||
*/ | ||
// eslint-disable-next-line no-unused-vars | ||
async _onListActivity(ev) { | ||
if (this.state.thread) { | ||
const thread = this.state.thread; | ||
const action = await this.orm.call( | ||
thread.model, | ||
"redirect_to_activities", | ||
[[]], | ||
{ | ||
id: this.state.thread.id, | ||
model: this.state.thread.model, | ||
} | ||
); | ||
this.action.doAction(action, { | ||
onClose: () => { | ||
thread.refreshActivities(); | ||
thread.refresh(); | ||
}, | ||
}); | ||
} | ||
}, | ||
}); |
11 changes: 5 additions & 6 deletions
11
...ponents/chatter_topbar/chatter_topbar.xml → ...static/src/components/chatter/chatter.xml
This file contains 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,20 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<templates id="template" xml:space="preserve"> | ||
<t | ||
t-name="ChatterTopbar" | ||
t-inherit="mail.ChatterTopbar" | ||
t-name="mail_activity_board.Chatter" | ||
t-inherit="mail.Chatter" | ||
t-inherit-mode="extension" | ||
owl="1" | ||
> | ||
<t t-if="chatterTopbar.chatter.hasActivities" position="after"> | ||
<xpath expr="//button[hasclass('o-mail-Chatter-activity')]" position="after"> | ||
<button | ||
class="btn btn-link o_ChatterTopbar_button" | ||
type="button" | ||
t-att-disabled="!chatterTopbar.chatter.hasWriteAccess" | ||
t-att-disabled="!state.thread.hasWriteAccess" | ||
t-on-click="_onListActivity" | ||
> | ||
<i class="fa fa-list" /> View Activities | ||
</button> | ||
</t> | ||
</xpath> | ||
</t> | ||
</templates> |
45 changes: 0 additions & 45 deletions
45
mail_activity_board/static/src/components/chatter_topbar/chatter_topbar.esm.js
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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