Skip to content

Commit

Permalink
Fixes for Apps General, Apps Analytics, Developer Apss Display Settin…
Browse files Browse the repository at this point in the history
…gs, Developer Custom Attributes & Api products Access config forms
  • Loading branch information
kedarkhaire committed Jan 16, 2025
1 parent befdace commit ede2b16
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 15 deletions.
18 changes: 15 additions & 3 deletions src/Form/ApiProductAccessControlForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace Drupal\apigee_edge\Form;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
Expand All @@ -38,17 +39,27 @@ class ApiProductAccessControlForm extends ConfigFormBase {
*/
protected $entityTypeManager;

/**
* Typed Config Service.
*
* @var \Drupal\Core\Config\TypedConfigManagerInterface
*/
protected TypedConfigManagerInterface $typedConfigManager;

/**
* ProductAccessControlForm constructor.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
* The entity type manager service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, TypedConfigManagerInterface $typed_config_manager) {
parent::__construct($config_factory, $typed_config_manager);
$this->entityTypeManager = $entity_type_manager;
$this->typedConfigManager = $typed_config_manager;
}

/**
Expand All @@ -57,7 +68,8 @@ public function __construct(ConfigFactoryInterface $config_factory, EntityTypeMa
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('entity_type.manager')
$container->get('entity_type.manager'),
$container->get('config.typed')
);
}

Expand Down
18 changes: 15 additions & 3 deletions src/Form/AppAnalyticsSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

use Apigee\Edge\Api\Management\Controller\EnvironmentController;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\apigee_edge\SDKConnectorInterface;
Expand All @@ -38,17 +39,27 @@ class AppAnalyticsSettingsForm extends ConfigFormBase {
*/
protected $environmentController;

/**
* Typed Config Service.
*
* @var \Drupal\Core\Config\TypedConfigManagerInterface
*/
protected TypedConfigManagerInterface $typedConfigManager;

/**
* Constructs a new DeveloperAppAnalyticsSettingsForm.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The factory for configuration objects.
* @param \Drupal\apigee_edge\SDKConnectorInterface $sdk_connector
* The SDK connector service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, SDKConnectorInterface $sdk_connector) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, SDKConnectorInterface $sdk_connector, TypedConfigManagerInterface $typed_config_manager) {
parent::__construct($config_factory, $typed_config_manager);
$this->environmentController = new EnvironmentController($sdk_connector->getOrganization(), $sdk_connector->getClient());
$this->typedConfigManager = $typed_config_manager;
}

/**
Expand All @@ -57,7 +68,8 @@ public function __construct(ConfigFactoryInterface $config_factory, SDKConnector
public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('apigee_edge.sdk_connector')
$container->get('apigee_edge.sdk_connector'),
$container->get('config.typed')
);
}

Expand Down
18 changes: 15 additions & 3 deletions src/Form/AppSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
use Drupal\Core\Ajax\AjaxResponse;
use Drupal\Core\Ajax\ReplaceCommand;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityStorageException;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
Expand Down Expand Up @@ -49,6 +50,13 @@ class AppSettingsForm extends ConfigFormBase {
*/
protected $renderer;

/**
* Typed Config Service.
*
* @var \Drupal\Core\Config\TypedConfigManagerInterface
*/
protected TypedConfigManagerInterface $typedConfigManager;

/**
* AppSettingsForm constructor.
*
Expand All @@ -58,11 +66,14 @@ class AppSettingsForm extends ConfigFormBase {
* The entity type manager service.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The renderer.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, TypedConfigManagerInterface $typed_config_manager) {
parent::__construct($config_factory, $typed_config_manager);
$this->entityTypeManager = $entity_type_manager;
$this->renderer = $renderer;
$this->typedConfigManager = $typed_config_manager;
}

/**
Expand All @@ -72,7 +83,8 @@ public static function create(ContainerInterface $container) {
return new static(
$container->get('config.factory'),
$container->get('entity_type.manager'),
$container->get('renderer')
$container->get('renderer'),
$container->get('config.typed')
);
}

Expand Down
23 changes: 20 additions & 3 deletions src/Form/DeveloperAttributesSettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
namespace Drupal\apigee_edge\Form;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityFieldManagerInterface;
use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;
Expand Down Expand Up @@ -56,6 +57,13 @@ class DeveloperAttributesSettingsForm extends ConfigFormBase {
*/
private $fieldStorageFormatManager;

/**
* Typed Config Service.
*
* @var \Drupal\Core\Config\TypedConfigManagerInterface
*/
protected TypedConfigManagerInterface $typedConfigManager;

/**
* DeveloperAttributesSettingsForm constructor.
*
Expand All @@ -67,19 +75,28 @@ class DeveloperAttributesSettingsForm extends ConfigFormBase {
* Field storage format manager service.
* @param \Drupal\apigee_edge\FieldAttributeConverter $field_attribute_converter
* Field name to attribute name converted service.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, EntityFieldManagerInterface $entity_field_manager, FieldStorageFormatManagerInterface $field_storage_format_manager, FieldAttributeConverter $field_attribute_converter) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, EntityFieldManagerInterface $entity_field_manager, FieldStorageFormatManagerInterface $field_storage_format_manager, FieldAttributeConverter $field_attribute_converter, TypedConfigManagerInterface $typed_config_manager) {
parent::__construct($config_factory, $typed_config_manager);
$this->fieldAttributeConverter = $field_attribute_converter;
$this->entityFieldManager = $entity_field_manager;
$this->fieldStorageFormatManager = $field_storage_format_manager;
$this->typedConfigManager = $typed_config_manager;
}

/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container->get('config.factory'), $container->get('entity_field.manager'), $container->get('plugin.manager.apigee_field_storage_format'), $container->get('apigee_edge.converter.field_attribute'));
return new static(
$container->get('config.factory'),
$container->get('entity_field.manager'),
$container->get('plugin.manager.apigee_field_storage_format'),
$container->get('apigee_edge.converter.field_attribute'),
$container->get('config.typed')
);
}

/**
Expand Down
18 changes: 15 additions & 3 deletions src/Form/EdgeEntityDisplaySettingsForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
namespace Drupal\apigee_edge\Form;

use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Config\TypedConfigManagerInterface;
use Drupal\Core\Entity\EntityDisplayRepositoryInterface;
use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
Expand Down Expand Up @@ -72,6 +73,13 @@ class EdgeEntityDisplaySettingsForm extends ConfigFormBase implements BaseFormId
*/
protected $routeMatch;

/**
* Typed Config Service.
*
* @var \Drupal\Core\Config\TypedConfigManagerInterface
*/
protected TypedConfigManagerInterface $typedConfigManager;

/**
* AppDisplaySettingsForm constructor.
*
Expand All @@ -85,13 +93,16 @@ class EdgeEntityDisplaySettingsForm extends ConfigFormBase implements BaseFormId
* The module handler.
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager
* The typed config manager.
*/
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, ModuleHandlerInterface $module_handler, RouteMatchInterface $route_match) {
parent::__construct($config_factory);
public function __construct(ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, EntityDisplayRepositoryInterface $entity_display_repository, ModuleHandlerInterface $module_handler, RouteMatchInterface $route_match, TypedConfigManagerInterface $typed_config_manager) {
parent::__construct($config_factory, $typed_config_manager);
$this->entityTypeManager = $entity_type_manager;
$this->moduleHandler = $module_handler;
$this->entityDisplayRepository = $entity_display_repository;
$this->routeMatch = $route_match;
$this->typedConfigManager = $typed_config_manager;
}

/**
Expand All @@ -103,7 +114,8 @@ public static function create(ContainerInterface $container) {
$container->get('entity_type.manager'),
$container->get('entity_display.repository'),
$container->get('module_handler'),
$container->get('current_route_match')
$container->get('current_route_match'),
$container->get('config.typed')
);
}

Expand Down

0 comments on commit ede2b16

Please sign in to comment.