Issue #2964640 by chr.fritsch, starshaped, andrewmacpherson, webchick, phenaproxima: Provide a media type for remote video in Standard
parent
4e8c573d0b
commit
05a11424fc
|
@ -0,0 +1,52 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- field.field.media.remote_video.field_media_oembed_video
|
||||
- media.type.remote_video
|
||||
module:
|
||||
- media
|
||||
- path
|
||||
id: media.remote_video.default
|
||||
targetEntityType: media
|
||||
bundle: remote_video
|
||||
mode: default
|
||||
content:
|
||||
created:
|
||||
type: datetime_timestamp
|
||||
weight: 10
|
||||
region: content
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
field_media_oembed_video:
|
||||
type: oembed_textfield
|
||||
weight: 0
|
||||
settings:
|
||||
size: 60
|
||||
placeholder: ''
|
||||
third_party_settings: { }
|
||||
region: content
|
||||
path:
|
||||
type: path
|
||||
weight: 30
|
||||
region: content
|
||||
settings: { }
|
||||
third_party_settings: { }
|
||||
status:
|
||||
type: boolean_checkbox
|
||||
settings:
|
||||
display_label: true
|
||||
weight: 100
|
||||
region: content
|
||||
third_party_settings: { }
|
||||
uid:
|
||||
type: entity_reference_autocomplete
|
||||
weight: 5
|
||||
settings:
|
||||
match_operator: CONTAINS
|
||||
size: 60
|
||||
placeholder: ''
|
||||
region: content
|
||||
third_party_settings: { }
|
||||
hidden:
|
||||
name: true
|
|
@ -0,0 +1,27 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- field.field.media.remote_video.field_media_oembed_video
|
||||
- media.type.remote_video
|
||||
module:
|
||||
- media
|
||||
id: media.remote_video.default
|
||||
targetEntityType: media
|
||||
bundle: remote_video
|
||||
mode: default
|
||||
content:
|
||||
field_media_oembed_video:
|
||||
type: oembed
|
||||
weight: 0
|
||||
label: hidden
|
||||
settings:
|
||||
max_width: 0
|
||||
max_height: 0
|
||||
third_party_settings: { }
|
||||
region: content
|
||||
hidden:
|
||||
created: true
|
||||
name: true
|
||||
thumbnail: true
|
||||
uid: true
|
|
@ -0,0 +1,18 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
config:
|
||||
- field.storage.media.field_media_oembed_video
|
||||
- media.type.remote_video
|
||||
id: media.remote_video.field_media_oembed_video
|
||||
field_name: field_media_oembed_video
|
||||
entity_type: media
|
||||
bundle: remote_video
|
||||
label: 'Video URL'
|
||||
description: ''
|
||||
required: true
|
||||
translatable: true
|
||||
default_value: { }
|
||||
default_value_callback: ''
|
||||
settings: { }
|
||||
field_type: string
|
|
@ -0,0 +1,20 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies:
|
||||
module:
|
||||
- media
|
||||
id: media.field_media_oembed_video
|
||||
field_name: field_media_oembed_video
|
||||
entity_type: media
|
||||
type: string
|
||||
settings:
|
||||
max_length: 255
|
||||
is_ascii: false
|
||||
case_sensitive: false
|
||||
module: core
|
||||
locked: false
|
||||
cardinality: 1
|
||||
translatable: true
|
||||
indexes: { }
|
||||
persist_with_no_fields: false
|
||||
custom_storage: false
|
|
@ -0,0 +1,16 @@
|
|||
langcode: en
|
||||
status: true
|
||||
dependencies: { }
|
||||
id: remote_video
|
||||
label: 'Remote video'
|
||||
description: 'A remotely hosted video from YouTube or Vimeo.'
|
||||
source: 'oembed:video'
|
||||
queue_thumbnail_downloads: false
|
||||
new_revision: false
|
||||
source_configuration:
|
||||
thumbnails_directory: 'public://oembed_thumbnails'
|
||||
providers:
|
||||
- YouTube
|
||||
- Vimeo
|
||||
source_field: field_media_oembed_video
|
||||
field_map: { }
|
|
@ -232,6 +232,7 @@ class StandardTest extends BrowserTestBase {
|
|||
$this->adminUser->addRole($role->id());
|
||||
$this->adminUser->save();
|
||||
$assert_session = $this->assertSession();
|
||||
$page = $this->getSession()->getPage();
|
||||
/** @var \Drupal\media\Entity\MediaType $media_type */
|
||||
foreach (MediaType::loadMultiple() as $media_type) {
|
||||
$media_type_machine_name = $media_type->id();
|
||||
|
@ -241,14 +242,16 @@ class StandardTest extends BrowserTestBase {
|
|||
$form = $assert_session->elementExists('css', $form_selector);
|
||||
$form_html = $form->getOuterHtml();
|
||||
|
||||
// The name field should come before the source field, which should itself
|
||||
// come before the vertical tabs.
|
||||
$name_field = $assert_session->fieldExists('Name', $form)->getOuterHtml();
|
||||
// The name field (if it exists) should come before the source field,
|
||||
// which should itself come before the vertical tabs.
|
||||
$test_source_field = $assert_session->fieldExists($media_type->getSource()->getSourceFieldDefinition($media_type)->getLabel(), $form)->getOuterHtml();
|
||||
$vertical_tabs = $assert_session->elementExists('css', '.form-type-vertical-tabs', $form)->getOuterHtml();
|
||||
$date_field = $assert_session->fieldExists('Date', $form)->getOuterHtml();
|
||||
$published_checkbox = $assert_session->fieldExists('Published', $form)->getOuterHtml();
|
||||
$this->assertTrue(strpos($form_html, $test_source_field) > strpos($form_html, $name_field));
|
||||
if ($page->findField('Name')) {
|
||||
$name_field = $assert_session->fieldExists('Name', $form)->getOuterHtml();
|
||||
$this->assertTrue(strpos($form_html, $test_source_field) > strpos($form_html, $name_field));
|
||||
}
|
||||
$this->assertTrue(strpos($form_html, $vertical_tabs) > strpos($form_html, $test_source_field));
|
||||
// The "Published" checkbox should be the last element.
|
||||
$this->assertTrue(strpos($form_html, $published_checkbox) > strpos($form_html, $date_field));
|
||||
|
|
Loading…
Reference in New Issue