[MOV] website, *: move static files to prepare website UI in backend

*: web_editor, web_unsplash, website_event, website_blog,
   website_event_meet, website_forum, website_links, website_livechat,
   website_sale_slides, website_slides

With [1], many files will move as the website UI is moved in the
backend. This commit moves all the static files (JS/CSS/XML) to their
final destination without modifying them, in an attempt to preserve
some history and ease some forward-ports.
After this commit, everything works as before as the files are simply
renamed and the references to them adapted.

However, technically, many files will actually be split into multiple
files by the work made with [1]. While it is theoretically possible to
preserve history over multiples files, this would require inner merge
commits, which does not go well with robodoo. In those cases, the "main"
file of the split was chosen. Mainly, 4 worth-noticing splits were
detected (and so the history moved only to the first file):

move: addons/web_editor/static/src/js/wysiwyg/widgets/media.js
to: addons/web_editor/static/src/components/media_dialog/file_selector.js
  - addons/web_editor/static/src/components/media_dialog/search_media.js
  - addons/web_editor/static/src/components/media_dialog/image_selector.js
  - addons/web_editor/static/src/components/media_dialog/document_selector.js
  - addons/web_editor/static/src/components/media_dialog/icon_selector.js
  - addons/web_editor/static/src/components/media_dialog/video_selector.js

move: addons/web_editor/static/src/js/wysiwyg/widgets/upload_progress_toast.js
to: addons/web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js
  - addons/web_editor/static/src/components/upload_progress_toast/upload_service.js

move: addons/website/static/src/js/menu/content.js
to: addons/website/static/src/components/dialog/edit_menu.js
  - addons/website/static/src/components/dialog/page_properties.js
  - addons/website/static/src/components/wysiwyg_adapter/page_options.js
  - addons/website/static/src/js/website_page_list.js

move: addons/website/static/src/js/menu/edit.js
to: addons/website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js
  - addons/website/static/src/systray_items/edit_website.js
  - addons/website/static/src/components/editor/editor.js

Notice that as those moves were made post-work and the rest of the work
(80+ commits) rebased on top of it, some commits may remove more than
they should in a moved file to then reimplement some of what was
removed in a later commit... ideally this should have been avoided of
course but keep in mind that the final files are just entirely rewritten
and split as converted to OWL. It seemed however worth it to keep most
of the inner history of the work made here to see step by step what was
done. [1] will obviously be merged with a merge commit, binding the
whole work together.

[1]: https://github.com/odoo/odoo/pull/89223

task-2687506
This commit is contained in:
qsm-odoo
2022-06-24 10:28:04 +02:00
parent ce272ce13b
commit 29f21a23f1
41 changed files with 43 additions and 40 deletions
+3
View File
@@ -78,6 +78,9 @@ Odoo Web Editor widget.
# widgets & plugins
'web_editor/static/src/js/wysiwyg/widgets/**/*',
'web_editor/static/src/components/media_dialog/file_selector.js',
'web_editor/static/src/components/media_dialog/media_dialog.js',
'web_editor/static/src/components/upload_progress_toast/upload_progress_toast.js',
'web_editor/static/src/js/editor/snippets.editor.js',
'web_editor/static/src/js/editor/toolbar.js',
'web_editor/static/src/js/editor/snippets.options.js',
@@ -11,7 +11,7 @@ var Widget = require('web.Widget');
var session = require('web.session');
const {removeOnImageChangeAttrs} = require('web_editor.image_processing');
const {getCSSVariableValue, DEFAULT_PALETTE} = require('web_editor.utils');
const { UploadProgressToast } = require('@web_editor/js/wysiwyg/widgets/upload_progress_toast');
const { UploadProgressToast } = require('@web_editor/components/upload_progress_toast/upload_progress_toast');
var QWeb = core.qweb;
var _t = core._t;
+2 -2
View File
@@ -13,8 +13,8 @@
'auto_install': True,
'assets': {
'web_editor.assets_wysiwyg': [
'web_unsplash/static/src/js/unsplashapi.js',
'web_unsplash/static/src/js/unsplash_image_widget.js',
'web_unsplash/static/src/services/unsplash_service.js',
'web_unsplash/static/src/components/media_dialog/image_selector.js',
],
'web.assets_frontend': [
'web_unsplash/static/src/js/unsplash_beacon.js',
@@ -22,7 +22,7 @@ delete originalEvents['click .o_existing_attachment_cell'];
widgetsMedia.ImageWidget.include({
xmlDependencies: widgetsMedia.ImageWidget.prototype.xmlDependencies.concat(
['/web_unsplash/static/src/xml/unsplash_image_widget.xml']
['/web_unsplash/static/src/components/media_dialog/image_selector.xml']
),
events: _.extend({}, widgetsMedia.ImageWidget.prototype.events, {
'click .o_unsplash_attachment_cell[data-imgid]': '_onUnsplashImgClick',
+12 -12
View File
@@ -125,7 +125,7 @@
'website/static/src/js/utils.js',
'website/static/src/js/content/website_root.js',
'website/static/src/js/widgets/dialog.js',
'website/static/src/js/widgets/fullscreen_indication.js',
'website/static/src/components/fullscreen_indication/fullscreen_indication.js',
'website/static/src/js/content/compatibility.js',
'website/static/src/js/content/menu.js',
'website/static/src/js/content/snippets.animation.js',
@@ -212,7 +212,7 @@
'website/static/src/snippets/s_process_steps/options.js',
'website/static/src/js/editor/wysiwyg.js',
'website/static/src/js/editor/widget_link.js',
'website/static/src/js/widgets/media.js',
'website/static/src/components/media_dialog/image_selector.js',
'website/static/src/js/widgets/link_popover_widget.js',
],
'website.assets_editor': [
@@ -222,24 +222,24 @@
'website/static/src/scss/website.editor.ui.scss',
'website/static/src/scss/website.theme_install.scss',
'website/static/src/js/form_editor_registry.js',
'website/static/src/js/menu/content.js',
'website/static/src/components/dialog/edit_menu.js',
'website/static/src/js/menu/customize.js',
'website/static/src/js/menu/debug_menu.js',
'website/static/src/js/menu/edit.js',
'website/static/src/js/menu/mobile_view.js',
'website/static/src/js/menu/new_content.js',
'website/static/src/js/menu/seo.js',
'website/static/src/js/menu/translate.js',
'website/static/src/components/wysiwyg_adapter/wysiwyg_adapter.js',
'website/static/src/systray_items/mobile_preview.js',
'website/static/src/systray_items/new_content.js',
'website/static/src/components/dialog/seo.js',
'website/static/src/systray_items/translate_website.js',
'website/static/src/js/set_view_track.js',
'website/static/src/js/tours/homepage.js',
'website/static/src/js/tours/tour_utils.js',
'website/static/src/js/widgets/ace.js',
'website/static/src/components/ace_editor/ace_editor.js',
],
'web.assets_qweb': [
'website/static/src/xml/website.backend.xml',
'website/static/src/xml/website_widget.xml',
'website/static/src/xml/theme_preview.xml',
'website/static/src/components/configurator/configurator.xml',
'website/static/src/client_actions/configurator/configurator.xml',
],
'website.test_bundle': [
'/web/static/lib/qweb/qweb2.js',
@@ -251,11 +251,11 @@
'http://test.external.link/style2.css',
],
'website.website_configurator_assets_js': [
'/website/static/src/components/configurator/configurator.js',
'/website/static/src/client_actions/configurator/configurator.js',
],
'website.website_configurator_assets_scss': [
('include', 'web.assets_frontend'),
'/website/static/src/scss/configurator.scss',
'/website/static/src/client_actions/configurator/configurator.scss',
'/website/static/src/scss/website.theme_install.scss',
'/website/static/src/scss/website.wysiwyg.scss'
]
@@ -746,7 +746,7 @@ async function setup() {
if (!env.state.industries) {
await skipConfigurator(env.services);
} else {
const templates = await (await fetch('/website/static/src/components/configurator/configurator.xml')).text();
const templates = await (await fetch('/website/static/src/client_actions/configurator/configurator.xml')).text();
const app = new App(Configurator, {
env,
dev: env.debug,
@@ -17,7 +17,7 @@ var qweb = core.qweb;
var PagePropertiesDialog = weWidgets.Dialog.extend({
template: 'website.pagesMenu.page_info',
xmlDependencies: weWidgets.Dialog.prototype.xmlDependencies.concat(
['/website/static/src/xml/website.pageProperties.xml']
['/website/static/src/components/dialog/page_properties.xml']
),
events: _.extend({}, weWidgets.Dialog.prototype.events, {
'keyup input#page_name': '_onNameChanged',
@@ -474,7 +474,7 @@ var MenuEntryDialog = weWidgets.LinkDialog.extend({
isNewWindow: data.new_window,
}, data || {}));
this.linkWidget.xmlDependencies = this.linkWidget.xmlDependencies.concat(['/website/static/src/xml/website.contentMenu.xml']);
this.linkWidget.xmlDependencies = this.linkWidget.xmlDependencies.concat(['/website/static/src/components/dialog/edit_menu.xml']);
const oldSave = this.linkWidget.save;
/**
@@ -521,7 +521,7 @@ var MenuEntryDialog = weWidgets.LinkDialog.extend({
var SelectEditMenuDialog = weWidgets.Dialog.extend({
template: 'website.contentMenu.dialog.select',
xmlDependencies: weWidgets.Dialog.prototype.xmlDependencies.concat(
['/website/static/src/xml/website.contentMenu.xml']
['/website/static/src/components/dialog/edit_menu.xml']
),
/**
@@ -552,7 +552,7 @@ var SelectEditMenuDialog = weWidgets.Dialog.extend({
var EditMenuDialog = weWidgets.Dialog.extend({
template: 'website.contentMenu.dialog.edit',
xmlDependencies: weWidgets.Dialog.prototype.xmlDependencies.concat(
['/website/static/src/xml/website.contentMenu.xml']
['/website/static/src/components/dialog/edit_menu.xml']
),
events: _.extend({}, weWidgets.Dialog.prototype.events, {
'click a.js_add_menu': '_onAddMenuButtonClick',
@@ -21,7 +21,7 @@ var WORD_SEPARATORS_REGEX = '([\\u2000-\\u206F\\u2E00-\\u2E7F\'!"#\\$%&\\(\\)\\*
var Suggestion = Widget.extend({
template: 'website.seo_suggestion',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
events: {
'click .o_seo_suggestion': 'select',
},
@@ -37,7 +37,7 @@ var Suggestion = Widget.extend({
var SuggestionList = Widget.extend({
template: 'website.seo_suggestion_list',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
init: function (parent, options) {
this.root = options.root;
@@ -93,7 +93,7 @@ var SuggestionList = Widget.extend({
var Keyword = Widget.extend({
template: 'website.seo_keyword',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
events: {
'click a[data-action=remove-keyword]': 'destroy',
},
@@ -149,7 +149,7 @@ var Keyword = Widget.extend({
var KeywordList = Widget.extend({
template: 'website.seo_list',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
maxKeywords: 10,
init: function (parent, options) {
@@ -206,7 +206,7 @@ var KeywordList = Widget.extend({
var Preview = Widget.extend({
template: 'website.seo_preview',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
init: function (parent, options) {
this.title = options.title;
@@ -318,7 +318,7 @@ var MetaTitleDescription = Widget.extend({
// Basically we don't want the too small alert when the field is empty and
// we start typing on it.
template: 'website.seo_meta_title_description',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
events: {
'input input[name=website_meta_title]': '_titleChanged',
'input input[name=website_seo_name]': '_seoNameChanged',
@@ -485,7 +485,7 @@ var MetaTitleDescription = Widget.extend({
var MetaKeywords = Widget.extend({
// Form and table for SEO meta keywords
template: 'website.seo_meta_keywords',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
events: {
'keyup input[name=website_meta_keywords]': '_confirmKeyword',
'click button[data-action=add]': '_addKeyword',
@@ -569,7 +569,7 @@ var MetaKeywords = Widget.extend({
var MetaImageSelector = Widget.extend({
template: 'website.seo_meta_image_selector',
xmlDependencies: ['/website/static/src/xml/website.seo.xml'],
xmlDependencies: ['/website/static/src/components/dialog/seo.xml'],
events: {
'click .o_meta_img_upload': '_onClickUploadImg',
'click .o_meta_img': '_onClickSelectImg',
@@ -670,7 +670,7 @@ var MetaImageSelector = Widget.extend({
var SeoConfigurator = Dialog.extend({
template: 'website.seo_configuration',
xmlDependencies: Dialog.prototype.xmlDependencies.concat(
['/website/static/src/xml/website.seo.xml']
['/website/static/src/components/dialog/seo.xml']
),
canEditTitle: false,
canEditDescription: false,
@@ -7,7 +7,7 @@ import {Markup} from 'web.utils';
import session from 'web.session';
import publicRootData from 'web.public.root';
import "web.zoomodoo";
import { FullscreenIndication } from '@website/js/widgets/fullscreen_indication';
import { FullscreenIndication } from '@website/components/fullscreen_indication/fullscreen_indication';
export const WebsiteRoot = publicRootData.PublicRoot.extend(KeyboardNavigationMixin, {
// TODO remove KeyboardNavigationMixin in master
@@ -18,7 +18,7 @@ var localStorageNoDialogKey = 'website_translator_nodialog';
var TranslatorInfoDialog = Dialog.extend({
template: 'website.TranslatorInfoDialog',
xmlDependencies: Dialog.prototype.xmlDependencies.concat(
['/website/static/src/xml/translator.xml']
['/website/static/src/components/translator/translator.xml']
),
/**
+1 -1
View File
@@ -35,7 +35,7 @@
'website_blog/static/src/snippets/s_blog_posts/options.js',
],
'website.assets_editor': [
'website_blog/static/src/js/website_blog.editor.js',
'website_blog/static/src/js/systray_items/new_content.js',
'website_blog/static/src/js/tours/website_blog.js',
],
'web.assets_frontend': [
+2 -2
View File
@@ -58,10 +58,10 @@
'website_event/static/src/js/register_toaster_widget.js',
'website_event/static/src/js/website_event.js',
'website_event/static/src/js/website_event_ticket_details.js',
'website_event/static/src/js/website_event_set_customize_options.js',
'website_event/static/src/snippets/options.js',
],
'website.assets_editor': [
'website_event/static/src/js/website_event.editor.js',
'website_event/static/src/js/systray_items/new_content.js',
],
'website.assets_wysiwyg': [
'/website_event/static/src/snippets/s_events/options.js',
+1 -1
View File
@@ -26,7 +26,7 @@
'assets': {
'web.assets_frontend': [
'website_event_meet/static/src/scss/event_meet_templates.scss',
'website_event_meet/static/src/js/customize_options.js',
'website_event_meet/static/src/js/snippets/options.js',
'website_event_meet/static/src/js/website_event_meeting_room.js',
'website_event_meet/static/src/js/website_event_create_meeting_room_button.js',
],
+1 -1
View File
@@ -42,7 +42,7 @@ Ask questions, get answers, no distractions
'assets': {
'website.assets_editor': [
'website_forum/static/src/js/tours/website_forum.js',
'website_forum/static/src/js/website_forum.editor.js',
'website_forum/static/src/js/systray_items/new_content.js',
],
'web.assets_tests': [
'website_forum/static/tests/**/*',
+1 -1
View File
@@ -26,7 +26,7 @@ Those trackers can be used in Google Analytics to track clicks and visitors, or
'website_links/static/tests/**/*',
],
'website.assets_editor': [
'website_links/static/src/js/website_links_menu.js',
'website_links/static/src/components/navbar/navbar.js',
],
'web.assets_qweb': [
'website_links/static/src/xml/*.xml',
@@ -1,6 +1,6 @@
/** @odoo-module **/
import {ChannelCreateDialog} from '@website_slides/js/website_slides.editor';
import {ChannelCreateDialog} from '@website_slides/js/systray_items/new_content';
ChannelCreateDialog.include({
xmlDependencies: ChannelCreateDialog.prototype.xmlDependencies.concat(
+1 -1
View File
@@ -100,7 +100,7 @@ Featuring
'website_slides/static/tests/tours/*.js',
],
'website.assets_editor': [
'website_slides/static/src/js/website_slides.editor.js',
'website_slides/static/src/js/systray_items/new_content.js',
],
'website_slides.slide_embed_assets': [
('include', 'web._assets_helpers'),