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
Expand Up @@ -93,7 +93,7 @@
"moment-duration-format": "^2.3.2",
"moment-timezone": "^0.5.33",
"mui-color-input": "^9.0.0",
"openstack-uicore-foundation": "5.0.44",
"openstack-uicore-foundation": "5.0.49-beta.0",
"p-limit": "^6.1.0",
"path-browserify": "^1.0.1",
"postcss-loader": "^6.2.1",
Expand Down
4 changes: 3 additions & 1 deletion src/actions/sponsor-forms-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ export const getSponsorForms =
expand: "sponsorship_types"
};

filter.push(`is_archived==${showArchived ? 1 : 0}`);
if (!showArchived) {
filter.push("is_archived==0");
}

if (sponsorshipTypesId?.length > 0) {
const formattedSponsorships = sponsorshipTypesId.join("&&");
Expand Down
1 change: 0 additions & 1 deletion src/pages/media_uploads/media-upload-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ const MediaUploadListPage = ({
<MuiTable
columns={columns}
data={media_uploads}
tableSx={{ tableLayout: "auto" }}
options={tableOptions}
perPage={perPage}
currentPage={currentPage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ const AddFormTemplateItemDialog = ({
{
columnKey: "select",
header: "",
width: 30,
align: "center",
render: (row) => (
<FormControlLabel
Expand Down Expand Up @@ -157,7 +156,6 @@ const AddFormTemplateItemDialog = ({
{
columnKey: "hasImage",
header: "",
width: 40,
align: "center",
render: (row) => {
const img = row.images?.[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ const FormTemplateFromDuplicateDialog = ({
{
columnKey: "select",
header: "",
width: 30,
align: "center",
render: (row) => (
<FormControlLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ const FormTemplateItemListPage = ({
{
columnKey: "hasImage",
header: "",
width: 40,
align: "center",
render: (row) => {
const img = row.images?.[0];
Expand Down
1 change: 0 additions & 1 deletion src/pages/sponsors-global/inventory/inventory-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ const InventoryListPage = ({
{
columnKey: "hasImage",
header: "",
width: 40,
align: "center",
render: (row) => {
const img = row.images?.[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ describe("ShowPagesListPage", () => {
}
}
);
const archiveButton = screen.getByText("general.archive");
const archiveButton = screen.getByTestId("action-archive");
await act(async () => {
await userEvent.click(archiveButton);
});
Expand All @@ -295,7 +295,7 @@ describe("ShowPagesListPage", () => {
}
}
);
const unarchiveButton = screen.getByText("general.unarchive");
const unarchiveButton = screen.getByTestId("action-archive");
await act(async () => {
await userEvent.click(unarchiveButton);
});
Expand Down
5 changes: 2 additions & 3 deletions src/pages/sponsors/show-purchase-list-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const ShowPurchaseListPage = ({
{
columnKey: "purchased",
header: T.translate("sponsor_show_purchases.purchased"),
width: 200,
width: 180,
sortable: true
},
{
Expand Down Expand Up @@ -171,7 +171,7 @@ const ShowPurchaseListPage = ({
{
columnKey: "details",
header: "",
width: 100,
width: 80,
align: "center",
render: (row) => (
<Button
Expand All @@ -187,7 +187,6 @@ const ShowPurchaseListPage = ({
{
columnKey: "menu",
header: "",
width: 100,
align: "center",
render: (row) =>
downloadingOrderId === row.id ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ const SponsorFormAddItemFromInventoryPopup = ({
{
columnKey: "select",
header: "",
width: 30,
align: "center",
render: (row) => (
<FormControlLabel
Expand Down Expand Up @@ -143,7 +142,6 @@ const SponsorFormAddItemFromInventoryPopup = ({
{
columnKey: "hasImage",
header: "",
width: 40,
align: "center",
render: (row) => {
const img = row.images?.[0];
Expand Down
1 change: 0 additions & 1 deletion src/pages/sponsors/sponsor-form-item-list-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ const SponsorFormItemListPage = ({
{
columnKey: "hasImage",
header: "",
width: 40,
align: "center",
render: (row) => {
const img = row.images?.[0];
Expand Down
35 changes: 15 additions & 20 deletions src/pages/sponsors/sponsor-forms-list-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,23 +208,21 @@ const SponsorFormsListPage = ({
{
columnKey: "code",
header: T.translate("sponsor_forms.code_column_label"),
sortable: true
sortable: true,
cellSx: { maxWidth: 120 }
},
{
columnKey: "name",
header: T.translate("sponsor_forms.name_column_label"),
sortable: true
sortable: true,
cellSx: { maxWidth: 120 }
},
{
columnKey: "tiers",
header: T.translate("sponsor_forms.tiers_column_label"),
sortable: false,
width: 140,
render: (row) => {
const cellStyle = {
width: 140,
maxWidth: 140,
minWidth: 140,
display: "block"
};
if (editingTiersId === row.id) {
Expand Down Expand Up @@ -280,8 +278,7 @@ const SponsorFormsListPage = ({
cursor: "pointer",
textDecoration: "underline dotted",
display: "block",
whiteSpace: "normal",
wordBreak: "break-word",
whiteSpace: "nowrap",
verticalAlign: "middle"
}}
title={label}
Expand All @@ -297,26 +294,26 @@ const SponsorFormsListPage = ({
columnKey: "opens_at",
header: T.translate("edit_sponsor.forms_tab.opens_at"),
sortable: true,
width: 115,
headSx: { whiteSpace: "nowrap" },
render: (row) => formatDate(row.opens_at)
},
{
columnKey: "expires_at",
header: T.translate("edit_sponsor.forms_tab.expires_at"),
sortable: true,
width: 120,
headSx: { whiteSpace: "nowrap" },
render: (row) => formatDate(row.expires_at)
},
{
columnKey: "items_qty",
width: 90,
header: T.translate("sponsor_forms.items_column_label"),
sortable: false
sortable: false,
cellSx: { whiteSpace: "nowrap" }
},
{
columnKey: "manage_items",
header: "",
width: 140,
width: 132,
align: "left",
render: (row) => (
<Button
Expand Down Expand Up @@ -356,10 +353,10 @@ const SponsorFormsListPage = ({
mb: 2
}}
>
<Grid2 size={1}>
<Grid2 size={{ xs: 12, sm: 6, md: 2 }}>
<Box component="span">{totalCount} forms</Box>
</Grid2>
<Grid2 size={2} offset={1}>
<Grid2 size={{ xs: 12, sm: 6, md: 3 }}>
<FormGroup>
<FormControlLabel
control={
Expand All @@ -378,33 +375,31 @@ const SponsorFormsListPage = ({
/>
</FormGroup>
</Grid2>
<Grid2 size={2}>
<Grid2 size={{ xs: 12, sm: 12, md: 3 }}>
<SearchInput
term={term}
onSearch={handleSearch}
placeholder={T.translate("sponsor_forms.placeholders.search")}
/>
</Grid2>
<Grid2 size={3}>
<Grid2 size={{ xs: 6, sm: 6, md: 2 }}>
<Button
variant="contained"
size="medium"
fullWidth
onClick={() => setOpenPopup("clone")}
startIcon={<AddIcon />}
sx={{ height: "36px" }}
>
{T.translate("sponsor_forms.using_global")}
</Button>
</Grid2>
<Grid2 size={3}>
<Grid2 size={{ xs: 6, sm: 6, md: 2 }}>
<Button
variant="contained"
size="medium"
fullWidth
onClick={() => setOpenPopup("new")}
startIcon={<AddIcon />}
sx={{ height: "36px" }}
>
{T.translate("sponsor_forms.add_form")}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ const AddSponsorFormTemplatePopup = ({
{
columnKey: "select",
header: "",
width: 30,
align: "center",
render: (row) => (
<FormControlLabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ const SponsorFormItemFromInventoryPopup = ({
{
columnKey: "select",
header: "",
width: 30,
align: "center",
render: (row) => (
<FormControlLabel
Expand Down Expand Up @@ -142,7 +141,6 @@ const SponsorFormItemFromInventoryPopup = ({
{
columnKey: "images",
header: "",
width: 40,
align: "center",
render: (row) => {
const img = row.images?.[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ const SponsorFormsManageItems = ({
{
columnKey: "images",
header: "",
width: 40,
align: "center",
render: (row) =>
row.images?.length > 0 ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ const SponsorFormsTab = ({
columnKey: "allowed_add_ons",
header: T.translate("edit_sponsor.forms_tab.add_ons"),
sortable: true,
width: 120,
render: (row) =>
row.allowed_add_ons?.length > 0
? row.allowed_add_ons.map((a) => `${a.type} ${a.name}`).join(", ")
Expand All @@ -318,7 +317,6 @@ const SponsorFormsTab = ({
columnKey: "items_qty",
header: T.translate("edit_sponsor.forms_tab.items"),
sortable: true,
width: 90,
render: (row) =>
`${row.items_count} ${
row.items_count === 1
Expand Down Expand Up @@ -478,7 +476,6 @@ const SponsorFormsTab = ({
sortDir: customizedForms.orderDir,
disableProp: "is_archived"
}}
tableSx={{ tableLayout: "auto", minWidth: 910 }}
perPage={customizedForms.perPage}
totalRows={customizedForms.totalCount}
currentPage={customizedForms.currentPage}
Expand All @@ -499,7 +496,6 @@ const SponsorFormsTab = ({
sortCol: managedForms.order,
sortDir: managedForms.orderDir
}}
tableSx={{ tableLayout: "auto", minWidth: 910 }}
perPage={managedForms.perPage}
totalRows={managedForms.totalCount}
currentPage={managedForms.currentPage}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ describe("SponsorPagesTab", () => {
}
);

const archiveButton = screen.getByText("general.archive");
const archiveButton = screen.getByTestId("action-archive");
await act(async () => {
await userEvent.click(archiveButton);
});
Expand All @@ -422,7 +422,7 @@ describe("SponsorPagesTab", () => {
}
);

const unarchiveButton = screen.getByText("general.unarchive");
const unarchiveButton = screen.getByTestId("action-archive");
await act(async () => {
await userEvent.click(unarchiveButton);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ const AddSponsorPageTemplatePopup = ({
{
columnKey: "select",
header: "",
width: 30,
align: "center",
render: (row) => (
<FormControlLabel
Expand Down
Loading
Loading