OBPIH-7500 add createdby and updatedby fields to product supplier#5553
OBPIH-7500 add createdby and updatedby fields to product supplier#5553
Conversation
There was a problem hiding this comment.
Don't merge yet since I still need to confirm with Manon what the desired look is.
I also need to add the new localization labels once we agree on a look.
Also we likely want to filter out the fields when first creating the supplier. Or have it auto-populate with the name of the current user but idk how to do that on the frontend
| --gray-200: #D6D8DC; | ||
| --gray-250: #D0DAED; | ||
| --gray-300: #CED4DA; | ||
| --gray-350: #9299A6; |
There was a problem hiding this comment.
I noticed we have two --gray-350 so I removed one
|
|
||
| &:disabled { | ||
| background-color: var(--blue-100); | ||
| background-color: var(--gray-200); |
There was a problem hiding this comment.
also, side note: DateField components don't dim the background when disabled so something must be going wrong there
There was a problem hiding this comment.
The background probably doesn’t work because inside DatePicker we use customInput={<DateFieldInput onClear={onClear} clearable={clearable} />}, which has the .date-field-input className that overrides the .form-element-input className. If you also change it there to background-color: var(--gray-200), you should see the background
There was a problem hiding this comment.
I personally don't mind the "grayer" version, so probably up to Manon
There was a problem hiding this comment.
@ewaterman we wanted to merge that but we weren't sure whether you confirmed the color with Manon so I decided to ask her - she prefers not to get creative and change colors, so probably you need to change your monitor 🙈
There was a problem hiding this comment.
RIP to my monitor 💀 (thanks for checking with Manon)
| dateCreated: dateCreated, | ||
| lastUpdated: lastUpdated, | ||
| createdBy: createdBy?.name, | ||
| updatedBy: updatedBy?.name, |
There was a problem hiding this comment.
Another option for this would be:
updatedBy: updatedBy ? [
id: updatedBy?.id,
name: updatedBy?.name,
] : null,
Alternatively, we can create a separate method for jsonifying the supplier for use in the product source list view. That one will have fewer fields (we don't fetch the associations because they're not used). Then this large toJson method can be used when fetching the supplier details.
I wanted to make as little changes as possible here so I just adding the single field, but we could to some minor optimizations here if we wanted. Idk if it's worth it though. Thoughts?
There was a problem hiding this comment.
I would opt for adding the id, so to use this version:
updatedBy: updatedBy ? [
id: updatedBy?.id,
name: updatedBy?.name,
] : null,
this would be easier to use if frontend ever needed to reference that
| dateCreated: dateCreated, | ||
| lastUpdated: lastUpdated, | ||
| createdBy: createdBy?.name, | ||
| updatedBy: updatedBy?.name, |
There was a problem hiding this comment.
I would opt for adding the id, so to use this version:
updatedBy: updatedBy ? [
id: updatedBy?.id,
name: updatedBy?.name,
] : null,
this would be easier to use if frontend ever needed to reference that
|
|
||
| &:disabled { | ||
| background-color: var(--blue-100); | ||
| background-color: var(--gray-200); |
There was a problem hiding this comment.
I personally don't mind the "grayer" version, so probably up to Manon
| active: productSupplier?.active, | ||
| dateCreated: productSupplier?.dateCreated ?? undefined, | ||
| lastUpdated: productSupplier?.lastUpdated ?? undefined, | ||
| createdBy: productSupplier?.createdBy ?? undefined, |
There was a problem hiding this comment.
I'm surprised if it's displayed correctly without having id, value, label properties
| /> | ||
| )} | ||
| <TextInput | ||
| name="basicDetails.created" |
There was a problem hiding this comment.
Is the name prop needed here? We usually use name inside <Controller> for controlled fields, but this one is just a display (disabled) field, so it’s probably not necessary
| /> | ||
| )} | ||
| <TextInput | ||
| name="basicDetails.updated" |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5553 +/- ##
============================================
- Coverage 9.12% 8.49% -0.64%
+ Complexity 1170 1106 -64
============================================
Files 701 701
Lines 45281 45274 -7
Branches 10851 10850 -1
============================================
- Hits 4131 3845 -286
- Misses 40497 40857 +360
+ Partials 653 572 -81 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|

✨ Description of Change
Link to GitHub issue or Jira ticket: https://pihemr.atlassian.net/browse/OBPIH-7500
Description: Add "createdBy" and "updatedBy" fields to product source/supplier and display them in the create/edit product source page.
📷 Screenshots & Recordings (optional)