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

ExportAll action doesn’t use LoadDelegate #3313

Closed
KremnevDmitry opened this issue May 30, 2024 · 1 comment · Fixed by #3388
Closed

ExportAll action doesn’t use LoadDelegate #3313

KremnevDmitry opened this issue May 30, 2024 · 1 comment · Fixed by #3388
Assignees
Labels
in: flowui size: S type: bug Something isn't working
Milestone

Comments

@KremnevDmitry
Copy link
Contributor

Environment

Jmix version: 2.3.999-SNAPSHOT

Bug Description

If you click the option to ExportAll in the Excel or JSON export action using DTO entity, an empty list will be exported.

The presence of a load delegate for the collection loader is ignored here:

List<?> entities = dataManager.loadList(loadContext);
for (Object entity : entities) {
EntityExportContext entityExportContext = new EntityExportContext(entity, ++rowNumber);
proceedToExport = exportedEntityVisitor.visitEntity(entityExportContext);
if (!proceedToExport) {
break;
}
}

We should use the same approach as in the collection loader:

if (delegate == null) {
list = dataManager.loadList(loadContext);
} else {
list = delegate.apply(loadContext);
if (list == null) {
return false;
}
}

Steps To Reproduce

  1. Define load delegate for the CollectionLoader
  2. Try to export data using Grid Export Actions add-on

Current Behavior

An empty list will be exported.

Expected Behavior

All data will be exported.

@KremnevDmitry KremnevDmitry added type: bug Something isn't working in: flowui triage Issue is waiting for triage labels May 30, 2024
@gorbunkov gorbunkov added size: S and removed triage Issue is waiting for triage labels May 31, 2024
@ilushaaa ilushaaa linked a pull request Jun 15, 2024 that will close this issue
ilushaaa added a commit that referenced this issue Jun 15, 2024
@SergeiAksenov2
Copy link

Tested on:

  1. Jmix version: 2.3.999-SNAPSHOT
    Jmix Studio plugin version: 2.3.SNAPSHOT6490-233
    IntelliJ version: IntelliJ IDEA 2023.3.7 (Community Edition)
  2. Jmix version: 2.3.999-SNAPSHOT
    Jmix Studio plugin version: 2.3.SNAPSHOT6489-241
    IntelliJ version: IntelliJ IDEA 2024.1.3 (Community Edition)

Added load delegate with condition by entity nameю And this result collection entered to the excel export. Ok.

@gorbunkov gorbunkov added this to the 2.3.0 milestone Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: flowui size: S type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants