Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openstack-uicore-foundation",
"version": "5.0.53",
"version": "5.0.55-beta.0",
"description": "ui reactjs components for openstack marketing site",
"main": "lib/openstack-uicore-foundation.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/components/mui/FormItemTable/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export const getCurrentApplicableRate = (timeZone, rateDates) => {
return "expired";
};

export const isItemAvailable = (item, currentApplicableRate) =>
item.rates?.[currentApplicableRate] != null;
export const isItemAvailable = (item, currentApplicableRate, customRate = 0) =>
customRate || item.rates?.[currentApplicableRate] != null;

// The global quantity for a row is driven (and therefore read-only/computed)
// when a Form-class metafield of type Quantity exists for it (extraColumns,
Expand Down
8 changes: 4 additions & 4 deletions src/components/mui/FormItemTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,12 @@ const FormItemTable = ({
);

const calculateRowTotal = (row) => {
const customRate = values[`i-${row.form_item_id}-c-global-f-custom_rate`];
const qty =
values[`i-${row.form_item_id}-c-global-f-quantity`] ||
calculateQuantity(row);

if (currentApplicableRate === "expired") return 0;

const customRate = values[`i-${row.form_item_id}-c-global-f-custom_rate`];
// if currentRate is expired or not set then we return, unless customRate is set
const rate = customRate || row.rates[currentApplicableRate];

if (rate == null || qty == null) return 0;
Expand Down Expand Up @@ -230,7 +229,8 @@ const FormItemTable = ({
</TableHead>
<TableBody>
{data.map((row) => {
const disabled = !isItemAvailable(row, currentApplicableRate);
const customRate = values[`i-${row.form_item_id}-c-global-f-custom_rate`];
const disabled = !isItemAvailable(row, currentApplicableRate, customRate);
const isOpen = !!openRows[row.form_item_id];

return (
Expand Down
Loading