From f603c9ceccd0fecb1a9834160f95a35813e4bb6c Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Tue, 17 Dec 2024 21:31:21 +0530 Subject: [PATCH 1/5] Changes for deprecated message being declared before apps_warning_checker --- .../src/Entity/ListBuilder/TeamAppListByTeam.php | 12 ++++++------ src/Entity/ListBuilder/AppListBuilder.php | 10 +++++----- .../DeveloperAppListBuilderForDeveloper.php | 12 ++++++------ 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php index 3510dec7..5283b6f9 100644 --- a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php +++ b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php @@ -61,17 +61,17 @@ class TeamAppListByTeam extends AppListBuilder implements ContainerInjectionInte * The time service. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The route match object. - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The config factory. * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker * The app warnings checker service. + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config factory. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, AppWarningsCheckerInterface $app_warnings_checker, ?ConfigFactoryInterface $config_factory = NULL) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } - parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $config_factory, $app_warnings_checker); + parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $app_warnings_checker, $config_factory); $this->routeMatch = $route_match; } @@ -86,8 +86,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $container->get('request_stack'), $container->get('datetime.time'), $container->get('current_route_match'), - $container->get('config.factory'), - $container->get('apigee_edge.entity.app_warnings_checker') + $container->get('apigee_edge.entity.app_warnings_checker'), + $container->get('config.factory') ); } diff --git a/src/Entity/ListBuilder/AppListBuilder.php b/src/Entity/ListBuilder/AppListBuilder.php index 85e3c178..0bb79491 100644 --- a/src/Entity/ListBuilder/AppListBuilder.php +++ b/src/Entity/ListBuilder/AppListBuilder.php @@ -89,12 +89,12 @@ class AppListBuilder extends EdgeEntityListBuilder { * The request stack object. * @param \Drupal\Component\Datetime\TimeInterface $time * The time service. - * @param \Drupal\Core\Config\ConfigFactoryInterface|null $config_factory - * The config factory. * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker * The app warnings checker service. + * @param \Drupal\Core\Config\ConfigFactoryInterface|null $config_factory + * The config factory. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, AppWarningsCheckerInterface $app_warnings_checker, ?ConfigFactoryInterface $config_factory = NULL) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } @@ -117,8 +117,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $container->get('renderer'), $container->get('request_stack'), $container->get('datetime.time'), - $container->get('config.factory'), - $container->get('apigee_edge.entity.app_warnings_checker') + $container->get('apigee_edge.entity.app_warnings_checker'), + $container->get('config.factory') ); } diff --git a/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php b/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php index 051aa51b..4d6c3001 100644 --- a/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php +++ b/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php @@ -84,17 +84,17 @@ class DeveloperAppListBuilderForDeveloper extends AppListBuilder implements Cont * Currently logged-in user. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The route match object. - * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory - * The config factory. * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker * The app warnings checker service. + * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory + * The config factory. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, ?ConfigFactoryInterface $config_factory = NULL, AppWarningsCheckerInterface $app_warnings_checker) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, AppWarningsCheckerInterface $app_warnings_checker, ?ConfigFactoryInterface $config_factory = NULL) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } - parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $config_factory, $app_warnings_checker); + parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $app_warnings_checker, $config_factory); $this->currentUser = $current_user; $this->routeMatch = $route_match; } @@ -111,8 +111,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $container->get('datetime.time'), $container->get('current_user'), $container->get('current_route_match'), - $container->get('config.factory'), - $container->get('apigee_edge.entity.app_warnings_checker') + $container->get('apigee_edge.entity.app_warnings_checker'), + $container->get('config.factory') ); } From 5299511a7a35ae3ae827cdf1c09b921dc79a4e94 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 19 Dec 2024 21:54:32 +0530 Subject: [PATCH 2/5] Fixes for deprecated messaged --- .../src/Controller/TeamMembersList.php | 2 +- .../src/Entity/ListBuilder/TeamAppListByTeam.php | 12 ++++++------ .../src/Entity/Storage/TeamMemberRoleStorage.php | 2 +- src/Entity/ListBuilder/AppListBuilder.php | 10 +++++----- .../DeveloperAppListBuilderForDeveloper.php | 12 ++++++------ 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/apigee_edge_teams/src/Controller/TeamMembersList.php b/modules/apigee_edge_teams/src/Controller/TeamMembersList.php index e3ee1e81..02516ce3 100644 --- a/modules/apigee_edge_teams/src/Controller/TeamMembersList.php +++ b/modules/apigee_edge_teams/src/Controller/TeamMembersList.php @@ -99,7 +99,7 @@ class TeamMembersList extends ControllerBase { * @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller * The organization controller service. */ - public function __construct(TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager, ?ModuleHandlerInterface $module_handler = NULL, CompanyMembershipObjectCacheInterface $company_membership_object_cache, AppGroupMembershipObjectCacheInterface $appgroup_membership_object_cache, OrganizationControllerInterface $org_controller) { + public function __construct(TeamMembershipManagerInterface $team_membership_manager, EntityTypeManagerInterface $entity_type_manager, ModuleHandlerInterface $module_handler, CompanyMembershipObjectCacheInterface $company_membership_object_cache, AppGroupMembershipObjectCacheInterface $appgroup_membership_object_cache, OrganizationControllerInterface $org_controller) { if (!$module_handler) { @trigger_error('Calling ' . __METHOD__ . ' without the $module_handler is deprecated in apigee_edge:8-x-1.19 and is required before apigee_edge:8.x-2.0. See https://github.com/apigee/apigee-edge-drupal/pull/518.', E_USER_DEPRECATED); $module_handler = \Drupal::moduleHandler(); diff --git a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php index 5283b6f9..1c615912 100644 --- a/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php +++ b/modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListByTeam.php @@ -61,17 +61,17 @@ class TeamAppListByTeam extends AppListBuilder implements ContainerInjectionInte * The time service. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The route match object. - * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker - * The app warnings checker service. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. + * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker + * The app warnings checker service. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, AppWarningsCheckerInterface $app_warnings_checker, ?ConfigFactoryInterface $config_factory = NULL) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, RouteMatchInterface $route_match, ConfigFactoryInterface $config_factory, AppWarningsCheckerInterface $app_warnings_checker) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } - parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $app_warnings_checker, $config_factory); + parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $config_factory, $app_warnings_checker); $this->routeMatch = $route_match; } @@ -86,8 +86,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $container->get('request_stack'), $container->get('datetime.time'), $container->get('current_route_match'), - $container->get('apigee_edge.entity.app_warnings_checker'), - $container->get('config.factory') + $container->get('config.factory'), + $container->get('apigee_edge.entity.app_warnings_checker') ); } diff --git a/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php b/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php index cfa27ddd..af611705 100644 --- a/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php +++ b/modules/apigee_edge_teams/src/Entity/Storage/TeamMemberRoleStorage.php @@ -94,7 +94,7 @@ class TeamMemberRoleStorage extends SqlContentEntityStorage implements TeamMembe * @param \Drupal\apigee_edge\Entity\Controller\OrganizationControllerInterface $org_controller * The organization controller service. */ - public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityFieldManagerInterface $entity_field_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, MemoryCacheInterface $memory_cache, TeamMembershipManagerInterface $team_membership_manager, LoggerInterface $logger, ?EntityTypeBundleInfoInterface $entity_type_bundle_info = NULL, ?EntityTypeManagerInterface $entity_type_manager = NULL, OrganizationControllerInterface $org_controller) { + public function __construct(EntityTypeInterface $entity_type, Connection $database, EntityFieldManagerInterface $entity_field_manager, CacheBackendInterface $cache, LanguageManagerInterface $language_manager, MemoryCacheInterface $memory_cache, TeamMembershipManagerInterface $team_membership_manager, LoggerInterface $logger, EntityTypeBundleInfoInterface $entity_type_bundle_info, EntityTypeManagerInterface $entity_type_manager, OrganizationControllerInterface $org_controller) { parent::__construct($entity_type, $database, $entity_field_manager, $cache, $language_manager, $memory_cache, $entity_type_bundle_info, $entity_type_manager); $this->teamMembershipManager = $team_membership_manager; $this->logger = $logger; diff --git a/src/Entity/ListBuilder/AppListBuilder.php b/src/Entity/ListBuilder/AppListBuilder.php index 0bb79491..5a96173b 100644 --- a/src/Entity/ListBuilder/AppListBuilder.php +++ b/src/Entity/ListBuilder/AppListBuilder.php @@ -89,12 +89,12 @@ class AppListBuilder extends EdgeEntityListBuilder { * The request stack object. * @param \Drupal\Component\Datetime\TimeInterface $time * The time service. - * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker - * The app warnings checker service. * @param \Drupal\Core\Config\ConfigFactoryInterface|null $config_factory * The config factory. + * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker + * The app warnings checker service. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, AppWarningsCheckerInterface $app_warnings_checker, ?ConfigFactoryInterface $config_factory = NULL) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $renderer, RequestStack $request_stack, TimeInterface $time, ConfigFactoryInterface $config_factory, AppWarningsCheckerInterface $app_warnings_checker) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } @@ -117,8 +117,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $container->get('renderer'), $container->get('request_stack'), $container->get('datetime.time'), - $container->get('apigee_edge.entity.app_warnings_checker'), - $container->get('config.factory') + $container->get('config.factory'), + $container->get('apigee_edge.entity.app_warnings_checker') ); } diff --git a/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php b/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php index 4d6c3001..c46505b0 100644 --- a/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php +++ b/src/Entity/ListBuilder/DeveloperAppListBuilderForDeveloper.php @@ -84,17 +84,17 @@ class DeveloperAppListBuilderForDeveloper extends AppListBuilder implements Cont * Currently logged-in user. * @param \Drupal\Core\Routing\RouteMatchInterface $route_match * The route match object. - * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker - * The app warnings checker service. * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory * The config factory. + * @param \Drupal\apigee_edge\Entity\AppWarningsCheckerInterface $app_warnings_checker + * The app warnings checker service. */ - public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, AppWarningsCheckerInterface $app_warnings_checker, ?ConfigFactoryInterface $config_factory = NULL) { + public function __construct(EntityTypeInterface $entity_type, EntityTypeManagerInterface $entity_type_manager, RendererInterface $render, RequestStack $request_stack, TimeInterface $time, AccountInterface $current_user, RouteMatchInterface $route_match, ConfigFactoryInterface $config_factory, AppWarningsCheckerInterface $app_warnings_checker) { if (!$config_factory) { $config_factory = \Drupal::service('config.factory'); } - parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $app_warnings_checker, $config_factory); + parent::__construct($entity_type, $entity_type_manager, $render, $request_stack, $time, $config_factory, $app_warnings_checker); $this->currentUser = $current_user; $this->routeMatch = $route_match; } @@ -111,8 +111,8 @@ public static function createInstance(ContainerInterface $container, EntityTypeI $container->get('datetime.time'), $container->get('current_user'), $container->get('current_route_match'), - $container->get('apigee_edge.entity.app_warnings_checker'), - $container->get('config.factory') + $container->get('config.factory'), + $container->get('apigee_edge.entity.app_warnings_checker') ); } From 19e36d0b4bc8ec2e0eb20c4bc057e16b7a841c02 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 19 Dec 2024 22:47:33 +0530 Subject: [PATCH 3/5] Test case url change to visit the listing page of teams --- modules/apigee_edge_teams/tests/src/Functional/UiTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php index 494ecf86..287fda4d 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php @@ -257,7 +257,7 @@ protected function teamsWorkflowTest() { // Login with the default user, the created team app should be visible on // the team app administer collection page (/team-apps). $this->drupalLogin($this->account); - $this->drupalGet(Url::fromRoute('entity.team_app.collection')); + $this->drupalGet(Url::fromRoute('entity.team_app.collection_by_team')); $this->assertSession()->linkExists($team_modified_display_name); $this->assertSession()->linkExists($team_app_1_modified_display_name); @@ -270,7 +270,7 @@ protected function teamsWorkflowTest() { // Remove the other user from the team's member list. $this->drupalLogin($this->account); - $this->drupalGet(Url::fromRoute('entity.team_app.collection')); + $this->drupalGet(Url::fromRoute('entity.team_app.collection_by_team')); $this->clickLink($team_modified_display_name); $this->clickLink('Members'); $this->getSession()->getPage()->findById((Html::getUniqueId($this->otherAccount->getEmail())))->clickLink('Remove'); From 8fe5f6b1366db5bc2cc492c1eaa34799cc4c7c99 Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 19 Dec 2024 23:19:54 +0530 Subject: [PATCH 4/5] Changes for correct ur; --- modules/apigee_edge_teams/tests/src/Functional/UiTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php index 287fda4d..bfa37627 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php @@ -257,7 +257,7 @@ protected function teamsWorkflowTest() { // Login with the default user, the created team app should be visible on // the team app administer collection page (/team-apps). $this->drupalLogin($this->account); - $this->drupalGet(Url::fromRoute('entity.team_app.collection_by_team')); + $this->drupalGet($this->team->toUrl('collection')); $this->assertSession()->linkExists($team_modified_display_name); $this->assertSession()->linkExists($team_app_1_modified_display_name); @@ -270,7 +270,7 @@ protected function teamsWorkflowTest() { // Remove the other user from the team's member list. $this->drupalLogin($this->account); - $this->drupalGet(Url::fromRoute('entity.team_app.collection_by_team')); + $this->drupalGet($this->team->toUrl('collection')); $this->clickLink($team_modified_display_name); $this->clickLink('Members'); $this->getSession()->getPage()->findById((Html::getUniqueId($this->otherAccount->getEmail())))->clickLink('Remove'); From 96b6c92cbb7920889104f1f1bee86265ab35a74b Mon Sep 17 00:00:00 2001 From: Kedar Khaire Date: Thu, 26 Dec 2024 22:07:05 +0530 Subject: [PATCH 5/5] Fixes Missing Team App error --- modules/apigee_edge_teams/tests/src/Functional/UiTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php index bfa37627..28c6a172 100644 --- a/modules/apigee_edge_teams/tests/src/Functional/UiTest.php +++ b/modules/apigee_edge_teams/tests/src/Functional/UiTest.php @@ -259,6 +259,8 @@ protected function teamsWorkflowTest() { $this->drupalLogin($this->account); $this->drupalGet($this->team->toUrl('collection')); $this->assertSession()->linkExists($team_modified_display_name); + $this->clickLink($team_modified_display_name); + $this->clickLink('Team Apps'); $this->assertSession()->linkExists($team_app_1_modified_display_name); // Try to delete the first team app without verification code then with a