Skip to content

Commit

Permalink
Merge pull request #1070 from griidc/release/6.12.0
Browse files Browse the repository at this point in the history
Release/6.12.0
  • Loading branch information
praneethpr authored Jan 4, 2022
2 parents 5a02d96 + 3ef232e commit c2902e4
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 281 deletions.
2 changes: 1 addition & 1 deletion assets/js/entry/data-land.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ if (geovizMap.attr('description') !== '' && geovizMap.attr('wkt') === '') {
const imagePath = geovizMap.attr('labimage');
dlmap.addImage(imagePath, 0.4);
dlmap.makeStatic();
} else if (geovizMap.attr('wkt') !== '') {
} else if (geovizMap.attr('wkt')) {
dlmap.addFeatureFromWKT(geovizMap.attr('wkt'), { udi: geovizMap.attr('udi') });
dlmap.gotoAllFeatures();
}
Expand Down
21 changes: 15 additions & 6 deletions assets/js/vue/FileManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,13 @@ export default {
myFileManager = this.$refs.myFileManager;
},
computed: {
getUploadBackgroundImageUrl() {
// eslint-disable-next-line global-require
return require('../../images/dropzone.png');
},
},
methods: {
onSelectionChanged(args) {
const isDirectory = (fileItem) => fileItem.isDirectory;
Expand Down Expand Up @@ -596,6 +603,14 @@ export default {
this.totalFiles = 0;
this.totalFileSize = 0;
this.doneFileSize = 0;
if (this.writeMode) {
const fileManagerContainerElement = document.querySelector('.dx-datagrid.dx-gridbase-container');
if (fileManagerContainerElement) {
fileManagerContainerElement.style.backgroundImage = `url(${this.getUploadBackgroundImageUrl})`;
fileManagerContainerElement.style.backgroundPosition = 'center';
fileManagerContainerElement.style.backgroundRepeat = 'no-repeat';
}
}
},
stopProcess() {
Expand Down Expand Up @@ -736,12 +751,6 @@ export default {
</script>
<style>
.dx-datagrid.dx-gridbase-container {
background-image: url("../../images/dropzone.png");
background-position: center;
background-repeat: no-repeat;
}
.progress-dialog {
align-items: center;
text-align: center;
Expand Down
3 changes: 1 addition & 2 deletions config/packages/prod/messenger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ framework:

routing:
# Slow running Handlers
'App\Message\ProcessFile': async_low
'App\Message\ScanFileForVirus': async_low
'App\Message\ZipDatasetFiles': async_low

# Normal Handlers
'App\Message\DatasetSubmissionFiler': async_normal
'App\Message\RenameFile': async_normal
'App\Message\DeleteFile': async_normal

'App\Message\DeleteDir': async_normal

# DOI Handler
'App\Message\DoiMessage': async_doi
100 changes: 100 additions & 0 deletions src/Command/PelagosReQueueZipCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?php

namespace App\Command;

use App\Entity\Dataset;
use App\Entity\DatasetSubmission;
use App\Message\ZipDatasetFiles;
use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Messenger\MessageBusInterface;

/**
* Command to re-queue zip files for a dataset.
*/
class PelagosReQueueZipCommand extends Command
{
/**
* @var string $defaultName
*/
protected static $defaultName = 'pelagos:re-queue-zip';

/**
* @var string $defaultDescription
*/
protected static $defaultDescription = 'Re-queue zip files by UDI';

/**
* A Doctrine ORM EntityManager instance.
*
* @var EntityManagerInterface $entityManager
*/
protected $entityManager;

/**
* Symfony messenger bus interface.
*
* @var MessageBusInterface $messageBus
*/
protected $messageBus;

/**
* The command configuration.
*
* @return void
*/
protected function configure(): void
{
$this
->setDescription(self::$defaultDescription)
->addArgument('udi', InputArgument::REQUIRED, 'What is the UDI of the dataset?');
;
}

/**
* Class constructor for dependency injection.
*
* @param EntityManagerInterface $entityManager A Doctrine EntityManager.
* @param MessageBusInterface $messageBus Symfony messenger bus interface.
*/
public function __construct(EntityManagerInterface $entityManager, MessageBusInterface $messageBus)
{
$this->entityManager = $entityManager;
$this->messageBus = $messageBus;
parent::__construct();
}

/**
* Symfony command execute section.
*
* @param InputInterface $input Required by Command.
* @param OutputInterface $output Required by Command.
*
* @return integer Return code.
*/
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output);
$udi = $input->getArgument('udi');
$dataset = $this->entityManager->getRepository(Dataset::class)->findOneBy(array(
'udi' => $udi));

if ($dataset) {
$datasetSubmission = $dataset->getLatestDatasetReview();
if ($datasetSubmission instanceof DatasetSubmission) {
$zipFiles = new ZipDatasetFiles($datasetSubmission->getId());
$this->messageBus->dispatch($zipFiles);
}
} else {
$io->error('No such dataset exists');
}

$io->success('Zip files re-queued for the dataset');

return 0;
}
}
37 changes: 0 additions & 37 deletions src/Message/ProcessFile.php

This file was deleted.

21 changes: 1 addition & 20 deletions src/Message/ZipDatasetFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,6 @@
*/
class ZipDatasetFiles
{
/**
* The file IDs of the to be zipped file.
*
* @var array
*/
private $fileIds;

/**
* The datasetSubmission Id it is associated.
*
Expand All @@ -24,25 +17,13 @@ class ZipDatasetFiles
/**
* Constructor.
*
* @param array $fileIds The file IDs of the to be zipped file.
* @param integer $datasetSubmissionId DatasetSubmission Id it is associated with.
*/
public function __construct(array $fileIds, int $datasetSubmissionId)
public function __construct(int $datasetSubmissionId)
{
$this->fileIds = $fileIds;
$this->datasetSubmissionId = $datasetSubmissionId;
}

/**
* The file IDs getter.
*
* @return array
*/
public function getFileIds(): array
{
return $this->fileIds;
}

/**
* Getter for datasetSubmissionId.
*
Expand Down
Loading

0 comments on commit c2902e4

Please sign in to comment.