Skip to content

Feat/material relations fe#1113

Open
OlgaIvkovic wants to merge 6 commits intoeclipse-tractusx:feat/bill-of-materialsfrom
achtzig20:feat/material-relations-fe
Open

Feat/material relations fe#1113
OlgaIvkovic wants to merge 6 commits intoeclipse-tractusx:feat/bill-of-materialsfrom
achtzig20:feat/material-relations-fe

Conversation

@OlgaIvkovic
Copy link
Contributor

@OlgaIvkovic OlgaIvkovic commented Mar 9, 2026

Description

  • Frontend implementation of modal for inserting material relations
  • Frontend implementation table of viewing existing material relations

Resolves #1086

Pre-review checks

Please ensure to do as many of the following checks as possible, before asking for committer review:

  • DEPENDENCIES are up-to-date. Dash license tool. Committers can open IP issues for restricted libs.
  • Copyright and license header are present on all affected files (TRG 7.02
  • Documentation Notice are present on all affected files (TRG 7.07)
  • If helm chart has been changed, the chart version has been bumped to either next major, minor or patch level (compared to released chart).
  • Changelog updated (changelog.md) with PR reference and brief summary.
  • Frontend version bumped, if needed (frontend/package.json, frontend/package-lock.json)
  • Backend version bumped, if needed (backend/pom.xml)
  • Open API specification updated, if controllers have been changed (use python script scripts/generate_openapi_yaml.py with running customer backend)

@ReneSchroederLJ ReneSchroederLJ linked an issue Mar 9, 2026 that may be closed by this pull request
Copy link
Member

@ReneSchroederLJ ReneSchroederLJ left a comment

Choose a reason for hiding this comment

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

It seems a small error resulted from merging my previous changes. besides that the feature works for the most part just some improvements to validation and styling.

<Table
title="Material Relations"
columns={[
{ headerName: 'Parent Material Number', field: 'parentMaterialNumber', flex: 1 },
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{ headerName: 'Parent Material Number', field: 'parentMaterialNumber', flex: 1 },
{ headerName: 'Parent Material Number', field: 'parentOwnMaterialNumber', flex: 1 },

title="Material Relations"
columns={[
{ headerName: 'Parent Material Number', field: 'parentMaterialNumber', flex: 1 },
{ headerName: 'Child Material Number', field: 'childMaterialNumber', flex: 1 },
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{ headerName: 'Child Material Number', field: 'childMaterialNumber', flex: 1 },
{ headerName: 'Child Material Number', field: 'childOwnMaterialNumber', flex: 1 },

flex: 1,
renderCell: (data: { row: MaterialRelation }) => {
return (
<Box display="flex" textAlign="center" alignItems="center" justifyContent="center" width="100%" height="100%">
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<Box display="flex" textAlign="center" alignItems="center" justifyContent="center" width="100%" height="100%">
<Box display="flex" textAlign="center" alignItems="center" width="100%" height="100%">

<Box>{new Date(data.row.validFrom).toLocaleDateString('de-DE')}</Box>
<Box>{new Date(data.row.validFrom).toLocaleTimeString('de-DE')}</Box>
</Stack>
) : null
Copy link
Member

Choose a reason for hiding this comment

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

I would show a - if the date is not set how it's usually done elsewhere in the app. Same for valid to.

flex: 1.5,
renderCell: (data: { row: MaterialRelation }) => data.row.validFrom ? (
<Stack display="flex" textAlign="center" alignItems="center" justifyContent="center" width="100%" height="100%">
<Box>{new Date(data.row.validFrom).toLocaleDateString('de-DE')}</Box>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<Box>{new Date(data.row.validFrom).toLocaleDateString('de-DE')}</Box>
<Box>{new Date(data.row.validFrom).toLocaleDateString('en-GB')}</Box>

);

const validChildMaterials = childBase.filter((mat) =>
!mrs.some((existingMr) =>
Copy link
Member

Choose a reason for hiding this comment

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

fix indentation please

type="number"
placeholder="Enter quantity"
value={temporaryMr.quantity ?? ''}
error={formError && !temporaryMr.quantity}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
error={formError && !temporaryMr.quantity}
error={formError && (!temporaryMr.quantity || temporaryMr.quantity <= 0) }

error={
formError &&
(
(!!temporaryMr.validFrom && new Date(temporaryMr.validFrom) > new Date()) ||
Copy link
Member

Choose a reason for hiding this comment

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

I'm confused by this line. If validFrom is set it can't be after today? There is no such rule for validity that I am aware of.

error={
formError &&
(
(!!temporaryMr.validTo && new Date(temporaryMr.validTo) > new Date()) ||
Copy link
Member

Choose a reason for hiding this comment

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

Same as above. This condition should not exist.

- name: ENDPOINT_MATERIAL_PARTNER_RELATIONS
value: "{{ .Values.frontend.puris.endpointMaterialPartnerRelations | default "materialpartnerrelations" }}"
- name: ENDPOINT_MATERIAL_RELATIONS
value: "{{ .Values.frontend.puris.endpointMaterialRelations | default "material-relations" }}"
Copy link
Member

Choose a reason for hiding this comment

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

You forgot to also add the appropriate new value to the values.yaml file. Also remember to update the readme file accordingly.

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.

[Story] Material relation frontend implementation

2 participants