mirror of
https://github.com/code-rhapsodie/ibexa-dataflow-bundle.git
synced 2026-03-24 06:32:07 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ece645267 | ||
|
|
5180108598 |
@@ -1,3 +1,9 @@
|
||||
# Version 5.2.1
|
||||
* Fixed datepicker in oneshot modal
|
||||
|
||||
# Version 5.2.0
|
||||
* Added Dashboard tab
|
||||
|
||||
# Version 5.1.1
|
||||
* Add branding label
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class CodeRhapsodieIbexaDataflowBundle extends Bundle
|
||||
{
|
||||
public const VERSION = '5.1.1';
|
||||
public const VERSION = '5.2.0';
|
||||
public const PRODUCT_NAME = 'ibexadataflow';
|
||||
|
||||
protected $name = 'CodeRhapsodieIbexaDataflowBundle';
|
||||
|
||||
@@ -140,4 +140,13 @@ class DashboardController extends Controller
|
||||
|
||||
return $pager;
|
||||
}
|
||||
|
||||
public function dashboard(): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted(new Attribute('ibexa_dataflow', 'view'));
|
||||
|
||||
return $this->render('@ibexadesign/ibexa_dataflow/Dashboard/dashboard.html.twig', [
|
||||
'jobs' => $this->jobGateway->getListPendindOrRunning(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,5 +54,15 @@ final class JobGateway
|
||||
{
|
||||
$this->jobRepository->save($job);
|
||||
}
|
||||
|
||||
public function getListPendindOrRunning(): array
|
||||
{
|
||||
$qb = $this->jobRepository->createQueryBuilder('w');
|
||||
return $qb->andWhere($qb->expr()->in('w.status', ':status'))
|
||||
->setParameter('status', implode(',',[Job::STATUS_RUNNING, Job::STATUS_PENDING, Job::STATUS_QUEUED]))
|
||||
->orderBy('w.requested_date', 'ASC')
|
||||
->execute()
|
||||
->fetchAllAssociative();
|
||||
}
|
||||
}
|
||||
class_alias(JobGateway::class, 'CodeRhapsodie\EzDataflowBundle\Gateway\JobGateway');
|
||||
|
||||
@@ -129,6 +129,14 @@ services:
|
||||
arguments:
|
||||
$jobRepository: '@CodeRhapsodie\DataflowBundle\Repository\JobRepository'
|
||||
|
||||
CodeRhapsodie\IbexaDataflowBundle\Tab\DashboardTab:
|
||||
parent: Ibexa\Contracts\AdminUi\Tab\AbstractTab
|
||||
public: false
|
||||
arguments:
|
||||
$httpKernelRuntime: '@twig.runtime.httpkernel'
|
||||
tags:
|
||||
- { name: ibexa.admin_ui.tab, group: coderhapsodie-ibexa_dataflow }
|
||||
|
||||
CodeRhapsodie\IbexaDataflowBundle\Tab\RepeatingTab:
|
||||
parent: Ibexa\Contracts\AdminUi\Tab\AbstractTab
|
||||
public: false
|
||||
|
||||
@@ -85,3 +85,5 @@ coderhapsodie.ibexa_dataflow.workflow.edit.error: 'An error occurred during the
|
||||
coderhapsodie.ibexa_dataflow.notfound: 'Requested data is not found'
|
||||
coderhapsodie.ibexa_dataflow.powered_by: 'Powered by'
|
||||
coderhapsodie.ibexa_dataflow.made_by: 'Made by'
|
||||
coderhapsodie.ibexa_dataflow.dashboard: Dashboard
|
||||
coderhapsodie.ibexa_dataflow.dashboard.title: Running or waiting tasks
|
||||
@@ -83,3 +83,5 @@ coderhapsodie.ibexa_dataflow.workflow.edit.error: 'Une erreur est survenue lors
|
||||
coderhapsodie.ibexa_dataflow.notfound: 'Les données demandées sont introuvables'
|
||||
coderhapsodie.ibexa_dataflow.powered_by: 'Propulsé par'
|
||||
coderhapsodie.ibexa_dataflow.made_by: 'Fabriqué par'
|
||||
coderhapsodie.ibexa_dataflow.dashboard: Dashboard
|
||||
coderhapsodie.ibexa_dataflow.dashboard.title: Tâches en cours ou en attente
|
||||
@@ -0,0 +1,5 @@
|
||||
{%- block content -%}
|
||||
{% include '@ibexadesign/ibexa_dataflow/parts/tab/dashboard_list.html.twig' with {
|
||||
identifier: 'ibexa_dataflow_schedule_dashboard_results',
|
||||
} %}
|
||||
{%- endblock -%}
|
||||
@@ -61,7 +61,7 @@
|
||||
const oneShotModal = document.getElementById('modal-new-oneshot');
|
||||
oneShotModal.querySelector('#create_oneshot_label').value = '';
|
||||
oneShotModal.querySelector('#create_oneshot_options').value = '';
|
||||
oneShotModal.querySelector('.flatpickr.flatpickr-input').parentNode.parentNode.ibexaInstance.flatpickrInstance.setDate(new Date(), true);
|
||||
oneShotModal.querySelector('.flatpickr.flatpickr-input').parentNode.parentNode.parentNode.ibexaInstance.flatpickrInstance.setDate(new Date(), true);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
{% set id = identifier|default('ibexa_dataflow_history_results') %}
|
||||
|
||||
{% import '@ibexadesign/ibexa_dataflow/macros.twig' as macros %}
|
||||
|
||||
<div id="loading_{{ id }}" class="text-center" hidden>
|
||||
<svg class="ez-icon ez-icon--extra-large">
|
||||
<use xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xlink:href="{{ ibexa_icon_path('spinner') }}"></use>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<div id="{{ id }}" data-loader="loading_{{ id }}" class="history-details-aware">
|
||||
|
||||
{% set body_rows = [] %}
|
||||
|
||||
{% for job in jobs %}
|
||||
{% set body_row_cols = [] %}
|
||||
{% set body_row_cols = body_row_cols|merge([
|
||||
{content: job.label},
|
||||
{content: date(job.requested_date)|ibexa_short_datetime},
|
||||
{content: job.start_time ? date(job.start_time)|ibexa_short_datetime : '—'},
|
||||
{content: macros.translateStatus(job.status)},
|
||||
]) %}
|
||||
|
||||
|
||||
{% set body_rows = body_rows|merge([{ cols: body_row_cols }]) %}
|
||||
{% endfor %}
|
||||
|
||||
{% embed '@ibexadesign/ui/component/table/table.html.twig' with {
|
||||
headline: 'coderhapsodie.ibexa_dataflow.dashboard.title'|trans,
|
||||
head_cols: [
|
||||
{ content: 'coderhapsodie.ibexa_dataflow.history.list.name'|trans },
|
||||
{ content: 'coderhapsodie.ibexa_dataflow.history.list.request'|trans },
|
||||
{ content: 'coderhapsodie.ibexa_dataflow.history.list.start'|trans },
|
||||
{ content: 'coderhapsodie.ibexa_dataflow.history.list.status'|trans },
|
||||
{ },
|
||||
],
|
||||
body_rows,
|
||||
empty_table_info_text: 'coderhapsodie.ibexa_dataflow.history.list.empty'|trans,
|
||||
} %}
|
||||
{% endembed %}
|
||||
</div>
|
||||
@@ -148,7 +148,7 @@
|
||||
oneShotModal.querySelector('#create_oneshot_label').value = node.querySelector('#create_oneshot_label').value;
|
||||
oneShotModal.querySelector('#create_oneshot_options').value = node.querySelector('#create_oneshot_options').value;
|
||||
oneShotModal.querySelector('.ibexa-dropdown').ibexaInstance.selectOption(node.querySelector('#create_oneshot_dataflowType').value)
|
||||
oneShotModal.querySelector('.flatpickr.flatpickr-input').parentNode.parentNode.ibexaInstance.flatpickrInstance.setDate(new Date(), true);
|
||||
oneShotModal.querySelector('.flatpickr.flatpickr-input').parentNode.parentNode.parentNode.ibexaInstance.flatpickrInstance.setDate(new Date(), true);
|
||||
})
|
||||
.then(() => {
|
||||
bootstrap.Tab.getOrCreateInstance(document.querySelector('#ibexa-tab-label-coderhapsodie-ibexa_dataflow-code-rhapsodie-ibexa_dataflow-oneshot')).show()
|
||||
|
||||
45
src/Tab/DashboardTab.php
Normal file
45
src/Tab/DashboardTab.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace CodeRhapsodie\IbexaDataflowBundle\Tab;
|
||||
|
||||
use CodeRhapsodie\IbexaDataflowBundle\Controller\DashboardController;
|
||||
use Ibexa\Contracts\AdminUi\Tab\AbstractControllerBasedTab;
|
||||
use Ibexa\Contracts\AdminUi\Tab\OrderedTabInterface;
|
||||
use Symfony\Component\HttpKernel\Controller\ControllerReference;
|
||||
|
||||
class DashboardTab extends AbstractControllerBasedTab implements OrderedTabInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getControllerReference(array $parameters): ControllerReference
|
||||
{
|
||||
return new ControllerReference(DashboardController::class.'::dashboard');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getOrder(): int
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getIdentifier(): string
|
||||
{
|
||||
return 'code-rhapsodie-ibexa_dataflow-dashboard';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->translator->trans('coderhapsodie.ibexa_dataflow.dashboard');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user