@dashadmin/dash-admin 1.3.73 → 1.3.74-srcfree.1
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/tenant/TenancyPlan.js +307 -0
- package/dist/systemResources.js +18 -2
- package/package.json +25 -22
- package/src/AppAsyncWrapper.tsx +0 -42
- package/src/AppWrapper.tsx +0 -45
- package/src/DASHAdmin.tsx +0 -502
- package/src/DASHAdmin.tsx.old +0 -456
- package/src/RoutingWrapper.tsx +0 -143
- package/src/classes/DASHStorageClass.tsx +0 -8
- package/src/components/Input/RichTextField.tsx +0 -27
- package/src/components/Redirect.tsx +0 -46
- package/src/components/avatar/Avatar.tsx +0 -71
- package/src/components/avatar/SingleImageUploader.tsx +0 -107
- package/src/components/currency/Format.tsx +0 -79
- package/src/components/custom/Redirect.tsx +0 -23
- package/src/components/error/Error.tsx +0 -168
- package/src/components/geocoding/GeocodingField.tsx +0 -167
- package/src/components/i18n/BridgedLocalesMenuButton.tsx +0 -160
- package/src/components/i18n/LangSwitcher.tsx +0 -204
- package/src/components/loader/GlobalLoader.tsx +0 -49
- package/src/components/logs/LogFile.tsx +0 -88
- package/src/components/logs/LogFileById.tsx +0 -68
- package/src/components/logs/LogViewer.tsx +0 -43
- package/src/components/menu/AppMenu.tsx +0 -22
- package/src/components/menu/CustomMenuItemLink.tsx +0 -61
- package/src/components/menu/DarkToggleMode.tsx +0 -65
- package/src/components/menu/LanguageToggleMode.tsx +0 -120
- package/src/components/misc/CustomImageInput.tsx +0 -62
- package/src/components/misc/DASHGlobalErrorHandler.tsx +0 -194
- package/src/components/misc/DarkModeSwitcher.tsx +0 -112
- package/src/components/misc/HorizontalScroller.tsx +0 -225
- package/src/components/misc/LanguageSwitcher.tsx +0 -199
- package/src/components/misc/MUIHtmlToolTip.tsx +0 -15
- package/src/components/misc/MuiSimpleJsonTable.tsx +0 -279
- package/src/components/misc/MultiLevelTable.tsx +0 -229
- package/src/components/misc/NoResults.tsx +0 -28
- package/src/components/misc/PDFViewer.tsx +0 -85
- package/src/components/navigation/Breadcrumbs.tsx +0 -220
- package/src/components/navigation/BreadcrumbsManager.tsx +0 -310
- package/src/components/navigation/index.tsx +0 -5
- package/src/components/panel/Error.tsx +0 -168
- package/src/components/permission/AvailablePermissionsContext.tsx +0 -173
- package/src/components/permission/PermissionsSelector.tsx +0 -834
- package/src/components/permission/PermissionsSelectorList.tsx +0 -473
- package/src/components/permission/tsx +0 -0
- package/src/components/racustombuttons/CustomRAButton.tsx +0 -87
- package/src/components/racustombuttons/QuickButton.tsx +0 -117
- package/src/components/racustombuttons/QuickEditButton.tsx +0 -115
- package/src/components/racustombuttons/QuickIconButton.tsx +0 -122
- package/src/components/scrollbar/Scrollbar.tsx +0 -31
- package/src/components/selects/MultiSelect.tsx +0 -53
- package/src/components/selects/RASearchableSelect.tsx +0 -282
- package/src/components/selects/RASearchableSelectChips.tsx +0 -308
- package/src/components/selects/SearchableSelect.tsx +0 -139
- package/src/components/serviceAccount/ApiKeyRevealDialog.tsx +0 -129
- package/src/components/serviceAccount/ServiceAccountStatusSwitch.tsx +0 -99
- package/src/components/subscription/BillingCycleSelectInput.tsx +0 -68
- package/src/components/subscription/PlanAddonsSettings.tsx +0 -563
- package/src/components/subscription/PlanAuditLog.tsx +0 -453
- package/src/components/subscription/PlanFeaturesSettings.tsx +0 -243
- package/src/components/subscription/PlanLimitsSettings.tsx +0 -230
- package/src/components/subscription/PlanMetadataSettings.tsx +0 -306
- package/src/components/subscription/PlanPricesSettings.tsx +0 -307
- package/src/components/subscription/index.ts +0 -7
- package/src/components/svgelements/SvgLoading.tsx +0 -229
- package/src/components/svgelements/SvgLogo.tsx +0 -53
- package/src/components/svgelements/SvgLogoMin.tsx +0 -64
- package/src/components/svgelements/SvgShipping.tsx +0 -673
- package/src/components/tenancy/GlobalTenantWrapper.tsx +0 -84
- package/src/components/tenancy/TenantSwitcher.tsx +0 -514
- package/src/components/tenant/AvailablePermissionsContext.tsx +0 -0
- package/src/components/tenant/SettingsSections.tsx +0 -151
- package/src/components/tenant/TenancySettings.tsx +0 -122
- package/src/components/tenant/TenantAttributes.tsx +0 -153
- package/src/components/tenant/TenantAttributesContext.tsx +0 -163
- package/src/components/tenant/TenantSelector.tsx +0 -142
- package/src/components/tenant/TenantSettings.tsx +0 -184
- package/src/components/tenant/TenantSettingsContext.tsx +0 -165
- package/src/components/tenant/TenantTheme.tsx +0 -172
- package/src/components/user/AvatarComponent.tsx +0 -317
- package/src/components/user/TenantAvatarComponent.tsx +0 -99
- package/src/components/user/UserPreferences.tsx +0 -677
- package/src/config/ACTIONS.tsx +0 -26
- package/src/config/ConstantsService.tsx +0 -44
- package/src/config/DASHAdminSystemConstants.tsx +0 -183
- package/src/config/PARSERS.tsx +0 -9
- package/src/contexts/DashQueryClientContext.tsx +0 -113
- package/src/contexts/DashResourceContext.tsx +0 -34
- package/src/contexts/I18nBridgeContext.tsx +0 -156
- package/src/contexts/I18nBridgeSetter.tsx +0 -39
- package/src/contexts/I18nReduxSync.tsx +0 -27
- package/src/contexts/SubscriptionPlanFormatsProvider.tsx +0 -217
- package/src/contexts/SystemRequestsCache.tsx +0 -215
- package/src/contexts/auth/AuthContext.tsx +0 -567
- package/src/contexts/auth/AuthContextLocalStorage.tsx +0 -140
- package/src/contexts/auth/DASHAuthenticationService.tsx +0 -915
- package/src/contexts/auth/WindowContext.tsx +0 -15
- package/src/contexts/auth/index.tsx +0 -3
- package/src/contexts/com/FCMContext.tsx +0 -415
- package/src/contexts/com/LaravelEchoContext.tsx +0 -41
- package/src/contexts/com/LaravelEchoMgr.tsx +0 -155
- package/src/contexts/com/components/DefaultNotificationComponent.tsx +0 -20
- package/src/contexts/com/components/EchoNotificationsCenter.tsx +0 -65
- package/src/contexts/com/components/NotificationAttributesTable.tsx +0 -54
- package/src/contexts/com/components/NotificationRenderer.tsx +0 -42
- package/src/contexts/com/components/NotificationsWidget.tsx +0 -182
- package/src/contexts/com/components/notificationFormats.tsx +0 -50
- package/src/contexts/com/useLaravelEcho.tsx +0 -432
- package/src/contexts/dictionary/DictionaryContext.tsx +0 -94
- package/src/declarations.d.ts +0 -17
- package/src/default-theme/DASHAppProviders.tsx +0 -117
- package/src/default-theme/DashThemeContext.tsx +0 -209
- package/src/default-theme/DashThemeContext.tsx.fast +0 -143
- package/src/default-theme/DashThemeContext.tsx.old +0 -306
- package/src/default-theme/DashThemeHelperProvider.tsx +0 -98
- package/src/default-theme/DomainAppLayout.tsx +0 -166
- package/src/default-theme/DomainHeader.tsx +0 -162
- package/src/default-theme/DomainTheme.tsx +0 -59
- package/src/default-theme/FullLayoutMarkup.tsx +0 -231
- package/src/default-theme/StaticLayout.tsx +0 -47
- package/src/default-theme/index.tsx +0 -11
- package/src/default-theme/menu/AppDashboardGrid.tsx +0 -279
- package/src/default-theme/menu/AppMaterialMenu.tsx +0 -546
- package/src/default-theme/menu/AppMenuComponents/SubmenuPortal.tsx +0 -61
- package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItem.tsx +0 -264
- package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItems.tsx +0 -31
- package/src/default-theme/menu/AppMenuComponents/expanded/CollapsableSidebarMenu.tsx +0 -293
- package/src/default-theme/menu/AppMenuComponents/expanded/SidebarItem.tsx +0 -92
- package/src/default-theme/menu/AppMenuComponents/getItem.tsx +0 -17
- package/src/default-theme/menu/AppMenuComponents/interfaces.tsx +0 -41
- package/src/default-theme/menu/AppMenuComponents/submenuConstants.ts +0 -90
- package/src/default-theme/menu/AppSidebarMaterial.tsx +0 -339
- package/src/default-theme/menu/SidebarActions.tsx +0 -84
- package/src/default-theme/updateDomCssVariables.tsx +0 -176
- package/src/helpers/checkRole.tsx +0 -66
- package/src/helpers/parseAxiosError.tsx +0 -41
- package/src/hooks/audio/useAudio.tsx +0 -39
- package/src/hooks/axios.tsx +0 -165
- package/src/hooks/data/useDashboardStats.tsx +0 -65
- package/src/hooks/data/usePackageByClientsStats.tsx +0 -44
- package/src/hooks/data/usePackageByCommunesStats.tsx +0 -44
- package/src/hooks/data/usePackageStats.tsx +0 -69
- package/src/hooks/data/usePackageWithdrawDetails.tsx +0 -61
- package/src/hooks/data/useStats.tsx +0 -86
- package/src/hooks/isCurrentPath.tsx +0 -22
- package/src/hooks/notifications/WSMessagesManager.tsx +0 -152
- package/src/hooks/notifications/WSPusherManager.tsx +0 -92
- package/src/hooks/useBreadcrumbs.tsx +0 -329
- package/src/hooks/useClickOutside.tsx +0 -57
- package/src/hooks/useFormPersistance.tsx +0 -150
- package/src/hooks/useGlobalErrorMediator.tsx +0 -43
- package/src/hooks/useGlobalLoaderMgr.tsx +0 -21
- package/src/hooks/useHash.tsx +0 -27
- package/src/hooks/useLocalStorage.tsx +0 -196
- package/src/hooks/usePolyglotTranslation.tsx +0 -62
- package/src/hooks/usePrevious.tsx +0 -9
- package/src/hooks/usePrintSelected.tsx +0 -37
- package/src/hooks/useVirtualHash.tsx +0 -33
- package/src/hooks/window/useWindowSize.tsx +0 -36
- package/src/index.tsx +0 -134
- package/src/interfaces/IAppResourceConfig.tsx +0 -20
- package/src/interfaces/Log.tsx +0 -16
- package/src/interfaces/Tenant.tsx +0 -25
- package/src/interfaces/communication/IActions.tsx +0 -5
- package/src/interfaces/communication/INotification.tsx +0 -21
- package/src/interfaces/communication/IPayload.tsx +0 -3
- package/src/interfaces/communication/IRequestAction.tsx +0 -10
- package/src/interfaces/communication/IRequestPayload.tsx +0 -7
- package/src/interfaces/communication/IResponseAction.tsx +0 -7
- package/src/interfaces/misc/IAny.tsx +0 -3
- package/src/interfaces/misc/IFlashMessage.tsx +0 -10
- package/src/interfaces/navigation/IAppMenu.ts +0 -14
- package/src/interfaces/navigation/ICollapsableSidebarMenu.ts +0 -12
- package/src/interfaces/navigation/IMenuItem.ts +0 -16
- package/src/interfaces/notifications/IModel.tsx +0 -6
- package/src/interfaces/notifications/IModelField.tsx +0 -8
- package/src/interfaces/notifications/IUserNotification.tsx +0 -12
- package/src/interfaces/notifications/IUserNotificationData.tsx +0 -13
- package/src/interfaces/notifications/IUserNotificationPayload.tsx +0 -8
- package/src/interfaces/user/IGetAuth.tsx +0 -92
- package/src/interfaces/user/ITenantSettings.tsx +0 -3
- package/src/interfaces/user/IUser.tsx +0 -60
- package/src/interfaces/user/IUserSettings.tsx +0 -43
- package/src/interfaces.tsx +0 -6
- package/src/layout/AppLayout.tsx +0 -112
- package/src/layout/ApplicationLayout.tsx +0 -197
- package/src/layout/MotionWrapper.original.tsx +0 -236
- package/src/layout/MotionWrapper.tsx +0 -236
- package/src/layout/ResourceMenu.tsx +0 -164
- package/src/layout/ResoureLayout.tsx +0 -105
- package/src/layout/TransitionWrapper.tsx +0 -125
- package/src/pages/ChangePassword.tsx +0 -179
- package/src/pages/DASHLanding.tsx +0 -22
- package/src/pages/DASHLightWeightLogin.tsx +0 -611
- package/src/pages/DASHSimpleLogin.tsx +0 -260
- package/src/pages/Login.tsx +0 -111
- package/src/pages/Profile.tsx +0 -357
- package/src/pages/RecoverPassword.tsx +0 -175
- package/src/pages/SingleImageUploader.tsx +0 -55
- package/src/pages/VerifyAccount.tsx +0 -128
- package/src/providers/authProvider.tsx +0 -217
- package/src/providers/dataProvider.tsx +0 -672
- package/src/providers/i18n/en.ts +0 -646
- package/src/providers/i18n/es.ts +0 -652
- package/src/providers/i18n/languages.tsx +0 -8
- package/src/providers/i18n/mergeTranslations.ts +0 -53
- package/src/providers/i18nProvider.tsx +0 -23
- package/src/react-admin-dash/RADashComponent.tsx +0 -240
- package/src/react-admin-dash/Resource.tsx +0 -77
- package/src/resources/Brand/BrandResource.tsx +0 -130
- package/src/resources/DASHResourceLoader.ts +0 -180
- package/src/resources/Log/LogResource.tsx +0 -73
- package/src/resources/Tenant/ImpersonateTenantResource.tsx +0 -113
- package/src/resources/Trash/TrashTemplate.tsx +0 -180
- package/src/resources/User/components/AvatarUploadField.tsx +0 -57
- package/src/resources/User/components/PasswordFields.tsx +0 -73
- package/src/resources/User/getProfileMenu.ts +0 -57
- package/src/resources/User/profileResource.tsx +0 -51
- package/src/resources/User/userLayout.tsx +0 -62
- package/src/resources/User/userResource.tsx +0 -111
- package/src/resources/User/userSchema.tsx +0 -213
- package/src/resources/User/usersFilters.tsx +0 -21
- package/src/resources.tsx +0 -280
- package/src/schemas/log.tsx +0 -45
- package/src/schemas/notification.tsx +0 -42
- package/src/schemas/permissions.tsx +0 -44
- package/src/schemas/roles.tsx +0 -48
- package/src/schemas/rolesDataGrid.tsx +0 -48
- package/src/schemas/subscription/components/SubscriptionActions.tsx +0 -153
- package/src/schemas/subscription/components/SubscriptionPaymentHistory.tsx +0 -127
- package/src/schemas/subscription/components/SubscriptionPlanFeatures.tsx +0 -162
- package/src/schemas/subscription/components/SubscriptionPlanPreview.tsx +0 -141
- package/src/schemas/subscription/components/SubscriptionPlanStats.tsx +0 -318
- package/src/schemas/subscription/components/SubscriptionStatusIndicator.tsx +0 -72
- package/src/schemas/subscription/subscriptionPlanSchema.tsx +0 -185
- package/src/schemas/subscription/subscriptionSchema.tsx +0 -152
- package/src/schemas/subscriptionPlan.ts +0 -422
- package/src/schemas/tenant.tsx +0 -129
- package/src/schemas/tenantUser.tsx +0 -96
- package/src/schemas/tenant_superadmin.tsx +0 -119
- package/src/schemas/user.tsx +0 -26
- package/src/systemResources.old.tsx +0 -928
- package/src/systemResources.tsx +0 -1369
- package/src/templates/ResourceTemplate.tsx +0 -240
- package/src/templates/ResourceTemplate.tsx.memoized_experiment +0 -350
- package/src/templates/ResourceTemplate.tsx.original +0 -396
- package/src/templates/ResourceTemplateCreate.tsx +0 -182
- package/src/templates/ResourceTemplateEdit.tsx +0 -176
- package/src/templates/ResourceTemplateFull.tsx +0 -581
- package/src/templates/ResourceTemplateList.tsx +0 -340
- package/src/templates/ResourceTemplateOld.tsx.bkup +0 -567
- package/src/templates/ResourceTemplateShow.tsx +0 -88
- package/src/templates/TrashTemplate.tsx +0 -179
- package/src/tenantResources.tsx +0 -223
- package/src/test_portal_bubbles.tsx +0 -40
- package/src/theme/AppHeader.tsx +0 -52
- package/src/theme/AppLayoutSetting.tsx +0 -33
- package/src/theme/AppLogo.tsx +0 -13
- package/src/theme/AppSidebar.tsx +0 -12
- package/src/theme/AppSidebarContent.tsx +0 -105
- package/src/theme/AppSidebarLogo.tsx +0 -48
- package/src/theme/components/PageTitle.tsx +0 -37
- package/src/utils/cache/CacheInvalidatorContext.tsx +0 -125
- package/src/utils/cache/CacheInvalidatorListenerComponent.tsx +0 -10
- package/src/utils/cache/useCacheInvalidatorListener.tsx +0 -27
- package/src/utils/convertFileToBase64.tsx +0 -9
- package/src/utils/convertToFile.tsx +0 -14
- package/src/utils/cookies.tsx +0 -33
- package/src/utils/dashDefaultQueryClient.tsx +0 -34
- package/src/utils/dataUrlToBlob.tsx +0 -30
- package/src/utils/deepReplace.tsx +0 -19
- package/src/utils/getProfileMenu.tsx +0 -41
- package/src/utils/getTenantSettings.tsx +0 -9
- package/src/utils/getType.tsx +0 -8
- package/src/utils/getUserSettings.tsx +0 -8
- package/src/utils/hasCode.tsx +0 -14
- package/src/utils/index.ts +0 -19
- package/src/utils/injectTenantStyles.ts +0 -28
- package/src/utils/isComponent.tsx +0 -45
- package/src/utils/navEvents.tsx +0 -91
- package/src/utils/prototypes.tsx +0 -5
- package/src/utils/regexp.tsx +0 -4
- package/src/utils/resolveObjectPath.tsx +0 -4
- package/src/utils/setNativeValue.tsx +0 -24
- package/src/utils/slugify.tsx +0 -11
- package/src/utils/validators/emailValidator.tsx +0 -6
- package/src/utils/validators/requiredValidator.tsx +0 -5
- package/src/utils/validators/rutValidator.tsx +0 -31
- package/src/utils/validators.tsx +0 -96
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { useCallback, useEffect, useState } from "react";
|
|
23
|
+
import { Loading, useNotify, useRecordContext, useRefresh, useTranslate } from "react-admin";
|
|
24
|
+
import {
|
|
25
|
+
Alert,
|
|
26
|
+
Box,
|
|
27
|
+
Button,
|
|
28
|
+
Card,
|
|
29
|
+
CardActionArea,
|
|
30
|
+
CardContent,
|
|
31
|
+
Chip,
|
|
32
|
+
Dialog,
|
|
33
|
+
DialogActions,
|
|
34
|
+
DialogContent,
|
|
35
|
+
DialogTitle,
|
|
36
|
+
Divider,
|
|
37
|
+
Drawer,
|
|
38
|
+
FormControlLabel,
|
|
39
|
+
IconButton,
|
|
40
|
+
MenuItem,
|
|
41
|
+
Stack,
|
|
42
|
+
Switch,
|
|
43
|
+
Table,
|
|
44
|
+
TableBody,
|
|
45
|
+
TableCell,
|
|
46
|
+
TableHead,
|
|
47
|
+
TableRow,
|
|
48
|
+
TextField,
|
|
49
|
+
Typography
|
|
50
|
+
} from "@mui/material";
|
|
51
|
+
import CloseIcon from "@mui/icons-material/Close";
|
|
52
|
+
import useAxios from "../../hooks/axios";
|
|
53
|
+
const prettyKey = (key) => key.replace(/^max_/, "Max ").replace(/_/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
54
|
+
const formatDate = (iso) => iso ? new Date(iso).toLocaleDateString() : "\u2014";
|
|
55
|
+
const formatPrice = (prices, fallback) => {
|
|
56
|
+
const entries = Object.entries(prices != null ? prices : {});
|
|
57
|
+
if (!entries.length) {
|
|
58
|
+
return fallback ? String(fallback) : "Free";
|
|
59
|
+
}
|
|
60
|
+
return entries.map(([code, value]) => {
|
|
61
|
+
const amount = code === "CLP" ? value : value / 100;
|
|
62
|
+
if (!amount) return `${code} 0`;
|
|
63
|
+
try {
|
|
64
|
+
return new Intl.NumberFormat(void 0, {
|
|
65
|
+
style: "currency",
|
|
66
|
+
currency: code,
|
|
67
|
+
maximumFractionDigits: code === "CLP" ? 0 : 2
|
|
68
|
+
}).format(amount);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
return `${code} ${amount}`;
|
|
71
|
+
}
|
|
72
|
+
}).join(" \xB7 ");
|
|
73
|
+
};
|
|
74
|
+
const isFree = (p) => {
|
|
75
|
+
var _a;
|
|
76
|
+
return !p || !p.price && !Object.values((_a = p.prices) != null ? _a : {}).some((v) => v > 0);
|
|
77
|
+
};
|
|
78
|
+
const statusColor = (status) => {
|
|
79
|
+
var _a;
|
|
80
|
+
return (_a = { active: "success", trial: "info", trialing: "info", past_due: "warning", canceled: "error", cancelled: "error" }[(status != null ? status : "").toLowerCase()]) != null ? _a : "default";
|
|
81
|
+
};
|
|
82
|
+
const TenancyPlanPanel = ({ tenancyId }) => {
|
|
83
|
+
var _a, _b, _c, _d, _e, _f;
|
|
84
|
+
const { axios } = useAxios();
|
|
85
|
+
const notify = useNotify();
|
|
86
|
+
const refresh = useRefresh();
|
|
87
|
+
const translate = useTranslate();
|
|
88
|
+
const [data, setData] = useState(null);
|
|
89
|
+
const [error, setError] = useState(null);
|
|
90
|
+
const [drawerOpen, setDrawerOpen] = useState(false);
|
|
91
|
+
const [dialogOpen, setDialogOpen] = useState(false);
|
|
92
|
+
const [targetPlan, setTargetPlan] = useState("");
|
|
93
|
+
const [charge, setCharge] = useState(false);
|
|
94
|
+
const [saving, setSaving] = useState(false);
|
|
95
|
+
const load = useCallback(() => __async(null, null, function* () {
|
|
96
|
+
var _a2, _b2, _c2, _d2;
|
|
97
|
+
try {
|
|
98
|
+
const res = yield axios.get(`system/tenancy/${tenancyId}/plan`);
|
|
99
|
+
setData((_b2 = (_a2 = res.data) == null ? void 0 : _a2.data) != null ? _b2 : null);
|
|
100
|
+
setError(null);
|
|
101
|
+
} catch (e) {
|
|
102
|
+
setError(((_d2 = (_c2 = e == null ? void 0 : e.response) == null ? void 0 : _c2.data) == null ? void 0 : _d2.message) || "Could not load the plan");
|
|
103
|
+
}
|
|
104
|
+
}), [axios, tenancyId]);
|
|
105
|
+
useEffect(() => {
|
|
106
|
+
load();
|
|
107
|
+
}, [load]);
|
|
108
|
+
if (error) return /* @__PURE__ */ jsx(Alert, { severity: "error", children: error });
|
|
109
|
+
if (!data) return /* @__PURE__ */ jsx(Loading, {});
|
|
110
|
+
const { subscription, plan } = data;
|
|
111
|
+
const target = data.available_plans.find((p) => String(p.id) === targetPlan);
|
|
112
|
+
const changing = target && String(target.id) !== String(plan == null ? void 0 : plan.id);
|
|
113
|
+
const gatewayManaged = !!(subscription == null ? void 0 : subscription.external_subscription_id);
|
|
114
|
+
const apply = () => __async(null, null, function* () {
|
|
115
|
+
var _a2, _b2;
|
|
116
|
+
if (!targetPlan) return;
|
|
117
|
+
setSaving(true);
|
|
118
|
+
try {
|
|
119
|
+
yield axios.post(`system/tenancy/${tenancyId}/change-plan`, {
|
|
120
|
+
subscription_plan_id: targetPlan,
|
|
121
|
+
charge
|
|
122
|
+
});
|
|
123
|
+
notify(translate("tenancy.plan.changed", { _: "Plan updated" }), { type: "success" });
|
|
124
|
+
setDialogOpen(false);
|
|
125
|
+
setTargetPlan("");
|
|
126
|
+
yield load();
|
|
127
|
+
refresh();
|
|
128
|
+
} catch (e) {
|
|
129
|
+
notify(((_b2 = (_a2 = e == null ? void 0 : e.response) == null ? void 0 : _a2.data) == null ? void 0 : _b2.message) || translate("tenancy.plan.failed", { _: "Could not change the plan" }), {
|
|
130
|
+
type: "error"
|
|
131
|
+
});
|
|
132
|
+
} finally {
|
|
133
|
+
setSaving(false);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
return /* @__PURE__ */ jsxs(Box, { sx: { width: "100%", py: 1 }, children: [
|
|
137
|
+
/* @__PURE__ */ jsx(Card, { variant: "outlined", sx: { maxWidth: 720 }, children: /* @__PURE__ */ jsx(CardActionArea, { onClick: () => setDrawerOpen(true), children: /* @__PURE__ */ jsxs(CardContent, { children: [
|
|
138
|
+
/* @__PURE__ */ jsxs(Stack, { direction: "row", spacing: 1, useFlexGap: true, sx: { mb: 1, alignItems: "center", flexWrap: "wrap" }, children: [
|
|
139
|
+
/* @__PURE__ */ jsx(Typography, { variant: "overline", color: "text.secondary", children: translate("tenancy.plan.current", { _: "Current plan" }) }),
|
|
140
|
+
subscription && /* @__PURE__ */ jsx(Chip, { size: "small", color: statusColor(subscription.status), label: subscription.status }),
|
|
141
|
+
(subscription == null ? void 0 : subscription.subscription_state) && /* @__PURE__ */ jsx(Chip, { size: "small", variant: "outlined", label: subscription.subscription_state }),
|
|
142
|
+
(subscription == null ? void 0 : subscription.pending_plan) && /* @__PURE__ */ jsx(
|
|
143
|
+
Chip,
|
|
144
|
+
{
|
|
145
|
+
size: "small",
|
|
146
|
+
color: "warning",
|
|
147
|
+
label: `${translate("tenancy.plan.pending", { _: "Pending" })}: ${subscription.pending_plan.name}`
|
|
148
|
+
}
|
|
149
|
+
)
|
|
150
|
+
] }),
|
|
151
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h5", children: (_a = plan == null ? void 0 : plan.name) != null ? _a : translate("tenancy.plan.none", { _: "No plan" }) }),
|
|
152
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", sx: { mt: 0.5 }, children: plan ? `${formatPrice(plan.prices, plan.price)} / ${(_b = plan.billing_cycle) != null ? _b : "monthly"}` : "" }),
|
|
153
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "text.secondary", sx: { mt: 1.5 }, children: [
|
|
154
|
+
translate("tenancy.plan.renews", { _: "Current period ends" }),
|
|
155
|
+
": ",
|
|
156
|
+
formatDate(subscription == null ? void 0 : subscription.current_period_end),
|
|
157
|
+
(subscription == null ? void 0 : subscription.trial_ends_at) ? ` \xB7 ${translate("tenancy.plan.trial_ends", { _: "Trial ends" })}: ${formatDate(subscription.trial_ends_at)}` : ""
|
|
158
|
+
] }),
|
|
159
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "primary", sx: { display: "block", mt: 1 }, children: translate("tenancy.plan.details", { _: "View details" }) })
|
|
160
|
+
] }) }) }),
|
|
161
|
+
/* @__PURE__ */ jsx(Stack, { direction: "row", spacing: 1, sx: { mt: 2 }, children: /* @__PURE__ */ jsx(Button, { variant: "contained", onClick: () => setDialogOpen(true), disabled: !subscription && !data.available_plans.length, children: translate("tenancy.plan.change", { _: "Change plan" }) }) }),
|
|
162
|
+
/* @__PURE__ */ jsx(
|
|
163
|
+
Drawer,
|
|
164
|
+
{
|
|
165
|
+
anchor: "right",
|
|
166
|
+
open: drawerOpen,
|
|
167
|
+
onClose: () => setDrawerOpen(false),
|
|
168
|
+
sx: { zIndex: (theme) => theme.zIndex.modal + 2 },
|
|
169
|
+
children: /* @__PURE__ */ jsxs(Box, { sx: { width: { xs: "100vw", sm: 560 }, p: 2 }, children: [
|
|
170
|
+
/* @__PURE__ */ jsxs(Box, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", mb: 1 }, children: [
|
|
171
|
+
/* @__PURE__ */ jsx(Typography, { variant: "h6", children: (_c = plan == null ? void 0 : plan.name) != null ? _c : "\u2014" }),
|
|
172
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: () => setDrawerOpen(false), size: "small", "aria-label": "Close", children: /* @__PURE__ */ jsx(CloseIcon, {}) })
|
|
173
|
+
] }),
|
|
174
|
+
/* @__PURE__ */ jsx(Divider, { sx: { mb: 2 } }),
|
|
175
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, children: translate("tenancy.plan.subscription", { _: "Subscription" }) }),
|
|
176
|
+
/* @__PURE__ */ jsx(Table, { size: "small", sx: { mb: 3 }, children: /* @__PURE__ */ jsx(TableBody, { children: [
|
|
177
|
+
["Status", subscription == null ? void 0 : subscription.status],
|
|
178
|
+
["State", subscription == null ? void 0 : subscription.subscription_state],
|
|
179
|
+
["Account", data.tenancy.account_status],
|
|
180
|
+
["Payment gateway", (_e = (_d = subscription == null ? void 0 : subscription.payment_gateway) != null ? _d : data.tenancy.gateway_type) != null ? _e : "internal"],
|
|
181
|
+
["Period start", formatDate(subscription == null ? void 0 : subscription.current_period_start)],
|
|
182
|
+
["Period end", formatDate(subscription == null ? void 0 : subscription.current_period_end)],
|
|
183
|
+
["Trial ends", formatDate(subscription == null ? void 0 : subscription.trial_ends_at)],
|
|
184
|
+
["Cancels at", formatDate(subscription == null ? void 0 : subscription.cancels_at)],
|
|
185
|
+
["Plan tier", plan == null ? void 0 : plan.tier],
|
|
186
|
+
["Trial days (plan)", plan == null ? void 0 : plan.trial_days]
|
|
187
|
+
].map(([k, v]) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
188
|
+
/* @__PURE__ */ jsx(TableCell, { sx: { color: "text.secondary", width: "45%" }, children: k }),
|
|
189
|
+
/* @__PURE__ */ jsx(TableCell, { children: v != null ? v : "\u2014" })
|
|
190
|
+
] }, String(k))) }) }),
|
|
191
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, children: translate("tenancy.plan.limits", { _: "Limits" }) }),
|
|
192
|
+
/* @__PURE__ */ jsxs(Table, { size: "small", sx: { mb: 3 }, children: [
|
|
193
|
+
/* @__PURE__ */ jsx(TableHead, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
194
|
+
/* @__PURE__ */ jsx(TableCell, { children: translate("tenancy.plan.limit", { _: "Limit" }) }),
|
|
195
|
+
/* @__PURE__ */ jsx(TableCell, { align: "right", children: translate("tenancy.plan.allowed", { _: "Allowed" }) }),
|
|
196
|
+
/* @__PURE__ */ jsx(TableCell, { align: "right", children: translate("tenancy.plan.used", { _: "Used" }) })
|
|
197
|
+
] }) }),
|
|
198
|
+
/* @__PURE__ */ jsxs(TableBody, { children: [
|
|
199
|
+
data.usage.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colSpan: 3, children: "\u2014" }) }),
|
|
200
|
+
data.usage.map((u) => {
|
|
201
|
+
var _a2;
|
|
202
|
+
return /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
203
|
+
/* @__PURE__ */ jsx(TableCell, { children: prettyKey(u.key) }),
|
|
204
|
+
/* @__PURE__ */ jsx(TableCell, { align: "right", children: u.unlimited ? "Unlimited" : u.limit }),
|
|
205
|
+
/* @__PURE__ */ jsx(TableCell, { align: "right", children: (_a2 = u.current) != null ? _a2 : "\u2014" })
|
|
206
|
+
] }, u.key);
|
|
207
|
+
})
|
|
208
|
+
] })
|
|
209
|
+
] }),
|
|
210
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, children: translate("tenancy.plan.addons", { _: "Add-ons" }) }),
|
|
211
|
+
/* @__PURE__ */ jsx(Box, { sx: { mb: 3, display: "flex", gap: 0.5, flexWrap: "wrap" }, children: (() => {
|
|
212
|
+
const addons = plan == null ? void 0 : plan.addons;
|
|
213
|
+
const enabled = Array.isArray(addons) ? addons : Object.entries(addons != null ? addons : {}).filter(([, on]) => !!on).map(([k]) => k);
|
|
214
|
+
return enabled.length ? enabled.map((a) => /* @__PURE__ */ jsx(Chip, { size: "small", label: String(a) }, String(a))) : /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "text.secondary", children: "\u2014" });
|
|
215
|
+
})() }),
|
|
216
|
+
/* @__PURE__ */ jsx(Typography, { variant: "subtitle2", gutterBottom: true, children: translate("tenancy.plan.payments", { _: "Recent payments" }) }),
|
|
217
|
+
/* @__PURE__ */ jsx(Table, { size: "small", children: /* @__PURE__ */ jsxs(TableBody, { children: [
|
|
218
|
+
data.payments.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { children: "\u2014" }) }),
|
|
219
|
+
data.payments.map((p) => {
|
|
220
|
+
var _a2;
|
|
221
|
+
return /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
222
|
+
/* @__PURE__ */ jsx(TableCell, { children: formatDate(p.created_at) }),
|
|
223
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Chip, { size: "small", label: p.status }) }),
|
|
224
|
+
/* @__PURE__ */ jsx(TableCell, { align: "right", children: p.amount != null ? `${(_a2 = p.currency) != null ? _a2 : ""} ${p.amount}` : "\u2014" })
|
|
225
|
+
] }, p.id);
|
|
226
|
+
})
|
|
227
|
+
] }) })
|
|
228
|
+
] })
|
|
229
|
+
}
|
|
230
|
+
),
|
|
231
|
+
/* @__PURE__ */ jsxs(
|
|
232
|
+
Dialog,
|
|
233
|
+
{
|
|
234
|
+
open: dialogOpen,
|
|
235
|
+
onClose: () => !saving && setDialogOpen(false),
|
|
236
|
+
fullWidth: true,
|
|
237
|
+
maxWidth: "sm",
|
|
238
|
+
sx: { zIndex: (theme) => theme.zIndex.modal + 3 },
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: translate("tenancy.plan.change", { _: "Change plan" }) }),
|
|
241
|
+
/* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
242
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "text.secondary", sx: { mb: 2 }, children: [
|
|
243
|
+
data.tenancy.name,
|
|
244
|
+
" \xB7 ",
|
|
245
|
+
translate("tenancy.plan.current", { _: "Current plan" }),
|
|
246
|
+
": ",
|
|
247
|
+
/* @__PURE__ */ jsx("b", { children: (_f = plan == null ? void 0 : plan.name) != null ? _f : "\u2014" })
|
|
248
|
+
] }),
|
|
249
|
+
/* @__PURE__ */ jsx(
|
|
250
|
+
TextField,
|
|
251
|
+
{
|
|
252
|
+
select: true,
|
|
253
|
+
fullWidth: true,
|
|
254
|
+
label: translate("tenancy.plan.new_plan", { _: "New plan" }),
|
|
255
|
+
value: targetPlan,
|
|
256
|
+
onChange: (e) => setTargetPlan(e.target.value),
|
|
257
|
+
sx: { mb: 2 },
|
|
258
|
+
children: data.available_plans.map((p) => {
|
|
259
|
+
var _a2;
|
|
260
|
+
return /* @__PURE__ */ jsxs(MenuItem, { value: String(p.id), disabled: String(p.id) === String(plan == null ? void 0 : plan.id), children: [
|
|
261
|
+
p.name,
|
|
262
|
+
" \u2014 ",
|
|
263
|
+
formatPrice(p.prices, p.price),
|
|
264
|
+
" / ",
|
|
265
|
+
(_a2 = p.billing_cycle) != null ? _a2 : "monthly",
|
|
266
|
+
String(p.id) === String(plan == null ? void 0 : plan.id) ? " (current)" : ""
|
|
267
|
+
] }, String(p.id));
|
|
268
|
+
})
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
272
|
+
FormControlLabel,
|
|
273
|
+
{
|
|
274
|
+
control: /* @__PURE__ */ jsx(Switch, { checked: !charge, onChange: (e) => setCharge(!e.target.checked) }),
|
|
275
|
+
label: translate("tenancy.plan.no_charge", { _: "Assign now, without charging" })
|
|
276
|
+
}
|
|
277
|
+
),
|
|
278
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", color: "text.secondary", sx: { display: "block", ml: 6, mb: 1 }, children: charge ? translate("tenancy.plan.charge_help", {
|
|
279
|
+
_: "Normal flow: a paid plan stays pending until the payment gateway confirms it."
|
|
280
|
+
}) : translate("tenancy.plan.assign_help", {
|
|
281
|
+
_: "Applied immediately, whatever the plan's price. No payment is requested."
|
|
282
|
+
}) }),
|
|
283
|
+
!charge && gatewayManaged && /* @__PURE__ */ jsx(Alert, { severity: "warning", sx: { mt: 1 }, children: translate("tenancy.plan.gateway_warning", {
|
|
284
|
+
_: "This account has a subscription at an external payment gateway. Assigning here does not change it: it keeps billing the plan it has there."
|
|
285
|
+
}) }),
|
|
286
|
+
changing && target && isFree(plan) === false && isFree(target) && /* @__PURE__ */ jsx(Alert, { severity: "info", sx: { mt: 1 }, children: translate("tenancy.plan.downgrade_note", { _: "Moving to a free plan." }) })
|
|
287
|
+
] }),
|
|
288
|
+
/* @__PURE__ */ jsxs(DialogActions, { children: [
|
|
289
|
+
/* @__PURE__ */ jsx(Button, { onClick: () => setDialogOpen(false), disabled: saving, children: translate("ra.action.cancel", { _: "Cancel" }) }),
|
|
290
|
+
/* @__PURE__ */ jsx(Button, { variant: "contained", onClick: apply, disabled: !changing || saving, children: translate("tenancy.plan.apply", { _: "Apply" }) })
|
|
291
|
+
] })
|
|
292
|
+
]
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
] });
|
|
296
|
+
};
|
|
297
|
+
const TenancyPlan = ({ method }) => {
|
|
298
|
+
const record = useRecordContext();
|
|
299
|
+
if (method !== "edit" && method !== "view" || !(record == null ? void 0 : record.id)) {
|
|
300
|
+
return /* @__PURE__ */ jsx(Fragment, {});
|
|
301
|
+
}
|
|
302
|
+
return /* @__PURE__ */ jsx(TenancyPlanPanel, { tenancyId: String(record.id) });
|
|
303
|
+
};
|
|
304
|
+
var TenancyPlan_default = TenancyPlan;
|
|
305
|
+
export {
|
|
306
|
+
TenancyPlan_default as default
|
|
307
|
+
};
|
package/dist/systemResources.js
CHANGED
|
@@ -23,6 +23,7 @@ import ResourceTemplate from "./templates/ResourceTemplate";
|
|
|
23
23
|
import { TenantImpersonateResource } from "./resources/Tenant/ImpersonateTenantResource";
|
|
24
24
|
import tenantSystemAdminSchema from "./schemas/tenant_superadmin";
|
|
25
25
|
import TenancySettings from "./components/tenant/TenancySettings";
|
|
26
|
+
import TenancyPlan from "./components/tenant/TenancyPlan";
|
|
26
27
|
import subscriptionPlanSchema from "./schemas/subscriptionPlan";
|
|
27
28
|
import { RutValidator } from "./utils/validators";
|
|
28
29
|
import { DASHAppConstants } from "dash-constants";
|
|
@@ -349,6 +350,21 @@ const systemResources = [
|
|
|
349
350
|
inShow: true,
|
|
350
351
|
inCreate: false
|
|
351
352
|
},
|
|
353
|
+
{
|
|
354
|
+
// The account's plan: summary, details drawer and "change plan" for the System admin.
|
|
355
|
+
// `attribute` is required by the interface but unused: the component loads
|
|
356
|
+
// system/tenancy/{id}/plan itself.
|
|
357
|
+
tab: "Plan",
|
|
358
|
+
label: "Plan",
|
|
359
|
+
attribute: "current_subscription",
|
|
360
|
+
type: Object,
|
|
361
|
+
custom: true,
|
|
362
|
+
inList: false,
|
|
363
|
+
inEdit: true,
|
|
364
|
+
inShow: true,
|
|
365
|
+
inCreate: false,
|
|
366
|
+
component: TenancyPlan
|
|
367
|
+
},
|
|
352
368
|
{
|
|
353
369
|
tab: "AI Providers",
|
|
354
370
|
label: "AI Providers",
|
|
@@ -512,7 +528,7 @@ const systemResources = [
|
|
|
512
528
|
}),
|
|
513
529
|
{
|
|
514
530
|
// Platform-wide AI provider credentials (bionic/ollama/deepinfra/
|
|
515
|
-
// aws_bedrock) — see backend App\AiAgentCore\Models\SystemAiProviderKey.
|
|
531
|
+
// aws_bedrock/anthropic/elevenlabs/apify) — see backend App\AiAgentCore\Models\SystemAiProviderKey.
|
|
516
532
|
// The 4 rows are seeded by migration and never created/deleted here;
|
|
517
533
|
// an admin only ever edits an existing row's credentials/flags.
|
|
518
534
|
// Credential VALUES are never returned by the API once saved
|
|
@@ -570,7 +586,7 @@ const systemResources = [
|
|
|
570
586
|
inShow: false,
|
|
571
587
|
inCreate: false,
|
|
572
588
|
fieldProps: {
|
|
573
|
-
helperText: "Bionic / Ollama / DeepInfra
|
|
589
|
+
helperText: "Bionic / Ollama / DeepInfra / Anthropic / ElevenLabs / Apify. Write-only \u2014 leave blank to keep the current value."
|
|
574
590
|
}
|
|
575
591
|
},
|
|
576
592
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashadmin/dash-admin",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.74-srcfree.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"lint:fix": "pnpm prettier --write .",
|
|
11
11
|
"check-updates": "pnpm npm-check-updates",
|
|
12
12
|
"updates-packages": "pnpm npm-check-updates -u",
|
|
13
|
-
"build": "tsup"
|
|
13
|
+
"build": "tsup && pnpm run build:types",
|
|
14
|
+
"build:types": "tsc -p tsconfig.json --declaration --emitDeclarationOnly --noEmit false --outDir dist --rootDir src --skipLibCheck || true"
|
|
14
15
|
},
|
|
15
16
|
"browserslist": {
|
|
16
17
|
"production": [
|
|
@@ -38,11 +39,11 @@
|
|
|
38
39
|
"@rollup/plugin-node-resolve": "latest",
|
|
39
40
|
"@rollup/plugin-replace": "latest",
|
|
40
41
|
"@rollup/plugin-typescript": "latest",
|
|
41
|
-
"@dashadmin/dash-admin-state": "1.3.
|
|
42
|
-
"@dashadmin/dash-auto-admin": "1.3.
|
|
43
|
-
"@dashadmin/dash-constants": "1.3.
|
|
44
|
-
"@dashadmin/dash-dialog": "1.3.
|
|
45
|
-
"@dashadmin/dash-styles": "1.3.
|
|
42
|
+
"@dashadmin/dash-admin-state": "1.3.74-srcfree.1",
|
|
43
|
+
"@dashadmin/dash-auto-admin": "1.3.74-srcfree.1",
|
|
44
|
+
"@dashadmin/dash-constants": "1.3.74-srcfree.1",
|
|
45
|
+
"@dashadmin/dash-dialog": "1.3.74-srcfree.1",
|
|
46
|
+
"@dashadmin/dash-styles": "1.3.74-srcfree.1",
|
|
46
47
|
"framer-motion": "latest",
|
|
47
48
|
"prop-types": "latest",
|
|
48
49
|
"query-string": "latest",
|
|
@@ -61,11 +62,11 @@
|
|
|
61
62
|
"rollup-plugin-dts": "latest",
|
|
62
63
|
"rollup-plugin-peer-deps-external": "latest",
|
|
63
64
|
"rollup-plugin-svg": "latest",
|
|
64
|
-
"@dashadmin/dash-modal": "1.3.
|
|
65
|
-
"@dashadmin/dash-components": "1.3.
|
|
66
|
-
"@dashadmin/dash-axios-hook": "1.3.
|
|
67
|
-
"@dashadmin/dash-utils": "1.3.
|
|
68
|
-
"@dashadmin/dash-auth": "1.3.
|
|
65
|
+
"@dashadmin/dash-modal": "1.3.74-srcfree.1",
|
|
66
|
+
"@dashadmin/dash-components": "1.3.74-srcfree.1",
|
|
67
|
+
"@dashadmin/dash-axios-hook": "1.3.74-srcfree.1",
|
|
68
|
+
"@dashadmin/dash-utils": "1.3.74-srcfree.1",
|
|
69
|
+
"@dashadmin/dash-auth": "1.3.74-srcfree.1"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
72
|
"@babel/core": "latest",
|
|
@@ -78,8 +79,8 @@
|
|
|
78
79
|
"@types/react-dom": "latest",
|
|
79
80
|
"@zerollup/ts-transform-paths": "latest",
|
|
80
81
|
"babel-loader": "latest",
|
|
81
|
-
"@dashadmin/dash-eslint": "1.3.
|
|
82
|
-
"@dashadmin/dash-tsconfig": "1.3.
|
|
82
|
+
"@dashadmin/dash-eslint": "1.3.74-srcfree.1",
|
|
83
|
+
"@dashadmin/dash-tsconfig": "1.3.74-srcfree.1",
|
|
83
84
|
"eslint": "latest",
|
|
84
85
|
"eslint-config-airbnb": "latest",
|
|
85
86
|
"eslint-config-airbnb-typescript": "latest",
|
|
@@ -93,7 +94,7 @@
|
|
|
93
94
|
"eslint-plugin-prettier": "latest",
|
|
94
95
|
"eslint-plugin-react": "latest",
|
|
95
96
|
"eslint-plugin-react-hooks": "latest",
|
|
96
|
-
"@dashadmin/dash-prettier": "1.3.
|
|
97
|
+
"@dashadmin/dash-prettier": "1.3.74-srcfree.1",
|
|
97
98
|
"query-string": "latest",
|
|
98
99
|
"react-dom": "19.2.8",
|
|
99
100
|
"rollup": "latest",
|
|
@@ -117,7 +118,7 @@
|
|
|
117
118
|
"eslint-plugin-storybook": "latest"
|
|
118
119
|
},
|
|
119
120
|
"module": "dist/index.js",
|
|
120
|
-
"types": "./
|
|
121
|
+
"types": "./dist/index.d.ts",
|
|
121
122
|
"exports": {
|
|
122
123
|
".": "./dist/index.js",
|
|
123
124
|
"./components/navigation": "./dist/components/navigation/index.js",
|
|
@@ -138,18 +139,20 @@
|
|
|
138
139
|
"registry": "https://registry.npmjs.org"
|
|
139
140
|
},
|
|
140
141
|
"files": [
|
|
141
|
-
"dist"
|
|
142
|
-
"src"
|
|
142
|
+
"dist"
|
|
143
143
|
],
|
|
144
144
|
"typesVersions": {
|
|
145
145
|
"*": {
|
|
146
|
+
"dist/*": [
|
|
147
|
+
"dist/*"
|
|
148
|
+
],
|
|
146
149
|
"src/*": [
|
|
147
|
-
"
|
|
148
|
-
"
|
|
150
|
+
"dist/*",
|
|
151
|
+
"dist/*/index"
|
|
149
152
|
],
|
|
150
153
|
"*": [
|
|
151
|
-
"
|
|
152
|
-
"
|
|
154
|
+
"dist/*",
|
|
155
|
+
"dist/*/index"
|
|
153
156
|
]
|
|
154
157
|
}
|
|
155
158
|
}
|
package/src/AppAsyncWrapper.tsx
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* eslint react/jsx-key: off */
|
|
2
|
-
import React, { Suspense } from 'react';
|
|
3
|
-
import GlobalLoader from './components/loader/GlobalLoader';
|
|
4
|
-
import { Loading } from 'react-admin';
|
|
5
|
-
|
|
6
|
-
import { ErrorBoundary } from 'react-error-boundary';
|
|
7
|
-
|
|
8
|
-
const ErrorFallback = ({ error, resetErrorBoundary }) => {
|
|
9
|
-
return <Loading loadingPrimary='Error' loadingSecondary={error.message} />;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const AppComponent = React.lazy(() => {
|
|
13
|
-
return new Promise((resolve) => setTimeout(resolve, 1 * 1000)).then(
|
|
14
|
-
// @ts-ignore
|
|
15
|
-
() => import('@app/DASHApp'),
|
|
16
|
-
);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const AppAsyncWrapper: React.FC<any> = () => {
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<>
|
|
23
|
-
<ErrorBoundary
|
|
24
|
-
FallbackComponent={ErrorFallback}
|
|
25
|
-
//</>onReset={() => {
|
|
26
|
-
// reset the state of your app so the error doesn't happen again
|
|
27
|
-
//}}
|
|
28
|
-
>
|
|
29
|
-
<Suspense fallback={<Loading loadingPrimary='' loadingSecondary='' />}>
|
|
30
|
-
<AppComponent />
|
|
31
|
-
</Suspense>
|
|
32
|
-
</ErrorBoundary>
|
|
33
|
-
|
|
34
|
-
<GlobalLoader>
|
|
35
|
-
{/*<SlideInSpinner transitionDuration={0.5} isSlideIn={true} />*/}
|
|
36
|
-
...
|
|
37
|
-
</GlobalLoader>
|
|
38
|
-
</>
|
|
39
|
-
);
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default AppAsyncWrapper;
|
package/src/AppWrapper.tsx
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React, { PropsWithChildren, Suspense, useState, useTransition } from 'react';
|
|
2
|
-
import GlobalLoader from './components/loader/GlobalLoader';
|
|
3
|
-
import { Loading } from 'react-admin';
|
|
4
|
-
import { ErrorBoundary, FallbackProps } from 'react-error-boundary';
|
|
5
|
-
//import LoaderAnimation from 'react-spinners/PuffLoader';
|
|
6
|
-
//import { SlideInSpinner } from './layout/MotionWrapper';
|
|
7
|
-
|
|
8
|
-
const ErrorFallback: React.FC<FallbackProps> = ({ error, resetErrorBoundary }) => {
|
|
9
|
-
return <Loading loadingPrimary='Error' loadingSecondary={error?.message || 'Unknown error'} />;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const AppWrapper: React.FC<PropsWithChildren> = (props) => {
|
|
13
|
-
const { children } = props;
|
|
14
|
-
const [isPending, startTransition] = useTransition();
|
|
15
|
-
const [isInitialRender, setIsInitialRender] = useState(true);
|
|
16
|
-
|
|
17
|
-
React.useEffect(() => {
|
|
18
|
-
// Mark this content rendering as a transition
|
|
19
|
-
startTransition(() => {
|
|
20
|
-
setIsInitialRender(false);
|
|
21
|
-
});
|
|
22
|
-
}, []);
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<>
|
|
26
|
-
<ErrorBoundary
|
|
27
|
-
FallbackComponent={ErrorFallback}
|
|
28
|
-
onReset={() => {
|
|
29
|
-
// reset the state of your app so the error doesn't happen again
|
|
30
|
-
}}
|
|
31
|
-
>
|
|
32
|
-
<Suspense fallback={<Loading loadingPrimary='' loadingSecondary='' />}>
|
|
33
|
-
{children}
|
|
34
|
-
</Suspense>
|
|
35
|
-
</ErrorBoundary>
|
|
36
|
-
<GlobalLoader>
|
|
37
|
-
{/*<SlideInSpinner transitionDuration={3} />*/}
|
|
38
|
-
...
|
|
39
|
-
</GlobalLoader>
|
|
40
|
-
<div className={!isPending && !isInitialRender ? 'dash-splash fade-out' : 'dash-splash'}></div>
|
|
41
|
-
</>
|
|
42
|
-
);
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default AppWrapper;
|