-
Notifications
You must be signed in to change notification settings - Fork 16
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
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
949d692
Add delete response requisition service layer
fergie-nz 18a745b
Add service layer tests
fergie-nz a9bb801
Add graphql layer delete response requisition line
fergie-nz 88953a6
Add check for status as per update response requisition line
fergie-nz 32c14fb
Add tests to graphql layer
fergie-nz fcad1b2
Add front end deleteResponseLines
fergie-nz f743641
Add batch mutations service layer
fergie-nz 5772374
Add batch mutations graphql layer
fergie-nz ccb8f4b
Add individual line delete (using batch mutation on back end)
fergie-nz e6ec2a2
Add graphql tests
fergie-nz b5d434e
Merge branch 'develop' into 5139-delete-response-requisition
fergie-nz e6406a7
Regenerate schema
fergie-nz 322715b
Fix tests
fergie-nz 1d668b0
Restructure order of errors
fergie-nz 07df943
Remove redundant delete line from api
fergie-nz c5f479b
Add check for request requisition reference
fergie-nz d933c3b
Update server/service/src/requisition_line/response_requisition_line/β¦
fergie-nz 49c32da
Add check for transferred requisition
fergie-nz 206d377
Don't make map_response public
roxy-dao 8e8b2bb
Passing in wrong type for isResponseDisabled check
roxy-dao be7022a
Expose linkedRequisition node
roxy-dao 010e33c
Use linkedRequisition for disabled check
roxy-dao e1c3e4d
Disambiguiating map_errors
fergie-nz 83d98e2
Fix test
roxy-dao b685bb2
Merge branch '5139-example' into 5139-delete-response-requisition
fergie-nz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/ToolbarDropDown.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react'; | ||
import { | ||
DropdownMenu, | ||
DropdownMenuItem, | ||
DeleteIcon, | ||
useTranslation, | ||
} from '@openmsupply-client/common'; | ||
import { useResponse } from '../../api'; | ||
|
||
interface ToolbarDropDownProps { | ||
isDisabled: boolean; | ||
hasLinkedRequisition: boolean; | ||
} | ||
|
||
export const ToolbarDropDown = ({ | ||
isDisabled, | ||
hasLinkedRequisition, | ||
}: ToolbarDropDownProps) => { | ||
const t = useTranslation(); | ||
const onDelete = useResponse.line.delete(); | ||
|
||
return ( | ||
<DropdownMenu label={t('label.actions')}> | ||
<DropdownMenuItem | ||
IconComponent={DeleteIcon} | ||
onClick={onDelete} | ||
disabled={isDisabled || hasLinkedRequisition} | ||
> | ||
{t('button.delete-lines')} | ||
</DropdownMenuItem> | ||
</DropdownMenu> | ||
); | ||
}; |
1 change: 1 addition & 0 deletions
1
client/packages/requisitions/src/ResponseRequisition/DetailView/Toolbar/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './Toolbar'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 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