bcgov / bcgov/lcfs

LCFS - Download fuel codes

Open
#438 1 comment 0 reactions 0 assignees View on GitHub
Medium Story
Dominant language
Python
Stars
6
Forks
6
Avg merge
2d 4h
Merged PRs (30d)
87

Description

**Description:**
Enable the ability to download Fuel Code information from the main Fuel Code page into an Excel spreadsheet. Includes the following elements:

- IDIR users only
- Download button (see wireframe)
- User information to download includes the full data set: Prefix, Fuel code, Company, Carbon intensity, Application date, Approval date, Effective date, Expiry date, Fuel, Feedstock, Feedstock location, Feedstock misc., Fuel production facility Location, Facility nameplate capacity, Feedstock transport mode, Finished fuel transport mode, Former company, Last updated, Notes.
- File type = .xls
- Workbook name format: LCFS-fuel_codes-YYYY-MM-DD.xls, where YYYY-MM-DD is the day the file was downloaded
- Worksheet name: LCFS Fuel Codes
- Spreadsheet columns should be formatted to give adequate spacing for the information displayed
- The button label switches to "Downloading..." after the user clicks on the button and the sheet is being downloaded (loading). The button then switches back to the regular label after it has downloaded.

**Wireframe:**
https://preview.uxpin.com/59145260c7d8cc48969ac79401cc03d84843c3d9#/pages/164563748/simulate/sitemap

**Purpose and benefit to user:**

Allows user to extract fuel code data in an Excel format for other uses outside of the LCFS portal.

**Acceptance Criteria:**

- [ ] Given I am an IDIR user, when I access the main Fuel Code page, then I should see a download button enabled.
- [ ] Given I am an IDIR user, when I click the download button on the main Fuel Code page, then the button label should switch to "Downloading..." and the Excel file (LCFS-fuel_codes-YYYY-MM-DD.xls) should begin to download.
- [ ] Given I am an IDIR user, when the Excel file download is complete, then the button label should revert back to its original state and the Excel file should contain all specified fields with data formatted correctly.

**Development Checklist:**
- [ ] To implement this ticket, there is an Excel sheet generator available at `backend/lcfs/utils/spreadsheet_builder.py`.
- [ ] For the download button component, you can use `frontend/src/components/DownloadButton.jsx`.
- [ ] You can find an example in Organization List.

**Notes:**

Contributor guide

Open the contributing guide

Research direction

Start with backend/lcfs/utils/spreadsheet_builder.py and the frontend/src/components/DownloadButton.jsx component, then review the Organization List example. Trace the main Fuel Code page and its IDIR-only access path. Done means the button shows the loading state, downloads the correctly named .xls workbook with the specified worksheet, fields, spacing, and formatting, then returns to its original label.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
full-stack
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.