Skip to content
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

[IMP] mysterious_egg #3474

Draft
wants to merge 3 commits into
base: master-mysterious-egg
Choose a base branch
from
Draft

Conversation

loco-odoo
Copy link

@loco-odoo loco-odoo commented Nov 5, 2024

Begin of the save mechanism + tests

@robodoo
Copy link

robodoo commented Nov 5, 2024

This PR targets the un-managed branch odoo-dev/odoo:mysterious-egg, it needs to be retargeted before it can be merged.

@loco-odoo loco-odoo force-pushed the mysterious-egg-2-loco branch 5 times, most recently from da007fc to e81a630 Compare November 12, 2024 09:44
@loco-odoo loco-odoo changed the base branch from mysterious-egg to master-mysterious-egg November 12, 2024 09:45
@loco-odoo loco-odoo force-pushed the mysterious-egg-2-loco branch 9 times, most recently from 6510625 to c4b4364 Compare November 14, 2024 15:09
addons/html_builder/static/src/builder/snippets_menu.js Outdated Show resolved Hide resolved
@@ -24,7 +26,13 @@ export class SetupEditorPlugin extends Plugin {
.filter((el) => !el.hasAttribute("data-oe-sanitize-prevent-edition"));
editableEls.concat(Array.from(this.editable.querySelectorAll(".o_editable")));
editableEls.forEach((el) => el.classList.add("o_editable"));
this.beforeUnloadFc = this.addDomListener(window, "beforeunload", (event) => {
if (this.isDirty()) {
event.returnValue = _t("This document is not saved!");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

document ? It s a strange name. Maybe "This website page is not saved!" ? Maybe check with lionel

addons/html_builder/static/src/builder/snippets_menu.js Outdated Show resolved Hide resolved
addons/html_builder/static/src/builder/snippets_menu.js Outdated Show resolved Hide resolved
this.initialUrl = `/website/force/${encodeURIComponent(this.backendWebsiteId)}`;
this.websiteService.currentWebsiteId = this.backendWebsiteId;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for another pr, websiteService life cycle ? Only when the editor is open ?

this.getResource("handleNewRecords").forEach((cb) => cb(filteredRecords));
// TODO modify `handleMutations` of web_studio to handle
// `undoOperation`
this.getResource("handleNewRecords").forEach((cb) => cb(filteredRecords, this.undoOperation));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use the current step state ? I m not a big fan to put flag in this

@@ -586,6 +589,7 @@ export class HistoryPlugin extends Plugin {
this.addStep({ stepState: "undo" });

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stepState

@@ -29,18 +29,21 @@ class WebsiteBuilder extends Component {
});
this.state = useState({ isEditing: false });
this.websiteService = useService("website");
this.websiteService.useMysterious = true;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a comment //TODO to remove


test("double click on Image", async () => {
await setupWebsiteBuilder(`<div><img class=a_nice_img src='${base64Img}'></div>`);
await openSnippetsMenu();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check if you don t have .modal-content before. You don t have a specific class on your dialog ?

You have an issue in your test, if dblclick open another dialog for strange reason you don t know

@loco-odoo loco-odoo force-pushed the mysterious-egg-2-loco branch 6 times, most recently from 12e0add to 6af8375 Compare November 18, 2024 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants