Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 1.0.x
  • 1.x
  • issue/component_library-3259011-component-overrides
  • 1.0.0-alpha1
  • 1.0.0-alpha2
  • 1.0.0-alpha3
  • 1.0.0-alpha4
  • 1.0.0-alpha5
8 results

Target

Select target project
  • project/component_library
  • issue/component_library-3248568
  • issue/component_library-3259011
  • issue/component_library-3262430
  • issue/component_library-3264776
  • issue/component_library-3271103
  • issue/component_library-3272659
  • issue/component_library-3273574
  • issue/component_library-3273813
  • issue/component_library-3274318
  • issue/component_library-3294882
  • issue/component_library-3295912
  • issue/component_library-3296106
  • issue/component_library-3296114
  • issue/component_library-3300353
  • issue/component_library-3301393
  • issue/component_library-3307259
  • issue/component_library-3311381
  • issue/component_library-3313784
  • issue/component_library-3315055
  • issue/component_library-3315059
  • issue/component_library-3323687
  • issue/component_library-3316106
  • issue/component_library-3336864
  • issue/component_library-3351228
  • issue/component_library-3380414
  • issue/component_library-3393569
  • issue/component_library-3395549
  • issue/component_library-3428527
  • issue/component_library-3463212
30 results
Select Git revision
  • 1.0.x
  • 1.x
  • 3428527-automated-drupal-11
  • issue/component_library-3259011-component-overrides
  • project-update-bot-only
  • 1.0.0-alpha1
  • 1.0.0-alpha2
  • 1.0.0-alpha3
  • 1.0.0-alpha4
9 results
Show changes
Commits on Source (4)
......@@ -2,7 +2,7 @@ name: Component Library
type: module
description: Build a library of components
package: User interface
core_version_requirement: ^9 || ^10
core_version_requirement: ^9 || ^10 || ^11
php: 7.4
dependencies:
- entity:entity
......
......@@ -15,15 +15,11 @@ use Drupal\component_library\Entity\ComponentLibraryAsset;
*/
class Asset {
private FileSystemInterface $fileSystem;
private ConfigFactoryInterface $configFactory;
private LibraryDiscoveryInterface $libraryDiscovery;
public function __construct(FileSystemInterface $file_system, LibraryDiscoveryInterface $library_discovery, ConfigFactoryInterface $config_factory) {
$this->fileSystem = $file_system;
$this->configFactory = $config_factory;
$this->libraryDiscovery = $library_discovery;
}
public function __construct(
protected FileSystemInterface $fileSystem,
protected LibraryDiscoveryInterface $libraryDiscovery,
protected ConfigFactoryInterface $configFactory,
) {}
/**
* Generate library files.
......
......@@ -425,16 +425,16 @@ final class ComponentOverrideForm extends EntityForm {
protected function actions(array $form, FormStateInterface $form_state) {
$actions = parent::actions($form, $form_state);
$actions['preview'] = [
'#type' => 'submit',
'#value' => $this->t('Preview'),
'#submit' => ['::submitForm'],
'#attributes' => ['class' => ['preview-template']],
'#ajax' => [
'callback' => [$this, 'previewCallback'],
'event' => 'click',
],
];
// $actions['preview'] = [
// '#type' => 'submit',
// '#value' => $this->t('Preview'),
// '#submit' => ['::submitForm'],
// '#attributes' => ['class' => ['preview-template']],
// '#ajax' => [
// 'callback' => [$this, 'previewCallback'],
// 'event' => 'click',
// ],
// ];
$actions['submit']['#ajax'] = [
'callback' => [$this, 'ajaxSubmit'],
......
......@@ -178,25 +178,27 @@ final class OverrideMode {
'url' => Url::fromRoute($route, $route_parameters, $options)->toString(),
'theme_suggestion' => $theme_suggestion,
];
$variables = $this->addPlaceholders($variables);
try {
$bubbleable['#attached']['html_head'][] = [
[
'#type' => 'html_tag',
'#tag' => 'script',
'#weight' => -1,
'#attributes' => [
'type' => 'application/json',
'data-uuid' => $uuid,
],
'#value' => Json::encode($variables),
],
$uuid,
];
}
catch (\Throwable $t) {
$this->logger->get('component_library')->notice("component_library Override Mode: failed to serialize $theme_suggestion variables.\n" . $t->getMessage());
}
// This needs to be refactored as it now throws
// Deprecated function: Creation of dynamic property Drupal\Core\Template\Attribute::$#override_mode_breadcrumb is deprecated in Drupal\component_library\OverrideMode->traverse()
// $variables = $this->addPlaceholders($variables);
// try {
// $bubbleable['#attached']['html_head'][] = [
// [
// '#type' => 'html_tag',
// '#tag' => 'script',
// '#weight' => -1,
// '#attributes' => [
// 'type' => 'application/json',
// 'data-uuid' => $uuid,
// ],
// '#value' => Json::encode([]),
// ],
// $uuid,
// ];
// }
// catch (\Throwable $t) {
// $this->logger->get('component_library')->notice("component_library Override Mode: failed to serialize $theme_suggestion variables.\n" . $t->getMessage());
// }
$this->renderer->render($bubbleable);
return $uuid;
......