@dashadmin/dash-admin 1.3.50 → 1.3.52
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/default-theme/DashThemeContext.js +3 -8
- 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 +3 -3
- package/src/DASHAdmin.tsx +1 -0
- 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/DASHAppProviders.tsx +1 -1
- package/src/default-theme/DashThemeContext.tsx +5 -14
- 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
|
@@ -42,7 +42,17 @@ const PlanMetadataView = () => {
|
|
|
42
42
|
const metadata = (record == null ? void 0 : record.metadata) || {};
|
|
43
43
|
const entries = Object.entries(metadata);
|
|
44
44
|
if (!entries.length) {
|
|
45
|
-
return /* @__PURE__ */ jsx(
|
|
45
|
+
return /* @__PURE__ */ jsx(
|
|
46
|
+
Typography,
|
|
47
|
+
{
|
|
48
|
+
variant: "body2",
|
|
49
|
+
sx: {
|
|
50
|
+
color: "text.secondary",
|
|
51
|
+
py: 2
|
|
52
|
+
},
|
|
53
|
+
children: "No metadata configured"
|
|
54
|
+
}
|
|
55
|
+
);
|
|
46
56
|
}
|
|
47
57
|
return /* @__PURE__ */ jsx(TableContainer, { component: Paper, variant: "outlined", children: /* @__PURE__ */ jsxs(Table, { size: "small", children: [
|
|
48
58
|
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
@@ -60,7 +70,9 @@ const PlanMetadataList = () => {
|
|
|
60
70
|
const metadata = (record == null ? void 0 : record.metadata) || {};
|
|
61
71
|
const count = Object.keys(metadata).length;
|
|
62
72
|
if (!count) {
|
|
63
|
-
return /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
73
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
74
|
+
color: "text.secondary"
|
|
75
|
+
}, children: "\u2014" });
|
|
64
76
|
}
|
|
65
77
|
return /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
66
78
|
count,
|
|
@@ -126,45 +138,67 @@ const PlanMetadataEdit = () => {
|
|
|
126
138
|
};
|
|
127
139
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
|
128
140
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, children: "Plan Metadata" }),
|
|
129
|
-
/* @__PURE__ */ jsx(
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
141
|
+
/* @__PURE__ */ jsx(
|
|
142
|
+
Typography,
|
|
143
|
+
{
|
|
144
|
+
variant: "caption",
|
|
145
|
+
sx: {
|
|
146
|
+
color: "text.secondary",
|
|
147
|
+
display: "block",
|
|
148
|
+
mb: 2
|
|
149
|
+
},
|
|
150
|
+
children: "Add key-value pairs for additional plan configuration"
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ jsxs(
|
|
154
|
+
Stack,
|
|
155
|
+
{
|
|
156
|
+
direction: "row",
|
|
157
|
+
spacing: 1,
|
|
158
|
+
sx: {
|
|
159
|
+
alignItems: "flex-start",
|
|
160
|
+
mb: 2
|
|
161
|
+
},
|
|
162
|
+
children: [
|
|
163
|
+
/* @__PURE__ */ jsx(
|
|
164
|
+
TextField,
|
|
165
|
+
{
|
|
166
|
+
value: newKey,
|
|
167
|
+
onChange: (e) => {
|
|
168
|
+
setNewKey(e.target.value);
|
|
169
|
+
setKeyError("");
|
|
170
|
+
},
|
|
171
|
+
onKeyPress: handleKeyPress,
|
|
172
|
+
placeholder: "Key",
|
|
173
|
+
size: "small",
|
|
174
|
+
error: !!keyError,
|
|
175
|
+
helperText: keyError,
|
|
176
|
+
sx: { flex: 1 }
|
|
177
|
+
}
|
|
178
|
+
),
|
|
179
|
+
/* @__PURE__ */ jsx(
|
|
180
|
+
TextField,
|
|
181
|
+
{
|
|
182
|
+
value: newValue,
|
|
183
|
+
onChange: (e) => setNewValue(e.target.value),
|
|
184
|
+
onKeyPress: handleKeyPress,
|
|
185
|
+
placeholder: "Value",
|
|
186
|
+
size: "small",
|
|
187
|
+
sx: { flex: 2 }
|
|
188
|
+
}
|
|
189
|
+
),
|
|
190
|
+
/* @__PURE__ */ jsx(
|
|
191
|
+
IconButton,
|
|
192
|
+
{
|
|
193
|
+
onClick: handleAddPair,
|
|
194
|
+
color: "primary",
|
|
195
|
+
disabled: !newKey.trim(),
|
|
196
|
+
children: /* @__PURE__ */ jsx(AddIcon, {})
|
|
197
|
+
}
|
|
198
|
+
)
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
),
|
|
168
202
|
pairs.length > 0 ? /* @__PURE__ */ jsx(TableContainer, { component: Paper, variant: "outlined", children: /* @__PURE__ */ jsxs(Table, { size: "small", children: [
|
|
169
203
|
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
170
204
|
/* @__PURE__ */ jsx(TableCell, { width: "30%", children: /* @__PURE__ */ jsx("strong", { children: "Key" }) }),
|
|
@@ -193,7 +227,9 @@ const PlanMetadataEdit = () => {
|
|
|
193
227
|
}
|
|
194
228
|
) })
|
|
195
229
|
] }, key)) })
|
|
196
|
-
] }) }) : /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
230
|
+
] }) }) : /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
231
|
+
color: "text.secondary"
|
|
232
|
+
}, children: "No metadata added yet" })
|
|
197
233
|
] });
|
|
198
234
|
};
|
|
199
235
|
const PlanMetadataSettings = ({
|
|
@@ -56,7 +56,9 @@ const PlanPricesView = () => {
|
|
|
56
56
|
);
|
|
57
57
|
if (isLoading) return /* @__PURE__ */ jsx(Loading, {});
|
|
58
58
|
if (!prices || Object.keys(prices).length === 0) {
|
|
59
|
-
return /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
59
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
60
|
+
color: "text.secondary"
|
|
61
|
+
}, children: "No prices configured" });
|
|
60
62
|
}
|
|
61
63
|
return /* @__PURE__ */ jsx(TableContainer, { component: Paper, variant: "outlined", sx: { maxWidth: 400 }, children: /* @__PURE__ */ jsxs(Table, { size: "small", children: [
|
|
62
64
|
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
@@ -76,7 +78,9 @@ const PlanPricesView = () => {
|
|
|
76
78
|
color: (currency == null ? void 0 : currency.is_default) ? "primary" : "default"
|
|
77
79
|
}
|
|
78
80
|
),
|
|
79
|
-
(currency == null ? void 0 : currency.is_default) && /* @__PURE__ */ jsx(Typography, { variant: "caption",
|
|
81
|
+
(currency == null ? void 0 : currency.is_default) && /* @__PURE__ */ jsx(Typography, { variant: "caption", sx: {
|
|
82
|
+
color: "text.secondary"
|
|
83
|
+
}, children: "(Default)" })
|
|
80
84
|
] }) }),
|
|
81
85
|
/* @__PURE__ */ jsx(TableCell, { align: "right", children: /* @__PURE__ */ jsxs(Typography, { variant: "body2", children: [
|
|
82
86
|
currency == null ? void 0 : currency.symbol,
|
|
@@ -90,7 +94,9 @@ const PlanPricesList = () => {
|
|
|
90
94
|
const plan = useRecordContext();
|
|
91
95
|
const prices = plan == null ? void 0 : plan.prices;
|
|
92
96
|
if (!prices || Object.keys(prices).length === 0) {
|
|
93
|
-
return /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
97
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
98
|
+
color: "text.secondary"
|
|
99
|
+
}, children: "\u2014" });
|
|
94
100
|
}
|
|
95
101
|
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 0.5, flexWrap: "wrap" }, children: [
|
|
96
102
|
Object.entries(prices).slice(0, 3).map(([code, value]) => /* @__PURE__ */ jsx(
|
|
@@ -159,10 +165,14 @@ const PlanPricesEdit = ({ method }) => {
|
|
|
159
165
|
] });
|
|
160
166
|
}
|
|
161
167
|
if (!currencies || currencies.length === 0) {
|
|
162
|
-
return /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
168
|
+
return /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
169
|
+
color: "text.secondary"
|
|
170
|
+
}, children: "No currencies available. Please configure currencies first." });
|
|
163
171
|
}
|
|
164
172
|
return /* @__PURE__ */ jsxs(Box, { sx: { display: "flex", flexDirection: "column", gap: 2 }, children: [
|
|
165
|
-
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2",
|
|
173
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", sx: {
|
|
174
|
+
color: "text.secondary"
|
|
175
|
+
}, children: "Set the price for each available currency (in cents/smallest unit)" }),
|
|
166
176
|
currencies.map((currency) => {
|
|
167
177
|
var _a;
|
|
168
178
|
const currentValue = (_a = currentPrices[currency.code]) != null ? _a : "";
|
|
@@ -173,9 +183,6 @@ const PlanPricesEdit = ({ method }) => {
|
|
|
173
183
|
type: "number",
|
|
174
184
|
value: currentValue,
|
|
175
185
|
onChange: (e) => handlePriceChange(currency.code, e.target.value),
|
|
176
|
-
InputProps: {
|
|
177
|
-
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: currency.symbol })
|
|
178
|
-
},
|
|
179
186
|
helperText: currency.format ? `Format: ${currency.format} \u2022 Example: ${currency.symbol}${numeral(29900).format(currency.format)}` : `Enter price in smallest unit (cents)`,
|
|
180
187
|
fullWidth: true,
|
|
181
188
|
size: "small",
|
|
@@ -186,6 +193,11 @@ const PlanPricesEdit = ({ method }) => {
|
|
|
186
193
|
borderWidth: 2
|
|
187
194
|
}
|
|
188
195
|
} : {}
|
|
196
|
+
},
|
|
197
|
+
slotProps: {
|
|
198
|
+
input: {
|
|
199
|
+
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: currency.symbol })
|
|
200
|
+
}
|
|
189
201
|
}
|
|
190
202
|
},
|
|
191
203
|
currency.code
|
|
@@ -141,12 +141,14 @@ const TenantSelector = React.forwardRef((_a, ref) => {
|
|
|
141
141
|
handleSearch(ev.target.value);
|
|
142
142
|
}
|
|
143
143
|
},
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
slotProps: __spreadProps(__spreadValues({}, params.slotProps), {
|
|
145
|
+
input: __spreadProps(__spreadValues({}, params.slotProps.input), {
|
|
146
|
+
autoComplete: "new-password",
|
|
147
|
+
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
148
|
+
isLoading ? /* @__PURE__ */ jsx(CircularProgress, { color: "inherit", size: 20 }) : null,
|
|
149
|
+
params.slotProps.input.endAdornment
|
|
150
|
+
] })
|
|
151
|
+
})
|
|
150
152
|
})
|
|
151
153
|
})
|
|
152
154
|
)
|
|
@@ -204,7 +204,9 @@ const UserPreferences = () => {
|
|
|
204
204
|
return /* @__PURE__ */ jsx(Card, { sx: { mb: 2 }, children: /* @__PURE__ */ jsxs(CardContent, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
205
205
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
206
206
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", children: format.label }),
|
|
207
|
-
format.description && /* @__PURE__ */ jsx(Typography, { variant: "caption",
|
|
207
|
+
format.description && /* @__PURE__ */ jsx(Typography, { variant: "caption", sx: {
|
|
208
|
+
color: "text.secondary"
|
|
209
|
+
}, children: format.description })
|
|
208
210
|
] }),
|
|
209
211
|
/* @__PURE__ */ jsx(
|
|
210
212
|
Switch,
|
|
@@ -218,7 +220,18 @@ const UserPreferences = () => {
|
|
|
218
220
|
case "integer":
|
|
219
221
|
return /* @__PURE__ */ jsx(Card, { sx: { mb: 2 }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
220
222
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, children: format.label }),
|
|
221
|
-
format.description && /* @__PURE__ */ jsx(
|
|
223
|
+
format.description && /* @__PURE__ */ jsx(
|
|
224
|
+
Typography,
|
|
225
|
+
{
|
|
226
|
+
variant: "caption",
|
|
227
|
+
sx: {
|
|
228
|
+
color: "text.secondary",
|
|
229
|
+
display: "block",
|
|
230
|
+
mb: 2
|
|
231
|
+
},
|
|
232
|
+
children: format.description
|
|
233
|
+
}
|
|
234
|
+
),
|
|
222
235
|
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
223
236
|
/* @__PURE__ */ jsx(
|
|
224
237
|
Slider,
|
|
@@ -239,12 +252,14 @@ const UserPreferences = () => {
|
|
|
239
252
|
value: (_d = value != null ? value : format.default_value) != null ? _d : 0,
|
|
240
253
|
onChange: (e) => handleGenericPreferenceChange(format.id, parseInt(e.target.value, 10)),
|
|
241
254
|
disabled: saving || !format.editable,
|
|
242
|
-
inputProps: {
|
|
243
|
-
min: (_e = format.min) != null ? _e : 0,
|
|
244
|
-
max: (_f = format.max) != null ? _f : 100
|
|
245
|
-
},
|
|
246
255
|
sx: { width: 80 },
|
|
247
|
-
size: "small"
|
|
256
|
+
size: "small",
|
|
257
|
+
slotProps: {
|
|
258
|
+
htmlInput: {
|
|
259
|
+
min: (_e = format.min) != null ? _e : 0,
|
|
260
|
+
max: (_f = format.max) != null ? _f : 100
|
|
261
|
+
}
|
|
262
|
+
}
|
|
248
263
|
}
|
|
249
264
|
)
|
|
250
265
|
] })
|
|
@@ -252,7 +267,18 @@ const UserPreferences = () => {
|
|
|
252
267
|
case "string":
|
|
253
268
|
return /* @__PURE__ */ jsx(Card, { sx: { mb: 2 }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
254
269
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, children: format.label }),
|
|
255
|
-
format.description && /* @__PURE__ */ jsx(
|
|
270
|
+
format.description && /* @__PURE__ */ jsx(
|
|
271
|
+
Typography,
|
|
272
|
+
{
|
|
273
|
+
variant: "caption",
|
|
274
|
+
sx: {
|
|
275
|
+
color: "text.secondary",
|
|
276
|
+
display: "block",
|
|
277
|
+
mb: 2
|
|
278
|
+
},
|
|
279
|
+
children: format.description
|
|
280
|
+
}
|
|
281
|
+
),
|
|
256
282
|
/* @__PURE__ */ jsx(
|
|
257
283
|
TextField,
|
|
258
284
|
{
|
|
@@ -260,21 +286,34 @@ const UserPreferences = () => {
|
|
|
260
286
|
value: value != null ? value : "",
|
|
261
287
|
onChange: (e) => handleGenericPreferenceChange(format.id, e.target.value),
|
|
262
288
|
disabled: saving || !format.editable,
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
289
|
+
slotProps: {
|
|
290
|
+
input: format.maxLength ? {
|
|
291
|
+
endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
|
|
292
|
+
(value == null ? void 0 : value.length) || 0,
|
|
293
|
+
"/",
|
|
294
|
+
format.maxLength
|
|
295
|
+
] })
|
|
296
|
+
} : void 0,
|
|
297
|
+
htmlInput: { maxLength: format.maxLength }
|
|
298
|
+
}
|
|
271
299
|
}
|
|
272
300
|
)
|
|
273
301
|
] }) }, format.id);
|
|
274
302
|
case "textarea":
|
|
275
303
|
return /* @__PURE__ */ jsx(Card, { sx: { mb: 2 }, children: /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
276
304
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", gutterBottom: true, children: format.label }),
|
|
277
|
-
format.description && /* @__PURE__ */ jsx(
|
|
305
|
+
format.description && /* @__PURE__ */ jsx(
|
|
306
|
+
Typography,
|
|
307
|
+
{
|
|
308
|
+
variant: "caption",
|
|
309
|
+
sx: {
|
|
310
|
+
color: "text.secondary",
|
|
311
|
+
display: "block",
|
|
312
|
+
mb: 2
|
|
313
|
+
},
|
|
314
|
+
children: format.description
|
|
315
|
+
}
|
|
316
|
+
),
|
|
278
317
|
/* @__PURE__ */ jsx(
|
|
279
318
|
TextField,
|
|
280
319
|
{
|
|
@@ -284,8 +323,10 @@ const UserPreferences = () => {
|
|
|
284
323
|
value: value != null ? value : "",
|
|
285
324
|
onChange: (e) => handleGenericPreferenceChange(format.id, e.target.value),
|
|
286
325
|
disabled: saving || !format.editable,
|
|
287
|
-
|
|
288
|
-
|
|
326
|
+
helperText: format.maxLength ? `${(value == null ? void 0 : value.length) || 0}/${format.maxLength} characters` : void 0,
|
|
327
|
+
slotProps: {
|
|
328
|
+
htmlInput: { maxLength: format.maxLength }
|
|
329
|
+
}
|
|
289
330
|
}
|
|
290
331
|
)
|
|
291
332
|
] }) }, format.id);
|
|
@@ -302,7 +343,9 @@ const UserPreferences = () => {
|
|
|
302
343
|
return /* @__PURE__ */ jsx(Card, { sx: { mb: 2 }, children: /* @__PURE__ */ jsxs(CardContent, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
303
344
|
/* @__PURE__ */ jsxs(Box, { children: [
|
|
304
345
|
/* @__PURE__ */ jsx(Typography, { variant: "subtitle1", children: formatNotificationName(pref.name) }),
|
|
305
|
-
/* @__PURE__ */ jsx(Typography, { variant: "caption",
|
|
346
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", sx: {
|
|
347
|
+
color: "text.secondary"
|
|
348
|
+
}, children: pref.name })
|
|
306
349
|
] }),
|
|
307
350
|
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", gap: 2 }, children: [
|
|
308
351
|
(config == null ? void 0 : config.hasEmail) && /* @__PURE__ */ jsx(
|
|
@@ -335,7 +378,9 @@ const UserPreferences = () => {
|
|
|
335
378
|
label: "Push"
|
|
336
379
|
}
|
|
337
380
|
),
|
|
338
|
-
!(config == null ? void 0 : config.hasEmail) && !(config == null ? void 0 : config.hasPush) && /* @__PURE__ */ jsx(Typography, { variant: "caption",
|
|
381
|
+
!(config == null ? void 0 : config.hasEmail) && !(config == null ? void 0 : config.hasPush) && /* @__PURE__ */ jsx(Typography, { variant: "caption", sx: {
|
|
382
|
+
color: "text.secondary"
|
|
383
|
+
}, children: "(No configurable channels)" })
|
|
339
384
|
] })
|
|
340
385
|
] }) }, pref.id);
|
|
341
386
|
}) });
|
|
@@ -344,7 +389,17 @@ const UserPreferences = () => {
|
|
|
344
389
|
const groupPreferences = getPreferencesForGroup(groupKey);
|
|
345
390
|
const groupConfig = groups[groupKey];
|
|
346
391
|
return /* @__PURE__ */ jsxs(Box, { sx: { pt: 2 }, children: [
|
|
347
|
-
(groupConfig == null ? void 0 : groupConfig.description) && /* @__PURE__ */ jsx(
|
|
392
|
+
(groupConfig == null ? void 0 : groupConfig.description) && /* @__PURE__ */ jsx(
|
|
393
|
+
Typography,
|
|
394
|
+
{
|
|
395
|
+
variant: "body2",
|
|
396
|
+
sx: {
|
|
397
|
+
color: "text.secondary",
|
|
398
|
+
mb: 3
|
|
399
|
+
},
|
|
400
|
+
children: groupConfig.description
|
|
401
|
+
}
|
|
402
|
+
),
|
|
348
403
|
groupPreferences.map((format) => {
|
|
349
404
|
if (format.type === "custom" && format.component === "NotificationPreferences") {
|
|
350
405
|
return /* @__PURE__ */ jsx(Box, { children: renderNotificationPreferences() }, format.id);
|
|
@@ -25,9 +25,9 @@ const useDashThemeContext = () => {
|
|
|
25
25
|
return context;
|
|
26
26
|
};
|
|
27
27
|
const DashThemeProvider = ({ extendedOptions, children }) => {
|
|
28
|
-
const [currentMode, setCurrentMode] = useState(
|
|
29
|
-
|
|
30
|
-
);
|
|
28
|
+
const [currentMode, setCurrentMode] = useState(() => {
|
|
29
|
+
return document.documentElement.getAttribute("data-theme") || "dark";
|
|
30
|
+
});
|
|
31
31
|
const [themeOptions, setThemeOptions] = useState(() => {
|
|
32
32
|
const initialTenantSettings = AuthPersistenceService.getTenantSettings();
|
|
33
33
|
return appTheme(extendedOptions, {
|
|
@@ -59,7 +59,6 @@ const DashThemeProvider = ({ extendedOptions, children }) => {
|
|
|
59
59
|
const recreateTheme = (tenantSettings, mode) => {
|
|
60
60
|
const settings = tenantSettings || getTenantSettings();
|
|
61
61
|
const themeMode = mode || document.documentElement.getAttribute("data-theme") || "dark";
|
|
62
|
-
console.log("Recreating MUI theme with tenant settings:", settings, "mode:", themeMode);
|
|
63
62
|
const newThemeOptions = appTheme(
|
|
64
63
|
extendedOptions,
|
|
65
64
|
{
|
|
@@ -84,10 +83,8 @@ const DashThemeProvider = ({ extendedOptions, children }) => {
|
|
|
84
83
|
if (mutation.type === "attributes" && mutation.attributeName === "data-theme") {
|
|
85
84
|
const newMode = document.documentElement.getAttribute("data-theme") || "dark";
|
|
86
85
|
if (newMode !== currentMode) {
|
|
87
|
-
console.log("Theme mode changed from", currentMode, "to", newMode);
|
|
88
86
|
setCurrentMode(newMode);
|
|
89
87
|
const settings = getTenantSettings();
|
|
90
|
-
console.log("Updating theme with new mode:", newMode, "and settings:", settings);
|
|
91
88
|
updateDomCssVariables(newMode, settings == null ? void 0 : settings.colors, settings == null ? void 0 : settings.values);
|
|
92
89
|
}
|
|
93
90
|
}
|
|
@@ -100,14 +97,12 @@ const DashThemeProvider = ({ extendedOptions, children }) => {
|
|
|
100
97
|
return () => observer.disconnect();
|
|
101
98
|
}, [currentMode]);
|
|
102
99
|
useEffect(() => {
|
|
103
|
-
console.log("Current mode updated to:", currentMode);
|
|
104
100
|
const tenantSettings = getTenantSettings();
|
|
105
101
|
recreateTheme(tenantSettings, currentMode);
|
|
106
102
|
}, [currentMode]);
|
|
107
103
|
useEffect(() => {
|
|
108
104
|
const tenantSettings = getTenantSettings();
|
|
109
105
|
if (tenantSettings) {
|
|
110
|
-
console.log("Recreating MUI theme on mount");
|
|
111
106
|
recreateTheme(tenantSettings, currentMode);
|
|
112
107
|
}
|
|
113
108
|
}, []);
|
|
@@ -345,11 +345,13 @@ const DASHLightWeightLogin = (props) => {
|
|
|
345
345
|
children: /* @__PURE__ */ jsx(Container, { maxWidth: "sm", sx: { p: 1 }, children: /* @__PURE__ */ jsx(
|
|
346
346
|
Box,
|
|
347
347
|
{
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
348
|
+
sx: {
|
|
349
|
+
display: "flex",
|
|
350
|
+
justifyContent: "center",
|
|
351
|
+
alignItems: "center",
|
|
352
|
+
minHeight: "50vh",
|
|
353
|
+
textAlign: "center"
|
|
354
|
+
},
|
|
353
355
|
children: /* @__PURE__ */ jsx("div", { children: "Cargando..." })
|
|
354
356
|
}
|
|
355
357
|
) })
|
package/dist/pages/Profile.js
CHANGED
|
@@ -156,9 +156,11 @@ const Profile = (_props) => {
|
|
|
156
156
|
Grid,
|
|
157
157
|
{
|
|
158
158
|
size: { xs: 12, md: 4 },
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
sx: {
|
|
160
|
+
display: "flex",
|
|
161
|
+
justifyContent: "center",
|
|
162
|
+
alignItems: "center"
|
|
163
|
+
},
|
|
162
164
|
children: /* @__PURE__ */ jsxs(
|
|
163
165
|
CardContent,
|
|
164
166
|
{
|
|
@@ -122,18 +122,30 @@ const RecoverPassword = ({}) => {
|
|
|
122
122
|
]
|
|
123
123
|
}
|
|
124
124
|
) : /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "dash-app-login-form", children: [
|
|
125
|
-
/* @__PURE__ */ jsxs(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
125
|
+
/* @__PURE__ */ jsxs(
|
|
126
|
+
Grid,
|
|
127
|
+
{
|
|
128
|
+
container: true,
|
|
129
|
+
spacing: 2,
|
|
130
|
+
sx: {
|
|
131
|
+
alignItems: "center",
|
|
132
|
+
mb: 4,
|
|
133
|
+
mt: 2
|
|
134
|
+
},
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 2, children: /* @__PURE__ */ jsx(
|
|
137
|
+
IconButton,
|
|
138
|
+
{
|
|
139
|
+
color: "primary",
|
|
140
|
+
size: "large",
|
|
141
|
+
onClick: () => redirect("/"),
|
|
142
|
+
children: /* @__PURE__ */ jsx(HomeIcon, {})
|
|
143
|
+
}
|
|
144
|
+
) }),
|
|
145
|
+
/* @__PURE__ */ jsx(Grid, { item: true, xs: 10, children: /* @__PURE__ */ jsx("h1", { className: "dash-app-login-form-title", style: { margin: 0 }, children: "Recuperar Contrase\xF1a" }) })
|
|
146
|
+
]
|
|
147
|
+
}
|
|
148
|
+
),
|
|
137
149
|
error && /* @__PURE__ */ jsx(Alert, { severity: "error", sx: { mb: 2 }, children: error }),
|
|
138
150
|
/* @__PURE__ */ jsx("div", { className: "dash-app-form-item", children: /* @__PURE__ */ jsx(
|
|
139
151
|
TextField,
|
|
@@ -144,13 +156,15 @@ const RecoverPassword = ({}) => {
|
|
|
144
156
|
placeholder: "Email",
|
|
145
157
|
required: true,
|
|
146
158
|
value: email,
|
|
147
|
-
inputProps: { type: "email" },
|
|
148
159
|
onChange: (e) => setEmail(e.target.value),
|
|
149
160
|
className: "dash-app-form-item-input",
|
|
150
161
|
autoComplete: "username",
|
|
151
162
|
name: "email",
|
|
152
163
|
type: "email",
|
|
153
|
-
id: "email"
|
|
164
|
+
id: "email",
|
|
165
|
+
slotProps: {
|
|
166
|
+
htmlInput: { type: "email" }
|
|
167
|
+
}
|
|
154
168
|
}
|
|
155
169
|
) }),
|
|
156
170
|
/* @__PURE__ */ jsx("div", { className: "dash-app-form-item mt-1", children: /* @__PURE__ */ jsx(
|
|
@@ -60,7 +60,17 @@ const PaymentHistoryView = () => {
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
if (loading) {
|
|
63
|
-
return /* @__PURE__ */ jsx(
|
|
63
|
+
return /* @__PURE__ */ jsx(
|
|
64
|
+
Box,
|
|
65
|
+
{
|
|
66
|
+
sx: {
|
|
67
|
+
display: "flex",
|
|
68
|
+
justifyContent: "center",
|
|
69
|
+
p: 2
|
|
70
|
+
},
|
|
71
|
+
children: /* @__PURE__ */ jsx(CircularProgress, {})
|
|
72
|
+
}
|
|
73
|
+
);
|
|
64
74
|
}
|
|
65
75
|
if (payments.length === 0) {
|
|
66
76
|
return /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "textSecondary", children: "No hay historial de pagos disponible" });
|
|
@@ -83,7 +93,9 @@ const PaymentHistoryView = () => {
|
|
|
83
93
|
children: payment.status === "completed" ? "Completado" : "Fallido"
|
|
84
94
|
}
|
|
85
95
|
) }),
|
|
86
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { variant: "body2",
|
|
96
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: {
|
|
97
|
+
fontFamily: "monospace"
|
|
98
|
+
}, children: payment.transaction_id }) })
|
|
87
99
|
] }, payment.id)) })
|
|
88
100
|
] }) });
|
|
89
101
|
};
|