Skip to content

Commit

Permalink
[MIG] web_dialog_size: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosRoca13 committed Aug 16, 2024
1 parent d760a19 commit 2f6bb7f
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 192 deletions.
1 change: 1 addition & 0 deletions web_dialog_size/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ Contributors
- Pedro M. Baeza
- Jairo Llopis
- Ernesto Tejeda
- Carlos Roca

- Sudhir Arya <[email protected]>
- Pierre Pizzetta <[email protected]>
Expand Down
16 changes: 11 additions & 5 deletions web_dialog_size/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,25 @@
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"category": "web",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"license": "AGPL-3",
"depends": ["web"],
"installable": True,
"assets": {
"web.assets_backend": [
"/web_dialog_size/static/src/js/web_dialog_size.js",
"/web_dialog_size/static/src/js/web_dialog_size.esm.js",
"/web_dialog_size/static/src/js/web_dialog_draggable.esm.js",
"/web_dialog_size/static/src/scss/web_dialog_size.scss",
"/web_dialog_size/static/src/xml/web_dialog_size.xml",
"/web_dialog_size/static/src/xml/ExpandButton.xml",
"/web_dialog_size/static/src/xml/DialogDraggable.xml",
(
"after",
"/web/static/src/core/dialog/dialog.xml",
"/web_dialog_size/static/src/xml/web_dialog_header.xml",
),
(
"after",
"/web/static/src/views/view_dialogs/select_create_dialog.xml",
"/web_dialog_size/static/src/xml/select_create_dialog.xml",
),
],
},
}
1 change: 1 addition & 0 deletions web_dialog_size/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Pedro M. Baeza
- Jairo Llopis
- Ernesto Tejeda
- Carlos Roca
- Sudhir Arya \<<[email protected]>\>
- Pierre Pizzetta \<<[email protected]>\>
- Mantas Šniukas \<<[email protected]>\>
1 change: 1 addition & 0 deletions web_dialog_size/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Pedro M. Baeza</li>
<li>Jairo Llopis</li>
<li>Ernesto Tejeda</li>
<li>Carlos Roca</li>
</ul>
</li>
<li>Sudhir Arya &lt;<a class="reference external" href="mailto:sudhir&#64;erpharbor.com">sudhir&#64;erpharbor.com</a>&gt;</li>
Expand Down
50 changes: 0 additions & 50 deletions web_dialog_size/static/src/js/web_dialog_draggable.esm.js

This file was deleted.

25 changes: 11 additions & 14 deletions web_dialog_size/static/src/js/web_dialog_size.esm.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
/** @odoo-module **/

import {ActionDialog} from "@web/webclient/actions/action_dialog";
import {patch} from "@web/core/utils/patch";
import rpc from "web.rpc";
import {Component, onMounted} from "@odoo/owl";
import {Dialog} from "@web/core/dialog/dialog";
import {SelectCreateDialog} from "@web/views/view_dialogs/select_create_dialog";
import {patch} from "@web/core/utils/patch";
import {useService} from "@web/core/utils/hooks";

export class ExpandButton extends Component {
setup() {
this.orm = useService("orm");
this.last_size = this.props.getsize();
this.config = rpc.query({
model: "ir.config_parameter",
method: "get_web_dialog_size_config",
});
this.config = this.orm.call(
"ir.config_parameter",
"get_web_dialog_size_config"
);

onMounted(() => {
var self = this;
Expand All @@ -38,9 +37,9 @@ export class ExpandButton extends Component {

ExpandButton.template = "web_dialog_size.ExpandButton";

patch(Dialog.prototype, "web_dialog_size.Dialog", {
patch(Dialog.prototype, {
setup() {
this._super(...arguments);
super.setup();
this.setSize = this.setSize.bind(this);
this.getSize = this.getSize.bind(this);
},
Expand All @@ -55,9 +54,9 @@ patch(Dialog.prototype, "web_dialog_size.Dialog", {
},
});

patch(SelectCreateDialog.prototype, "web_dialog_size.SelectCreateDialog", {
patch(SelectCreateDialog.prototype, {
setup() {
this._super(...arguments);
super.setup();
this.setSize = this.setSize.bind(this);
this.getSize = this.getSize.bind(this);
},
Expand All @@ -71,8 +70,6 @@ patch(SelectCreateDialog.prototype, "web_dialog_size.SelectCreateDialog", {
return this.props.size;
},
});

Object.assign(ActionDialog.components, {ExpandButton});
SelectCreateDialog.components = Object.assign(SelectCreateDialog.components || {}, {
ExpandButton,
});
Expand Down
50 changes: 0 additions & 50 deletions web_dialog_size/static/src/js/web_dialog_size.js

This file was deleted.

8 changes: 0 additions & 8 deletions web_dialog_size/static/src/xml/DialogDraggable.xml

This file was deleted.

8 changes: 8 additions & 0 deletions web_dialog_size/static/src/xml/select_create_dialog.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<t t-inherit="web.SelectCreateDialog" t-inherit-mode="extension" owl="1">
<xpath expr="//Dialog" position="attributes">
<attribute name="size">props.size</attribute>
</xpath>
</t>
</templates>
13 changes: 13 additions & 0 deletions web_dialog_size/static/src/xml/web_dialog_header.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-inherit="web.Dialog.header" t-inherit-mode="extension" owl="1">
<xpath expr="//button[hasclass('btn-close')]" position="before">
<ExpandButton
getsize="getSize"
setsize="setSize"
t-if="!isFullscreen and getSize and setSize"
/>
</xpath>
</t>
</templates>
65 changes: 0 additions & 65 deletions web_dialog_size/static/src/xml/web_dialog_size.xml

This file was deleted.

0 comments on commit 2f6bb7f

Please sign in to comment.