How to reproduce:
=================
1. Open any course having quiz.
2. Select quiz content.
-> In the quiz template we can see that the html content is not sanitize.
Technical:
==========
I think the issue arises after this commit https://github.com/odoo/odoo/commit/0d7acf60b4cca84a8c700edd97af8c4de6b78010
After this commit:
==================
Now t-esc is deprecated and the HTML text is not sanitize in the template
so instead of t-esc we are using t-out.
Task-3555159
closesodoo/odoo#138873
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
The purpose of this commit is to delete the legacy/js/core/time.js file.
We have therefore replaced all calls to time.js with the l10N/date.js utilities.
Part of task 3439226
closesodoo/odoo#138609
Related: odoo/enterprise#48918
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Step to reproduce:
- Install `Elearning` module
- Go to any course and a content as document
- Upload a pdf with more than 1 page
- Go to the website and click on the course then on the content with
the document
- Go to last page and click on next button (should display suggested
slides page)
- Click on previous button
Issue:
Page displayed is not the last one, but the one before.
Cause:
When clicking on the previous button, the current page is still the
last page (just with the suggested slides page on top of it as
overlay), and therefore will decrease it to the page number before
last page (nb last page - 1).
Solution:
When clicking on previous button, if we are on the suggested slides
page (by checking if overlay is not hidden since no attribute is set
on `EmbeddedViewer` to know if we are on that page), hide it.
opw-3482712
closesodoo/odoo#137644
X-original-commit: 422625615b2f6708667fa44d2a9e83ad3e66e5af
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
This commit removes the module sortable from jQueryUI and adds instead a
sortable service to use the sortable code already used by the backend.
The service can be called using `this.call("sortable", ...)` and the
sortable listeners are added when the `enable` function is called.
This function (`enable()`) returns an object that contains the `cleanup`
function (`cleanup()`).
```javascript
// start / setup
const sortable = this.call(
"sortable",
"create",
{
ref: { el: document.querySelector(".list") },
elements: ".items",
handle: ".drag-icon",
},
);
// on attach callback / on mounted
const sortableInstance = sortable.enable();
// on destroy / on willUnmount
sortableInstance.cleanup();
```
Also, it adds some new property to the useSortable:
* clone: the placeholder is a clone of the drag element
* placeholderClasses: classes added to the placeholder element
* applyChangeOnDrop: on drop the change is applied to the DOM
* followingElementClasses: classes added to the element following mouse
task-3439226
closesodoo/odoo#137527
Related: odoo/enterprise#48371
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
*: auth_totp_portal, event, portal_rating, web, web_tour, website_blog,
website_event, website_event_booth, website_event_sale,
website_event_track, website_event_track_quiz, website_payment,
website_sale, website_sale_comparison, website_slides,
website_twitter
This commit allows to have responsive font sizes on all the Odoo
frontend. It is based on the Bootstrap mixin `font-size` which
calculates the font size based on the viewport width.
task-1958098
closesodoo/odoo#129469
Related: odoo/design-themes#673
Related: odoo/enterprise#44578
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, owl was in the linter's accepted global variables.
This allowed direct access to owl global object.
For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`
Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:
`import { xml } from "@odoo/owl";`
task-id 3498859
closesodoo/odoo#137517
Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.
closesodoo/odoo#136271
Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit:
- Select a course from the website, and click 'Add Content'.
From the 'Add Content' window, click 'Video'.
- The description with the title 'On Vimeo' is not up to date with
Vimeo privacy management.
After this commit:
The description is now up to date.
task-3458724
closesodoo/odoo#136083
X-original-commit: 4a1d2a2726ce83edbf28dd478c60a3e6f67d4470
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The Dialog widget is deprecated and will soon be removed, this commit
converts the usage of this dialog for the enroll buttons to use the new
dialog service.
To avoid duplicating the opening logic in the Quiz code, the selector of
the widget that opens the dialog now targets the #wrapwrap and uses
event delegation for the button, avoiding the need to manually spawn the
dialog for buttons added to the DOM after the first load.
closesodoo/odoo#135476
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
*account,web_editor,website,website_sale,website_slides
This commit removes all legacy utils except Markup, which will be
removed in another PR. A lot of those utils were no longer used and
thus have just been removed. Those that were still used either
already existed in the wowl codebase, so usecases have been adapted
to use the new version instead. A few have been re-implemented (or
moved basically) to the wowl codebase (e.g. isEmail and humanSize).
Part of task~3439226
closesodoo/odoo#134620
Related: odoo/enterprise#47044
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit removes the legacy session and adapts the modules where it
was used.
task 3439226
closesodoo/odoo#133153
Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit removes almost all exports of the module services/core.js
(only the bus is left) and adapts the module that imported it.
task 3439226
Part-of: odoo/odoo#133153
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.
closesodoo/odoo#131278
Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.
Part of task~3443861
Part-of: odoo/odoo#130467
This commit removes the qweb.render method, instead it will use the owl
render engine (renderToString or renderToElement).
Part of task~3443861
Part-of: odoo/odoo#130467
As all the templates are now imported in the owl app, the templates must
comply to owl.
t-key is mandatory when using a t-foreach
Part of task~3443861
Part-of: odoo/odoo#130467
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.
closesodoo/odoo#123932
Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
In this commit, _t import from import { _t } from
"@web/legacy/js/services/core" and from
web/static/src/legacy/js/core/translation.js are replaced by
@web/core/l10n/translation.js.
task-3292454
closesodoo/odoo#130865
Related: odoo/enterprise#45270
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Bug to reproduce
----------------
- Log in as admin
- Go to the frontend page of a course
- Click on 'Add Section'
- Fill the form (name input)
- Press 'Enter' or click on save button x times
x sections with the same name will be created
Specifications
--------------
Prevent the 'Add section' form being submitted multiple times in a row.
task-3432418
closesodoo/odoo#131107
X-original-commit: a91a60b4be5b2f606d20fbe574625b85e43407f6
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Add a slide icon class field to prevent computing
the fa-class icon from the slide type in the template
everytime we need it.
Also, using a template wasn't suitable anymore as we
may need the icon outside of its own <i> tag
(see slide_sidebar_done_button).
Task-3378180
closesodoo/odoo#125859
Related: odoo/upgrade#4802
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit removes legacy patch/unpatch functions and adapts their use
by using the modern patch. There was also a custom patch function used
in tests which has been replaced too.
closesodoo/odoo#130867
Related: odoo/design-themes#685
Related: odoo/enterprise#45271
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Purpose
=======
Fix the traceback which was appearing when toggling
as done the content in the course template.
Specification
=============
The traceback happened because when all the content in the
section has been completed, we want to collapse the next section
automatically. However in this view the sections aren't
collapsable which resulted in calling methods on null HTML elements.
Fixing this by checking if HTML elements exists before trying to
collapse the next section.
Task-3449558
closesodoo/odoo#130633
X-original-commit: 51f82b306ed12dc2c8e32d2a0bd3052f8eed5d2a
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
When finishing (and succeeding) a certification in the e-learning module, you
can 'share' the content of the course by email.
But the "Send Email" button is unresponsive.
This is caused by having nested `<form>` tags: the one of the share modal is
inside the main survey form element.
To resolve this issue, we turn the `<form>` tag into a `<div>` tag in the
sharing template, as it does not need to be a form since it's never submitted.
Indeed, the sharing request is sent through attaching an event handler on the
"Send Email" button which still works fine after our tag replacement.
Note that this fix requires updating the module, but there is no (easy) way to
fix it otherwise, and we consider it acceptable as the impact is pretty low.
In addition to that, we also need to add a survey form JS override to correctly
attach the "ShareMail" widget when the screen is loaded to the "finished" page.
Indeed, as the survey form loads and replaces its content in AJAX rather than
fully reloading the page, we need to watch for the screen refresh and then
manually attach the widget so that the button handler is functional.
During FW to 16.4, we also fixed a small oversight of:
odoo/odoo@e0257347a7
Where we did not correctly add the "email_sharing" parameter when sharing the
certification content in the success screen.
Task-3360175
closesodoo/odoo#130613
X-original-commit: 337762b864d7b06abd7d1622083c5f00d7c7e7f7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
In the commit [1], the patch has been refactored to support the
native keyword `super`. The current commit just adapts the codebase
to that change.
task 3410198
[1]: 19ea1ac08043e22a811630968e44715cc3bfc495
Part-of: odoo/odoo#125716
As steps are encapsuled in an arrow function from
69a5d8e3ce47238 for steps tour definition to avoid
direct Markup(_t()) interpretation, the same is done
for registerWebsitePreviewTour() of
"odoo/addons/website/static/src/js/tours/tour_utils.js"
in this commit.
This is done in anticipation of the use of
_t() (import from @web/core/l10n/translation) with
registerWebsitePreviewTour().
task-3292454
closesodoo/odoo#130248
Related: odoo/design-themes#678
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Steps to reproduce:
- Install `website_slides` module
- Create a course and add a slide of type `Article`
- Go to frontend and edit the slide
- Add a text element and edit conditional visibility
(e.g. visible only if user logged in)
- Save and open the slide in fullscreen mode (with any logged user)
Issue:
The text block is missing.
Cause:
The slide is rendered in lazy load after that the code that unhide
conditional elements is already executed (on event `DOMContentLoaded`)
Solution:
Extract the concerned code so it can be called and re-executed after
the slide is rendered also in fullscreen.
opw-3225444
closesodoo/odoo#129646
X-original-commit: 553702c99cbd90edfb509ca9e7ab0c99c73a96e6
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.
Main changes that were requested are:
- record datapoints no longer always have an "id" key in their
data (they still do if the id field is in the view), so we use
record.resId instead
- the new model is based on fined-grained reactivity, so several
components that previously relied on onWillUpdateProps to update
their internal state no longer worked. Typically, using the hook
"observeRecord" is the way to go now.
- specialdata are no longer handled in the model, so the components
needing specialData can use the hook "useSpecialData"
- more generally, all overrides of models (RelationalModel or
KanbanModel) needed to be reworked.
Part of task~3179751
Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
When the user adds the "Title" or "Certificate" in a large number of
characters, the content goes beyond the window.
Technical:
By using this class it applies width 100%, which resolves the issue.
Now, the content stays within the sheet.
Task-3368902
closesodoo/odoo#129014
X-original-commit: 44720aa6e7080ce849af329d8c92681489e093fb
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
luxon and moment are both used in the solution, but
these two libraries facilitate the manipulation of dates.
It was decided to replace all uses of moment with
luxon so we can then remove moment.js from the
code and lighten the assets.
task-3391739
closesodoo/odoo#127406
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
After refactoring the modal options to stop using the `Underscore.js`
library, the modal was not displayed properly anymore. You can check the
behavior by completing a quiz in the website_slides module.
If we set the `option` as the target of the `Object.assign()` we then
got the optiond properly applied and we got the same behavior as before.
Refactoring commit:
https://github.com/odoo/odoo/commit/f4f0f783183507df8227b37fe1234c256325df6d
opw-3389193
closesodoo/odoo#128132
X-original-commit: 46ed163e39238f7f4d7115711fe9dee93abd4cde
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
When we have a long course name or we update the font size to something
big (24 px) for example the course name and the progress bar will overflow
outside its container.
Steps to reproduce the error :
1- go to one of the courses and update it's name to make it a bit long
2- click on one of it's content and got website preview
3- you can see that the progress bar is outside the container
4- if not : click edit -> theme -> change font size to 24 px
5- You can see now clearly that there is overflow from the container
The origin of the problem was because the container has fixed height
equals 80px
opw-3191888
closesodoo/odoo#126460
X-original-commit: 8184374450f8e2b775a29ff05b3128c24579bbba
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
In the course fullscreen view, a black overlay is
hovering the content on medium screen size and lower
when the sidebar is active.
Fix the black overlay which is still showing after
closing the sidebar. When the sidebar is close the
overlay shouldn't be displayed.
As the content is translated to the right and still
fully visible on medium screen size, a black overlay
isn't needed. Only show the black overlay for small
screen size and lower.
Task-3371743
closesodoo/odoo#126118
X-original-commit: f8c45330605837c61f20bed962532b339afc4460
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Purpose
=======
Earn some space in the left content panel (fullscreen and
course page panels).
Specifications
==============
- Align additional resources to the left and remove bold
on the links and icons.
- Remove "mark as done" bubble and push content to the left.
- Question mark, youtube, etc.. icons now become the mark
as undone button. Icon should have a border outline and be empty
- "V" icon remains the one we use when done (filled and green
as currently)
Task-3265917
closesodoo/odoo#125646
X-original-commit: 9dabc99c7711501ec84b3ce0902cb78fed43a868
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Dieudonné Amélie (amdi) <amdi@odoo.com>
*: account, crm, crm_iap_mine, event, hr_expense, hr_holidays,
hr_recruitment, lunch, mail, mass_mailing, point_of_sale, project,
purchase, purchase_stock, sale, survey, web, website, website_blog,
website_event, website_forum, website_sale, website_slides,
test_main_flows
In odoo/odoo#111103 the tour system was rewritten. The previous tour
system used to depend on the `root.widget` js module, and this module
was an async module that indirectly depended on `session_bind` which
would load the translations, meaning that the js module definition code
of the tours would only run after the translations were loaded. This is
no longer the case with the new tour system, this means that the module
definition code is executed as soon as the dependencies of that module
are fulfilled, which is generally befoe the translations are loaded,
causing most tour tips to not be translated.
This commit adds a hacky workaround for this problem: it creates a new
module that has a default export which is a promise, and has a legacy
alias, this creates an async module that waits for the translations to
be loaded. This module is then imported for its side-effect in all
onboarding tours, causing them to be translated correctly once again.
This commit also needs to convert the steps key in the tours internal
registry to a getter. In previous versions, the steps were directly
added as is to the internal state of the tour service, but since
odoo/odoo#122834 the steps are now mapped, and without a getter, any
edits to the steps occurring after registration will not be taken into
account. This causes issues in some modules that change original
behaviour of other modules (eg accounting makes invoices into a menu in
the accounting app instead of a top-level app in the home menu) as they
need to edit the steps of existing tours to make them work.
In a separate PR, we will implement a more proper fix by changing the
API of the tour manager so that we no longer need this workaround.
closesodoo/odoo#125284
X-original-commit: d130699ba82dc9919c9116f4b64a5e461ebb6319
Related: odoo/enterprise#42655
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
Purpose
=======
Improve the behavior of the collapse/expand categories
in front-end for large courses.
Specifications
==============
In channel content view and channel fullscreen view:
- When following the course, expand the ongoing section and
collapse the other ones.
- When the section is completed, open the next one and
keep the previous one(s) opened.
- If an attendee leaves and comes back, only open the ongoing one.
Task-3284195
closesodoo/odoo#121003
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit improves the various sharing templates to check if there is a
configured mail template before suggesting to share the course/slide by email.
Currently the user gets an error message suggesting to configure templates,
which is not ideal as the sharing feature can be used by everyone including
portal users, that have no idea what that means.
Task-3349606
closesodoo/odoo#123702
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Remove "fake" feature sub-folders that make files harder to find.
Note: If there are too many files in the main folder now, a new split
that actually makes sense can be done at a later time: this would not
just be code move, but removing coupling between said feature and the
rest of the code.
Apply consistent structure, where the top level folder is a feature (or
core), and sub-folders are subdivision of the feature depending on
context (closely related to assets bundles).
```
- core
- common
- public
- web
- feature
- common
- public
- web
```
The opportunity is taken to reorganize the top of the files and imports:
- Always use absolute path in imports to be able to find all usages of a
file with a single search.
- Reorganize imports to group them by module, and to sort them
alphabetically by path/feature.
- Always use single asterisk (*) for `odoo-module`: less characters yay!
And double asterisk should be used for JSDoc comments, not for custom
instructions.
Part of task-3265211
closesodoo/odoo#124168
Related: odoo/enterprise#42121
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Delete the autoplay for all iframes in the iframefallback.
The autoplay was causing issue where the sound of the previous video
was played on the background. Now we delete the autoplay for all iframe
directly.
This happened in media_iframe_video, youtube player and vimeo videos.
We can do this for all iframe source url directly as it impacts other
modules like website_slides or website_event_track_live.
task-3012952
closesodoo/odoo#122392
X-original-commit: 6be8af36726d750065972e122e8f4a0aa0f56a17
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Hennecart Jérémy (jeh) <jeh@odoo.com>
To reproduce
============
- add video to a course
- remove user from course if user is enrolled
- open video in full screen mode and play it
- move nearly to the last part of the video so that is detected as completed
- an error will occure
Problem
=======
- when the video is detected to be completed we want to mark the slide as completed
- as the user is not a member, we can't retreive the current slide which is the source
of this issue
Solution
========
as the use is not a member, marking the slide as **Completed** dosen't make any sense,
so checking if the user is member, should solve the problem.
opw-3295662
closesodoo/odoo#122393
X-original-commit: 885d8a18d06d3d3181a345a3fda2a420824f9896
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
- Log in as admin
- Install `eLearning` module
- Create a course and add a youtube video as a lesson
- Publish the course
- Go to the website and click on the course
- Enable `Editor` mode (top left corner)
- Click on lesson to open it in fullscreen
- Click `Back to course` button
Issue:
Video is playing in the background.
Same issue occure with video snippet in the website editor (by default
video is mute but still playing in the background).
Cause:
When editor mode is enabled, there is a fallback iframe that clone the
content of the current page that we leave into it.
Since the youtube video has `autoplay=1` in the URL, it will
automatically start in the fallback iframe.
Solution:
For regular website pages, remove the `autoplay` param from all
media video iframes urls (targeting all `div.iframe` that have a class
`media_iframe_video`).
For eLearning, override the `WebsitePreview._cleanIframeFallback`
method to remove the `autoplay` param from youtube videos URLs.
opw-3226002
closesodoo/odoo#121475
X-original-commit: ad78585cd514f5ff16647572d34937c18a112529
Signed-off-by: Romain Derie (rde) <rde@odoo.com>