Skip to content

Commit

Permalink
make it simpler to increase max row and file size
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpapst committed Jul 19, 2024
1 parent d251f46 commit c85b79e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 2.14.0 (unreleased)

Compatibility: requires minimum Kimai 2.17.0

- Make it simpler to increase max row and file size

## Version 2.13.0

Compatibility: requires minimum Kimai 2.17.0
Expand Down
4 changes: 3 additions & 1 deletion Form/ImportForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

namespace KimaiPlugin\ImportBundle\Form;

use KimaiPlugin\ImportBundle\Importer\ImporterService;
use KimaiPlugin\ImportBundle\Model\ImportModel;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
Expand Down Expand Up @@ -49,7 +50,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
'constraints' => [
new NotNull(),
new File([
'maxSize' => '1024k',
'maxSize' => $options['max_file_size'],
])
],
])
Expand All @@ -64,6 +65,7 @@ public function configureOptions(OptionsResolver $resolver): void
'csrf_field_name' => '_token',
'csrf_token_id' => 'import_csv_data',
'method' => 'POST',
'max_file_size' => ImporterService::MAX_FILESIZE,
]);
}
}
1 change: 1 addition & 0 deletions Importer/ImporterService.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
final class ImporterService
{
public const MAX_ROWS = 1000;
public const MAX_FILESIZE = '1024k';

/**
* @param iterable<ImporterInterface> $importer
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Import data from CSV files via Web UI",
"homepage": "https://www.kimai.org/store/keleo-importer-bundle.html",
"type": "kimai-plugin",
"version": "2.13.0",
"version": "2.14.0",
"keywords": [
"kimai",
"kimai-plugin"
Expand Down

0 comments on commit c85b79e

Please sign in to comment.