Skip to content

[#664] feat(feedback): implement secure feedback download functionality - #665

Merged
wayangalihpratama merged 11 commits into
developfrom
feature/664-add-a-feedback-download-functionality
Mar 25, 2026
Merged

[#664] feat(feedback): implement secure feedback download functionality#665
wayangalihpratama merged 11 commits into
developfrom
feature/664-add-a-feedback-download-functionality

Conversation

@wayangalihpratama

@wayangalihpratama wayangalihpratama commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR implements the 'Download Feedback' functionality for administrators.

Key Changes:

  • Backend:
    • Refactored get_feedback_for_export in backend/db/crud_feedback.py to support multi-ISCO filtering.
    • Created generate_feedback_export utility in backend/util/sheets.py using pandas and xlsxwriter.
    • Added GET /api/feedback/download route in backend/routes/feedback.py with strict ISCO-based access control.
    • Added GET /api/isco_type/mine in backend/routes/isco_type.py to provide user-specific ISCO context.
  • Frontend:
    • Added 'Download Feedback' task to the Admin dashboard in Admin.jsx.
    • Created a dedicated Download Feedback page (DownloadFeedback.jsx) with ISCO and Monitoring Round selectors.
    • Implemented dynamic ISCO filtering based on user permissions.
    • Styled the new page to match the project's admin interface in style.scss.
  • Security:
    • Enforced role-based access control (Secretariat vs. Member Admin) via verify_admin middleware.
    • Validated ISCO permissions on both frontend and backend.
  • Testing:
    • Added comprehensive backend tests in backend/tests/test_111_feedback_download.py (all 185 tests in suite passing).
    • Handled date-suffixed filename verification (feedback_export_YYYYMMDD.xlsx).

Verification:

  • All 185 backend tests passed.
  • Frontend linting passed.

Closes #664


@wayangalihpratama wayangalihpratama linked an issue Mar 25, 2026 that may be closed by this pull request
@wayangalihpratama wayangalihpratama self-assigned this Mar 25, 2026
@coveralls

coveralls commented Mar 25, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 86.285% (+0.1%) from 86.185%
when pulling b61b0d6 on feature/664-add-a-feedback-download-functionality
into ab73c38 on develop.

@wayangalihpratama
wayangalihpratama merged commit a65fa7d into develop Mar 25, 2026
3 checks passed
@wayangalihpratama
wayangalihpratama deleted the feature/664-add-a-feedback-download-functionality branch March 25, 2026 04:32
@wayangalihpratama
wayangalihpratama restored the feature/664-add-a-feedback-download-functionality branch March 25, 2026 04:40
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.

Add a feedback download functionality

2 participants