Skip to content

#4107 BOM inline editing#4141

Open
cielbellerose wants to merge 12 commits intodevelopfrom
#4107-maintenance-bom-inline-editing
Open

#4107 BOM inline editing#4141
cielbellerose wants to merge 12 commits intodevelopfrom
#4107-maintenance-bom-inline-editing

Conversation

@cielbellerose
Copy link
Copy Markdown
Contributor

@cielbellerose cielbellerose commented Apr 9, 2026

Changes

BOM inline editing

  • All fields except Subtotal can be edited inline
  • Subtotal updates when quantity or price change

Notes

Removed the 'None' special handling for PDM file name to make inline editing more intuitive (None vs empty it was just a bit odd to handle inline)

Test Cases

  • Subtotal updates when quantity or price change
  • price & quantity cannot be negative
  • name trimmed cannot be empty
  • material type is required, no empty dropdown option

Screenshots

Untitled.mov
Screenshot 2026-04-08 at 8 30 49 PM Screenshot 2026-04-11 at 9 09 24 AM Screenshot 2026-04-11 at 9 10 13 AM Screenshot 2026-04-11 at 9 10 29 AM Screenshot 2026-04-11 at 9 45 13 AM

Checklist

It can be helpful to check the Checks and Files changed tabs.
Please review the contributor guide and reach out to your Tech Lead if anything is unclear.
Please request reviewers and ping on slack only after you've gone through this whole checklist.

  • All commits are tagged with the ticket number
  • No linting errors / newline at end of file warnings
  • All code follows repository-configured prettier formatting
  • No merge conflicts
  • All checks passing
  • Screenshots of UI changes (see Screenshots section)
  • Remove any non-applicable sections of this template
  • Assign the PR to yourself
  • No yarn.lock changes (unless dependencies have changed)
  • Request reviewers & ping on Slack
  • PR is linked to the ticket (fill in the closes line below)

Closes #4107

@cielbellerose cielbellerose linked an issue Apr 9, 2026 that may be closed by this pull request
3 tasks
@cielbellerose cielbellerose self-assigned this Apr 9, 2026
@cielbellerose cielbellerose marked this pull request as ready for review April 11, 2026 14:12
@cielbellerose cielbellerose requested review from Steph375, chpy04 and wavehassman and removed request for Steph375, chpy04 and wavehassman April 11, 2026 14:23
Copy link
Copy Markdown
Contributor

@wavehassman wavehassman left a comment

Choose a reason for hiding this comment

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

Great job Kinsey! I'm fine with taking subtotal out of the backend endpoint and calculating it in the service function, but if we're going to do that, I want to take it out everywhere in the frontend and other places. If someone were to go back later, it would be pretty confusing to have it in some places but not others.

Comment thread src/backend/src/controllers/projects.controllers.ts
manufacturer = await BillOfMaterialsService.getSingleManufacturerWithQueryArgs(manufacturerName, organization);
}

// recalculate subtotal on edits
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if we're going to take subtotal out of the endpoints in the backend, we should take it out of the frontend hooks too since now it's being passed and then dropped

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still relevant I think?


const processRowUpdate = async (newRow: BomRow, oldRow: BomRow): Promise<BomRow> => {
// assemblies are not editable
if (String(newRow.id).startsWith('assembly')) return newRow;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

id is already a string in the BomRow type so casting it is unecessary

renderCell: renderStatusBOM,
renderCell: (params) => {
// assemblies are not editable
if (!params.value || String(params.row.id).startsWith('assembly')) return null;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same thing here

@cielbellerose cielbellerose changed the title #4107 inline status dropdown #4107 BOM inline editing Apr 14, 2026
const { mutateAsync: deleteAssemblyMutateAsync, isLoading: deleteAssemblyIsLoading } = useDeleteAssembly(project.wbsNum);
const { mutateAsync: assignMaterialToAssembly } = useAssignMaterialToAssembly();
const { mutateAsync: editMaterial } = useEditMaterialById(project.wbsNum);
const { data: materialTypes } = useGetAllMaterialTypes();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need isloading iserror and error on both this and getAllManufacturers

Comment thread src/frontend/src/utils/bom.utils.ts Outdated
quantity: material.quantity + (material.unitName ? ' ' + material.unitName : ''),
quantityRaw: material.quantity !== undefined ? Number(material.quantity) : undefined,
price: material.price !== undefined ? `$${centsToDollar(material.price)}` : '',
priceRaw: material.price !== undefined ? material.price / 100 : undefined,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

quantityRaw and priceRaw feels very very weird, why do we need these?

if (!perms) throw new AccessDeniedException('create materials');

const computedSubtotal =
price !== undefined && quantity !== undefined ? Math.round(price * Number(quantity)) : undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this not what Wave was talking about with removing from backend everywhere

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

she mentioned not passing it to the backend and just calculating it in the service function. it is also still in MaterialFormView in the frontend but thats bc the modal shows a preview of what the subtotal will be before submitting

manufacturer = await BillOfMaterialsService.getSingleManufacturerWithQueryArgs(manufacturerName, organization);
}

// recalculate subtotal on edits
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Still relevant I think?

@cielbellerose cielbellerose requested a review from chpy04 April 18, 2026 18:53
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.

[Maintenance] - BOM Inline Editing

3 participants