diff --git a/modules/datastore/drush.services.yml b/modules/datastore/drush.services.yml index 106c2cd014..2f56bbe011 100755 --- a/modules/datastore/drush.services.yml +++ b/modules/datastore/drush.services.yml @@ -7,6 +7,7 @@ services: - '@dkan.datastore.service.post_import' - '@dkan.datastore.service.resource_localizer' - '@dkan.metastore.resource_mapper' + - '@dkan.datastore.import_info_list' tags: - { name: drush.command } datastore.purger.commands: diff --git a/modules/datastore/src/Drush.php b/modules/datastore/src/Drush.php index 8099cd1947..ca34b55db4 100755 --- a/modules/datastore/src/Drush.php +++ b/modules/datastore/src/Drush.php @@ -5,6 +5,7 @@ use Consolidation\OutputFormatters\StructuredData\RowsOfFields; use Consolidation\OutputFormatters\StructuredData\UnstructuredListData; use Drupal\common\DataResource; +use Drupal\datastore\Service\Info\ImportInfoList; use Drupal\datastore\Service\ResourceLocalizer; use Drupal\metastore\MetastoreService; use Drupal\datastore\Service\PostImport; @@ -54,6 +55,13 @@ class Drush extends DrushCommands { */ protected ResourceMapper $resourceMapper; + /** + * Import info list service. + * + * @var \Drupal\datastore\Service\Info\ImportInfoList + */ + private ImportInfoList $importInfoList; + /** * Constructor for DkanDatastoreCommands. */ @@ -62,7 +70,8 @@ public function __construct( DatastoreService $datastoreService, PostImport $postImport, ResourceLocalizer $resourceLocalizer, - ResourceMapper $resourceMapper + ResourceMapper $resourceMapper, + ImportInfoList $importInfoList ) { parent::__construct(); $this->metastoreService = $metastoreService; @@ -70,6 +79,7 @@ public function __construct( $this->postImport = $postImport; $this->resourceLocalizer = $resourceLocalizer; $this->resourceMapper = $resourceMapper; + $this->importInfoList = $importInfoList; } /** @@ -147,7 +157,7 @@ public function list($options = [ $status = $options['status']; $uuid_only = $options['uuid-only']; - $list = $this->datastoreService->list(); + $list = $this->importInfoList->buildList(); $rows = []; foreach ($list as $uuid => $item) { $rows[] = $this->createRow($uuid, $item);