-
Notifications
You must be signed in to change notification settings - Fork 23.2k
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
Master snippet options owl ard #164668
Draft
detrouxdev
wants to merge
20
commits into
odoo:master
Choose a base branch
from
odoo-dev:master-snippet-options-owl-ard
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Master snippet options owl ard #164668
Conversation
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
detrouxdev
force-pushed
the
master-snippet-options-owl-ard
branch
from
May 7, 2024 07:24
c73bc85
to
c1fa12d
Compare
detrouxdev
force-pushed
the
master-snippet-options-owl-ard
branch
from
May 17, 2024 06:16
105fcdc
to
ee275b6
Compare
detrouxdev
force-pushed
the
master-snippet-options-owl-ard
branch
from
May 27, 2024 09:42
a8e963d
to
ca980ac
Compare
detrouxdev
force-pushed
the
master-snippet-options-owl-ard
branch
2 times, most recently
from
June 5, 2024 09:19
8f65bde
to
6b1012e
Compare
This will allow both the OWL Option system and the Legacy system to work alongside each other. Making it easier to convert step by step. The original file will be the one used for the conversion. This will allow any fix done in the master branch to hit the OWL file when rebased since this is the file that will be kept at the end of the conversion. task-3850413
The widget will be turned into a "state model" in future commits and most of its code will be rewritten, but the first step is to turn it into an ES6 class instead of a "Legacy" widget task-3850413
detrouxdev
force-pushed
the
master-snippet-options-owl-ard
branch
from
June 5, 2024 09:25
6b1012e
to
82f0d03
Compare
This is the first step of a major refactoring to accommodate the current SnippetsMenu stack to OWL. To do so, it split some of the logic, to separate (as much as possible) state from UI HTML. Previously, a lot of the widgets in the SnippetsMenu would rely on DOM to handle their states and values. SnippetOption also had direct access to the widgets and templates. This allowed Options to request values from the child widgets and update their state accordingly. The template for the option was also rendered using its own system. Now, the SnippetOption is a simple ES6 class, and has no direct element in the DOM. Instead, a SnippetOptionRendering component is passed to the SnippetsMenu to render the "UserValueComponent" which is the UI the use will interact with. The state of these UserValueComponents are still handled by the SnippetOption however. Which allows the SnippetOption to modify the state of a component, and the component will re-render accordingly. This means the XML rendering is no longer handled by the option and widgets, but by OWL. ===== NOTE ===== This commit message is WIP but any suggestion is welcomed :D task-3850413
This follows the previous commit logic, with the added complexity of handling the state of a toggler. task-3850413
This commit adds WeButtonGroup which replaces the ButtonGroupUserValueWidget
This commit SHOULD not reach master as this solution has not been discussed and is IMO a big downgrade to the old tooltip system.
This commit changes the old SnippetOptionWidget class to an ES6 class and adapts the template to OWL.
This commit combines we-datetimepicker and we-datepicker into one Component with different props and converts the API to the new OWL api. task-3850413 Co-authored-by: Arthur Detroux (ard) <ard@odoo.com>
In this commit, some properties are renamed to better fit the new framework. The `user_value_widget_request` trigger_up which was previously a trigger_up is changed to a "callback". The dependency system remains almost identical. Component just use the state to apply d-none or not. task-3850413
This commit convert we-row to owl and introduces the concept of layout elements. Their state is also shared with the option so that it can properly hide the layout elements when all of the layout's widgets are hidden. task-3850413
The templates are now static templates and the options are now ES6 classes. The layout mixin was also adapted so that it works with this type of class.
This commit adapts the code so that it may work inside an OWL Component while retaining most of its previous functionality. task-3850413
This commit converts the API of the Mediapicker widget to OWL and combines the Imagepicker and the Videopicker widgets into a common WeMediapicker whose behavior depends on its props (specifically `mediaType`, being either "images" or "videos"). task-3850413
task-3850413
task-3850413
detrouxdev
force-pushed
the
master-snippet-options-owl-ard
branch
from
June 5, 2024 09:28
82f0d03
to
f3594f8
Compare
task-3850413
Converted option's extend into a SnippetOption patch. Adapted refreshPublicWidget. Note that the signatures had to be adapted to the modern style for methods that call `super`. task-3850413
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
/!\ The high diff is because some files were duplicated to ensure that Odoo would still load while partially adapted to OWL
The duplication will of course be deleted when all components are adapted. (This will remove ~9 761 + 4 195 = 13 956 lines)
Work still needs to be done for options which share a state to their widgets beyond _computeWidgetState
task-3850413