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

Fix: LCFS - BUG AG Grid copy and paste function for Fuel codes table … #1420

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

prv-proton
Copy link
Collaborator

@prv-proton prv-proton commented Dec 10, 2024

…on IDIR side not functioning #1302

  • fix for create fuel code function
  • for suffix increment version once the subversion reaches 9
  • raise ValueErrors when invalid data is passed for save and propagate this error back to the user.
  • In the action Tooltip renderer show validation failure message.
  • fix delete endpoint for fuel codes.
  • create separate paste handler for fuel code.
  • Fuel field name is changed to FuelType

Copy link

github-actions bot commented Dec 10, 2024

Backend Test Results

449 tests  ±0   449 ✅ ±0   1m 48s ⏱️ +2s
  1 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 5544e39. ± Comparison against base commit e3b3a67.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Dec 10, 2024

Frontend Test Results

  1 files  ±0  115 suites  ±0   37s ⏱️ ±0s
385 tests ±0  365 ✅ ±0  20 💤 ±0  0 ❌ ±0 
387 runs  ±0  367 ✅ ±0  20 💤 ±0  0 ❌ ±0 

Results for commit 5544e39. ± Comparison against base commit e3b3a67.

♻️ This comment has been updated with latest results.

prv-proton added 2 commits December 10, 2024 04:16
@@ -229,10 +231,12 @@ const AddEditFuelCodeBase = () => {
const errMsg = `Error updating row: ${
fieldLabels.length === 1 ? fieldLabels[0] : ''
} ${message}`

updatedData.validationMsg = errMsg
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and received 422, when processing the date fields. They are not in correct format. Then, needed to give a proper format. Something like this:


      // Format date fields to ISO 8601
      const formattedData = { ...params.node.data };
      dateFields.forEach((field) => {
        if (formattedData[field]) {
          const date = new Date(formattedData[field]);
          if (!isNaN(date.getTime())) {
            formattedData[field] = date.toISOString().split('T')[0]; // Keep only the YYYY-MM-DD part
          }
        }
      });
      let updatedData = Object.entries(formattedData)

After that the request passes the schema validation, it can start executing create_fuel_code. However, an error is raised: ValueError: Invalid transport mode: Truck

Copy link
Collaborator Author

@prv-proton prv-proton Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review @areyeslo ,

  • yes, from excel , date needs to be copied in proper format otherwise it throws error.
  • Truck is no longer among the valid transport mode in the database. hence value error.

@areyeslo areyeslo requested review from areyeslo and removed request for areyeslo December 10, 2024 17:29
@prv-proton prv-proton requested a review from areyeslo December 10, 2024 19:21
Copy link
Collaborator

@areyeslo areyeslo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for adding support for different date types.

@prv-proton prv-proton merged commit 625d24c into release-0.2.0 Dec 10, 2024
9 checks passed
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.

2 participants