Skip to content
Snippets Groups Projects
Commit aaa0ea5f authored by baldwinlouie's avatar baldwinlouie Committed by Yas Naoi
Browse files

Issue #3047694 by baldwinlouie, yas, Xiaohua Guan: Merge cloud_server_template and cloud module

parent f4e58ff8
No related branches found
No related tags found
No related merge requests found
Showing
with 37 additions and 37 deletions
......@@ -2,7 +2,7 @@ langcode: en
status: true
dependencies:
module:
- cloud_server_template
- cloud
- options
id: cloud_server_template.field_schedule
field_name: field_schedule
......
......@@ -3,7 +3,7 @@ status: true
dependencies:
module:
- aws_cloud
- cloud_server_template
- cloud
id: cloud_server_template.field_security_group
field_name: field_security_group
entity_type: cloud_server_template
......
......@@ -3,7 +3,7 @@ status: true
dependencies:
module:
- aws_cloud
- cloud_server_template
- cloud
id: cloud_server_template.field_ssh_key
field_name: field_ssh_key
entity_type: cloud_server_template
......
......@@ -3,7 +3,7 @@ langcode: en
status: true
dependencies:
module:
- cloud_server_template
- cloud
- options
id: cloud_server_template.field_subnet
field_name: field_subnet
......
......@@ -3,7 +3,7 @@ status: true
dependencies:
module:
- aws_cloud
- cloud_server_template
- cloud
id: cloud_server_template.field_tags
field_name: field_tags
entity_type: cloud_server_template
......
......@@ -2,7 +2,7 @@ langcode: en
status: true
dependencies:
module:
- cloud_server_template
- cloud
id: cloud_server_template.field_termination_protection
field_name: field_termination_protection
entity_type: cloud_server_template
......
......@@ -2,7 +2,7 @@ langcode: en
status: true
dependencies:
module:
- cloud_server_template
- cloud
id: cloud_server_template.field_test_only
field_name: field_test_only
entity_type: cloud_server_template
......
......@@ -2,7 +2,7 @@ langcode: en
status: true
dependencies:
module:
- cloud_server_template
- cloud
id: cloud_server_template.field_user_data
field_name: field_user_data
entity_type: cloud_server_template
......
......@@ -3,7 +3,7 @@ langcode: en
status: true
dependencies:
module:
- cloud_server_template
- cloud
- options
id: cloud_server_template.field_vpc
field_name: field_vpc
......
......@@ -8,7 +8,7 @@ use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\cloud\Service\EntityLinkRendererInterface;
use Drupal\cloud_server_template\Controller\CloudServerTemplateListBuilder;
use Drupal\cloud\Controller\CloudServerTemplateListBuilder;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......
......@@ -155,7 +155,7 @@ class AwsCloudSubscriber implements EventSubscriberInterface {
return;
}
/* @var \Drupal\cloud_server_template\Entity\CloudServerTemplateTypeInterface $cloud_server_template_type */
/* @var \Drupal\cloud\Entity\CloudServerTemplateTypeInterface $cloud_server_template_type */
$cloud_server_template_type = $this->routeMatch->getParameter('cloud_server_template_type');
if ($cloud_server_template_type == NULL || $cloud_server_template_type->id() != 'aws_cloud') {
return;
......
......@@ -9,8 +9,8 @@ use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Component\Plugin\PluginBase;
use Drupal\Component\Uuid\UuidInterface;
use Drupal\aws_cloud\Service\AwsEc2ServiceInterface;
use Drupal\cloud_server_template\Entity\CloudServerTemplateInterface;
use Drupal\cloud_server_template\Plugin\CloudServerTemplatePluginInterface;
use Drupal\cloud\Entity\CloudServerTemplateInterface;
use Drupal\cloud\Plugin\CloudServerTemplatePluginInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
......
......@@ -17,7 +17,7 @@ use Drupal\Core\Entity\Query\QueryInterface;
use Drupal\Core\Entity\EntityStorageInterface;
use Drupal\Component\Uuid\UuidInterface;
use Drupal\aws_cloud\Plugin\AwsCloudServerTemplatePlugin;
use Drupal\cloud_server_template\Entity\CloudServerTemplateInterface;
use Drupal\cloud\Entity\CloudServerTemplateInterface;
use Drupal\aws_cloud\Service\AwsEc2ServiceInterface;
use Drupal\aws_cloud\Plugin\Field\FieldType\Tag;
......
<?php
namespace Drupal\cloud_server_template;
namespace Drupal\cloud;
use Drupal\Core\Entity\Sql\SqlContentEntityStorage;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\cloud_server_template\Entity\CloudServerTemplateInterface;
use Drupal\cloud\Entity\CloudServerTemplateInterface;
/**
* Defines the storage handler class for Cloud Server Template entities.
......
<?php
namespace Drupal\cloud_server_template;
namespace Drupal\cloud;
use Drupal\Core\Entity\ContentEntityStorageInterface;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Language\LanguageInterface;
use Drupal\cloud_server_template\Entity\CloudServerTemplateInterface;
use Drupal\cloud\Entity\CloudServerTemplateInterface;
/**
* Defines the storage handler class for Cloud Server Template entities.
......@@ -18,9 +18,9 @@ use Drupal\cloud_server_template\Entity\CloudServerTemplateInterface;
interface CloudServerTemplateStorageInterface extends ContentEntityStorageInterface {
/**
* Gets a list of Cloud Server Template revision IDs for a specific Cloud Server Template.
* Gets a list of Cloud Server Template revision IDs.
*
* @param \Drupal\cloud_server_template\Entity\CloudServerTemplateInterface $entity
* @param \Drupal\cloud\Entity\CloudServerTemplateInterface $entity
* The Cloud Server Template entity.
*
* @return int[]
......@@ -29,7 +29,7 @@ interface CloudServerTemplateStorageInterface extends ContentEntityStorageInterf
public function revisionIds(CloudServerTemplateInterface $entity);
/**
* Gets a list of revision IDs having a given user as Cloud Server Template author.
* Gets a list of revision IDs given an Cloud Server Template author.
*
* @param \Drupal\Core\Session\AccountInterface $account
* The user entity.
......@@ -42,7 +42,7 @@ interface CloudServerTemplateStorageInterface extends ContentEntityStorageInterf
/**
* Counts the number of revisions in the default language.
*
* @param \Drupal\cloud_server_template\Entity\CloudServerTemplateInterface $entity
* @param \Drupal\cloud\Entity\CloudServerTemplateInterface $entity
* The Cloud Server Template entity.
*
* @return int
......
<?php
namespace Drupal\cloud_server_template;
namespace Drupal\cloud;
use Drupal\content_translation\ContentTranslationHandler;
......
<?php
namespace Drupal\cloud_server_template;
namespace Drupal\cloud;
use Drupal\Core\Config\Entity\ConfigEntityListBuilder;
use Drupal\Core\Entity\EntityInterface;
......
<?php
namespace Drupal\cloud_server_template\Controller;
namespace Drupal\cloud\Controller;
use Drupal\Core\Entity\EntityAccessControlHandler;
use Drupal\Core\Entity\EntityInterface;
......@@ -10,7 +10,7 @@ use Drupal\Core\Access\AccessResult;
/**
* Access controller for the Cloud Server Template entity.
*
* @see \Drupal\cloud_server_template\Entity\CloudServerTemplate.
* @see \Drupal\cloud\Entity\CloudServerTemplate.
*/
class CloudServerTemplateAccessControlHandler extends EntityAccessControlHandler {
......@@ -28,7 +28,7 @@ class CloudServerTemplateAccessControlHandler extends EntityAccessControlHandler
// Determine if the user is the entity owner id.
$is_entity_owner = $account->id() == $entity->getOwner()->id();
/** @var \Drupal\cloud_server_template\Entity\CloudServerTemplateInterface $entity */
/** @var \Drupal\cloud\Entity\CloudServerTemplateInterface $entity */
switch ($operation) {
case 'view':
if (!$entity->isPublished()) {
......
<?php
namespace Drupal\cloud_server_template\Controller;
namespace Drupal\cloud\Controller;
use Drupal\cloud_server_template\Entity\CloudServerTemplateInterface;
use Drupal\cloud_server_template\Plugin\CloudServerTemplatePluginManagerInterface;
use Drupal\cloud\Entity\CloudServerTemplateInterface;
use Drupal\cloud\Plugin\CloudServerTemplatePluginManagerInterface;
use Drupal\Component\Utility\Xss;
use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
......@@ -23,7 +23,7 @@ class CloudServerTemplateController extends ControllerBase implements ContainerI
/**
* The ServerTemplatePluginManager.
*
* @var \Drupal\cloud_server_template\Plugin\CloudServerTemplatePluginManager
* @var \Drupal\cloud\Plugin\CloudServerTemplatePluginManager
*/
protected $serverTemplatePluginManager;
......@@ -53,7 +53,7 @@ class CloudServerTemplateController extends ControllerBase implements ContainerI
*
* @param \Drupal\Core\Routing\RouteMatchInterface $route_match
* The route match.
* @param \Drupal\cloud_server_template\Controller\CloudServerTemplatePluginManagerInterface $server_template_plugin_manager
* @param \Drupal\cloud\Plugin\CloudServerTemplatePluginManagerInterface $server_template_plugin_manager
* The server template plugin manager.
* @param \Drupal\Core\Render\RendererInterface $renderer
* The render service.
......@@ -117,7 +117,7 @@ class CloudServerTemplateController extends ControllerBase implements ContainerI
/**
* Generates an overview table of older revisions of a Cloud Server Template .
*
* @param \Drupal\cloud_server_template\Entity\CloudServerTemplateInterface $cloud_server_template
* @param \Drupal\cloud\Entity\CloudServerTemplateInterface $cloud_server_template
* A Cloud Server Template object.
*
* @return array
......@@ -144,7 +144,7 @@ class CloudServerTemplateController extends ControllerBase implements ContainerI
$latest_revision = TRUE;
foreach (array_reverse($vids) as $vid) {
/** @var \Drupal\cloud_server_template\CloudServerTemplateInterface $revision */
/** @var \Drupal\cloud\CloudServerTemplateInterface $revision */
$revision = $cloud_server_template_storage->loadRevision($vid);
// Only show revisions that are affected by the language that is being
// displayed.
......@@ -251,7 +251,7 @@ class CloudServerTemplateController extends ControllerBase implements ContainerI
*/
public function launch(CloudServerTemplateInterface $cloud_server_template) {
$redirect_route = $this->serverTemplatePluginManager->launch($cloud_server_template);
// Let other modules alter the redirect after a server template has been launched.
// Let modules alter the redirect after a server template has been launched.
\Drupal::moduleHandler()->invokeAll('cloud_server_template_post_launch_redirect_alter', [&$redirect_route, $cloud_server_template]);
return $this->redirect($redirect_route['route_name'], isset($redirect_route['params']) ? $redirect_route['params'] : []);
}
......
<?php
namespace Drupal\cloud_server_template\Controller;
namespace Drupal\cloud\Controller;
use Drupal\cloud_server_template\Entity\CloudServerTemplateInterface;
use Drupal\cloud\Entity\CloudServerTemplateInterface;
/**
* Common interfaces for the CloudServerTemplateControllerInterface.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment