Skip to content

Commit

Permalink
Merge branch '5.9' into feat/api_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidmattei authored Sep 11, 2023
2 parents 53f6700 + 97a1e5f commit a36bf69
Show file tree
Hide file tree
Showing 37 changed files with 61,204 additions and 60,980 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{%- use '@EMSAdminUI/bootstrap5/form/forms.html.twig' -%}
{% trans_default_domain 'EMSCoreBundle' %}


<div class="table-responsive">
<table class="table table-condensed table-striped" data-datatable="{{ datatable.frontendOptions|json_encode|e('html_attr') }}">
<thead>
<table class="table table-condensed table-striped" data-datatable="{{ datatable.frontendOptions|json_encode|e('html_attr') }}" style="width: 100%;">
<thead>
<tr role="row">
{% if datatable.supportsTableActions %}
<th class="fit" data-orderable="false" data-name="_checkbox">
Expand All @@ -25,8 +23,8 @@
<th class="nowrap" data-orderable="false">{{ 'table.index.column.actions'|trans }}</th>
{% endif %}
</tr>
</thead>
<tbody>
</thead>
<tbody>
{% for line in datatable %}
<tr>
{% if datatable.supportsTableActions %}
Expand All @@ -44,13 +42,12 @@
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</tbody>
</table>
{% if datatable.supportsTableActions %}
<div class="btn-group">
{% for action in datatable.tableActions %}
{{ form_widget(attribute(form, action.name)) }}
{% endfor %}
</div>
{% endif %}
{% endif %}
8 changes: 7 additions & 1 deletion EMS/common-bundle/src/Common/File/FileReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@

use EMS\CommonBundle\Contracts\File\FileReaderInterface;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Csv;
use PhpOffice\PhpSpreadsheet\Reader\Html;
use PhpOffice\PhpSpreadsheet\Reader\Slk;

final class FileReader implements FileReaderInterface
{
/**
* {@inheritDoc}
*/
public function getData(string $filename, bool $skipFirstRow = false): array
public function getData(string $filename, bool $skipFirstRow = false, string $encoding = null): array
{
$reader = IOFactory::createReaderForFile($filename);
if (($reader instanceof Csv || $reader instanceof Html || $reader instanceof Slk) && null !== $encoding) {
$reader->setInputEncoding($encoding);
}

$data = $reader->load($filename)->getActiveSheet()->toArray();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ interface FileReaderInterface
/**
* @return array<mixed>
*/
public function getData(string $filename, bool $skipFirstRow = false): array;
public function getData(string $filename, bool $skipFirstRow = false, string $encoding = null): array;
}
4 changes: 4 additions & 0 deletions EMS/core-bundle/assets/css/_ems.scss
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,8 @@ div.core-js-progress {
text-align: left;

& i { padding-right: 10px;}
}

div.dataTables_scroll {
margin-bottom: 10px;
}
4 changes: 3 additions & 1 deletion EMS/core-bundle/src/Form/Data/TableAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ public function getFrontendOptions(): array
++$counter;
}
}
$options = [];
$options = [
'scrollX' => true,
];

if (null !== $columnIndex) {
$options['order'] = [[$columnIndex, $this->orderDirection]];
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit a36bf69

Please sign in to comment.