File tree Expand file tree Collapse file tree 3 files changed +24
-20
lines changed
html_editor/static/src/main/media/media_dialog Expand file tree Collapse file tree 3 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -129,22 +129,7 @@ export class VideoSelector extends Component {
129
129
}
130
130
} ) ;
131
131
132
- onMounted ( async ( ) => {
133
- await Promise . all (
134
- this . props . vimeoPreviewIds . map ( async ( videoId ) => {
135
- const { thumbnail_url : thumbnailSrc } = await this . http . get (
136
- `https://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/${ encodeURIComponent (
137
- videoId
138
- ) } `
139
- ) ;
140
- this . state . vimeoPreviews . push ( {
141
- id : videoId ,
142
- thumbnailSrc,
143
- src : `https://player.vimeo.com/video/${ encodeURIComponent ( videoId ) } ` ,
144
- } ) ;
145
- } )
146
- ) ;
147
- } ) ;
132
+ onMounted ( async ( ) => this . prepareVimeoPreviews ( ) ) ;
148
133
149
134
useAutofocus ( ) ;
150
135
@@ -275,4 +260,24 @@ export class VideoSelector extends Component {
275
260
return div ;
276
261
} ) ;
277
262
}
263
+
264
+ /**
265
+ * Based on the config vimeo ids, prepare the vimeo previews.
266
+ */
267
+ async prepareVimeoPreviews ( ) {
268
+ await Promise . all (
269
+ this . props . vimeoPreviewIds . map ( async ( videoId ) => {
270
+ const { thumbnail_url : thumbnailSrc } = await this . http . get (
271
+ `https://vimeo.com/api/oembed.json?url=http%3A//vimeo.com/${ encodeURIComponent (
272
+ videoId
273
+ ) } `
274
+ ) ;
275
+ this . state . vimeoPreviews . push ( {
276
+ id : videoId ,
277
+ thumbnailSrc,
278
+ src : `https://player.vimeo.com/video/${ encodeURIComponent ( videoId ) } ` ,
279
+ } ) ;
280
+ } )
281
+ ) ;
282
+ }
278
283
}
Original file line number Diff line number Diff line change 1
1
/** @odoo -module **/
2
2
3
3
import { patch } from "@web/core/utils/patch" ;
4
- import { VideoSelector } from '@web_editor/components/ media_dialog/video_selector' ;
4
+ import { VideoSelector } from "@html_editor/main/media/ media_dialog/video_selector" ;
5
5
import { insertSnippet , registerWebsitePreviewTour } from "@website/js/tours/tour_utils" ;
6
6
7
7
registerWebsitePreviewTour (
@@ -54,7 +54,7 @@ registerWebsitePreviewTour(
54
54
} ,
55
55
{
56
56
content : "Click on the 'Background Video' button option." ,
57
- trigger : "we- button[data-name='bg_video_toggler_opt ']" ,
57
+ trigger : "button[data-action-id='toggleBgVideo ']" ,
58
58
run : "click" ,
59
59
} ,
60
60
{
Original file line number Diff line number Diff line change 6
6
7
7
@odoo .tests .common .tagged ('post_install' , '-at_install' )
8
8
class TestSnippetBackgroundVideo (odoo .tests .HttpCase ):
9
- # TODO master-mysterious-egg fix error
10
- @unittest .skip ("prepare mysterious-egg for merging" )
9
+
11
10
def test_snippet_background_video (self ):
12
11
self .start_tour ("/" , "snippet_background_video" , login = "admin" )
You can’t perform that action at this time.
0 commit comments