-
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
5139 delete response requisition lines #5226
Changes from 18 commits
949d692
18a745b
a9bb801
88953a6
32c14fb
fcad1b2
f743641
5772374
ccb8f4b
e6ec2a2
b5d434e
e6406a7
322715b
1d668b0
07df943
c5f479b
d933c3b
49c32da
206d377
8e8b2bb
be7022a
010e33c
e1c3e4d
83d98e2
b685bb2
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuItem, | ||
DeleteIcon, | ||
useTranslation, | ||
} from '@openmsupply-client/common'; | ||
import { useResponse } from '../../api'; | ||
|
||
interface ToolbarDropDownProps { | ||
isDisabled: boolean; | ||
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 would pass in the linkedRequisition here as a check just in case we add other actions to Requisition and having it this way will help differentiate between the two |
||
} | ||
|
||
export const ToolbarDropDown = ({ isDisabled }: ToolbarDropDownProps) => { | ||
const t = useTranslation(); | ||
const onDelete = useResponse.line.delete(); | ||
|
||
return ( | ||
<DropdownMenu label={t('label.actions')}> | ||
<DropdownMenuItem | ||
IconComponent={DeleteIcon} | ||
onClick={onDelete} | ||
disabled={isDisabled} | ||
fergie-nz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
> | ||
{t('button.delete-lines', { ns: 'distribution' })} | ||
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. We don't need to use namespace anymore since all the translations are in one common.json file |
||
</DropdownMenuItem> | ||
</DropdownMenu> | ||
); | ||
}; | ||
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. Moved into its own file to duplicate RequestRequisition pattern |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Toolbar'; |
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.
The user can enter in theirReference, so we shouldn't be using this for the check. Their is a
linkedRequisition
node that gets returned which will tell us if the Requisition was created as a result of an Internal Order.