@dashadmin/dash-admin 1.3.51 → 1.3.53
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/components/avatar/Avatar.js +10 -1
- package/dist/components/currency/Format.js +3 -1
- package/dist/components/i18n/BridgedLocalesMenuButton.js +4 -2
- package/dist/components/misc/NoResults.js +3 -1
- package/dist/components/permission/PermissionsSelector.js +34 -14
- package/dist/components/permission/PermissionsSelectorList.js +11 -1
- package/dist/components/selects/RASearchableSelect.js +8 -6
- package/dist/components/selects/RASearchableSelectChips.js +8 -6
- package/dist/components/selects/SearchableSelect.js +8 -6
- package/dist/components/subscription/PlanAddonsSettings.js +88 -17
- package/dist/components/subscription/PlanAuditLog.js +41 -21
- package/dist/components/subscription/PlanFeaturesSettings.js +35 -6
- package/dist/components/subscription/PlanMetadataSettings.js +78 -42
- package/dist/components/subscription/PlanPricesSettings.js +20 -8
- package/dist/components/tenant/TenantSelector.js +8 -6
- package/dist/components/user/UserPreferences.js +77 -22
- package/dist/pages/DASHLightWeightLogin.js +7 -5
- package/dist/pages/Profile.js +5 -3
- package/dist/pages/RecoverPassword.js +28 -14
- package/dist/schemas/subscription/components/SubscriptionPaymentHistory.js +14 -2
- package/dist/schemas/subscription/components/SubscriptionPlanFeatures.js +37 -25
- package/dist/schemas/subscription/components/SubscriptionPlanPreview.js +47 -28
- package/dist/schemas/subscription/components/SubscriptionPlanStats.js +127 -37
- package/package.json +5 -5
- package/src/components/avatar/Avatar.tsx +8 -4
- package/src/components/currency/Format.tsx +8 -6
- package/src/components/i18n/BridgedLocalesMenuButton.tsx +4 -2
- package/src/components/misc/DASHGlobalErrorHandler.tsx +1 -1
- package/src/components/misc/NoResults.tsx +7 -4
- package/src/components/permission/AvailablePermissionsContext.tsx +1 -1
- package/src/components/permission/PermissionsSelector.tsx +48 -33
- package/src/components/permission/PermissionsSelectorList.tsx +7 -2
- package/src/components/selects/RASearchableSelect.tsx +22 -19
- package/src/components/selects/RASearchableSelectChips.tsx +23 -19
- package/src/components/selects/SearchableSelect.tsx +22 -18
- package/src/components/subscription/PlanAddonsSettings.tsx +61 -20
- package/src/components/subscription/PlanAuditLog.tsx +22 -8
- package/src/components/subscription/PlanFeaturesSettings.tsx +28 -8
- package/src/components/subscription/PlanMetadataSettings.tsx +29 -7
- package/src/components/subscription/PlanPricesSettings.tsx +30 -18
- package/src/components/tenant/TenantAttributesContext.tsx +1 -1
- package/src/components/tenant/TenantSelector.tsx +20 -17
- package/src/components/tenant/TenantSettingsContext.tsx +1 -1
- package/src/components/user/UserPreferences.tsx +56 -21
- package/src/contexts/SystemRequestsCache.tsx +1 -1
- package/src/default-theme/menu/AppMenuComponents/expanded/CollapsableSidebarMenu.tsx +3 -3
- package/src/default-theme/menu/SidebarActions.tsx +6 -6
- package/src/pages/DASHLightWeightLogin.tsx +8 -7
- package/src/pages/Profile.tsx +10 -9
- package/src/pages/RecoverPassword.tsx +15 -6
- package/src/schemas/subscription/components/SubscriptionPaymentHistory.tsx +9 -2
- package/src/schemas/subscription/components/SubscriptionPlanFeatures.tsx +10 -3
- package/src/schemas/subscription/components/SubscriptionPlanPreview.tsx +25 -12
- package/src/schemas/subscription/components/SubscriptionPlanStats.tsx +64 -14
- package/src/theme/AppSidebarLogo.tsx +7 -7
|
@@ -52,7 +52,16 @@ const AvatarDisplay = (props) => {
|
|
|
52
52
|
const record = useRecordContext();
|
|
53
53
|
const _attributeName = attribute.listAttribute || attribute.attribute;
|
|
54
54
|
const imageUrl = record == null ? void 0 : record[_attributeName];
|
|
55
|
-
return /* @__PURE__ */ jsx(
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
Box,
|
|
57
|
+
{
|
|
58
|
+
sx: {
|
|
59
|
+
display: "flex",
|
|
60
|
+
alignItems: "center"
|
|
61
|
+
},
|
|
62
|
+
children: /* @__PURE__ */ jsx(AvatarMui, { src: imageUrl, alt: "avatar" })
|
|
63
|
+
}
|
|
64
|
+
);
|
|
56
65
|
};
|
|
57
66
|
const Avatar = ({ method, attribute, resourceConfig }) => {
|
|
58
67
|
switch (method) {
|
|
@@ -103,8 +103,10 @@ const BridgedLocalesMenuButton = ({
|
|
|
103
103
|
anchorEl,
|
|
104
104
|
open,
|
|
105
105
|
onClose: handleClose,
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
slotProps: {
|
|
107
|
+
list: {
|
|
108
|
+
"aria-labelledby": "locale-button"
|
|
109
|
+
}
|
|
108
110
|
},
|
|
109
111
|
children: locales.map((localeOption) => /* @__PURE__ */ jsx(
|
|
110
112
|
MenuItem,
|
|
@@ -8,7 +8,9 @@ const NoResults = (props) => {
|
|
|
8
8
|
/* @__PURE__ */ jsx(InfoIcon, { sx: { fontSize: 32 } }),
|
|
9
9
|
title ? /* @__PURE__ */ jsx(Typography, { variant: "h5", children: title }) : "No hay registros"
|
|
10
10
|
] }),
|
|
11
|
-
description && /* @__PURE__ */ jsx(Typography, { variant: "body1",
|
|
11
|
+
description && /* @__PURE__ */ jsx(Typography, { variant: "body1", sx: {
|
|
12
|
+
color: "text.secondary"
|
|
13
|
+
}, children: description }),
|
|
12
14
|
children ? children : /* @__PURE__ */ jsx(Fragment, {})
|
|
13
15
|
] }) });
|
|
14
16
|
};
|
|
@@ -97,7 +97,9 @@ const PermissionsSelectorView = ({
|
|
|
97
97
|
}
|
|
98
98
|
}, [record == null ? void 0 : record.permissions]);
|
|
99
99
|
if (!(record == null ? void 0 : record.permissions) || record.permissions.length === 0) {
|
|
100
|
-
return /* @__PURE__ */ jsx(Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
100
|
+
return /* @__PURE__ */ jsx(Box, { sx: { p: 2, textAlign: "center" }, children: /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
101
|
+
color: "text.secondary"
|
|
102
|
+
}, children: "No permissions assigned" }) });
|
|
101
103
|
}
|
|
102
104
|
return /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
|
|
103
105
|
/* @__PURE__ */ jsxs(Typography, { variant: "h6", sx: { mb: 3 }, children: [
|
|
@@ -462,9 +464,11 @@ const PermissionsSelectorBase = ({
|
|
|
462
464
|
placeholder: "e.g., user, admin, system...",
|
|
463
465
|
value: groupSearchTerm,
|
|
464
466
|
onChange: (e) => setGroupSearchTerm(e.target.value),
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
467
|
+
slotProps: {
|
|
468
|
+
input: {
|
|
469
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx(SearchIcon, { color: "action" }) }),
|
|
470
|
+
endAdornment: groupSearchTerm && /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleClearGroupSearch, children: /* @__PURE__ */ jsx(ClearIcon, { fontSize: "small" }) }) })
|
|
471
|
+
}
|
|
468
472
|
}
|
|
469
473
|
}
|
|
470
474
|
) }),
|
|
@@ -477,15 +481,19 @@ const PermissionsSelectorBase = ({
|
|
|
477
481
|
placeholder: "e.g., create, edit, delete, view...",
|
|
478
482
|
value: itemSearchTerm,
|
|
479
483
|
onChange: (e) => setItemSearchTerm(e.target.value),
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
484
|
+
slotProps: {
|
|
485
|
+
input: {
|
|
486
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: /* @__PURE__ */ jsx(SearchIcon, { color: "action" }) }),
|
|
487
|
+
endAdornment: itemSearchTerm && /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(IconButton, { size: "small", onClick: handleClearItemSearch, children: /* @__PURE__ */ jsx(ClearIcon, { fontSize: "small" }) }) })
|
|
488
|
+
}
|
|
483
489
|
}
|
|
484
490
|
}
|
|
485
491
|
) })
|
|
486
492
|
] }),
|
|
487
493
|
hasActiveSearch && /* @__PURE__ */ jsxs(Box, { sx: { mt: 2, p: 2, bgcolor: "action.hover", borderRadius: 1 }, children: [
|
|
488
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "body2",
|
|
494
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", sx: {
|
|
495
|
+
color: "text.secondary"
|
|
496
|
+
}, children: [
|
|
489
497
|
/* @__PURE__ */ jsx("strong", { children: "Search Results:" }),
|
|
490
498
|
" ",
|
|
491
499
|
filteredGroupsCount,
|
|
@@ -524,12 +532,24 @@ const PermissionsSelectorBase = ({
|
|
|
524
532
|
borderColor: "divider"
|
|
525
533
|
}, children: [
|
|
526
534
|
/* @__PURE__ */ jsx(SearchIcon, { sx: { fontSize: 48, color: "text.disabled", mb: 2 } }),
|
|
527
|
-
/* @__PURE__ */ jsx(Typography, { variant: "h6",
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
535
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", gutterBottom: true, sx: {
|
|
536
|
+
color: "text.secondary"
|
|
537
|
+
}, children: "No permissions found" }),
|
|
538
|
+
/* @__PURE__ */ jsxs(
|
|
539
|
+
Typography,
|
|
540
|
+
{
|
|
541
|
+
variant: "body2",
|
|
542
|
+
sx: {
|
|
543
|
+
color: "text.disabled",
|
|
544
|
+
mb: 2
|
|
545
|
+
},
|
|
546
|
+
children: [
|
|
547
|
+
"No permissions match your search criteria",
|
|
548
|
+
debouncedGroupSearch && ` for group "${debouncedGroupSearch}"`,
|
|
549
|
+
debouncedItemSearch && ` for permission "${debouncedItemSearch}"`
|
|
550
|
+
]
|
|
551
|
+
}
|
|
552
|
+
),
|
|
533
553
|
/* @__PURE__ */ jsx(
|
|
534
554
|
Button,
|
|
535
555
|
{
|
|
@@ -356,7 +356,17 @@ const PermissionsSelectorListBase = ({
|
|
|
356
356
|
onToggle: handleTogglePermission
|
|
357
357
|
},
|
|
358
358
|
permission.route_name
|
|
359
|
-
)) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: 4, align: "center", children: /* @__PURE__ */ jsx(
|
|
359
|
+
)) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: 4, align: "center", children: /* @__PURE__ */ jsx(
|
|
360
|
+
Typography,
|
|
361
|
+
{
|
|
362
|
+
variant: "body2",
|
|
363
|
+
sx: {
|
|
364
|
+
color: "text.secondary",
|
|
365
|
+
py: 3
|
|
366
|
+
},
|
|
367
|
+
children: "No permissions found"
|
|
368
|
+
}
|
|
369
|
+
) }) }) })
|
|
360
370
|
] }),
|
|
361
371
|
/* @__PURE__ */ jsx(
|
|
362
372
|
TablePagination,
|
|
@@ -170,12 +170,14 @@ const SearchableSelect = ({
|
|
|
170
170
|
if (searchValue && searchValue !== "" && searchValue.length >= minSearch)
|
|
171
171
|
debounce(() => setQ(searchValue), timerSearch);
|
|
172
172
|
},
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
slotProps: __spreadProps(__spreadValues({}, params.slotProps), {
|
|
174
|
+
input: __spreadProps(__spreadValues({}, params.slotProps.input), {
|
|
175
|
+
autoComplete: "new-password",
|
|
176
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
177
|
+
isLoading ? /* @__PURE__ */ jsx(CircularProgress, { color: "inherit", size: 20 }) : null,
|
|
178
|
+
params.slotProps.input.endAdornment
|
|
179
|
+
] })
|
|
180
|
+
})
|
|
179
181
|
})
|
|
180
182
|
}),
|
|
181
183
|
params.id
|
|
@@ -174,12 +174,14 @@ const SearchableSelectChipsControl = ({
|
|
|
174
174
|
if (searchValue && searchValue !== "" && searchValue.length >= minSearch)
|
|
175
175
|
debounce(() => setQ(searchValue), timerSearch);
|
|
176
176
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
177
|
+
slotProps: __spreadProps(__spreadValues({}, params.slotProps), {
|
|
178
|
+
input: __spreadProps(__spreadValues({}, params.slotProps.input), {
|
|
179
|
+
autoComplete: "new-password",
|
|
180
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
181
|
+
isResourceSearchLoading ? /* @__PURE__ */ jsx(CircularProgress, { color: "inherit", size: 20 }) : null,
|
|
182
|
+
params.slotProps.input.endAdornment
|
|
183
|
+
] })
|
|
184
|
+
})
|
|
183
185
|
})
|
|
184
186
|
}),
|
|
185
187
|
params.id
|
|
@@ -109,12 +109,14 @@ const SearchableSelect = ({
|
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
onBlur: () => setQ(""),
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
slotProps: __spreadProps(__spreadValues({}, params.slotProps), {
|
|
113
|
+
input: __spreadProps(__spreadValues({}, params.slotProps.input), {
|
|
114
|
+
autoComplete: "new-password",
|
|
115
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
116
|
+
isLoading ? /* @__PURE__ */ jsx(CircularProgress, { color: "inherit", size: 20 }) : null,
|
|
117
|
+
params.slotProps.input.endAdornment
|
|
118
|
+
] })
|
|
119
|
+
})
|
|
118
120
|
})
|
|
119
121
|
})
|
|
120
122
|
)
|
|
@@ -76,7 +76,9 @@ const AddonRow = ({ addonId, entry, plan, mode }) => {
|
|
|
76
76
|
borderLeft: isEnabled ? "4px solid #4caf50" : "4px solid #e0e0e0",
|
|
77
77
|
transition: "border-color 0.3s"
|
|
78
78
|
},
|
|
79
|
-
children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2,
|
|
79
|
+
children: /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 2, sx: {
|
|
80
|
+
alignItems: "flex-start"
|
|
81
|
+
}, children: [
|
|
80
82
|
/* @__PURE__ */ jsxs(Grid, { item: true, xs: 12, md: 4, children: [
|
|
81
83
|
/* @__PURE__ */ jsx(
|
|
82
84
|
Controller,
|
|
@@ -102,11 +104,15 @@ const AddonRow = ({ addonId, entry, plan, mode }) => {
|
|
|
102
104
|
}
|
|
103
105
|
),
|
|
104
106
|
label: /* @__PURE__ */ jsxs(Box, { children: [
|
|
105
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "subtitle1",
|
|
107
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "subtitle1", sx: {
|
|
108
|
+
fontWeight: "medium"
|
|
109
|
+
}, children: [
|
|
106
110
|
entry.icon && /* @__PURE__ */ jsx("span", { style: { marginRight: 8 }, children: entry.icon }),
|
|
107
111
|
entry.label
|
|
108
112
|
] }),
|
|
109
|
-
entry.description && /* @__PURE__ */ jsx(Typography, { variant: "caption",
|
|
113
|
+
entry.description && /* @__PURE__ */ jsx(Typography, { variant: "caption", sx: {
|
|
114
|
+
color: "text.secondary"
|
|
115
|
+
}, children: entry.description })
|
|
110
116
|
] })
|
|
111
117
|
}
|
|
112
118
|
);
|
|
@@ -143,13 +149,15 @@ const AddonRow = ({ addonId, entry, plan, mode }) => {
|
|
|
143
149
|
type: "text",
|
|
144
150
|
size: "small",
|
|
145
151
|
disabled: isReadOnly,
|
|
146
|
-
InputProps: {
|
|
147
|
-
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: config.symbol })
|
|
148
|
-
},
|
|
149
152
|
sx: { width: 150 },
|
|
150
153
|
value: formatPrice((_a3 = field.value) != null ? _a3 : 0, currency),
|
|
151
154
|
onChange: (e) => handlePriceChange(currency, e.target.value),
|
|
152
|
-
helperText: config.name
|
|
155
|
+
helperText: config.name,
|
|
156
|
+
slotProps: {
|
|
157
|
+
input: {
|
|
158
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: config.symbol })
|
|
159
|
+
}
|
|
160
|
+
}
|
|
153
161
|
})
|
|
154
162
|
);
|
|
155
163
|
}
|
|
@@ -157,10 +165,21 @@ const AddonRow = ({ addonId, entry, plan, mode }) => {
|
|
|
157
165
|
currency
|
|
158
166
|
);
|
|
159
167
|
}) }),
|
|
160
|
-
((_g = plan == null ? void 0 : plan.flow_addon_items) == null ? void 0 : _g[addonId]) && /* @__PURE__ */ jsxs(
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
168
|
+
((_g = plan == null ? void 0 : plan.flow_addon_items) == null ? void 0 : _g[addonId]) && /* @__PURE__ */ jsxs(
|
|
169
|
+
Typography,
|
|
170
|
+
{
|
|
171
|
+
variant: "caption",
|
|
172
|
+
sx: {
|
|
173
|
+
color: "text.secondary",
|
|
174
|
+
mt: 1,
|
|
175
|
+
display: "block"
|
|
176
|
+
},
|
|
177
|
+
children: [
|
|
178
|
+
"Flow Item ID: ",
|
|
179
|
+
plan.flow_addon_items[addonId]
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
)
|
|
164
183
|
] }) })
|
|
165
184
|
] })
|
|
166
185
|
}
|
|
@@ -203,9 +222,29 @@ const PlanAddonsSettingsEdit = ({ method, attribute }) => {
|
|
|
203
222
|
}, {});
|
|
204
223
|
return /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
|
|
205
224
|
/* @__PURE__ */ jsx(Typography, { variant: "h6", gutterBottom: true, children: "Plan Add-ons Configuration" }),
|
|
206
|
-
/* @__PURE__ */ jsx(
|
|
225
|
+
/* @__PURE__ */ jsx(
|
|
226
|
+
Typography,
|
|
227
|
+
{
|
|
228
|
+
variant: "body2",
|
|
229
|
+
sx: {
|
|
230
|
+
color: "text.secondary",
|
|
231
|
+
mb: 3
|
|
232
|
+
},
|
|
233
|
+
children: "Enable add-ons and set prices per currency. Prices are in the smallest currency unit (e.g., cents for USD, pesos for CLP)."
|
|
234
|
+
}
|
|
235
|
+
),
|
|
207
236
|
Object.entries(groupedByTab).map(([tabName, entries]) => /* @__PURE__ */ jsxs(Box, { sx: { mb: 4 }, children: [
|
|
208
|
-
/* @__PURE__ */ jsx(
|
|
237
|
+
/* @__PURE__ */ jsx(
|
|
238
|
+
Typography,
|
|
239
|
+
{
|
|
240
|
+
variant: "subtitle1",
|
|
241
|
+
sx: {
|
|
242
|
+
fontWeight: "bold",
|
|
243
|
+
mb: 2
|
|
244
|
+
},
|
|
245
|
+
children: tabName
|
|
246
|
+
}
|
|
247
|
+
),
|
|
209
248
|
/* @__PURE__ */ jsx(Divider, { sx: { mb: 2 } }),
|
|
210
249
|
entries.map((entry) => {
|
|
211
250
|
const addonId = entry.attribute ? entry.attribute.replace("addons.", "") : entry.id;
|
|
@@ -257,9 +296,29 @@ const PlanAddonsSettingsCreate = ({ method, attribute }) => {
|
|
|
257
296
|
}, {});
|
|
258
297
|
return /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
|
|
259
298
|
/* @__PURE__ */ jsx(Typography, { variant: "h6", gutterBottom: true, children: "Plan Add-ons Configuration" }),
|
|
260
|
-
/* @__PURE__ */ jsx(
|
|
299
|
+
/* @__PURE__ */ jsx(
|
|
300
|
+
Typography,
|
|
301
|
+
{
|
|
302
|
+
variant: "body2",
|
|
303
|
+
sx: {
|
|
304
|
+
color: "text.secondary",
|
|
305
|
+
mb: 3
|
|
306
|
+
},
|
|
307
|
+
children: "Enable add-ons and set prices per currency. Prices are in the smallest currency unit."
|
|
308
|
+
}
|
|
309
|
+
),
|
|
261
310
|
Object.entries(groupedByTab).map(([tabName, entries]) => /* @__PURE__ */ jsxs(Box, { sx: { mb: 4 }, children: [
|
|
262
|
-
/* @__PURE__ */ jsx(
|
|
311
|
+
/* @__PURE__ */ jsx(
|
|
312
|
+
Typography,
|
|
313
|
+
{
|
|
314
|
+
variant: "subtitle1",
|
|
315
|
+
sx: {
|
|
316
|
+
fontWeight: "bold",
|
|
317
|
+
mb: 2
|
|
318
|
+
},
|
|
319
|
+
children: tabName
|
|
320
|
+
}
|
|
321
|
+
),
|
|
263
322
|
/* @__PURE__ */ jsx(Divider, { sx: { mb: 2 } }),
|
|
264
323
|
entries.map((entry) => {
|
|
265
324
|
const addonId = entry.attribute ? entry.attribute.replace("addons.", "") : entry.id;
|
|
@@ -294,7 +353,17 @@ const PlanAddonsSettingsView = ({ method, attribute }) => {
|
|
|
294
353
|
return /* @__PURE__ */ jsxs(Box, { sx: { p: 2 }, children: [
|
|
295
354
|
/* @__PURE__ */ jsx(Typography, { variant: "h6", gutterBottom: true, children: "Plan Add-ons" }),
|
|
296
355
|
Object.entries(groupedByTab).map(([tabName, entries]) => /* @__PURE__ */ jsxs(Box, { sx: { mb: 3 }, children: [
|
|
297
|
-
/* @__PURE__ */ jsx(
|
|
356
|
+
/* @__PURE__ */ jsx(
|
|
357
|
+
Typography,
|
|
358
|
+
{
|
|
359
|
+
variant: "subtitle1",
|
|
360
|
+
sx: {
|
|
361
|
+
fontWeight: "bold",
|
|
362
|
+
mb: 2
|
|
363
|
+
},
|
|
364
|
+
children: tabName
|
|
365
|
+
}
|
|
366
|
+
),
|
|
298
367
|
/* @__PURE__ */ jsx(Divider, { sx: { mb: 2 } }),
|
|
299
368
|
entries.map((entry) => {
|
|
300
369
|
var _a, _b, _c, _d, _e;
|
|
@@ -338,7 +407,9 @@ const PlanAddonsSettingsView = ({ method, attribute }) => {
|
|
|
338
407
|
formatPrice(price, currency)
|
|
339
408
|
] }, currency);
|
|
340
409
|
}),
|
|
341
|
-
flowItemId && /* @__PURE__ */ jsxs(Typography, { variant: "caption",
|
|
410
|
+
flowItemId && /* @__PURE__ */ jsxs(Typography, { variant: "caption", sx: {
|
|
411
|
+
color: "text.secondary"
|
|
412
|
+
}, children: [
|
|
342
413
|
"Flow ID: ",
|
|
343
414
|
flowItemId
|
|
344
415
|
] })
|
|
@@ -72,24 +72,36 @@ const JsonDialog = ({ open, log, onClose }) => {
|
|
|
72
72
|
fullWidth: true,
|
|
73
73
|
"aria-labelledby": "audit-log-dialog-title",
|
|
74
74
|
children: [
|
|
75
|
-
/* @__PURE__ */ jsx(DialogTitle, { id: "audit-log-dialog-title", children: /* @__PURE__ */ jsxs(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
75
|
+
/* @__PURE__ */ jsx(DialogTitle, { id: "audit-log-dialog-title", children: /* @__PURE__ */ jsxs(
|
|
76
|
+
Box,
|
|
77
|
+
{
|
|
78
|
+
sx: {
|
|
79
|
+
display: "flex",
|
|
80
|
+
justifyContent: "space-between",
|
|
81
|
+
alignItems: "center"
|
|
82
|
+
},
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "h6", children: [
|
|
85
|
+
"Audit Log Details - ",
|
|
86
|
+
log.event || log.description
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsx(
|
|
89
|
+
IconButton,
|
|
90
|
+
{
|
|
91
|
+
edge: "end",
|
|
92
|
+
color: "inherit",
|
|
93
|
+
onClick: onClose,
|
|
94
|
+
"aria-label": "close",
|
|
95
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
) }),
|
|
91
101
|
/* @__PURE__ */ jsxs(DialogContent, { dividers: true, children: [
|
|
92
|
-
/* @__PURE__ */ jsxs(Box, {
|
|
102
|
+
/* @__PURE__ */ jsxs(Box, { sx: {
|
|
103
|
+
mb: 2
|
|
104
|
+
}, children: [
|
|
93
105
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", color: "textSecondary", children: "Event Information" }),
|
|
94
106
|
/* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 2, mt: 1 }, children: [
|
|
95
107
|
/* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
@@ -262,7 +274,9 @@ const PlanAuditLogView = ({ resourceConfig }) => {
|
|
|
262
274
|
if (!(record == null ? void 0 : record.id)) {
|
|
263
275
|
return /* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 3, textAlign: "center" }, children: [
|
|
264
276
|
/* @__PURE__ */ jsx(HistoryIcon, { sx: { fontSize: 48, color: "text.secondary", mb: 1 } }),
|
|
265
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1",
|
|
277
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: {
|
|
278
|
+
color: "text.secondary"
|
|
279
|
+
}, children: "Save the record first to view audit logs" })
|
|
266
280
|
] });
|
|
267
281
|
}
|
|
268
282
|
if (isLoading) {
|
|
@@ -277,7 +291,9 @@ const PlanAuditLogView = ({ resourceConfig }) => {
|
|
|
277
291
|
if (!data || data.length === 0) {
|
|
278
292
|
return /* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 3, textAlign: "center" }, children: [
|
|
279
293
|
/* @__PURE__ */ jsx(HistoryIcon, { sx: { fontSize: 48, color: "text.secondary", mb: 1 } }),
|
|
280
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1",
|
|
294
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: {
|
|
295
|
+
color: "text.secondary"
|
|
296
|
+
}, children: "No audit logs available for this record" })
|
|
281
297
|
] });
|
|
282
298
|
}
|
|
283
299
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -319,7 +335,9 @@ const PlanAuditLogEdit = (props) => {
|
|
|
319
335
|
};
|
|
320
336
|
const PlanAuditLogList = () => {
|
|
321
337
|
const record = useRecordContext();
|
|
322
|
-
return /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
338
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
339
|
+
color: "text.secondary"
|
|
340
|
+
}, children: "\u2014" });
|
|
323
341
|
};
|
|
324
342
|
const PlanAuditLog = (props) => {
|
|
325
343
|
const { method } = props;
|
|
@@ -333,7 +351,9 @@ const PlanAuditLog = (props) => {
|
|
|
333
351
|
case "create":
|
|
334
352
|
return /* @__PURE__ */ jsxs(Paper, { variant: "outlined", sx: { p: 3, textAlign: "center" }, children: [
|
|
335
353
|
/* @__PURE__ */ jsx(HistoryIcon, { sx: { fontSize: 48, color: "text.secondary", mb: 1 } }),
|
|
336
|
-
/* @__PURE__ */ jsx(Typography, { variant: "body1",
|
|
354
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body1", sx: {
|
|
355
|
+
color: "text.secondary"
|
|
356
|
+
}, children: "Audit logs will be available after the record is created" })
|
|
337
357
|
] });
|
|
338
358
|
default:
|
|
339
359
|
return /* @__PURE__ */ jsx(PlanAuditLogView, __spreadValues({}, props));
|
|
@@ -22,7 +22,17 @@ const PlanFeaturesView = () => {
|
|
|
22
22
|
const record = useRecordContext();
|
|
23
23
|
const features = (record == null ? void 0 : record.features) || [];
|
|
24
24
|
if (!features.length) {
|
|
25
|
-
return /* @__PURE__ */ jsx(
|
|
25
|
+
return /* @__PURE__ */ jsx(
|
|
26
|
+
Typography,
|
|
27
|
+
{
|
|
28
|
+
variant: "body2",
|
|
29
|
+
sx: {
|
|
30
|
+
color: "text.secondary",
|
|
31
|
+
py: 2
|
|
32
|
+
},
|
|
33
|
+
children: "No features configured"
|
|
34
|
+
}
|
|
35
|
+
);
|
|
26
36
|
}
|
|
27
37
|
return /* @__PURE__ */ jsx(TableContainer, { component: Paper, variant: "outlined", children: /* @__PURE__ */ jsx(Table, { size: "small", children: /* @__PURE__ */ jsx(TableBody, { children: features.map((feature, index) => /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(
|
|
28
38
|
Chip,
|
|
@@ -38,9 +48,13 @@ const PlanFeaturesList = () => {
|
|
|
38
48
|
const record = useRecordContext();
|
|
39
49
|
const features = (record == null ? void 0 : record.features) || [];
|
|
40
50
|
if (!features.length) {
|
|
41
|
-
return /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
51
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
52
|
+
color: "text.secondary"
|
|
53
|
+
}, children: "\u2014" });
|
|
42
54
|
}
|
|
43
|
-
return /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 0.5,
|
|
55
|
+
return /* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 0.5, useFlexGap: true, sx: {
|
|
56
|
+
flexWrap: "wrap"
|
|
57
|
+
}, children: [
|
|
44
58
|
features.slice(0, 3).map((feature, index) => /* @__PURE__ */ jsx(
|
|
45
59
|
Chip,
|
|
46
60
|
{
|
|
@@ -92,7 +106,18 @@ const PlanFeaturesEdit = () => {
|
|
|
92
106
|
};
|
|
93
107
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
94
108
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, children: "Plan Features" }),
|
|
95
|
-
/* @__PURE__ */ jsx(
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
Typography,
|
|
111
|
+
{
|
|
112
|
+
variant: "caption",
|
|
113
|
+
sx: {
|
|
114
|
+
color: "text.secondary",
|
|
115
|
+
display: "block",
|
|
116
|
+
mb: 2
|
|
117
|
+
},
|
|
118
|
+
children: 'Add feature keys that are enabled for this plan (e.g., "api_access", "custom_branding")'
|
|
119
|
+
}
|
|
120
|
+
),
|
|
96
121
|
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, sx: { mb: 2 }, children: [
|
|
97
122
|
/* @__PURE__ */ jsx(
|
|
98
123
|
TextField,
|
|
@@ -115,7 +140,9 @@ const PlanFeaturesEdit = () => {
|
|
|
115
140
|
}
|
|
116
141
|
)
|
|
117
142
|
] }),
|
|
118
|
-
features.length > 0 ? /* @__PURE__ */ jsx(Paper, { variant: "outlined", sx: { p: 1 }, children: /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1,
|
|
143
|
+
features.length > 0 ? /* @__PURE__ */ jsx(Paper, { variant: "outlined", sx: { p: 1 }, children: /* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, useFlexGap: true, sx: {
|
|
144
|
+
flexWrap: "wrap"
|
|
145
|
+
}, children: features.map((feature, index) => /* @__PURE__ */ jsx(
|
|
119
146
|
Chip,
|
|
120
147
|
{
|
|
121
148
|
label: feature,
|
|
@@ -125,7 +152,9 @@ const PlanFeaturesEdit = () => {
|
|
|
125
152
|
variant: "outlined"
|
|
126
153
|
},
|
|
127
154
|
index
|
|
128
|
-
)) }) }) : /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
155
|
+
)) }) }) : /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
156
|
+
color: "text.secondary"
|
|
157
|
+
}, children: "No features added yet" })
|
|
129
158
|
] });
|
|
130
159
|
};
|
|
131
160
|
const PlanFeaturesSettings = ({
|