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

Remove the ability to store the PDF reports into the filesystem #6495

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Mar 11, 2024

Description

This pull request removes the ability to store the PDF reports in the filesystem of the plugin host.

Changes:

  • Remove the ability to store the PDF reports in the filesystem, now it will be directly downloaded to the client
  • Remove Reporting application
  • Change the DOM selector to get the screenshots of the visualizations
  • Replace the communication of dashboards with the Generate report button through the Redux store
  • Remove unused ReportingService (AngularJS)
  • Remove the migration task of the PDF reports directory name
  • Remove constants related to the path of PDF reports in the main and core plugin

Warnings:

  • In upgrades, the previously generated reports will be inaccesible from the UI. They can be accessed by the filesystem.

Issues Resolved

#6487

Evidence

[Provide screenshots or videos to prove this PR solves the issues]

Test

[Provide instructions to test this PR]

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

…client instead of storing into the filesystem of the backend

- Generation of PDF reports downloads the file to the client instead of storing into the filesystem of the backend
- Refactor the Printer.print service to use a Buffer
- Create a frontend service to save the file from the API response
- Refactor the ReportingService to use the new generic service to save
  the file from the response
- Adapt the endpoints that generate reports to return the file
  - POST /reports/modules/{moduleID}
  - POST /reports/groups/{groupID}
  - POST /reports/agents/{agentID}
  - POST /reports/agents/{agentID}/inventory
- Remove reporting application
- Remove render components files
…F reports files

- Remove API endpoints related to the management of PDF reports files
  - GET /reports
  - GET /reports/{name}
  - DELETE /reports
- Replace taking screenshot of visualuzations in startVis2Png method
- Communicate dashboard with the Generate report button though Redux
  - Create reducer
  - Create action creator
  - Adapt the Generate report button
  - Remove disabledReport property comming from old dashboard rendering
- Refactor the method to add the visualizations to the PDF report in the
  Printer service
@Desvelao Desvelao self-assigned this Mar 11, 2024
@Desvelao Desvelao linked an issue Mar 11, 2024 that may be closed by this pull request
6 tasks
…o enhancement/6487-remove-ability-store-pdf-reports-filesystem
- Remove service to migrate the direcotry name of the PDF reports stored
  in the filesystem
- Remove constants related to PDF report paths
@Desvelao Desvelao changed the title Remove the ablity to store the PDF reports into the filesystem Remove the ability to store the PDF reports into the filesystem Mar 25, 2024
@Desvelao
Copy link
Member Author

We will close this pull request due to this feature needs to be discussed and moved to a major version because it is a breaking change.

@Desvelao Desvelao closed this Mar 27, 2024
@Desvelao Desvelao reopened this Mar 27, 2024
@Desvelao Desvelao closed this Mar 27, 2024
Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 28.8% ( 284 / 986 )
Branches 26.22% ( 107 / 408 )
Functions 26.87% ( 86 / 320 )
Lines 28.54% ( 276 / 967 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 11.95% ( 4117 / 34440 )
Branches 7.76% ( 1762 / 22681 )
Functions 10.64% ( 870 / 8174 )
Lines 12.13% ( 4006 / 33002 )

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

Successfully merging this pull request may close these issues.

Remove the ablity to store the PDF reports into the filesystem
1 participant