-
Notifications
You must be signed in to change notification settings - Fork 15
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
5137.3 Requisition line edit + UI updates to line columns #5308
Changes from all commits
9237b1f
4883c67
497c8e3
7ed5c46
e4b4264
1f63ef5
70d2bdc
ea39dbb
56ecd01
a884b6b
05bba09
1ec5867
8d84927
42fe9b2
1934f51
266df44
920175e
bc610df
4d9f5b0
593eaf5
d164bc6
c459e4d
79be92a
52a8dd3
eba331a
a6ce13d
9f2a975
e1f4e0b
29029b6
54ff080
8af9e35
ae32c65
c0972f1
63c3405
25d0378
a5bebb2
474db73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,11 +67,13 @@ | |
"button.new-return": "New Return", | ||
"button.new-shipment": "New Shipment", | ||
"button.new-stock": "New Stock", | ||
"button.next": "Next", | ||
"button.next-step": "Next step", | ||
"button.ok": "OK", | ||
"button.ok-and-next": "OK & Next", | ||
"button.open-the-menu": "Open the menu", | ||
"button.order-more": "Order more", | ||
"button.previous": "Previous", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Other than this and There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct~ |
||
"button.print": "Print", | ||
"button.print-qr": "Print QR code", | ||
"button.reduce-lines-to-zero": "Reduce lines to 0", | ||
|
@@ -142,6 +144,7 @@ | |
"customers": "Customers", | ||
"dashboard": "Dashboard", | ||
"description.already-issued": "Quantity already issued in shipments.", | ||
"description.available-stock": "The customer's initial stock on hand + incoming stock +/- inventory adjustments - outgoing stock", | ||
"description.average-monthly-consumption": "Average Monthly Consumption", | ||
"description.breach-type": "Ongoing breach type", | ||
"description.bundle-ratio": "The number of units of the bundled item for every unit of the base item", | ||
|
@@ -157,7 +160,6 @@ | |
"description.fc-sell-price": "Foreign currency sell price per pack", | ||
"description.forecast-quantity": "Forecast Quantity to Reach Target", | ||
"description.initial-stock-on-hand": "Stock on hand on the first day of the program period", | ||
"description.available-stock": "The customer's initial stock on hand + incoming stock +/- inventory adjustments - outgoing stock", | ||
"description.invoice-number": "Shipment number", | ||
"description.last-reading-datetime": "Date and time of the last reading", | ||
"description.max-min-temperature": "Maximum or minimum temperature reading", | ||
|
@@ -225,6 +227,7 @@ | |
"error.date_minDate": "Date value is too low", | ||
"error.dose-ages-out-of-order": "Each dose needs a higher minimum age than the previous dose", | ||
"error.duplicate-asset-number": "duplicate asset number in csv", | ||
"error.duplicate-item-variant-name": "Item variant with the same name already exists for this item", | ||
"error.duplicated-field": "{{field}} already exists in the import file", | ||
"error.encounter-not-created": "Unable to create encounter", | ||
"error.encounter-not-found": "Encounter not found.", | ||
|
@@ -241,7 +244,6 @@ | |
"error.failed-to-save-item-variant": "Failed to save item variant", | ||
"error.failed-to-save-service-charges": "Failed to save service charges", | ||
"error.failed-to-save-vaccination": "Failed to save vaccination!", | ||
"error.duplicate-item-variant-name": "Item variant with the same name already exists for this item", | ||
"error.failed-to-save-vaccine-course": "Failed to save vaccine course", | ||
"error.fetch-notifications": "Unable to display cold chain notifications", | ||
"error.field-must-be-specified": "{{field}} must be specified", | ||
|
@@ -738,11 +740,11 @@ | |
"label.invoice-number": "Number", | ||
"label.is-vaccine": "Vaccine", | ||
"label.issue": "Issue", | ||
"label.item-variant": "Item Variant", | ||
"label.item_few": "Items", | ||
"label.item_many": "Items", | ||
"label.item_one": "Item", | ||
"label.item_other": "Items", | ||
"label.item-variant": "Item Variant", | ||
"label.items-expiring-before": "Items expiring before", | ||
"label.items-no-stock_few": "Items with no stock", | ||
"label.items-no-stock_many": "Items with no stock", | ||
|
@@ -1366,8 +1368,8 @@ | |
"messages.new-sensor": "A new sensor has been added as a result of importing these logs. Would you like to assign a location to the new sensor now?", | ||
"messages.no": "No", | ||
"messages.no-available-periods": "No available periods found for schedule", | ||
"messages.no-bundled-items": "No bundled items configured", | ||
"messages.no-batch-selected": "You have not selected a batch for this vaccination. No stock transaction will be created. Are you sure you want to continue?", | ||
"messages.no-bundled-items": "No bundled items configured", | ||
"messages.no-contact-traces": "This patient has no contact traces", | ||
"messages.no-data-available": "No data available", | ||
"messages.no-data-found": "No data found", | ||
|
@@ -1634,8 +1636,8 @@ | |
"text.months": "Months", | ||
"title.adjustment-details": "Adjustment Details", | ||
"title.amc": "AMC", | ||
"title.bundled-on": "Bundled on", | ||
"title.bundle-with": "Bundle with", | ||
"title.bundled-on": "Bundled on", | ||
"title.categories": "Categories", | ||
"title.confirm-delete-encounter": "Delete encounter", | ||
"title.details": "Details", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,6 +94,10 @@ export enum ActivityLogNodeType { | |
AssetLogReasonDeleted = 'ASSET_LOG_REASON_DELETED', | ||
AssetPropertyCreated = 'ASSET_PROPERTY_CREATED', | ||
AssetUpdated = 'ASSET_UPDATED', | ||
DemographicIndicatorCreated = 'DEMOGRAPHIC_INDICATOR_CREATED', | ||
DemographicIndicatorUpdated = 'DEMOGRAPHIC_INDICATOR_UPDATED', | ||
DemographicProjectionCreated = 'DEMOGRAPHIC_PROJECTION_CREATED', | ||
DemographicProjectionUpdated = 'DEMOGRAPHIC_PROJECTION_UPDATED', | ||
InventoryAdjustment = 'INVENTORY_ADJUSTMENT', | ||
InvoiceCreated = 'INVOICE_CREATED', | ||
InvoiceDeleted = 'INVOICE_DELETED', | ||
|
@@ -2969,21 +2973,9 @@ export type InsertResponseRequisitionLineErrorInterface = { | |
}; | ||
|
||
export type InsertResponseRequisitionLineInput = { | ||
additionInUnits?: InputMaybe<Scalars['Float']['input']>; | ||
averageMonthlyConsumption?: InputMaybe<Scalars['Float']['input']>; | ||
comment?: InputMaybe<Scalars['String']['input']>; | ||
daysOutOfStock?: InputMaybe<Scalars['Float']['input']>; | ||
expiringUnits?: InputMaybe<Scalars['Float']['input']>; | ||
Comment on lines
-2972
to
-2976
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't need all these fields on insert. We will do everything on update as everything is saved on blur except for the actual line creation itself |
||
id: Scalars['String']['input']; | ||
incomingUnits?: InputMaybe<Scalars['Float']['input']>; | ||
itemId: Scalars['String']['input']; | ||
lossInUnits?: InputMaybe<Scalars['Float']['input']>; | ||
optionId?: InputMaybe<Scalars['String']['input']>; | ||
outgoingUnits?: InputMaybe<Scalars['Float']['input']>; | ||
requestedQuantity?: InputMaybe<Scalars['Float']['input']>; | ||
requisitionId: Scalars['String']['input']; | ||
stockOnHand?: InputMaybe<Scalars['Float']['input']>; | ||
supplyQuantity?: InputMaybe<Scalars['Float']['input']>; | ||
}; | ||
|
||
export type InsertResponseRequisitionLineResponse = InsertResponseRequisitionLineError | RequisitionLineNode; | ||
|
@@ -6510,6 +6502,7 @@ export type RequisitionLineNode = { | |
remainingQuantityToSupply: Scalars['Float']['output']; | ||
/** Quantity requested */ | ||
requestedQuantity: Scalars['Float']['output']; | ||
requisitionNumber: Scalars['Int']['output']; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed for navigation |
||
/** | ||
* Calculated quantity | ||
* When months_of_stock < requisition.min_months_of_stock, calculated = average_monthly_consumption * requisition.max_months_of_stock - months_of_stock | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { CheckIcon, ChevronDownIcon } from '@common/icons'; | ||
import { | ||
List, | ||
ListItemIcon, | ||
ListItem, | ||
ListItemText, | ||
Divider, | ||
Box, | ||
} from '@mui/material'; | ||
import React from 'react'; | ||
|
||
export type ListOptionValues = { | ||
id: string; | ||
value: string; | ||
}; | ||
|
||
interface ListProps { | ||
onClick: (id: string) => void; | ||
options: ListOptionValues[]; | ||
currentId?: string; | ||
enteredLineIds?: string[]; | ||
} | ||
|
||
export const ListOptions = ({ | ||
onClick, | ||
options, | ||
currentId, | ||
enteredLineIds, | ||
}: ListProps) => { | ||
const startIcon = ( | ||
<CheckIcon | ||
style={{ | ||
backgroundColor: '#33A901', | ||
borderRadius: '50%', | ||
padding: '2px', | ||
color: 'white', | ||
height: 18, | ||
width: 18, | ||
}} | ||
/> | ||
); | ||
|
||
const endIcon = ( | ||
<ChevronDownIcon | ||
style={{ width: 17, height: 17, transform: 'rotate(-90deg)' }} | ||
/> | ||
); | ||
Comment on lines
+30
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had them passed in as props at first since we might use different icons for different use cases, but can't think of them right now for what we will use it for. Easy to refactor later on if needed |
||
|
||
return ( | ||
<List sx={{ padding: 0 }}> | ||
{options?.map((option, _) => ( | ||
<React.Fragment key={option.id}> | ||
<ListItem | ||
sx={{ padding: '5px 0px' }} | ||
onClick={() => onClick(option.id)} | ||
> | ||
<ListItemIcon sx={{ padding: 0, minWidth: 25 }}> | ||
<Box | ||
style={{ | ||
visibility: enteredLineIds?.includes(option.id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is in response to my comment I was more meaning that for this requisition of 21 items It renders the checkbox component 63 times (3 times per row for whatever reason π) when only one row is actually showing the checkbox. Where as if you had <Box>{enteredLineIds?.includes(option.id) && startIcon}</Box> Instead it only renders a checkbox 3 times, for the one row it's actually displayed on. Same goes for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh no it was just a refactor. I have both icons hidden because I didn't want it to move the text when it appears... which happens... So, instead we render it in a hidden state so the text doesn't move There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right I had to fiddle around a bit to see only seems to happen on a small window, so probably would happen on tablet! |
||
? 'visible' | ||
: 'hidden', | ||
}} | ||
> | ||
{startIcon} | ||
</Box> | ||
</ListItemIcon> | ||
<ListItemText | ||
primary={option.value} | ||
sx={{ margin: 0, padding: 0 }} | ||
/> | ||
<ListItemIcon sx={{ padding: 0, minWidth: 15 }}> | ||
<Box | ||
style={{ | ||
visibility: option.id === currentId ? 'visible' : 'hidden', | ||
}} | ||
> | ||
{endIcon} | ||
</Box> | ||
</ListItemIcon> | ||
</ListItem> | ||
<Divider component="li" /> | ||
</React.Fragment> | ||
))} | ||
</List> | ||
); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './ListOptions'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renaming of the next button so I can create an actual 'next' button not 'ok & next'