-
Notifications
You must be signed in to change notification settings - Fork 14
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
UI: overridden: Override PaymentInformation and OrderLine #851
Merged
kpsherva
merged 6 commits into
CERNDocumentServer:master
from
sakshamarora1:override_payment_information_props
Mar 4, 2024
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
fd997e3
UI: overridden: Override PaymentInformation left table to change IPR-…
sakshamarora1 a6391bf
UI: overridden: Acquisition: Override OrderLineMiddleColumn in OrderLine
sakshamarora1 9e54b56
config: Change Due date->Returned date in overlay
sakshamarora1 7c4e890
overridden: Use formatPrice from invenio-app-ils
sakshamarora1 e74adce
overridden: frontsite: Acquisition: Add htmlFor attribute to label ta…
sakshamarora1 3bf58cf
installation: upgrade react-invenio-app-ils
kpsherva 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { OrderLine } from "@inveniosoftware/react-invenio-app-ils"; | ||
import PropTypes from "prop-types"; | ||
import React from "react"; | ||
import { Icon, Item, Popup } from "semantic-ui-react"; | ||
import { parametrize } from "react-overridable"; | ||
|
||
export const OrderDetailsMiddleColumn = ({ line }) => { | ||
return ( | ||
<> | ||
<Item.Description> | ||
<label htmlFor="Copies ordered">Copies ordered: </label> | ||
{line.copies_ordered} | ||
</Item.Description> | ||
<Item.Description> | ||
<label htmlFor="Copies received">Copies received: </label> | ||
{line.copies_received || "-"} | ||
</Item.Description> | ||
<Item.Description> | ||
<label htmlFor="Payment mode">Payment mode: </label> | ||
{line.payment_mode || "-"} | ||
</Item.Description> | ||
<Item.Description> | ||
<label htmlFor="TID ID">TID ID: </label> | ||
{line.inter_departmental_transaction_id || "-"}{" "} | ||
<Popup | ||
content="Inter departmental transaction ID" | ||
trigger={<Icon name="info circle" />} | ||
/> | ||
</Item.Description> | ||
</> | ||
); | ||
}; | ||
|
||
OrderDetailsMiddleColumn.propTypes = { | ||
line: PropTypes.object.isRequired, | ||
}; | ||
|
||
export const OrderDetailsLine = parametrize(OrderLine, { | ||
MiddleColumn: OrderDetailsMiddleColumn, | ||
}); |
46 changes: 46 additions & 0 deletions
46
ui/src/overridden/backoffice/PaymentInformation/PaymentInformation.js
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,46 @@ | ||
import { | ||
PaymentInformation, | ||
formatPrice, | ||
} from "@inveniosoftware/react-invenio-app-ils"; | ||
import React from "react"; | ||
import { Icon, Popup } from "semantic-ui-react"; | ||
import { parametrize } from "react-overridable"; | ||
|
||
function leftPaymentInfoTable(order, type = "acquisition-order") { | ||
const { payment } = order; | ||
if (type === "borrowing-request") { | ||
order.grand_total = order.total; | ||
order.grand_total_main_currency = order.total_main_currency; | ||
} | ||
return [ | ||
{ | ||
name: `Total (${order.grand_total_main_currency.currency})`, | ||
value: formatPrice(order.grand_total_main_currency) || "-", | ||
}, | ||
{ | ||
name: | ||
order.grand_total && order.grand_total.currency | ||
? `Total (${order.grand_total.currency})` | ||
: "Total", | ||
value: formatPrice(order.grand_total) || "-", | ||
}, | ||
{ name: "Payment Mode", value: payment.mode }, | ||
{ | ||
name: ( | ||
<> | ||
DAI ID{" "} | ||
<Popup | ||
content="Internal purchase requisition ID" | ||
trigger={<Icon name="info circle" size="large" />} | ||
/> | ||
</> | ||
), | ||
value: payment.internal_purchase_requisition_id || "-", | ||
}, | ||
{ name: "Notes", value: payment.debit_note || "-" }, | ||
]; | ||
} | ||
|
||
export const PaymentInformationGrid = parametrize(PaymentInformation, { | ||
renderLeftTable: leftPaymentInfoTable, | ||
}); |
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.
how is this key used? I think I miss some context