Skip to content
Snippets Groups Projects
Verified Commit 181221a4 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3421000 by sorlov, quietone, smustgrave, larowlan, alexpott: Convert...

Issue #3421000 by sorlov, quietone, smustgrave, larowlan, alexpott: Convert ViewsWizard plugin discovery to attributes
parent 1c9e2cff
No related branches found
No related tags found
28 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8540Issue #3457061: Bootstrap Modal dialog Not closing after 10.3.0 Update,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8373Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...,!7526Expose roles in response,!7352Draft: Resolve #3203489 "Set filename as",!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2794Issue #3100732: Allow specifying `meta` data on JSON:API objects,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #138130 canceled
Pipeline: drupal

#138131

    Showing
    with 118 additions and 67 deletions
    ......@@ -2,17 +2,18 @@
    namespace Drupal\block_content\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    * Used for creating 'block_content' views with the wizard.
    *
    * @ViewsWizard(
    * id = "block_content",
    * base_table = "block_content_field_data",
    * title = @Translation("Content Block"),
    * )
    */
    #[ViewsWizard(
    id: 'block_content',
    title: new TranslatableMarkup('Content Block'),
    base_table: 'block_content_field_data'
    )]
    class BlockContent extends WizardPluginBase {
    /**
    ......
    ......@@ -2,6 +2,8 @@
    namespace Drupal\comment\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    ......@@ -10,13 +12,12 @@
    /**
    * Tests creating comment views with the wizard.
    *
    * @ViewsWizard(
    * id = "comment",
    * base_table = "comment_field_data",
    * title = @Translation("Comments")
    * )
    */
    #[ViewsWizard(
    id: 'comment',
    base_table: 'comment_field_data',
    title: new TranslatableMarkup('Comments')
    )]
    class Comment extends WizardPluginBase {
    /**
    ......
    ......@@ -2,18 +2,18 @@
    namespace Drupal\dblog\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    * Defines a wizard for the watchdog table.
    *
    * @ViewsWizard(
    * id = "watchdog",
    * module = "dblog",
    * base_table = "watchdog",
    * title = @Translation("Log entries")
    * )
    */
    #[ViewsWizard(
    id: 'watchdog',
    title: new TranslatableMarkup('Log entries'),
    base_table: 'watchdog'
    )]
    class Watchdog extends WizardPluginBase {
    /**
    ......
    ......@@ -2,17 +2,18 @@
    namespace Drupal\file\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    * Tests creating managed files views with the wizard.
    *
    * @ViewsWizard(
    * id = "file_managed",
    * base_table = "file_managed",
    * title = @Translation("Files")
    * )
    */
    #[ViewsWizard(
    id: 'file_managed',
    title: new TranslatableMarkup('Files'),
    base_table: 'file_managed'
    )]
    class File extends WizardPluginBase {
    /**
    ......
    ......@@ -2,17 +2,18 @@
    namespace Drupal\media\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    * Provides Views creation wizard for Media.
    *
    * @ViewsWizard(
    * id = "media",
    * base_table = "media_field_data",
    * title = @Translation("Media")
    * )
    */
    #[ViewsWizard(
    id: 'media',
    base_table: 'media_field_data',
    title: new TranslatableMarkup('Media')
    )]
    class Media extends WizardPluginBase {
    /**
    ......
    ......@@ -2,17 +2,18 @@
    namespace Drupal\media\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    * Provides Views creation wizard for Media revisions.
    *
    * @ViewsWizard(
    * id = "media_revision",
    * base_table = "media_field_revision",
    * title = @Translation("Media revisions")
    * )
    */
    #[ViewsWizard(
    id: 'media_revision',
    title: new TranslatableMarkup('Media revisions'),
    base_table: 'media_field_revision'
    )]
    class MediaRevision extends WizardPluginBase {
    /**
    ......
    ......@@ -8,6 +8,8 @@
    use Drupal\Core\Field\FieldDefinitionInterface;
    use Drupal\Core\Form\FormStateInterface;
    use Drupal\Core\Menu\MenuParentFormSelectorInterface;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    use Symfony\Component\DependencyInjection\ContainerInterface;
    ......@@ -17,13 +19,12 @@
    /**
    * Tests creating node views with the wizard.
    *
    * @ViewsWizard(
    * id = "node",
    * base_table = "node_field_data",
    * title = @Translation("Content")
    * )
    */
    #[ViewsWizard(
    id: 'node',
    base_table: 'node_field_data',
    title: new TranslatableMarkup('Content')
    )]
    class Node extends WizardPluginBase {
    /**
    ......
    ......@@ -3,6 +3,8 @@
    namespace Drupal\node\Plugin\views\wizard;
    use Drupal\Core\Form\FormStateInterface;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    ......@@ -11,13 +13,12 @@
    /**
    * Tests creating node revision views with the wizard.
    *
    * @ViewsWizard(
    * id = "node_revision",
    * base_table = "node_field_revision",
    * title = @Translation("Content revisions")
    * )
    */
    #[ViewsWizard(
    id: 'node_revision',
    title: new TranslatableMarkup('Content revisions'),
    base_table: 'node_field_revision'
    )]
    class NodeRevision extends WizardPluginBase {
    /**
    ......
    ......@@ -2,17 +2,18 @@
    namespace Drupal\taxonomy\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    * Tests creating taxonomy views with the wizard.
    *
    * @ViewsWizard(
    * id = "taxonomy_term",
    * base_table = "taxonomy_term_field_data",
    * title = @Translation("Taxonomy terms")
    * )
    */
    #[ViewsWizard(
    id: 'taxonomy_term',
    title: new TranslatableMarkup('Taxonomy terms'),
    base_table: 'taxonomy_term_field_data'
    )]
    class TaxonomyTerm extends WizardPluginBase {
    /**
    ......
    ......@@ -2,6 +2,8 @@
    namespace Drupal\user\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\views\wizard\WizardPluginBase;
    /**
    ......@@ -10,13 +12,12 @@
    /**
    * Tests creating user views with the wizard.
    *
    * @ViewsWizard(
    * id = "users",
    * base_table = "users_field_data",
    * title = @Translation("Users")
    * )
    */
    #[ViewsWizard(
    id: 'users',
    title: new TranslatableMarkup('Users'),
    base_table: 'users_field_data'
    )]
    class Users extends WizardPluginBase {
    /**
    ......
    <?php
    namespace Drupal\views\Attribute;
    use Drupal\Component\Plugin\Attribute\Plugin;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    /**
    * Defines a Plugin attribute object for views wizard plugins.
    *
    * @see \Drupal\views\Plugin\views\wizard\WizardPluginBase
    * @see \Drupal\views\Plugin\views\wizard\WizardInterface
    *
    * @ingroup views_wizard_plugins
    */
    #[\Attribute(\Attribute::TARGET_CLASS)]
    class ViewsWizard extends Plugin {
    /**
    * Constructs an ViewsWizard attribute.
    *
    * @param string $id
    * The plugin ID.
    * @param \Drupal\Core\StringTranslation\TranslatableMarkup $title
    * The plugin title used in the views UI.
    * @param string|null $base_table
    * (optional) The base table on which this wizard is used. The base_table is
    * required when a deriver class is not defined.
    * @param class-string|null $deriver
    * (optional) The deriver class.
    */
    public function __construct(
    public readonly string $id,
    public readonly TranslatableMarkup $title,
    public readonly ?string $base_table = NULL,
    public readonly ?string $deriver = NULL
    ) {}
    }
    ......@@ -2,17 +2,20 @@
    namespace Drupal\views\Plugin\views\wizard;
    use Drupal\Core\StringTranslation\TranslatableMarkup;
    use Drupal\views\Attribute\ViewsWizard;
    use Drupal\views\Plugin\Derivative\DefaultWizardDeriver;
    /**
    * Standard Views wizard plugin.
    *
    * @ingroup views_wizard_plugins
    *
    * @ViewsWizard(
    * id = "standard",
    * deriver = "Drupal\views\Plugin\Derivative\DefaultWizardDeriver",
    * title = @Translation("Default wizard")
    * )
    */
    #[ViewsWizard(
    id: 'standard',
    title: new TranslatableMarkup('Default wizard'),
    deriver: DefaultWizardDeriver::class,
    )]
    class Standard extends WizardPluginBase {
    }
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment