Before this commit:
When the page is expanded and try to add any block with an image, try to change
the image using replace button. It lands the user at the top of the page instead
of staying image place.
After this commit:
The user will stay at the image place after clicking on replace button.
Task-2753302
closesodoo/odoo#97266
X-original-commit: da4fdd90622b1f6ba2e45e717fcb4fdde09033af
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The "plain text" template instantiated the regular web_editor.wysiwyg
rather than its specific override for mass_mailing. As a result, it
didn't include certain customizations like commands that should be
overridden for mass_mailing.
task-2715295
closesodoo/odoo#94434
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The codeview of mass_mailing had the wrong height in non full-width
contexts.
task-2894177
closesodoo/odoo#96342
X-original-commit: ee001e843a0a02f04030f0959c7db58beaaa3a3b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
> Media query mixins parameters have changed for a more logical approach
> media-breakpoint-down() uses the breakpoint itself instead of the next
> breakpoint (e.g., media-breakpoint-down(lg) instead of
> media-breakpoint-down(md) targets viewports smaller than lg).
> Similarly, the second parameter in media-breakpoint-between() also
> uses the breakpoint itself instead of the next breakpoint (e.g.,
> media-between(sm, lg) instead of media-breakpoint-between(sm, md)
> targets viewports between sm and lg).
https://getbootstrap.com/docs/5.1/migration/#sass
Task ID: 2766483
Part-of: odoo/odoo#95450
It seems louche to use media-breakpoint-between(lg, xl,
$o-extra-grid-breakpoints) as in $o-extra-grid-breakpoints there is an
XXL value.
In short, in XXL mode the padding fallback to the value outside the
breakpoint (twice smaller).
e.g. result in CSS
```css
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-right: 16px;
padding-left: 16px;
}
@media (min-width: 992px) and (max-width: 1533.98px) {
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-right: 32px;
}
}
@media (min-width: 992px) and (max-width: 1533.98px) {
.o_form_view .o_form_sheet_bg > .o_form_sheet {
padding-left: 32px;
}
}
```
Part-of: odoo/odoo#95450
- BS5 JS use the `data-bs-toggle="dropdown"` attribute to
automatically enable the BS Component.
But in this case as the `.dropdown-menu` is only rendered when the
`.dropdown-toggle` is clicked we can't initialize the Dropdown at the
first render. So we do it manually.
- change .dropdown-menu by .o-dropdown-menu (owl)
-> to handle keyboard navigation we can't use BS dropdowns
- use currentTarget of event
As the event can bubble we use currentTarget to be sure to be at the
higher level in the DOM.
> All the events for the dropdown are now triggered on the dropdown
> toggle button and then bubbled up to the parent element.
- BS5 don't add .show on parent group anymore
-> dropdown show class not on the same node on BS5
- avoid dropdown warning using margin in CSS
BS5 show a warning if we use margin statically in CSS for a dropdown.
> Popper: CSS "margin" styles cannot be used to apply padding between
> the popper and its reference element or boundary. To replicate margin,
> use the `offset` modifier, as well as the `padding` option in the
> `preventOverflow` and `flip` modifiers.
- adapt the systray activity dropdown for mobile
On desktop positions are now dynamic and on mobile it's static
- In BS5 the CSS `bottom: 100%;` is not more applied to the
`.dropup .dropdown-menu` selector.
- Change right -> end and add data-bs-popper="none" to avoid
Popper interaction
Task ID: 2766483
Part-of: odoo/odoo#95450
Before the commit
Go to Email Marketing > Mailing Lists
The kanban cards are visually misplopped.
After the commit
Style is fixed
closesodoo/odoo#95387
Related: odoo/enterprise#29152
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Odoo-Editor, having originally been developed with the purpose of being
a standalone library, was put into a `lib` folder. Since in the meantime
the library plans were aborted and since its presence outside the `src`
directory makes translations unavailable for it, this moves the editor
to `src/js/editor/odoo-editor`.
task-2880723
Part-of: odoo/odoo#94516
Before this commit
When the user hit ctrl+k on a mass mailing, no command palette nor link
dialog was opening.
This was due to the fact that the hotkey service would not react
to hotkeys being pressed from inside of an iframe element.
After this commit
One can now register an iframe to the hotkey service to let it react
to hotkeys being pressed from within the registered iframes.
task-2738457
closes odoo/odoo#91102
Forward-port-of: #89940
Forward-port-of: #82994
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
*: mass_mailing, web, web_editor, website_blog, website_event,
website_event_meet, website_livechat, website_sale, website_twitter,
base
This commit does 3 things:
- Adapt existing code so that the editor can be run outside of its
editing element. Prior to this commit, it was expected that the
editor would be attached to the element it was currently editing.
This needs to change however as the editable is now inside an
iframe for the website edition. mass_mailing already had a similar
approach but the editor was started within the iframe.
With these changes, the editor is alongside the iframe, editing
the content that's inside it. This allows multiple features
such as reloading the iframe while keeping the editor visible and
resizing the iframe for a mobile preview.
- Adds logic to the wysiwyg_adapter so that it can undertake
the duty of the previous widget sytem. The wysiwyg existed not only
in the legacy widget system, but most importantly in the frontend.
One of the duties of this adapter is to send events inside the
iframe when it is necessary to reach the frontend public widget
(i.e. widgets_start_request)
- Removes existing SCSS that is no longer used.
See merge commit for more information.
task-2687506
Before this commit, in the editable form view of mass mailing, the
emoji widget is outside of the subject field, which is not optimum.
This issue was re-spawned after a recent commit that enabled saving
the mailing as a template, which changed the layout to add a star
next to the subject field.
With this commit, emoji widget is now inside the subject field.
task-2826521
closesodoo/odoo#92672
X-original-commit: 09991b477353e6167d576779b7364408b2109cd6
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Reorganize addon according to guidelines, helping finding and updating
SPECIFICATIONS
Reorganize templates in order to see a bit what's going on here. Notably split
subscription (opt-out, blacklist) from management (view, reporting) templates.
Reorganize controller code by main section in order to separate a bit various
code purpose.
This commit contains only file split / renaming and code move.
Task-2864264 (Mass Mailing Module Reorganization)
Part-of: odoo/odoo#92509
If you do not have favorite filters available in the mass mailing for
selected model, we display empty drop down, which is not ideal.
This commit improves the behavior with following changes:
- If there is no filter available (for this target) and no condition
set in the mailing domain, do not display anything
- If mailing domain is set but there is not filter available, show a
custom label "Save Filter as Favorite" save icon next to it
Ent PR: https://github.com/odoo/enterprise/pull/26308
task-2711258
closesodoo/odoo#87673
Related: odoo/enterprise#26308
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
There was an issue when a mailing save failed: the edited body of the mailing
was lost.
Impacted versions:
- 15.0 and higher
Steps to reproduce:
1. Create a mailing "Start from scratch" and add some elements
2. Do not fill in the subject (or at least one required field)
3. Save (it should fail because of the empty required field)
Current behavior:
- The edited template is lost
Expected behavior:
- Keep the edited template even if the save failed
This commit fixes the problem by properly awaiting the promise _doAction so that
the field's value will be set correctly.
The testing tour `mass_mailing_editor_tour` is updated to check that the
body_arch is kept after a failed save.
This issue was introduced in 15.0 with:
95754eb6a4
Task-2856742
closesodoo/odoo#92186
X-original-commit: bc81178d541587f757d76932449d35ed426699aa
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The design tab allows the customization of the separators' colors but
this is currently broken because it gets overridden by the default style
of the snippet, which has higher specificity.
Besides, the priority of styles was lost.
closesodoo/odoo#92174
X-original-commit: 098202ba584ca6ba3544ccd00397578f5deb12ad
Related: odoo/enterprise#27719
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Since background-image elements and their children will be flattened
into images, links within them won't work. This removes the link button
of the editor toolbar, as well as the link and button commands in those
contexts.
task-2856858
Part-of: odoo/odoo#91314
There are two ways of editing links: the link tools (in the sidebar) and
the link dialog. In `mass_mailing`, the link tools were in the sidebar
but using the link command of the Powerbox opened the link dialog. This
makes it so only one mechanism is in use (the link tools).
task-2856858
Part-of: odoo/odoo#91314
When the first snippet in a mail is for example a cover image,
the html2canvas library exports the image with a white line along the
top caused by the negative top margin on the iframe.
task-2856858
Part-of: odoo/odoo#91314
When importing snippets from `website` to `mass_mailing`, the styles for
`.o_bg_img` were not carried over. This makes the image of the `Masonry`
snippet size poorly. This duplicates that scss into mass_mailing.
task-2856858
Part-of: odoo/odoo#91314
The default values of borders for buttons were not properly parsed in
the design tab because they come from the `btn` class, which was not
part of the selectors for buttons in the design tab. The fake element
created to get computed styles therefore didn't have that class and thus
didn't have a border value.
The separator width value was also broken whenever it was "auto" since
we're expecting values of "25%", "50%", "75%" or "100%". This interprets
"auto" as equivalent to "100%" in all cases.
closesodoo/odoo#92138
X-original-commit: 56521a69d9cb61ec726722a2b102150bb1714070
Related: odoo/enterprise#27708
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
`wWebsite`'s `s_hr` snippet css targets the same element as
`mass_mailing`'s `hr` snippet, resulting in interferences. This raises
the speciticity of `mass_mailing.s_hr`'s css to counter that issue.
X-original-commit: 112758b7c07870c5d002a87f4eed58bd8feb9bee
Part-of: odoo/odoo#92138
Remove default styles which remove underlines on links.
Add global styling for theme_default.
X-original-commit: 4ec9847057d9888820c3d9b1b068e3658e80acd4
Part-of: odoo/odoo#92138
Separator widgets were not centered by default which looked weird when
we resized them with the design tab.
task-2821155
X-original-commit: 60190e283e4c75bb6480ba37b8c2ccf4246cf769
Part-of: odoo/odoo#92138
When styling a theme in XML, we don't have access to the top of
`.o_layout`, leading to the design element being located in different
places depending on whether it's been added programmatically or in XML.
This harmonizes it, ensuring it's always at the top of `.o_layout`.
X-original-commit: ab61f1d38b2852ec0b6727122a1cfc2cd81cfc9f
Part-of: odoo/odoo#92138
When changing a font-family style in the design tab, we need to make
sure we don't override the font-family of font awesome icons or it will
break them. This takes font-family out of its selector and applies
it to special selectors that exclude `.fa`.
task-2821155
X-original-commit: d25b38969d1d0f2f791ad33f2591ea4f3b7b5ed8
Part-of: odoo/odoo#92138
Some styles added by the design tab require the use of the 'important'
keyword. Prior to this that keyword was added to all styles of a
selector that contained at least one priority style.
task-2821155
X-original-commit: e41de41c6f1e8d3f34368e191b9debc03c57ab05
Part-of: odoo/odoo#92138
When adding a font-family style, we need to make sure it trickles down
to all its descendants. This implies adding selectors with a trailing
`*` to the selectors involved. The way it was done was
undiscriminatingly, leading to selectors ending in `* *`, which is
obvious non-sense.
task-2821155
X-original-commit: bb8685cc9829ab0e76d98c4c1196a344d2475759
Part-of: odoo/odoo#92138
Purpose
=======
This commit rework the design of the Kanban view of the mailing list.
There are now 2 styles for this Kanban view
- Grouped, for this one we keep the same "card design" as before
- Ungrouped, we use a "list style" view, and the card take the all
width of the screen
Add some actions to be able to import quickly contacts from this view
or to send a mailing to the mailing contact list.
Task-2737782
closesodoo/odoo#86587
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Currently, if user clicks the mass mailing template (theme) and holds
the click while moving the mouse (as if performing drag and drop), a
weird white highlight appears on the preview of the template.
This commit fixes the behavior by setting appropriate background color
instead of the default one of drop-down item, when the template is
focused.
task-2812312
closesodoo/odoo#89893
X-original-commit: e49f55e6f34486f8425653323544838f1a9fbd38
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, the design tab retrieved the current styles
exclusively from the `#design-element` style element. This meant that if
a template included that element to define its own styles, the defaults
were lost for the styles that it didn't define.
This reads the styles from the DOM instead so this is never an issue.
In order for the design tab to have values to read, we initialized the
`#design-tab` element with the css of the page. This was a temporary
workaround. Now that values are read via `getComputedStyle`, we don't
need it anymore.
task-2833420
closesodoo/odoo#89745
X-original-commit: e8f2f71f76f86bae84253374935fd7d14428746d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The masonry snippet was recently imported from website into mass_mailing
but its background image options were omitted, making it impossible to
changes these images.
task-2824014
closesodoo/odoo#89690
X-original-commit: a226c26255dfabff2ac10ca3ec9b56d01feb0d7e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
In the mass mailing form, when clicking on the filter save button, the screen
was unexpectedly scrolling down. This fixes this problem.
Task-2793090
closesodoo/odoo#86789
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, this bug was present in edit mode:
- Go into edit mode on an empty page.
- Click on the THEME tab on the right.
- Click on the empty "DRAG BUILDING BLOCKS HERE" area.
- Click on the THEME tab again.
- The content of THEME is empty.
It was because since this commit [1], clicking on an 'oeStructure'
activate the Blocks tab but without updating the options in the tabs.
Another similar bug was present when clicking the style tab and then
clicking on the theme tab.
About the first bug, actually a call of '_updateRightPanelContent' is
already done in '_activateSnippet()' (and the Blocks tab is activate by
default) so we only have to use '_activateSnippet(false)' to activate
the Blocks tab. This commit also remove '_updateRightPanelContent' from
the click event of the Blocks tab where it was not necessary.
For the second bug, we can't do the same fix, because it's not possible
to activate the options tab with only '_activateSnippet(false)' so we
had to combine the two functions.
[1]: https://github.com/odoo/odoo/commit/fbe048c202ff7878984adf26bef0651a45851f0a
task-2794266
closesodoo/odoo#88537
X-original-commit: 52d32e26c34bef10823582ef5c1f840492b73d7a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When starting the mass_mailing design option, some manipulations
are done on the `#design-element` style element. This can result in
sudden style changes when clicking the design tab.
This commit makes it so these manipulations are done as soon as
mass_mailing starts. In order to do that, constants were shared from
mass_mailing_snippets.
closesodoo/odoo#88318
Related: odoo/enterprise#25753
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Inline styles applied by the editor should always have priority over the
general stylesheet. This failed in the case of nested styles (a <font>
with a color within a <span> with a font size for instance).
closesodoo/odoo#88004
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
To give a custom style to a template, we need to add a style element at
its top, with the id "design-element", and apply to it the supported
styles. These supported styles and their selectors can be seen in the
`DEFAULT_CSS_OBJECT` constant in `mass_mailing_snippets.js`.
However, comma-separated selectors were not supported, meaning styles
could only be incomplete.
task-2816655
Part-of: odoo/odoo#88004
The image transform option uses the `transform` CSS property, which is
very poorly supported in email clients. This hides that option so as to
avoid bad surprises.
task-2802705
closesodoo/odoo#88052
X-original-commit: 611c9a2aa65f3c6f9e1c0780cb9177bc1e67513d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Commit [1] redefined the target in generic methods of snippet options so
that some buttons of the Design Tab snippet option could target a
different node than their parent option. This reverts that in favor of
the more generic `apply-to` data attribute.
[1]: c4bfedc37bclosesodoo/odoo#87325
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
mass_mailing has an override of _getCSSColorValue which was basically
never used since the option it's linked to was mostly inactive. Now it's
active it became obvious there is a mistake in it that causes a
traceback to occur when no color is passed to it. This adds the same
check as in the original method and thereby prevents the traceback.
task-2760157
closesodoo/odoo#84926
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This allows users to use the shape feature on images in mass_mailing.
Since email clients do not support the svg file type, it converts these
svg images into png images on save.
task-2760157
Part-of: odoo/odoo#84926
This adds options to the "Design" tab of mass_mailing so the user can
edit its stylesheet directly.
task-2789287
closesodoo/odoo#86881
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The empty editor message was overflowing its container when in a modal,
so a part of it was hidden and there was a scrollbar. This fixes it by
setting its width to the available space.
task-2742664
X-original-commit: 0bbe0a6e108591146d1d8cfb252b31f24fbf8ca5
Part-of: odoo/odoo#86506
Purpose
=======
Filter the mailing templates based on the model defined on the mailing,
so the user will see the most appropriate templates.
Task-2593231
Part-of: odoo/odoo#79174
Purpose
=======
Allow users to re-use a design they made in a previous mailing.
Specifications
==============
Add a duplicate button when the mailing has been sent (so the users
can easily duplicate an existing mailing to re-use the template).
Allow the user to add a mailing to the favorites. When we open the web
editor for the first time, show the email bodies of the favorite
mailings. When the users click on them, load the HTML like we do for
the themes.
Task-2593231
Part-of: odoo/odoo#79174
Purpose
=======
We can now define a title for the mailing templates that will be
displayed bellow the thumbnail.
Improve the thumbnail image of the "plaintext" template.
Technical
=========
The title is set on the "title" atribute, and not on "data-title",
because the data attributes are not translated.
Task-2593231
Part-of: odoo/odoo#79174