Feat/material relations fe#1113
Feat/material relations fe#1113OlgaIvkovic wants to merge 6 commits intoeclipse-tractusx:feat/bill-of-materialsfrom
Conversation
ReneSchroederLJ
left a comment
There was a problem hiding this comment.
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 }, |
There was a problem hiding this comment.
| { 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 }, |
There was a problem hiding this comment.
| { 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%"> |
There was a problem hiding this comment.
| <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 |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
| <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) => |
| type="number" | ||
| placeholder="Enter quantity" | ||
| value={temporaryMr.quantity ?? ''} | ||
| error={formError && !temporaryMr.quantity} |
There was a problem hiding this comment.
| error={formError && !temporaryMr.quantity} | |
| error={formError && (!temporaryMr.quantity || temporaryMr.quantity <= 0) } |
| error={ | ||
| formError && | ||
| ( | ||
| (!!temporaryMr.validFrom && new Date(temporaryMr.validFrom) > new Date()) || |
There was a problem hiding this comment.
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()) || |
There was a problem hiding this comment.
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" }}" |
There was a problem hiding this comment.
You forgot to also add the appropriate new value to the values.yaml file. Also remember to update the readme file accordingly.
Description
Resolves #1086
Pre-review checks
Please ensure to do as many of the following checks as possible, before asking for committer review:
changelog.md) with PR reference and brief summary.frontend/package.json,frontend/package-lock.json)backend/pom.xml)scripts/generate_openapi_yaml.pywith running customer backend)