From 3a0b06a98b8346d3abfc93b10b20c8736dd8655c Mon Sep 17 00:00:00 2001
From: Rajab Natshah <rajabn@gmail.com>
Date: Tue, 14 Jul 2020 11:27:07 +0300
Subject: [PATCH] =?UTF-8?q?Issue=20#3153614=20by=20RajabNatshah,=20Mohamme?=
 =?UTF-8?q?d=20J.=20Razem:=20Implement=20a=20way=20to=20offer=20default=20?=
 =?UTF-8?q?config=20templates=20using=20Varbase=E2=80=99s=20ConfigBit=20to?=
 =?UTF-8?q?=20unify=20admin=20experience?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ..._subqueue.ENTITYQUEUE_NAME.default.bit.yml |   7 +
 ..._display.node.CONTENT_TYPE.default.bit.yml |  90 +++
 ...ueue.entity_queue.ENTITYQUEUE_NAME.bit.yml |  69 +++
 .../node.type.CONTENT_TYPE.bit.yml            |  49 ++
 src/Config/ConfigBit.php                      | 577 +++++++++++++++++-
 .../01-04-website-languages_english.feature   |   8 +-
 ...ble-content-types-to-all-languages.feature |   2 +-
 .../04-01-basic-page-permissions.feature      |   2 +-
 ...add-any-paragraph-type-to-the-page.feature |  14 +-
 ...ing-page_text-and-image-paragraphs.feature |   2 +-
 .../04-05-standard-bredcrumbs.feature         |   4 +-
 ...ns-and-choose-layouts-for-sections.feature |   3 +-
 ...tyqueue-testing-content-and-config.feature |  19 +-
 ...yqueue-reverse-order-in-admin-view.feature |  12 +-
 ...ueue-using-entityqueue-form-widget.feature |  10 +-
 ...05-04-cloning-content-and-entities.feature |   5 +-
 ...embed-existing-media-image-library.feature |   2 +-
 ...nt-searching-content-by-its-titles.feature |  11 +-
 .../05-07-content-workflows.feature           |   1 +
 .../01-delete-default-testing-users.feature   |  12 +-
 varbase.services.yml                          |   5 +-
 21 files changed, 856 insertions(+), 48 deletions(-)
 create mode 100644 configbit/varbase_config_templates/core.entity_form_display.entity_subqueue.ENTITYQUEUE_NAME.default.bit.yml
 create mode 100644 configbit/varbase_config_templates/core.entity_form_display.node.CONTENT_TYPE.default.bit.yml
 create mode 100644 configbit/varbase_config_templates/entityqueue.entity_queue.ENTITYQUEUE_NAME.bit.yml
 create mode 100644 configbit/varbase_config_templates/node.type.CONTENT_TYPE.bit.yml

diff --git a/configbit/varbase_config_templates/core.entity_form_display.entity_subqueue.ENTITYQUEUE_NAME.default.bit.yml b/configbit/varbase_config_templates/core.entity_form_display.entity_subqueue.ENTITYQUEUE_NAME.default.bit.yml
new file mode 100644
index 00000000..70f2a3e7
--- /dev/null
+++ b/configbit/varbase_config_templates/core.entity_form_display.entity_subqueue.ENTITYQUEUE_NAME.default.bit.yml
@@ -0,0 +1,7 @@
+type: action
+status: true
+targetEntityType: entity_subqueue
+token_variant: id
+event: config.save
+event_config: core.entity_form_display.entity_subqueue.ENTITYQUEUE_NAME.default
+config_bits: {  }
\ No newline at end of file
diff --git a/configbit/varbase_config_templates/core.entity_form_display.node.CONTENT_TYPE.default.bit.yml b/configbit/varbase_config_templates/core.entity_form_display.node.CONTENT_TYPE.default.bit.yml
new file mode 100644
index 00000000..9ba0f5ec
--- /dev/null
+++ b/configbit/varbase_config_templates/core.entity_form_display.node.CONTENT_TYPE.default.bit.yml
@@ -0,0 +1,90 @@
+type: action
+status: true
+targetEntityType: node
+token_variant: bundle
+event: config.save
+event_config: core.entity_form_display.node.CONTENT_TYPE.default
+config_bits:
+  core.entity_form_display.node.CONTENT_TYPE.default:
+    # -------------------------------------------------------------------------.
+    # Add Enter title here as the Placeholder for the title of new content type.
+    # -------------------------------------------------------------------------.
+    - add:
+        dependencies:
+          config:
+            - node.type.CONTENT_TYPE
+            - core.entity_form_display.node.CONTENT_TYPE.default
+        target_config_path: content
+        target_config_expected_to_have:
+          title:
+            settings:
+              placeholder: ''
+        target_config_value:
+          title:
+            settings:
+              placeholder: 'Enter title here'
+    # -------------------------------------------------------------------------.
+    # Add Length indicator to the title field for new content type.
+    # -------------------------------------------------------------------------.
+    - add:
+        dependencies:
+          module:
+            - length_indicator
+          config:
+            - node.type.CONTENT_TYPE
+            - core.entity_form_display.node.CONTENT_TYPE.default
+        target_config_path: content
+        target_config_expected_not_to_have:
+          title:
+            third_party_settings:
+              length_indicator:
+                indicator: true
+        target_config_value:
+          title:
+            third_party_settings:
+              length_indicator:
+                indicator: true
+                indicator_opt:
+                  optimin: 15
+                  optimax: 50
+                  tolerance: 10
+    # -------------------------------------------------------------------------.
+    # Hide [Promoted to front page] at form display.
+    # -------------------------------------------------------------------------.
+    - add:
+        dependencies:
+          config:
+            - node.type.CONTENT_TYPE
+            - core.entity_form_display.node.CONTENT_TYPE.default
+        target_config_path: hidden
+        target_config_expected_not_to_have_index: promote
+        target_config_value:
+          promote: true
+    - remove:
+        dependencies:
+          config:
+            - node.type.CONTENT_TYPE
+            - core.entity_form_display.node.CONTENT_TYPE.default
+        target_config_path: content
+        target_config_expected_to_have_index: promote
+        target_config_remove_index: promote
+    # -------------------------------------------------------------------------.
+    # Hide [Sticky at top of lists] at form display.
+    # -------------------------------------------------------------------------.
+    - add:
+        dependencies:
+          config:
+            - node.type.CONTENT_TYPE
+            - core.entity_form_display.node.CONTENT_TYPE.default
+        target_config_path: hidden
+        target_config_expected_not_to_have_index: sticky
+        target_config_value:
+          sticky: true
+    - remove:
+        dependencies:
+          config:
+            - node.type.CONTENT_TYPE
+            - core.entity_form_display.node.CONTENT_TYPE.default
+        target_config_path: content
+        target_config_expected_to_have_index: sticky
+        target_config_remove_index: sticky
diff --git a/configbit/varbase_config_templates/entityqueue.entity_queue.ENTITYQUEUE_NAME.bit.yml b/configbit/varbase_config_templates/entityqueue.entity_queue.ENTITYQUEUE_NAME.bit.yml
new file mode 100644
index 00000000..0ddc3e3f
--- /dev/null
+++ b/configbit/varbase_config_templates/entityqueue.entity_queue.ENTITYQUEUE_NAME.bit.yml
@@ -0,0 +1,69 @@
+type: action
+status: true
+targetEntityType: entity_subqueue
+token_variant: id
+event: config.save
+event_config: entityqueue.entity_queue.ENTITYQUEUE_NAME
+config_bits:
+  core.entity_form_display.entity_subqueue.ENTITYQUEUE_NAME.default:
+    # -----------------------------------------------------------------------------.
+    # Import default entityqueue form display for new Entity Queues.
+    # -----------------------------------------------------------------------------.
+    - import:
+        dependencies:
+          module:
+            - entityqueue
+            - inline_entity_form
+            - entity_browser_entity_form
+          config:
+            - entityqueue.entity_queue.ENTITYQUEUE_NAME
+        target_config_value:
+          langcode: en
+          status: true
+          dependencies:
+            config:
+              - entityqueue.entity_queue.ENTITYQUEUE_NAME
+            module:
+              - entity_browser_entity_form
+              - inline_entity_form
+          id: entity_subqueue.ENTITYQUEUE_NAME.default
+          targetEntityType: entity_subqueue
+          bundle: ENTITYQUEUE_NAME
+          mode: default
+          content:
+            items:
+              type: inline_entity_form_complex
+              weight: 5
+              settings:
+                form_mode: default
+                revision: true
+                override_labels: true
+                label_singular: item
+                label_plural: items
+                allow_existing: true
+                match_operator: CONTAINS
+                collapsible: false
+                collapsed: false
+                allow_new: false
+                allow_edit: false
+                allow_duplicate: false
+              region: content
+              third_party_settings:
+                entity_browser_entity_form:
+                  entity_browser_id: _none
+            langcode:
+              type: language_select
+              weight: 2
+              region: content
+              settings:
+                include_locked: true
+              third_party_settings: {  }
+            title:
+              type: string_textfield
+              weight: -10
+              region: content
+              settings:
+                size: 60
+                placeholder: ''
+              third_party_settings: {  }
+          hidden: {  }
diff --git a/configbit/varbase_config_templates/node.type.CONTENT_TYPE.bit.yml b/configbit/varbase_config_templates/node.type.CONTENT_TYPE.bit.yml
new file mode 100644
index 00000000..3b5c3e72
--- /dev/null
+++ b/configbit/varbase_config_templates/node.type.CONTENT_TYPE.bit.yml
@@ -0,0 +1,49 @@
+type: action
+status: true
+targetEntityType: node
+token_variant: type
+event: config.save
+event_config: node.type.CONTENT_TYPE
+config_bits:
+  workflows.workflow.varbase_simple_workflow:
+    # -----------------------------------------------------------------------------.
+    # Add the node type to the Varbase Simple workflow.
+    # -----------------------------------------------------------------------------.
+    - add:
+        dependencies:
+          module:
+            - varbase_workflow
+          config:
+            - node.type.CONTENT_TYPE
+            - workflows.workflow.varbase_simple_workflow
+        target_config_path: type_settings
+        expected_config_wild_card: 'workflows.workflow.'
+        target_config_expected_not_to_have:
+          entity_types:
+            node:
+              - CONTENT_TYPE
+        target_config_value:
+          entity_types:
+            node:
+              - CONTENT_TYPE
+  metatag.settings:
+    # -----------------------------------------------------------------------------.
+    # Add default metatags config template when content types been created with
+    # only Basic tags metatags.
+    # -----------------------------------------------------------------------------.
+    - add:
+        dependencies:
+          module:
+            - metatag
+          config:
+            - node.type.CONTENT_TYPE
+            - metatag.settings
+        target_config_path: entity_type_groups
+        target_config_expected_not_to_have:
+          node:
+            CONTENT_TYPE:
+              basic: basic
+        target_config_value:
+          node:
+            CONTENT_TYPE:
+              basic: basic
diff --git a/src/Config/ConfigBit.php b/src/Config/ConfigBit.php
index 61aaf50e..831dfc58 100644
--- a/src/Config/ConfigBit.php
+++ b/src/Config/ConfigBit.php
@@ -1,13 +1,584 @@
 <?php
 
-namespace Drupal\varbase\config;
+namespace Drupal\varbase\Config;
 
 use Symfony\Component\Yaml\Yaml;
+use Drupal\Core\Config\Config;
+use Drupal\Core\Config\ConfigCrudEvent;
+use Drupal\Core\Config\ConfigEvents;
+use Drupal\Core\Config\ConfigFactoryInterface;
+use Drupal\Core\Config\ConfigManagerInterface;
+use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\Database\Connection;
+use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Drupal\Component\Utility\NestedArray;
+use Drupal\Component\Utility\DiffArray;
+use Drupal\Core\Plugin\CachedDiscoveryClearerInterface;
 
 /**
- * Defines config bit to help in managing custom config which used in install.
+ * Class ConfigBit.
+ *
+ * Defines Config bit to help in managing custom config which used in install.
+ *
+ * @package Drupal\varbase\Config
  */
-class ConfigBit {
+class ConfigBit implements EventSubscriberInterface, ContainerInjectionInterface {
+
+  /**
+   * The configuration factory.
+   *
+   * @var \Drupal\Core\Config\ConfigFactoryInterface
+   */
+  protected $configFactory;
+
+  /**
+   * The configuration manager.
+   *
+   * @var \Drupal\Core\Config\ConfigManagerInterface
+   */
+  protected $configManager;
+
+  /**
+   * The module handler service.
+   *
+   * @var \Drupal\Core\Extension\ModuleHandlerInterface
+   */
+  protected $moduleHandler;
+
+  /**
+   * Active database connection.
+   *
+   * @var \Drupal\Core\Database\Connection
+   */
+  protected $database;
+
+  /**
+   * A plugin cache clear instance.
+   *
+   * @var \Drupal\Core\Plugin\CachedDiscoveryClearerInterface
+   */
+  protected $pluginCacheClearer;
+
+  /**
+   * ConfigBit construct.
+   *
+   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
+   *   A config factory for retrieving required config objects.
+   * @param \Drupal\Core\Config\ConfigManagerInterface $config_manager
+   *   The configuration manager.
+   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
+   *   The module handler service.
+   * @param \Drupal\Core\Database\Connection $database
+   *   The database connection to be used.
+   * @param \Drupal\Core\Plugin\CachedDiscoveryClearerInterface $plugin_cache_clearer
+   *   A plugin cache clear instance.
+   */
+  public function __construct(
+    ConfigFactoryInterface $config_factory,
+    ConfigManagerInterface $config_manager,
+    ModuleHandlerInterface $module_handler,
+    Connection $database,
+    CachedDiscoveryClearerInterface $plugin_cache_clearer
+  ) {
+    $this->configFactory = $config_factory;
+    $this->configManager = $config_manager;
+    $this->moduleHandler = $module_handler;
+    $this->database = $database;
+    $this->pluginCacheClearer = $plugin_cache_clearer;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container) {
+    return new static(
+    $container->get('config.factory'),
+    $container->get('config.manager'),
+    $container->get('module_handler'),
+    $container->get('database'),
+    $container->get('plugin.cache_clearer')
+    );
+  }
+
+  /**
+   * Get list of supported config types.
+   */
+  protected static function supportedConfigTypes() {
+    return [
+      // ----------------------------------------------------------------------.
+      // When content type config had been saved.
+      // ----------------------------------------------------------------------.
+      'node.type' => [
+        'config_name_match' => "/^node.type.*$/",
+        'token' => 'CONTENT_TYPE',
+        'token_variant' => 'type',
+        'config_template_file' => 'node.type.CONTENT_TYPE.bit.yml',
+        'targetEntityType' => 'node',
+        'plugin.cache_clearer' => TRUE,
+      ],
+      // ----------------------------------------------------------------------.
+      // When a form display for a content type config had been saved.
+      // ----------------------------------------------------------------------.
+      'core.entity_form_display.node.CONTENT_TYPE.default' => [
+        'config_name_match' => "/^core.entity_form_display.node.*.default$/",
+        'token' => 'CONTENT_TYPE',
+        'token_variant' => 'bundle',
+        'config_template_file' => 'core.entity_form_display.node.CONTENT_TYPE.default.bit.yml',
+        'targetEntityType' => 'node',
+        'mode' => 'default',
+        'plugin.cache_clearer' => TRUE,
+      ],
+      // ----------------------------------------------------------------------.
+      // When an entityqueue config had been saved.
+      // ----------------------------------------------------------------------.
+      'entityqueue.entity_queue.ENTITYQUEUE_NAME' => [
+        'config_name_match' => "/^entityqueue.entity_queue.*$/",
+        'token' => 'ENTITYQUEUE_NAME',
+        'token_variant' => 'id',
+        'config_template_file' => 'entityqueue.entity_queue.ENTITYQUEUE_NAME.bit.yml',
+        'targetEntityType' => 'entity_subqueue',
+      ],
+      // ----------------------------------------------------------------------.
+      // When a form display for an entityqueue config had been saved.
+      // ----------------------------------------------------------------------.
+      'core.entity_form_display.entityqueue.entity_queue.ENTITYQUEUE_NAME.default' => [
+        'config_name_match' => "/^core.entity_form_display.entityqueue.entity_queue.*.default$/",
+        'token' => 'ENTITYQUEUE_NAME',
+        'token_variant' => 'id',
+        'config_template_file' => 'core.entity_form_display.entityqueue.entity_queue.ENTITYQUEUE_NAME.default.bit.yml',
+        'targetEntityType' => 'entity_subqueue',
+        'mode' => 'default',
+      ],
+    ];
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * @return array
+   *   The event names to listen for, and the methods that should be executed.
+   */
+  public static function getSubscribedEvents() {
+    $events[ConfigEvents::SAVE][] = ['configSave', -9000];
+    return $events;
+  }
+
+  /**
+   * React to a config object being saved.
+   *
+   * @param \Drupal\Core\Config\ConfigCrudEvent $event
+   *   The Config crud event.
+   */
+  public function configSave(ConfigCrudEvent $event) {
+    $saved_config = $event->getConfig();
+    $saved_config_name = $saved_config->getName();
+
+    $supportedConfigTypes = $this->supportedConfigTypes();
+
+    // Process config bits for each supported config type.
+    foreach ($supportedConfigTypes as $supportedConfigType) {
+      if (preg_match($supportedConfigType['config_name_match'], $saved_config_name)) {
+        $this->processConfigBits($supportedConfigType, $saved_config);
+      }
+    }
+  }
+
+  /**
+   * Process Config Bits.
+   *
+   * @param array $supportedConfigType
+   *   The supported config type.
+   * @param \Drupal\Core\Config\Config $saved_config
+   *   The saved config.
+   */
+  protected function processConfigBits(array $supportedConfigType, Config $saved_config) {
+
+    // Get saved cofnig name.
+    $saved_config_name = $saved_config->getName();
+
+    // Get token variant for entity type name.
+    $token_variant = $this->configFactory->getEditable($saved_config_name)->get($supportedConfigType['token_variant']);
+
+    // Have the config template file name.
+    $config_template_file = DRUPAL_ROOT . '/' . drupal_get_path('profile', 'varbase') . '/configbit/varbase_config_templates/' . $supportedConfigType['config_template_file'];
+
+    if (file_exists($config_template_file)) {
+      // Get config file contents.
+      $config_template_file_contents = file_get_contents($config_template_file);
+
+      // Using string manipulation to replace the entity type token with
+      // the current entity type name.
+      $config_template_file_contents = str_replace($supportedConfigType['token'], $token_variant, $config_template_file_contents);
+
+      // Parse the yml file content to an array of data.
+      $config_template_file_data = (array) Yaml::parse($config_template_file_contents);
+
+      if (isset($config_template_file_data['config_bits'])
+        && is_array($config_template_file_data['config_bits'])) {
+
+        foreach ($config_template_file_data['config_bits'] as $target_config_bit_name => $target_config_bit_actions) {
+
+          // Get the config bit factory for the current config bit changes.
+          $target_config_bit_factory = $this->configFactory->getEditable($target_config_bit_name);
+          $save_actions = 0;
+
+          if (isset($target_config_bit_actions)
+            && is_array($target_config_bit_actions)
+            && count($target_config_bit_actions) > 0) {
+
+            foreach ($target_config_bit_actions as $config_action) {
+
+              // Add config action.
+              if (isset($config_action['add'])
+                && $this->validateDependencies($config_action['add'])
+                && $this->applyConfigActionAdd($config_action['add'], $target_config_bit_name, $target_config_bit_factory)) {
+
+                $save_actions++;
+              }
+
+              // Remove config action.
+              if (isset($config_action['remove'])
+                && $this->validateDependencies($config_action['remove'])
+                && $this->applyConfigActionRemove($config_action['remove'], $target_config_bit_name, $target_config_bit_factory)) {
+
+                $save_actions++;
+              }
+
+              // Import new config if config does not exists.
+              if (isset($config_action['import'])
+                && $this->validateDependencies($config_action['import'])
+                && $this->applyConfigActionImport($config_action['import'], $target_config_bit_name, $target_config_bit_factory)) {
+
+                $save_actions++;
+              }
+
+            }
+
+            if ($save_actions > 0) {
+              // Save target config after finishing all config action changes.
+              $target_config_bit_factory->save(TRUE);
+
+              // Flushes plugins caches on requisted.
+              if (isset($supportedConfigType['plugin.cache_clearer'])
+                && $supportedConfigType['plugin.cache_clearer'] == TRUE) {
+
+                $this->pluginCacheClearer->clearCachedDefinitions();
+              }
+            }
+          }
+
+        }
+      }
+    }
+  }
+
+  /**
+   * Apply Config Action Add.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param string $target_config_bit_name
+   *   The target config bit name.
+   * @param \Drupal\Core\Config\Config $target_config_bit_factory
+   *   The target config object.
+   *
+   * @return bool
+   *   The status of the action.
+   */
+  protected function applyConfigActionAdd(array $config_action, string $target_config_bit_name, Config &$target_config_bit_factory) {
+
+    if (isset($config_action['target_config_path'])
+      && isset($config_action['target_config_value'])) {
+
+      $target_config_data = $target_config_bit_factory->get($config_action['target_config_path']);
+
+      if (isset($target_config_data)
+        && $this->expectedTargetConfig($config_action, $target_config_data)) {
+
+        $final_config_data = NestedArray::mergeDeep($target_config_data, $config_action['target_config_value']);
+        $target_config_bit_factory->set($config_action['target_config_path'], $final_config_data);
+        return TRUE;
+      }
+    }
+
+    return FALSE;
+  }
+
+  /**
+   * Apply Config Action Remove.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param string $target_config_bit_name
+   *   The target config bit name.
+   * @param \Drupal\Core\Config\Config $target_config_bit_factory
+   *   The target config object.
+   *
+   * @return bool
+   *   The status of the action.
+   */
+  protected function applyConfigActionRemove(array $config_action, string $target_config_bit_name, Config &$target_config_bit_factory) {
+
+    if (isset($config_action['target_config_path'])
+      && is_string($config_action['target_config_path'])
+      && isset($config_action['target_config_remove_index'])) {
+
+      $target_config_data = $target_config_bit_factory->get($config_action['target_config_path']);
+
+      if (isset($target_config_data)
+        && $this->expectedTargetConfig($config_action, $target_config_data)) {
+
+        if (isset($target_config_data[$config_action['target_config_remove_index']])) {
+          unset($target_config_data[$config_action['target_config_remove_index']]);
+          $target_config_bit_factory->set($config_action['target_config_path'], $target_config_data);
+          return TRUE;
+        }
+      }
+    }
+
+    return FALSE;
+  }
+
+  /**
+   * Apply Config Action Import.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param string $target_config_bit_name
+   *   The target config bit name.
+   * @param \Drupal\Core\Config\Config $target_config_bit_factory
+   *   The target config object.
+   *
+   * @return bool
+   *   The status of the action.
+   */
+  protected function applyConfigActionImport(array $config_action, string $target_config_bit_name, Config &$target_config_bit_factory) {
+    if (!$this->configExists($target_config_bit_name)
+      && isset($config_action['target_config_value'])) {
+      $target_config_bit_factory->setData($config_action['target_config_value']);
+      return TRUE;
+    }
+
+    return FALSE;
+  }
+
+  /**
+   * Validate dependencies for Varbase config template bit data.
+   *
+   * @param array $config_template_data
+   *   The config template data.
+   *
+   * @return bool
+   *   The status if dependencies are valid.
+   */
+  protected function validateDependencies(array $config_template_data) {
+
+    if (isset($config_template_data['dependencies'])
+      && is_array($config_template_data['dependencies'])) {
+
+      $dependencies = $config_template_data['dependencies'];
+
+      if (isset($dependencies['module'])
+        && is_array($dependencies['module'])) {
+
+        foreach ($dependencies['module'] as $module) {
+          if (!$this->moduleHandler->moduleExists($module)) {
+            return FALSE;
+          }
+        }
+      }
+
+      if (isset($dependencies['config'])
+        && is_array($dependencies['config'])) {
+
+        $all_config = $this->configFactory->listAll();
+
+        if (!empty($all_config)) {
+          $missing = [];
+          $missing = array_merge($missing, array_diff($dependencies['config'], $all_config));
+
+          if (!empty($missing) && count($missing) > 0) {
+            return FALSE;
+          }
+        }
+      }
+    }
+
+    return TRUE;
+  }
+
+  /**
+   * Is this config exists or not yet in the database.
+   *
+   * @param string $config_name
+   *   The name of the config.
+   *
+   * @return bool
+   *   The status of cofnig.
+   */
+  protected function configExists(string $config_name) {
+
+    $query = $this->database->select('config', 'c');
+    $query->condition('c.name', $config_name, '=');
+    $query->addExpression('COUNT(*)', 'count');
+
+    $config_count = $query->execute()->fetchField();
+
+    if ($config_count == 1) {
+      return TRUE;
+    }
+
+    return FALSE;
+  }
+
+  /**
+   * Check expected target config.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param array $target_config_data
+   *   The target config data.
+   */
+  protected function expectedTargetConfig(array $config_action, array $target_config_data) {
+    return ($this->targetConfigExpectedToHave($config_action, $target_config_data)
+      && $this->targetConfigExpectedNotToHave($config_action, $target_config_data)
+      && $this->targetConfigExpectedToHaveIndex($config_action, $target_config_data)
+      && $this->targetConfigExpectedNotToHaveIndex($config_action, $target_config_data));
+  }
+
+  /**
+   * Check target config expected to have.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param array $target_config_data
+   *   The target config data.
+   */
+  protected function targetConfigExpectedToHave(array $config_action, array $target_config_data) {
+    $target_config_expected_to_have = TRUE;
+
+    if (isset($config_action['target_config_expected_to_have'])) {
+      // Computes the difference of arrays with additional index check.
+      // containing all the values from [target config expected to have]
+      // that are not present in [target config data].
+      // ----------------------------------------------------------------------.
+      // Wild card exption to have in all listed configs.
+      if (isset($config_action['expected_config_wild_card'])) {
+        $wild_card_configs = $this->configFactory->listAll($config_action['expected_config_wild_card']);
+        foreach ($wild_card_configs as $wild_card_name) {
+          $wild_card_factory = $this->configFactory->getEditable($wild_card_name);
+          $wild_card_data = $wild_card_factory->get($config_action['target_config_path']);
+          $wild_card_expected_to_have_diff = DiffArray::diffAssocRecursive($config_action['target_config_expected_not_to_have'], $wild_card_data);
+          if (isset($wild_card_expected_to_have_diff)
+            && count($wild_card_expected_to_have_diff) > 0) {
+            $target_config_expected_to_have = FALSE;
+            break;
+          }
+        }
+      }
+      else {
+        $expected_to_have_diff = DiffArray::diffAssocRecursive($config_action['target_config_expected_to_have'], $target_config_data);
+        if (isset($expected_to_have_diff)
+          && count($expected_to_have_diff) > 0) {
+
+          $target_config_expected_to_have = FALSE;
+        }
+      }
+    }
+    else {
+      $target_config_expected_to_have = TRUE;
+    }
+
+    return $target_config_expected_to_have;
+  }
+
+  /**
+   * Check target config expected not to have.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param array $target_config_data
+   *   The target config data.
+   */
+  protected function targetConfigExpectedNotToHave(array $config_action, array $target_config_data) {
+    $target_config_expected_not_to_have = TRUE;
+
+    if (isset($config_action['target_config_expected_not_to_have'])) {
+      // Computes the difference of arrays with additional index check.
+      // containing all the values from [target config expected NOT to
+      // have] that are not present in [target config data] .
+      // ----------------------------------------------------------------------.
+      // Wild card exption not to have in all listed configs.
+      if (isset($config_action['expected_config_wild_card'])) {
+        $wild_card_configs = $this->configFactory->listAll($config_action['expected_config_wild_card']);
+        foreach ($wild_card_configs as $wild_card_name) {
+          $wild_card_factory = $this->configFactory->getEditable($wild_card_name);
+          $wild_card_data = $wild_card_factory->get($config_action['target_config_path']);
+          $wild_card_expected_not_to_have_diff = DiffArray::diffAssocRecursive($config_action['target_config_expected_not_to_have'], $wild_card_data);
+          if (isset($wild_card_expected_not_to_have_diff)
+            && count($wild_card_expected_not_to_have_diff) == 0) {
+
+            $target_config_expected_not_to_have = FALSE;
+            break;
+          }
+        }
+      }
+      else {
+        $expected_not_to_have_diff = DiffArray::diffAssocRecursive($config_action['target_config_expected_not_to_have'], $target_config_data);
+        if (isset($expected_not_to_have_diff)
+          && count($expected_not_to_have_diff) == 0) {
+
+          $target_config_expected_not_to_have = FALSE;
+        }
+      }
+    }
+
+    return $target_config_expected_not_to_have;
+  }
+
+  /**
+   * Check target config expected to have index.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param array $target_config_data
+   *   The target config data.
+   */
+  protected function targetConfigExpectedToHaveIndex(array $config_action, array $target_config_data) {
+    if (isset($config_action['target_config_expected_to_have_index'])) {
+      if (isset($target_config_data[$config_action['target_config_expected_to_have_index']])) {
+        return TRUE;
+      }
+      else {
+        return FALSE;
+      }
+    }
+
+    return TRUE;
+  }
+
+  /**
+   * Check target config expected not to have index.
+   *
+   * @param array $config_action
+   *   The config action.
+   * @param array $target_config_data
+   *   The target config data.
+   */
+  protected function targetConfigExpectedNotToHaveIndex(array $config_action, array $target_config_data) {
+    if (isset($config_action['target_config_expected_not_to_have_index'])) {
+      if (!isset($target_config_data[$config_action['target_config_expected_not_to_have_index']])) {
+        return TRUE;
+      }
+      else {
+        return FALSE;
+      }
+    }
+
+    return TRUE;
+  }
 
   /**
    * Get Config Bit file.
diff --git a/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-04-website-languages_english.feature b/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-04-website-languages_english.feature
index 67d3b03c..9042ac19 100644
--- a/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-04-website-languages_english.feature
+++ b/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-04-website-languages_english.feature
@@ -13,7 +13,7 @@ So that can be sure that the website is using the English language as one of the
      When I select "English" from "Language"
       And I fill in "Test English Basic page title by content admin" for "Title"
       And I fill in the rich text editor field "Body" with "Test English Basic page body"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test English Basic page title by content admin"
@@ -27,7 +27,7 @@ So that can be sure that the website is using the English language as one of the
      Then I should see "Language"
      When I select "English" from "Language"
       And I fill in "Test English Landing page title by content admin" for "Title"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test English Landing page title by content admin"
@@ -42,7 +42,7 @@ So that can be sure that the website is using the English language as one of the
      When I select "English" from "Language"
       And I fill in "Test English Basic page title by site admin" for "Title"
       And I fill in the rich text editor field "Body" with "Test English Basic page body"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test English Basic page title by site admin"
@@ -56,7 +56,7 @@ So that can be sure that the website is using the English language as one of the
      Then I should see "Language"
      When I select "English" from "Language"
       And I fill in "Test English Landing page title by site admin" for "Title"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test English Landing page title by site admin"
diff --git a/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-05-translatable-content-types-to-all-languages.feature b/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-05-translatable-content-types-to-all-languages.feature
index 84ab7baf..e56ca38f 100644
--- a/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-05-translatable-content-types-to-all-languages.feature
+++ b/tests/features/varbase/step2-apply-tests/01-website-base-requirements/01-05-translatable-content-types-to-all-languages.feature
@@ -20,7 +20,7 @@ So that I will be able to create a content then I will have the option to transl
       And I fill in "Test English Basic page" for "Title"
       And I fill in the rich text editor field "Body" with "Test English Basic page body"
       And I select "en" from "Language"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test English Basic page"
diff --git a/tests/features/varbase/step2-apply-tests/04-content-structure/04-01-basic-page-permissions.feature b/tests/features/varbase/step2-apply-tests/04-content-structure/04-01-basic-page-permissions.feature
index 1a8ca1b3..76970b65 100644
--- a/tests/features/varbase/step2-apply-tests/04-content-structure/04-01-basic-page-permissions.feature
+++ b/tests/features/varbase/step2-apply-tests/04-content-structure/04-01-basic-page-permissions.feature
@@ -65,7 +65,7 @@ So that the "Basic page" will show up in the structured menu under its parent pa
       And I wait
       And I fill in "Test Basic page" for "Title"
       And I fill in the rich text editor field "Body" with "Test Basic page body"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Basic page Test Basic page has been created."
diff --git a/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature b/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature
index 8112f3c1..0a2cbca2 100644
--- a/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature
+++ b/tests/features/varbase/step2-apply-tests/04-content-structure/04-03-landing-page_add-any-paragraph-type-to-the-page.feature
@@ -49,7 +49,7 @@ So that the "Landing page" will show up having paragrpahs of different types
      Then I should see "Block"
      When I select "Site branding" from "Block"
       And I wait
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Landing page Test Landing page Drupal Block has been created"
@@ -68,7 +68,7 @@ So that the "Landing page" will show up having paragrpahs of different types
       And I wait for 1 second
       And I select the "bp_columns" paragraph component
       And I wait for AJAX to finish
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Landing page Test Landing page Columns (Equal) has been created"
@@ -87,7 +87,7 @@ So that the "Landing page" will show up having paragrpahs of different types
       And I wait for 1 second
       And I select the "bp_columns_two_uneven" paragraph component
       And I wait for AJAX to finish
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Landing page Test Landing page Columns (Two Uneven) has been created"
@@ -115,7 +115,7 @@ So that the "Landing page" will show up having paragrpahs of different types
       And I wait
      Then I should see "Modal body"
      When I fill in the rich text editor field "Text" with "Modal Body test"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
      Then I should see "Landing page Test Landing page Modal has been created"
      When I press "Modal button"
@@ -139,7 +139,7 @@ So that the "Landing page" will show up having paragrpahs of different types
       And I wait for AJAX to finish
      Then I should see "Components"
      When I fill in the rich text editor field "Text" with "Rich Text test"
-  		And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Landing page Test Landing page Rich Text has been created"
@@ -167,7 +167,7 @@ So that the "Landing page" will show up having paragrpahs of different types
       And I wait
      Then I should see "Tab body"
       And I fill in the rich text editor field "Text" with "Tab 1 - Body test"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Landing page Test Landing page Tabs has been created"
@@ -190,7 +190,7 @@ So that the "Landing page" will show up having paragrpahs of different types
      Then I should see "Components"
      When I select "Contact" from "Webform"
       And I wait
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Landing page Test Landing page WebForm has been created"
diff --git a/tests/features/varbase/step2-apply-tests/04-content-structure/04-04-landing-page_text-and-image-paragraphs.feature b/tests/features/varbase/step2-apply-tests/04-content-structure/04-04-landing-page_text-and-image-paragraphs.feature
index db01c9ab..f786ad52 100644
--- a/tests/features/varbase/step2-apply-tests/04-content-structure/04-04-landing-page_text-and-image-paragraphs.feature
+++ b/tests/features/varbase/step2-apply-tests/04-content-structure/04-04-landing-page_text-and-image-paragraphs.feature
@@ -76,7 +76,7 @@ So that the "Landing page" will have text and images in right and left view.
        And I select all text in "Text" field
        And I click on "justifycenter" command button in the rich text editor field "Text"
        And I wait
-			 And I select "published" from "edit-moderation-state-0-state"
+       And I select "published" from "edit-moderation-state-0-state"
        And I press the "Save" button
        And I wait
       Then I should see "In eros ipsum, mattis vitae vulputate eu, blandit"
diff --git a/tests/features/varbase/step2-apply-tests/04-content-structure/04-05-standard-bredcrumbs.feature b/tests/features/varbase/step2-apply-tests/04-content-structure/04-05-standard-bredcrumbs.feature
index 6eadab04..728af185 100644
--- a/tests/features/varbase/step2-apply-tests/04-content-structure/04-05-standard-bredcrumbs.feature
+++ b/tests/features/varbase/step2-apply-tests/04-content-structure/04-05-standard-bredcrumbs.feature
@@ -14,7 +14,7 @@ So that I can see path I followed to locate the current page usually near the to
       And I wait
       And I check the box "Provide a menu link"
       And I select "<Main navigation>" from "Parent item"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test Basic page root title"
@@ -31,7 +31,7 @@ So that I can see path I followed to locate the current page usually near the to
       And I wait
       And I check the box "Provide a menu link"
       And I select "Test Basic page root title" from "Parent item"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And wait
      Then I should see "Basic page Test Basic page sub 1 title has been created."
diff --git a/tests/features/varbase/step2-apply-tests/04-content-structure/04-08-landing-page-layout-builder_check-to-add-sections-and-choose-layouts-for-sections.feature b/tests/features/varbase/step2-apply-tests/04-content-structure/04-08-landing-page-layout-builder_check-to-add-sections-and-choose-layouts-for-sections.feature
index cfa6a2f6..43aa7637 100644
--- a/tests/features/varbase/step2-apply-tests/04-content-structure/04-08-landing-page-layout-builder_check-to-add-sections-and-choose-layouts-for-sections.feature
+++ b/tests/features/varbase/step2-apply-tests/04-content-structure/04-08-landing-page-layout-builder_check-to-add-sections-and-choose-layouts-for-sections.feature
@@ -11,7 +11,8 @@ So that the "Landing (Layout Builder) page" will show up having the listed secti
      Then I should see "Create Landing page (Layout Builder)"
      When I fill in "Full Width - No Background Color - Text only" for "Title"
       And I fill in "Test Landing page (Layout Builder) description" for "Page description"
-      And I press "Save"
+      And I select "published" from "edit-moderation-state-0-state"
+      And I press the "Save" button
       And I wait
      Then I should see "Landing page (Layout Builder) Full Width - No Background Color - Text only has been created"
       And I should see "Layout"
diff --git a/tests/features/varbase/step2-apply-tests/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature b/tests/features/varbase/step2-apply-tests/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature
index 6b0b0c0f..11a332fd 100644
--- a/tests/features/varbase/step2-apply-tests/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature
+++ b/tests/features/varbase/step2-apply-tests/05-content-management/05-00-add-default-entityqueue-testing-content-and-config.feature
@@ -41,7 +41,7 @@ Scenario: Add Test content N1, N2, N3 type of test content
    Then I should see "Create Test Content"
    When I fill in "Test content N1" for "Title"
     And I fill in the rich text editor field "Body" with "Test content N1 Body"
-		And I select "published" from "edit-moderation-state-0-state"
+    And I select "published" from "edit-moderation-state-0-state"
     And I press the "Save" button
     And I wait
    Then I should see "Test Content Test content N1 has been created."
@@ -51,7 +51,7 @@ Scenario: Add Test content N1, N2, N3 type of test content
    Then I should see "Create Test Content"
    When I fill in "Test content N2" for "Title"
     And I fill in the rich text editor field "Body" with "Test content N2 Body"
-		And I select "published" from "edit-moderation-state-0-state"
+    And I select "published" from "edit-moderation-state-0-state"
     And I press the "Save" button
     And I wait
    Then I should see "Test Content Test content N2 has been created."
@@ -77,19 +77,28 @@ Scenario: Add Test content N1, N2, N3 nodes to the Test Queue entityqueue
    When I click "Edit items" in the "Test Queue" row
     And I wait
    Then I should see "Edit subqueue Test Queue"
-   When I fill in "Test content N1" for "items[add_more][new_item][target_id]"
+	 When I press "Add existing item"
+    And I wait for AJAX to finish
+	 Then I should see "Item"
+   When I fill in "Test content N1" for "items[form][0][entity_id]"
     And I press "Add item"
     And I wait for AJAX to finish
    Then I should see "Test content N1"
 
   # Add "Test content N2" to the location #2 in the "Test Queue"
-   When I fill in "Test content N2" for "items[add_more][new_item][target_id]"
+   When I press "Add existing item"
+	  And I wait for AJAX to finish
+	 Then I should see "Item"
+   When I fill in "Test content N2" for "items[form][1][entity_id]"
     And I press "Add item"
     And I wait for AJAX to finish
    Then I should see "Test content N1"
 
   # Add "Test content N3" to the location #3 in the "Test Queue"
-   When I fill in "Test content N3" for "items[add_more][new_item][target_id]"
+   When I press "Add existing item"
+	  And I wait for AJAX to finish
+	 Then I should see "Item"
+   When I fill in "Test content N3" for "items[form][2][entity_id]"
     And I press "Add item"
     And I wait for AJAX to finish
    Then I should see "Test content N1"
diff --git a/tests/features/varbase/step2-apply-tests/05-content-management/05-01-entityqueue-reverse-order-in-admin-view.feature b/tests/features/varbase/step2-apply-tests/05-content-management/05-01-entityqueue-reverse-order-in-admin-view.feature
index fa03e0d0..1858156c 100644
--- a/tests/features/varbase/step2-apply-tests/05-content-management/05-01-entityqueue-reverse-order-in-admin-view.feature
+++ b/tests/features/varbase/step2-apply-tests/05-content-management/05-01-entityqueue-reverse-order-in-admin-view.feature
@@ -12,9 +12,9 @@ Scenario: Check that Reverse order in admin view is working
    When I click "Edit items" in the "Test Queue" row
     And I wait
    Then I should see "Edit subqueue Test Queue"
-    And I should see "Test content N1" in the "#edit-items-0-target-id" element
-    And I should see "Test content N2" in the "#edit-items-1-target-id" element
-    And I should see "Test content N3" in the "#edit-items-2-target-id" element
+    And I should see "Test content N1" in the "Test content N1" row
+    And I should see "Test content N2" in the "Test content N2" row
+    And I should see "Test content N3" in the "Test content N3" row
 
    When I go to "/admin/structure/entityqueue/test_queue#edit-queue-settings"
     And I wait
@@ -42,6 +42,6 @@ Scenario: Check that Reverse order in admin view is working
    When I click "Edit items" in the "Test Queue" row
     And I wait
    Then I should see "Edit subqueue Test Queue"
-    And I should see "Test content N3" in the "#edit-items-0-target-id" element
-    And I should see "Test content N2" in the "#edit-items-1-target-id" element
-    And I should see "Test content N1" in the "#edit-items-2-target-id" element
+    And I should see "Test content N3" in the "Test content N3" row
+    And I should see "Test content N2" in the "Test content N2" row
+    And I should see "Test content N1" in the "Test content N1" row
diff --git a/tests/features/varbase/step2-apply-tests/05-content-management/05-03-add-hero-slider-to-entityqueue-using-entityqueue-form-widget.feature b/tests/features/varbase/step2-apply-tests/05-content-management/05-03-add-hero-slider-to-entityqueue-using-entityqueue-form-widget.feature
index 781b5113..d702415e 100644
--- a/tests/features/varbase/step2-apply-tests/05-content-management/05-03-add-hero-slider-to-entityqueue-using-entityqueue-form-widget.feature
+++ b/tests/features/varbase/step2-apply-tests/05-content-management/05-03-add-hero-slider-to-entityqueue-using-entityqueue-form-widget.feature
@@ -50,7 +50,7 @@ I want to be able to add and remove entities to any allowed entity queue.
       And I wait for AJAX to finish
      Then I should see "Choose from the available entityqueues below to push this content to."
      When I check the box "varbase_heroslider_media"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test hero slider #1"
@@ -83,7 +83,7 @@ I want to be able to add and remove entities to any allowed entity queue.
       And I wait for AJAX to finish
      Then I should see "Choose from the available entityqueues below to push this content to."
      When I check the box "varbase_heroslider_media"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Test hero slider #2"
@@ -93,8 +93,8 @@ I want to be able to add and remove entities to any allowed entity queue.
     Given I am a logged in user with the "test_super_admin" user
      When I go to "admin/structure/entityqueue/varbase_heroslider_media/varbase_heroslider_media"
       And I wait
-     Then I should see "Test hero slider #1" in the "#edit-items-0-target-id" element
-      And I should see "Test hero slider #2" in the "#edit-items-1-target-id" element
+     Then I should see "Test hero slider #1"
+      And I should see "Test hero slider #2"
 
   @javascript @local @development @staging @production
   Scenario: Remove a Hero slider from the varbase hero slider media entity queue
@@ -111,7 +111,7 @@ I want to be able to add and remove entities to any allowed entity queue.
       And I expand the field "edit-entityqueue-form-widget"
      Then the "varbase_heroslider_media" checkbox should be checked
      When I uncheck the box "varbase_heroslider_media"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I go to "admin/structure/entityqueue/varbase_heroslider_media/varbase_heroslider_media"
       And I wait
diff --git a/tests/features/varbase/step2-apply-tests/05-content-management/05-04-cloning-content-and-entities.feature b/tests/features/varbase/step2-apply-tests/05-content-management/05-04-cloning-content-and-entities.feature
index dc453db6..fa00964f 100644
--- a/tests/features/varbase/step2-apply-tests/05-content-management/05-04-cloning-content-and-entities.feature
+++ b/tests/features/varbase/step2-apply-tests/05-content-management/05-04-cloning-content-and-entities.feature
@@ -24,10 +24,13 @@ I want to be able to clone an entity.
       And I wait for AJAX to finish
       And I wait
       And I select the "bp_simple" paragraph component
+      And I wait for AJAX to finish
       And I wait
      Then I should see "Modal body"
-      And I fill in the rich text editor field "Text" with "Modal Body test"
+     When I fill in the rich text editor field "Text" with "Modal Body test"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
+      And I wait
      Then I should see "Modal button"
      When I click "Clone"
       And I wait
diff --git a/tests/features/varbase/step2-apply-tests/05-content-management/05-05-embed-existing-media-image-library.feature b/tests/features/varbase/step2-apply-tests/05-content-management/05-05-embed-existing-media-image-library.feature
index 980e3557..7bf2861d 100644
--- a/tests/features/varbase/step2-apply-tests/05-content-management/05-05-embed-existing-media-image-library.feature
+++ b/tests/features/varbase/step2-apply-tests/05-content-management/05-05-embed-existing-media-image-library.feature
@@ -73,7 +73,7 @@ So that it will show up under that rich text field without having to upload the
       And I fill in "Embed Flag Earth custom Alt text" for "Alternate text"
      When I click "Embed" in the "button" element with the "class" attribute set to "js-form-submit form-submit"
       And I wait for AJAX to finish
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
      Then I should see "Basic page Test Basic page to embed existing files has been updated."
diff --git a/tests/features/varbase/step2-apply-tests/05-content-management/05-06-easy-linking-internal-content-searching-content-by-its-titles.feature b/tests/features/varbase/step2-apply-tests/05-content-management/05-06-easy-linking-internal-content-searching-content-by-its-titles.feature
index 43c88b50..1a0bd0a9 100644
--- a/tests/features/varbase/step2-apply-tests/05-content-management/05-06-easy-linking-internal-content-searching-content-by-its-titles.feature
+++ b/tests/features/varbase/step2-apply-tests/05-content-management/05-06-easy-linking-internal-content-searching-content-by-its-titles.feature
@@ -12,7 +12,7 @@ So that will ease the work of adding internal links in the rich text editor fiel
      When I select "full_html" from "Text format"
       And I fill in "Linking to internal content #1 title" for "Title"
       And I fill in the rich text editor field "Body" with "Linking to internal content #1 body"
-			And I select "published" from "edit-moderation-state-0-state"
+      And I select "published" from "edit-moderation-state-0-state"
       And I press the "Save" button
       And I wait
       And I should see "Linking to internal content #1 body"
@@ -39,4 +39,11 @@ So that will ease the work of adding internal links in the rich text editor fiel
       And I wait for AJAX to finish
      Then I should see "Linking to internal content #1 title"
      When I click "Linking to internal content #1 title" in the "ul" element with the "class" attribute set to "ui-autocomplete"
-     Then I should not see "Linking to internal content #1 title"
\ No newline at end of file
+      And I wait for AJAX to finish
+     Then I should not see "Linking to internal content #1 title"
+     When I click "Save" in the "button" element with the "class" attribute set to "button js-form-submit form-submit ui-button ui-corner-all ui-widget"
+      And I wait
+      And I select "published" from "edit-moderation-state-0-state"
+      And I press the "Save" button
+      And I wait
+      And I should see "Linking to internal content #2 body"
diff --git a/tests/features/varbase/step2-apply-tests/05-content-management/05-07-content-workflows.feature b/tests/features/varbase/step2-apply-tests/05-content-management/05-07-content-workflows.feature
index 11823770..78806fab 100644
--- a/tests/features/varbase/step2-apply-tests/05-content-management/05-07-content-workflows.feature
+++ b/tests/features/varbase/step2-apply-tests/05-content-management/05-07-content-workflows.feature
@@ -16,6 +16,7 @@ So that will have an easy publishing workflow with revisions.
       And I should see "Publish"
       And I should see "Archive / Unpublish"
       And I should see "Restore from archive"
+      And I should see "Landing page (Layout Builder)"
       And I should see "Landing page"
       And I should see "Basic page"
       And I should see "Blog post"
diff --git a/tests/features/varbase/step3-cleanup-tests/01-delete-default-testing-users.feature b/tests/features/varbase/step3-cleanup-tests/01-delete-default-testing-users.feature
index f3355dc0..5d846d36 100644
--- a/tests/features/varbase/step3-cleanup-tests/01-delete-default-testing-users.feature
+++ b/tests/features/varbase/step3-cleanup-tests/01-delete-default-testing-users.feature
@@ -9,16 +9,16 @@ Feature: Delete default testing users
 
   @javascript @cleanup @tools @local @development @staging
   Scenario: Delete default testing users.
-	  Given I am a logged in user with the "webmaster" user
+    Given I am a logged in user with the "webmaster" user
      When I go to "/admin/people"
       And I wait
      Then I should see "People"
      When I check the box "test_authenticated"
-		  And I check the box "test_editor"
-		  And I check the box "test_content_admin"
-		  And I check the box "test_seo_admin"
-		  And I check the box "test_site_admin"
-		  And I check the box "test_super_admin"
+      And I check the box "test_editor"
+      And I check the box "test_content_admin"
+      And I check the box "test_seo_admin"
+      And I check the box "test_site_admin"
+      And I check the box "test_super_admin"
       And I select "Cancel the selected user accounts" from "action"
      When I press "Apply to selected items"
       And I wait
diff --git a/varbase.services.yml b/varbase.services.yml
index 1730a423..f0ae8e24 100644
--- a/varbase.services.yml
+++ b/varbase.services.yml
@@ -5,8 +5,9 @@ services:
       - '@element_info'
   varbase.config_bit:
     class: '\Drupal\varbase\Config\ConfigBit'
-    arguments:
-      - '@element_info'
+    arguments: ['@config.factory', '@config.manager', '@module_handler', '@database', '@plugin.cache_clearer']
+    tags:
+      - { name: 'event_subscriber' }
   varbase.definition_update_manager:
     class: '\Drupal\varbase\Entity\VarbaseEntityDefinitionUpdateManager'
     arguments: ['@class_resolver', '@entity.definition_update_manager']
-- 
GitLab