-
Notifications
You must be signed in to change notification settings - Fork 4
Feature: order grid revamp #262
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
Open
santipalenque
wants to merge
11
commits into
main
Choose a base branch
from
feature/order-grid-revamp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4cc5fbb
chore: change grid looks and feel - WIP
santipalenque 898fe23
chore: style tweaks
santipalenque 0765ba9
chore: more changes
santipalenque 9ce9ee0
v5.0.33-beta.0
santipalenque 9399332
chore: PR review and fix tests
santipalenque 11cfaf8
chore: change currencyAmountFromCents to return ERROR instead of exce…
santipalenque 8477ed9
v5.0.33-beta.1
santipalenque 3b32174
fix: balance multiplier in refunds should be positive, sort refunds a…
santipalenque ff7ec94
v5.0.33-beta.2
santipalenque 4aaf79e
fix: escape payments and refunds in case not set
santipalenque bc10316
v5.0.33-beta.3
santipalenque 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 hidden or 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 hidden or 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 hidden or 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
31 changes: 31 additions & 0 deletions
31
src/components/mui/SponsorOrderGrid/components/BalanceValue.jsx
This file contains hidden or 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,31 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import Typography from "@mui/material/Typography"; | ||
| import {currencyAmountFromCents} from "../../../../utils/money"; | ||
|
|
||
| const BalanceValue = ({value}) => { | ||
| const isNegative = value < 0; | ||
| const sign = isNegative ? "-" : ""; | ||
| const color = isNegative ? "primary.dark" : "text.disabled"; | ||
| const balance = `${sign}${currencyAmountFromCents(Math.abs(value))}`; | ||
|
|
||
| return ( | ||
| <Typography variant="body1" sx={{ color }}> | ||
| {balance} | ||
| </Typography> | ||
| ); | ||
| } | ||
|
|
||
| export default BalanceValue; |
45 changes: 45 additions & 0 deletions
45
src/components/mui/SponsorOrderGrid/components/CancelledItems.jsx
This file contains hidden or 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,45 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import T from "i18n-react/dist/i18n-react"; | ||
| import Typography from "@mui/material/Typography"; | ||
| import DoNotDisturbIcon from "@mui/icons-material/DoNotDisturb"; | ||
| import Box from "@mui/material/Box"; | ||
| import Link from "@mui/material/Link"; | ||
|
|
||
| const CancelledItems = ({cancelledItems, sx = {}}) => { | ||
|
|
||
| if (cancelledItems.length === 0) return null; | ||
|
|
||
| return ( | ||
| <Box sx={{display: "flex", flexDirection: "row", ...sx}}> | ||
| <DoNotDisturbIcon sx={{mr: 1}}/> | ||
| <Typography variant="body2" sx={{mb: 2, mr: 1}}> | ||
| {T.translate("sponsor_order_grid.cancelled_items", {count: cancelledItems.length})} | ||
| </Typography> | ||
| {cancelledItems.map((item) => ( | ||
| <Link | ||
| key={`cancelled-item-${item.id}`} | ||
| variant="body1" | ||
| href={`#item-${item.id}`} | ||
| sx={{mr: 1, color: "text.disabled", textDecorationColor: "rgba(0, 0, 0, 0.38)"}} | ||
| > | ||
| {item.formCode} - {item.itemCode} | ||
| </Link> | ||
| ))} | ||
| </Box> | ||
| ); | ||
| } | ||
|
|
||
| export default CancelledItems; | ||
62 changes: 62 additions & 0 deletions
62
src/components/mui/SponsorOrderGrid/components/ReconciliationBox.jsx
This file contains hidden or 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,62 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import Typography from "@mui/material/Typography"; | ||
| import T from "i18n-react/dist/i18n-react"; | ||
| import Divider from "@mui/material/Divider"; | ||
| import Box from "@mui/material/Box"; | ||
| import {currencyAmountFromCents} from "../../../../utils/money"; | ||
|
|
||
| const ReconciliationBox = ({cancelledTotal, refundsTotal, retained, credited}) => { | ||
| const totalColor = retained > 0 ? "error.dark" : "success.dark"; | ||
| const totalLabel = retained > 0 ? "retained" : (credited > 0 ? "credited" : "balance"); | ||
| const totalValue = retained > 0 ? retained : (credited > 0 ? credited : retained); | ||
|
|
||
| return ( | ||
| <Box sx={{maxWidth: 400, mt: 2, mb: 3}}> | ||
| <Typography variant="body2" sx={{mb: 3}}> | ||
| {T.translate("sponsor_order_grid.reconciliation")} | ||
| </Typography> | ||
| <Box sx={{display: "flex", justifyContent: "space-between"}}> | ||
| <Typography variant="body1" sx={{color: "text.secondary"}}> | ||
| {T.translate("sponsor_order_grid.cancelled")} | ||
| </Typography> | ||
| <Typography variant="body1"> | ||
| {currencyAmountFromCents(cancelledTotal ?? 0)} | ||
| </Typography> | ||
| </Box> | ||
| <Box sx={{display: "flex", justifyContent: "space-between"}}> | ||
| <Typography variant="body1" sx={{color: "text.secondary"}}> | ||
| {T.translate("sponsor_order_grid.refunded")} | ||
| </Typography> | ||
| <Typography variant="body1"> | ||
| {currencyAmountFromCents(refundsTotal ?? 0)} | ||
| </Typography> | ||
| </Box> | ||
| <Divider sx={{my: 1}}/> | ||
| <Box sx={{display: "flex", justifyContent: "space-between"}}> | ||
| <Typography variant="body2"> | ||
| {T.translate(`sponsor_order_grid.${totalLabel}`)} | ||
| </Typography> | ||
| <Typography variant="body2" sx={{color: totalColor}}> | ||
| {currencyAmountFromCents(totalValue ?? 0)} | ||
| </Typography> | ||
| </Box> | ||
|
santipalenque marked this conversation as resolved.
|
||
|
|
||
| </Box> | ||
|
|
||
| ); | ||
| } | ||
|
|
||
| export default ReconciliationBox; | ||
51 changes: 51 additions & 0 deletions
51
src/components/mui/SponsorOrderGrid/components/TotalFooter.jsx
This file contains hidden or 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,51 @@ | ||
| /** | ||
| * Copyright 2026 OpenStack Foundation | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * */ | ||
|
|
||
| import React from "react"; | ||
| import Box from "@mui/material/Box"; | ||
| import Typography from "@mui/material/Typography"; | ||
| import T from "i18n-react/dist/i18n-react"; | ||
| import {currencyAmountFromCents} from "../../../../utils/money"; | ||
|
|
||
| const TotalFooter = ({total}) => { | ||
| const safetotal = total ?? 0; | ||
| const isNegative = safetotal < 0; | ||
| const sign = isNegative ? "-" : ""; | ||
| const color = isNegative ? "primary.dark" : (safetotal === 0 ? "text.primary" : "error.main"); | ||
| const totalStr = `${sign}${currencyAmountFromCents(Math.abs(safetotal))}`; | ||
|
|
||
| return ( | ||
| <Box sx={{ | ||
| bgcolor: "#F1F3F5", | ||
| display: "flex", | ||
| justifyContent: "space-between", | ||
| alignItems: "center", | ||
| borderTop: "1px solid #EEE", | ||
| pt: 2, | ||
| mt: 2, | ||
| mx: -2, | ||
| px: "10%", | ||
| mb: -3, | ||
| pb: 2, | ||
| }}> | ||
| <Typography sx={{fontWeight: 800, textTransform: "uppercase"}}> | ||
| {T.translate("sponsor_order_grid.amount_due")} | ||
| </Typography> | ||
| <Typography sx={{color, fontWeight: 800, fontSize: "15px"}}> | ||
| {totalStr} | ||
| </Typography> | ||
| </Box> | ||
| ); | ||
| } | ||
|
|
||
| export default TotalFooter; |
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.
Uh oh!
There was an error while loading. Please reload this page.