Skip to content

Commit 0f0e59a

Browse files
Apigee X tests for team, team membership level and admin permissions, team roles (#1045)
1 parent d3f04aa commit 0f0e59a

File tree

3 files changed

+729
-2
lines changed

3 files changed

+729
-2
lines changed

modules/apigee_edge_teams/src/Entity/ListBuilder/TeamAppListBuilder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ protected function buildInfoRow(AppInterface $app, array &$rows) {
5151
/** @var \Drupal\apigee_edge_teams\Entity\TeamInterface[] $teams */
5252
$teams = $this->entityTypeManager->getStorage('team')->loadMultiple();
5353
$css_id = $this->getCssIdForInfoRow($app);
54-
$rows[$css_id]['data']['team']['data'] = $teams[$app->getCompanyName()]->access('view') ? $teams[$app->getCompanyName()]->toLink()->toRenderable() : $teams[$app->getCompanyName()]->label();
54+
$team_name = $app->isApigeeX() ? $app->getAppGroup() : $app->getCompanyName();
55+
$rows[$css_id]['data']['team']['data'] = $teams[$team_name]->access('view') ? $teams[$team_name]->toLink()->toRenderable() : $teams[$team_name]->label();
5556
parent::buildInfoRow($app, $rows);
5657
}
5758

modules/apigee_edge_teams/src/Entity/TeamApp.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@
8686
#[\AllowDynamicProperties]
8787
class TeamApp extends App implements TeamAppInterface {
8888

89+
/**
90+
* True if organization is Apigee X.
91+
*
92+
* @var bool
93+
*/
94+
public static $apigeex = FALSE;
95+
8996
/**
9097
* The decorated company app entity from the SDK.
9198
*
@@ -156,7 +163,11 @@ public function getAppGroup(): ?string {
156163
*/
157164
public static function isApigeeX(): bool {
158165
$orgController = \Drupal::service('apigee_edge.controller.organization');
159-
return $orgController->isOrganizationApigeeX();
166+
if ($orgController->isOrganizationApigeeX()) {
167+
TeamApp::$apigeex = $orgController->isOrganizationApigeeX();
168+
}
169+
170+
return TeamApp::$apigeex;
160171
}
161172

162173
/**

0 commit comments

Comments
 (0)