umwd-components 0.1.720 → 0.1.721
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/components/common/EnhancedTable/EnhancedTable.js +1 -1
- package/dist/cjs/src/components/common/EnhancedTable/EnhancedTableRow.js +1 -1
- package/dist/cjs/src/components/page-elements/FeaturesSection.js +1 -1
- package/dist/cjs/src/data/loaders/e-commerce/getAllOpos.js +1 -1
- package/dist/cjs/src/data/loaders/e-commerce/iros/getAllIros.js +1 -1
- package/dist/cjs/src/data/loaders/loaders.js +1 -1
- package/dist/cjs/src/data/loaders/page-elements/getSinglePage.js +1 -1
- package/dist/cjs/src/data/services/get-user-me-loader.js +1 -1
- package/dist/cjs/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/src/components/common/EnhancedTable/EnhancedTable.js +3 -3
- package/dist/esm/src/components/common/EnhancedTable/EnhancedTableRow.js +1 -1
- package/dist/esm/src/components/page-elements/FeaturesSection.js +24 -23
- package/dist/esm/src/data/loaders/e-commerce/getAllOpos.js +1 -1
- package/dist/esm/src/data/loaders/e-commerce/iros/getAllIros.js +2 -2
- package/dist/esm/src/data/loaders/loaders.js +59 -53
- package/dist/esm/src/data/loaders/page-elements/getSinglePage.js +50 -49
- package/dist/esm/src/data/services/get-user-me-loader.js +10 -2
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/types/data/loaders/e-commerce/iros/getAllIros.d.ts +1 -1
- package/dist/esm/types/types/common/enhancedTable/types.d.ts +4 -4
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ function EnhancedTable(props) {
|
|
|
28
28
|
const pathname = usePathname();
|
|
29
29
|
const searchParams = useSearchParams();
|
|
30
30
|
const [order, setOrder] = useState("asc");
|
|
31
|
-
const [orderBy, setOrderBy] = useState("
|
|
31
|
+
const [orderBy, setOrderBy] = useState("createdAt");
|
|
32
32
|
const [selected, setSelected] = useState([]);
|
|
33
33
|
const [page, setPage] = useState(0);
|
|
34
34
|
const [dense, setDense] = useState(false);
|
|
@@ -56,7 +56,7 @@ function EnhancedTable(props) {
|
|
|
56
56
|
const handleSelectAllClick = (e) => {
|
|
57
57
|
const target = e.target;
|
|
58
58
|
if (target.checked) {
|
|
59
|
-
const newSelected = data.map((n) => n.
|
|
59
|
+
const newSelected = data.map((n) => n.documentId);
|
|
60
60
|
setSelected(newSelected);
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
@@ -159,7 +159,7 @@ function EnhancedTable(props) {
|
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
}, [order, orderBy, page, rowsPerPage, filters]);
|
|
162
|
-
return (jsxs(Box, { sx: { width: "100%" }, children: [jsxs(Paper, { sx: { width: "100%", mb: 2 }, children: [jsx(EnhancedTableToolbar, { selected: selected, setSelected: setSelected, title: title, functions: functions, selectFunctions: selectFunctions, showFilters: showFilters, onToggleFilters: () => setShowFilters(!showFilters), hasFilterableColumns: hasFilterableColumns }), jsx(TableContainer, { children: jsxs(Table, { sx: { minWidth: 750 }, "aria-labelledby": "tableTitle", size: dense ? "small" : "medium", children: [jsx(EnhancedTableHead, { numSelected: selected.length, order: order, orderBy: orderBy, onSelectAllClick: handleSelectAllClick, onRequestSort: handleRequestSort, rowCount: data.length, headCells: headCells, withSelection: withSelection, withSubRows: !!subHeadCells }), jsxs(TableBody, { children: [showFilters && (jsx(EnhancedTableFilterRow, { headCells: headCells, filters: filters, onFilterChange: handleFilterChange, withSelection: withSelection, withSubRows: !!subHeadCells })), data.map((row, index) => (jsx(EnhancedTableRow, { row: row, headCells: headCells, subHeadCells: subHeadCells, withSelection: withSelection, isSelected: selected.includes(row.
|
|
162
|
+
return (jsxs(Box, { sx: { width: "100%" }, children: [jsxs(Paper, { sx: { width: "100%", mb: 2 }, children: [jsx(EnhancedTableToolbar, { selected: selected, setSelected: setSelected, title: title, functions: functions, selectFunctions: selectFunctions, showFilters: showFilters, onToggleFilters: () => setShowFilters(!showFilters), hasFilterableColumns: hasFilterableColumns }), jsx(TableContainer, { children: jsxs(Table, { sx: { minWidth: 750 }, "aria-labelledby": "tableTitle", size: dense ? "small" : "medium", children: [jsx(EnhancedTableHead, { numSelected: selected.length, order: order, orderBy: orderBy, onSelectAllClick: handleSelectAllClick, onRequestSort: handleRequestSort, rowCount: data.length, headCells: headCells, withSelection: withSelection, withSubRows: !!subHeadCells }), jsxs(TableBody, { children: [showFilters && (jsx(EnhancedTableFilterRow, { headCells: headCells, filters: filters, onFilterChange: handleFilterChange, withSelection: withSelection, withSubRows: !!subHeadCells })), data.map((row, index) => (jsx(EnhancedTableRow, { row: row, headCells: headCells, subHeadCells: subHeadCells, withSelection: withSelection, isSelected: selected.includes(row.documentId), handleSelectClick: handleSelectClick, subTitle: subTitle }, row.id))), emptyRows > 0 && (jsx(TableRow, { style: {
|
|
163
163
|
height: (dense ? 33 : 53) * emptyRows,
|
|
164
164
|
}, children: jsx(TableCell, { colSpan: headCells.length +
|
|
165
165
|
(withSelection ? 1 : 0) +
|
|
@@ -27,7 +27,7 @@ function EnhancedTableRow(props, index) {
|
|
|
27
27
|
const colspan = headCells.length + (withSelection ? 1 : 0) + (subHeadCells ? 1 : 0);
|
|
28
28
|
return (jsxs(Fragment, { children: [jsxs(TableRow, { sx: { "& > *": { borderBottom: "unset" } }, children: [withSelection && (jsx(TableCell, { padding: "checkbox", children: jsx(Checkbox, { color: "primary", checked: isSelected, inputProps: {
|
|
29
29
|
"aria-labelledby": labelId,
|
|
30
|
-
}, onClick: (event) => handleSelectClick && handleSelectClick(event, row.
|
|
30
|
+
}, onClick: (event) => handleSelectClick && handleSelectClick(event, row.documentId) }) })), subRows && subHeadCells && (jsx(TableCell, { children: jsx(IconButton, { "aria-label": "expand row", size: "small", onClick: () => setOpen(!open), children: open ? jsx(KeyboardArrowUpIcon, {}) : jsx(KeyboardArrowDownIcon, {}) }) })), headCells.map((cell) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: row[cell.id] }, cell.id)))] }), subRows && subHeadCells && (jsx(TableRow, { children: jsx(TableCell, { style: { paddingBottom: 0, paddingTop: 0 }, colSpan: colspan, children: jsx(Collapse, { in: open, timeout: "auto", unmountOnExit: true, children: jsxs(Box, { sx: { margin: 1 }, children: [jsx(Typography, { variant: "h6", gutterBottom: true, component: "div", children: subTitle }), jsxs(Table, { size: "small", "aria-label": "purchases", children: [jsx(TableHead, { children: jsx(TableRow, { children: subHeadCells.map((cell) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: cell.label }, `${cell.id}${cell.label}`))) }) }), jsx(TableBody, { children: subRows.map((subRow, index) => (jsx(TableRow, { children: subHeadCells.map((cell, index) => (jsx(TableCell, { align: cell.numeric ? "right" : "left", padding: cell.disablePadding ? "none" : "normal", children: subRow[cell.id] }, `${index}${cell.label}`))) }, `${subRow.key}${index}`))) })] })] }) }) }) }))] }));
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
export { EnhancedTableRow as default };
|
|
@@ -28,29 +28,30 @@ function FeatureSection({ data, }) {
|
|
|
28
28
|
[theme.breakpoints.up("sm")]: {
|
|
29
29
|
flexDirection: "row",
|
|
30
30
|
},
|
|
31
|
-
}, useFlexGap: true, children: feature
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
31
|
+
}, useFlexGap: true, children: feature &&
|
|
32
|
+
feature.map((feature) => {
|
|
33
|
+
const Icon = getIcon(feature.icon);
|
|
34
|
+
return (jsx(Card, { id: feature.anchor || "", sx: {
|
|
35
|
+
display: "flex",
|
|
36
|
+
flexDirection: "column",
|
|
37
|
+
justifyContent: "space-between",
|
|
38
|
+
flex: 1,
|
|
39
|
+
minWidth: 275,
|
|
40
|
+
}, children: jsxs(CardContent, { children: [jsx(Box, { sx: {
|
|
41
|
+
height: 100,
|
|
42
|
+
display: "grid",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
}, children: Icon !== null && (jsx(Icon, { sx: {
|
|
46
|
+
mr: 2,
|
|
47
|
+
mt: 0.2,
|
|
48
|
+
width: "75px",
|
|
49
|
+
height: "75px",
|
|
50
|
+
fill: "none",
|
|
51
|
+
stroke: "currentColor",
|
|
52
|
+
strokeWidth: 0.5,
|
|
53
|
+
} })) }), jsx(Typography, { variant: "h5", align: "center", component: "div", sx: { mb: 2, height: "4rem" }, children: feature.heading }), jsx(Typography, { variant: "h6", align: "center", component: "div", sx: { mb: 2, height: "4rem" }, children: feature.subHeading }), feature.text && jsx(MuiMarkdown, { children: feature.text })] }) }, feature.id));
|
|
54
|
+
}) }) }));
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
export { FeatureSection };
|
|
@@ -17,7 +17,7 @@ const baseUrl = getStrapiURL();
|
|
|
17
17
|
* INFO Fetch all IROs
|
|
18
18
|
* used by the IROs table in the admin panel
|
|
19
19
|
*/
|
|
20
|
-
async function getAllIros(currentPage, rowsPerPage, order, orderBy, is_archive = [false], // default to only non-archived OPOs
|
|
20
|
+
async function getAllIros(currentPage, rowsPerPage, order, orderBy = "createdAt", is_archive = [false], // default to only non-archived OPOs
|
|
21
21
|
filters = {}) {
|
|
22
22
|
unstable_noStore();
|
|
23
23
|
const user = await getUserRole();
|
|
@@ -32,7 +32,7 @@ filters = {}) {
|
|
|
32
32
|
},
|
|
33
33
|
...processedFilters,
|
|
34
34
|
},
|
|
35
|
-
sort: `${orderBy || "
|
|
35
|
+
sort: `${orderBy || "createdAt"}:${order || "desc"}`,
|
|
36
36
|
populate: {
|
|
37
37
|
iro_items: {
|
|
38
38
|
populate: {
|
|
@@ -79,65 +79,71 @@ async function getAllPages() {
|
|
|
79
79
|
unstable_noStore();
|
|
80
80
|
const url = new URL("/api/pages", baseUrl);
|
|
81
81
|
url.search = qs.stringify({
|
|
82
|
+
// populate: "*", // Populate all fields
|
|
82
83
|
populate: {
|
|
83
84
|
blocks: {
|
|
85
|
+
populate: "*",
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
/* populate: {
|
|
89
|
+
blocks: {
|
|
90
|
+
populate: {
|
|
91
|
+
bgImage: {
|
|
92
|
+
populate: true,
|
|
93
|
+
// fields: ["url", "alternativeText"],
|
|
94
|
+
},
|
|
95
|
+
logoImage: {
|
|
96
|
+
populate: true,
|
|
97
|
+
// fields: ["url", "alternativeText"],
|
|
98
|
+
},
|
|
99
|
+
image: {
|
|
100
|
+
populate: true,
|
|
101
|
+
// fields: ["url", "alternativeText"],
|
|
102
|
+
},
|
|
103
|
+
link: {
|
|
104
|
+
populate: true,
|
|
105
|
+
},
|
|
106
|
+
feature: {
|
|
107
|
+
populate: true,
|
|
108
|
+
},
|
|
109
|
+
icon: {
|
|
110
|
+
populate: true,
|
|
111
|
+
},
|
|
112
|
+
airplane: {
|
|
84
113
|
populate: {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
column: {
|
|
112
|
-
populate: true,
|
|
113
|
-
},
|
|
114
|
-
partner: {
|
|
115
|
-
populate: {
|
|
116
|
-
text: true,
|
|
117
|
-
photo: true,
|
|
118
|
-
links: true,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
pictures: true,
|
|
122
|
-
companies: {
|
|
123
|
-
populate: {
|
|
124
|
-
logo: true,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
textV2: true,
|
|
128
|
-
category: {
|
|
129
|
-
populate: {
|
|
130
|
-
products: {
|
|
131
|
-
populate: {
|
|
132
|
-
image: true,
|
|
133
|
-
price: true,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
},
|
|
114
|
+
floorplan: true,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
column: {
|
|
118
|
+
populate: true,
|
|
119
|
+
},
|
|
120
|
+
partner: {
|
|
121
|
+
populate: {
|
|
122
|
+
text: true,
|
|
123
|
+
photo: true,
|
|
124
|
+
links: true,
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
pictures: true,
|
|
128
|
+
companies: {
|
|
129
|
+
populate: {
|
|
130
|
+
logo: true,
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
textV2: true,
|
|
134
|
+
category: {
|
|
135
|
+
populate: {
|
|
136
|
+
products: {
|
|
137
|
+
populate: {
|
|
138
|
+
image: true,
|
|
139
|
+
price: true,
|
|
137
140
|
},
|
|
141
|
+
},
|
|
138
142
|
},
|
|
143
|
+
},
|
|
139
144
|
},
|
|
140
|
-
|
|
145
|
+
},
|
|
146
|
+
}, */
|
|
141
147
|
});
|
|
142
148
|
return await fetchData(url.href);
|
|
143
149
|
}
|
|
@@ -20,61 +20,62 @@ async function getSinglePage(slug) {
|
|
|
20
20
|
url.search = qs.stringify({
|
|
21
21
|
populate: {
|
|
22
22
|
blocks: {
|
|
23
|
-
populate:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
populate: "*",
|
|
24
|
+
/* {
|
|
25
|
+
logoImage: {
|
|
26
|
+
populate: true,
|
|
27
|
+
// fields: ["url", "alternativeText"],
|
|
28
|
+
},
|
|
29
|
+
bgImage: {
|
|
30
|
+
populate: true,
|
|
31
|
+
// fields: ["url", "alternativeText"],
|
|
32
|
+
},
|
|
33
|
+
image: {
|
|
34
|
+
populate: true,
|
|
35
|
+
// fields: ["url", "alternativeText"],
|
|
36
|
+
},
|
|
37
|
+
link: {
|
|
38
|
+
populate: true,
|
|
39
|
+
},
|
|
40
|
+
feature: {
|
|
41
|
+
populate: true,
|
|
42
|
+
},
|
|
43
|
+
icon: {
|
|
44
|
+
populate: true,
|
|
45
|
+
},
|
|
46
|
+
airplane: {
|
|
47
|
+
populate: {
|
|
48
|
+
floorplan: true,
|
|
27
49
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
50
|
+
},
|
|
51
|
+
column: {
|
|
52
|
+
populate: true,
|
|
53
|
+
},
|
|
54
|
+
partner: {
|
|
55
|
+
populate: {
|
|
56
|
+
text: true,
|
|
57
|
+
photo: true,
|
|
58
|
+
links: true,
|
|
31
59
|
},
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
60
|
+
},
|
|
61
|
+
pictures: true,
|
|
62
|
+
companies: {
|
|
63
|
+
populate: {
|
|
64
|
+
logo: true,
|
|
35
65
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
icon: {
|
|
43
|
-
populate: true,
|
|
44
|
-
},
|
|
45
|
-
airplane: {
|
|
46
|
-
populate: {
|
|
47
|
-
floorplan: true,
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
column: {
|
|
51
|
-
populate: true,
|
|
52
|
-
},
|
|
53
|
-
partner: {
|
|
54
|
-
populate: {
|
|
55
|
-
text: true,
|
|
56
|
-
photo: true,
|
|
57
|
-
links: true,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
pictures: true,
|
|
61
|
-
companies: {
|
|
62
|
-
populate: {
|
|
63
|
-
logo: true,
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
textV2: true,
|
|
67
|
-
category: {
|
|
66
|
+
},
|
|
67
|
+
textV2: true,
|
|
68
|
+
category: {
|
|
69
|
+
populate: {
|
|
70
|
+
products: {
|
|
68
71
|
populate: {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
image: true,
|
|
72
|
-
price: true,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
72
|
+
image: true,
|
|
73
|
+
price: true,
|
|
75
74
|
},
|
|
75
|
+
},
|
|
76
76
|
},
|
|
77
|
-
|
|
77
|
+
},
|
|
78
|
+
}, */
|
|
78
79
|
},
|
|
79
80
|
},
|
|
80
81
|
});
|
|
@@ -11,7 +11,9 @@ import { getStrapiURL } from '../../lib/utils.js';
|
|
|
11
11
|
import { unstable_noStore } from 'next/cache';
|
|
12
12
|
|
|
13
13
|
const baseUrl = getStrapiURL();
|
|
14
|
-
/*
|
|
14
|
+
/*
|
|
15
|
+
broken after updating cms to strapi v5
|
|
16
|
+
const query = qs.stringify({
|
|
15
17
|
populate: {
|
|
16
18
|
customer_profile: {
|
|
17
19
|
populate: {
|
|
@@ -56,7 +58,13 @@ const baseUrl = getStrapiURL();
|
|
|
56
58
|
},
|
|
57
59
|
},
|
|
58
60
|
}); */
|
|
59
|
-
const query = qs.stringify({
|
|
61
|
+
const query = qs.stringify({
|
|
62
|
+
populate: {
|
|
63
|
+
customer_profile: {
|
|
64
|
+
populate: "*",
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
});
|
|
60
68
|
const roleQuery = qs.stringify({
|
|
61
69
|
populate: "role",
|
|
62
70
|
});
|