Skip to content

Commit f146d88

Browse files
committed
Added additional filters to attachment datatable
1 parent 48be9a8 commit f146d88

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

src/DataTables/Filters/AttachmentFilter.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ class AttachmentFilter implements FilterInterface
4545
public readonly DateTimeConstraint $lastModified;
4646
public readonly DateTimeConstraint $addedDate;
4747

48+
public readonly TextConstraint $originalFileName;
49+
public readonly TextConstraint $externalLink;
50+
4851

4952
public function __construct(NodesListBuilder $nodesListBuilder)
5053
{
@@ -55,6 +58,9 @@ public function __construct(NodesListBuilder $nodesListBuilder)
5558
$this->lastModified = new DateTimeConstraint('attachment.lastModified');
5659
$this->addedDate = new DateTimeConstraint('attachment.addedDate');
5760
$this->showInTable = new BooleanConstraint('attachment.show_in_table');
61+
$this->originalFileName = new TextConstraint('attachment.original_filename');
62+
$this->externalLink = new TextConstraint('attachment.external_path');
63+
5864
}
5965

6066
public function apply(QueryBuilder $queryBuilder): void

src/Form/Filters/AttachmentFilterType.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,15 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
100100
'label' => 'attachment.edit.show_in_table'
101101
]);
102102

103+
$builder->add('originalFileName', TextConstraintType::class, [
104+
'label' => 'attachment.file_name'
105+
]);
106+
107+
$builder->add('externalLink', TextConstraintType::class, [
108+
'label' => 'attachment.table.external_link'
109+
]);
110+
111+
103112
$builder->add('lastModified', DateTimeConstraintType::class, [
104113
'label' => 'lastModified'
105114
]);

templates/attachment_list.html.twig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
{{ form_row(filterForm.attachmentType) }}
3535
{{ form_row(filterForm.targetType) }}
3636
{{ form_row(filterForm.showInTable) }}
37+
{{ form_row(filterForm.originalFileName) }}
38+
{{ form_row(filterForm.externalLink) }}
3739
{{ form_row(filterForm.lastModified) }}
3840
{{ form_row(filterForm.addedDate) }}
3941
{{ form_row(filterForm.dbId) }}

0 commit comments

Comments
 (0)