Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter Data and export #283

Open
plozmun opened this issue Feb 25, 2021 · 4 comments
Open

Filter Data and export #283

plozmun opened this issue Feb 25, 2021 · 4 comments

Comments

@plozmun
Copy link
Contributor

plozmun commented Feb 25, 2021

Q A
Bug? no
New Feature? yes
Bundle Version -
Sulu Version 2.1
Browser Version All

Actual Behavior

Currently if you have a lot of contacts on a daily basis and you want to make a daily export you have to download everything for filtering. You can receive it by email but many users prefer direct download.

Expected Behavior

Add filtering possibilities like other sulu entities in order to be able to select more specific filtering.

@alexander-schranz
Copy link
Member

Which specific filters for the dynamic list data do you want to be implemented to improve your workflow?

@plozmun
Copy link
Contributor Author

plozmun commented Feb 25, 2021

Maybe only be able to filter by "created at" which is not a dynamic field.

@niklasnatter
Copy link
Contributor

Like the idea! If I am not mistaken, this should be quite easy to do by adding the respective filters in the list-configuration 🙂

<case-property name="locale">
<field>
<field-name>locale</field-name>
<entity-name>Sulu\Bundle\FormBundle\Entity\FormTranslation</entity-name>
<joins ref="translation"/>
</field>
<field>
<field-name>defaultLocale</field-name>
<entity-name>Sulu\Bundle\FormBundle\Entity\Form</entity-name>
</field>
</case-property>
<property
name="changed"
translation="sulu_admin.changed"
visibility="yes"
type="datetime">
<field-name>changed</field-name>
<entity-name>Sulu\Bundle\FormBundle\Entity\FormTranslation</entity-name>
<joins ref="translation"/>
</property>
<property
name="created"
translation="sulu_admin.created"
visibility="no"
type="datetime">
<field-name>created</field-name>
<entity-name>Sulu\Bundle\FormBundle\Entity\FormTranslation</entity-name>
<joins ref="translation"/>
</property>
</properties>

@alexander-schranz
Copy link
Member

alexander-schranz commented Feb 26, 2021

@nnatter the form data (dynamic entity) list metadata are created in PHP as they have no static structure. I think the filter would need to be added here then:

$fieldDescriptors = $this->dynamicListFactory->getFieldDescriptors($form, $locale);
foreach ($fieldDescriptors as $fieldDescriptor) {
$field = new FieldMetadata($fieldDescriptor->getName());
$field->setLabel($this->translator->trans($fieldDescriptor->getTranslation(), [], 'admin', $locale));
$field->setType($fieldDescriptor->getType());
$field->setVisibility($fieldDescriptor->getVisibility());
$field->setSortable($fieldDescriptor->getSortable());
$list->addField($field);
}

Also the Controller doesn't use the ListBuilder so the filter would need to be implemented there also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants