-
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
Conversation
β¦ns' into 5137.3
Bundle size differenceComparing this PR to
|
@@ -145,7 +145,7 @@ export const UpdateStatusButtonComponent = ({ | |||
nextButton={ | |||
currentTab === Tabs.Status ? ( | |||
<DialogButton | |||
variant="next" | |||
variant="next-and-ok" |
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'
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']>; |
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.
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
@@ -6469,6 +6457,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 comment
The reason will be displayed to describe this comment to others. Learn more.
Needed for navigation
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)' }} | ||
/> | ||
); |
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.
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
<DialogButton | ||
variant="previous" | ||
disabled={!hasPrevious} | ||
onClick={() => |
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.
Using existing buttons for now instead of re-designing to fit new UI designs
const lines = | ||
data?.lines.nodes.sort((a, b) => a.item.name.localeCompare(b.item.name)) ?? | ||
[]; |
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.
Sorting so the list is in alphabetical order
export const useDraftRequisitionLine = (item?: ItemRowFragment | null) => { | ||
const { id: reqId, lines } = useResponse.document.fields(['id', 'lines']); |
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.
Using existing pattern for now, but this could be updated straight from endpoint instead of going through a draft
β¦ns' into 5137.3
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.
Some wee nit and comments but otherwise works great!
"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 comment
The reason will be displayed to describe this comment to others. Learn more.
Other than this and Next
the rest of this is just your editor alphabetically sorting aye?
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.
Correct~
client/packages/common/src/ui/components/buttons/ButtonShowcase.stories.tsx
Show resolved
Hide resolved
client/packages/invoices/src/Returns/modals/SupplierReturn/SupplierReturn.tsx
Show resolved
Hide resolved
...ckages/requisitions/src/ResponseRequisition/DetailView/ResponseLineEdit/ResponseEditPage.tsx
Show resolved
Hide resolved
...ckages/requisitions/src/ResponseRequisition/DetailView/ResponseLineEdit/ResponseLineEdit.tsx
Show resolved
Hide resolved
/> | ||
} | ||
labelWidth={LABEL_WIDTH} | ||
label={t('label.outgoing')} |
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.
Guess it's just up the design but I'd have assumed we should have the header as "Outgoing Units"
. Maybe it's redundant given everything is in units though.
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.
Sick looks great!
startIcon | ||
) : ( | ||
<Box style={{ visibility: 'hidden' }}>{startIcon}</Box> | ||
)} |
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.
This one is quite funky - behind the scenes it appears to still be rendering the icon it's just invisible. But if you remove the icon JSX from here it renders the same anyway, just shadow dom doing less work?
)} | ||
<Box | ||
style={{ | ||
visibility: enteredLineIds?.includes(option.id) |
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.
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 endIcon
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.
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 comment
The 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!
Part 3 of #5137
π©π»βπ» What does this PR do?
ListOption
component that lists an array of optionsScreen.Recording.2024-11-05.at.12.03.28.PM.mov
π Any notes for the reviewer?
P.S. I forgot about the charts and only just remembered while writing up this PR so there will be a part 4 incoming! π
Carryover: Don't let user navigate away from page if reason isn't inputted and is required?
π§ͺ Testing
π Documentation
1.
2.