@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
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { IDashAutoAdminAttribute } from 'dash-auto-admin';
|
|
2
|
-
import { SelectInput } from 'react-admin';
|
|
3
|
-
import SubscriptionPlanFeatures from './components/SubscriptionPlanFeatures';
|
|
4
|
-
import SubscriptionPlanPreview from './components/SubscriptionPlanPreview';
|
|
5
|
-
import SubscriptionPlanStats from './components/SubscriptionPlanStats';
|
|
6
|
-
|
|
7
|
-
const subscriptionPlanSchema: IDashAutoAdminAttribute[] = [
|
|
8
|
-
{
|
|
9
|
-
label: 'ID',
|
|
10
|
-
attribute: 'id',
|
|
11
|
-
type: Number,
|
|
12
|
-
inList: true,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
label: 'Nombre',
|
|
16
|
-
attribute: 'name',
|
|
17
|
-
type: String,
|
|
18
|
-
inList: true,
|
|
19
|
-
validate: (value: string) => {
|
|
20
|
-
if (!value || value.trim().length === 0) {
|
|
21
|
-
throw new Error('El nombre es requerido');
|
|
22
|
-
}
|
|
23
|
-
if (value.length > 255) {
|
|
24
|
-
throw new Error('El nombre no puede exceder 255 caracteres');
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: 'Slug',
|
|
30
|
-
attribute: 'slug',
|
|
31
|
-
type: String,
|
|
32
|
-
inList: true,
|
|
33
|
-
validate: (value: string) => {
|
|
34
|
-
if (!value || value.trim().length === 0) {
|
|
35
|
-
throw new Error('El slug es requerido');
|
|
36
|
-
}
|
|
37
|
-
if (!/^[a-z0-9-_]+$/.test(value)) {
|
|
38
|
-
throw new Error('El slug solo puede contener letras minúsculas, números, guiones y guiones bajos');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
label: 'Descripción',
|
|
44
|
-
attribute: 'description',
|
|
45
|
-
type: String,
|
|
46
|
-
inList: false,
|
|
47
|
-
componentProps: {
|
|
48
|
-
multiline: true,
|
|
49
|
-
rows: 3
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
label: 'Precio (en centavos)',
|
|
54
|
-
attribute: 'price',
|
|
55
|
-
type: Number,
|
|
56
|
-
inList: true,
|
|
57
|
-
validate: (value: number) => {
|
|
58
|
-
if (value === null || value === undefined) {
|
|
59
|
-
throw new Error('El precio es requerido');
|
|
60
|
-
}
|
|
61
|
-
if (value < 0) {
|
|
62
|
-
throw new Error('El precio no puede ser negativo');
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
label: 'Precio Formateado',
|
|
68
|
-
attribute: 'formatted_price',
|
|
69
|
-
type: String,
|
|
70
|
-
inList: true,
|
|
71
|
-
custom: true,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
label: 'Ciclo de Facturación',
|
|
75
|
-
attribute: 'billing_cycle',
|
|
76
|
-
type: String,
|
|
77
|
-
component: SelectInput,
|
|
78
|
-
componentProps: {
|
|
79
|
-
choices: [
|
|
80
|
-
{ id: 'monthly', name: 'Mensual' },
|
|
81
|
-
{ id: 'yearly', name: 'Anual' },
|
|
82
|
-
]
|
|
83
|
-
},
|
|
84
|
-
inList: true,
|
|
85
|
-
validate: (value: string) => {
|
|
86
|
-
if (!value) {
|
|
87
|
-
throw new Error('El ciclo de facturación es requerido');
|
|
88
|
-
}
|
|
89
|
-
if (!['monthly', 'yearly'].includes(value)) {
|
|
90
|
-
throw new Error('Ciclo de facturación inválido');
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
label: 'Días de Prueba',
|
|
96
|
-
attribute: 'trial_days',
|
|
97
|
-
type: Number,
|
|
98
|
-
inList: true,
|
|
99
|
-
componentProps: {
|
|
100
|
-
min: 0,
|
|
101
|
-
max: 365
|
|
102
|
-
},
|
|
103
|
-
validate: (value: number) => {
|
|
104
|
-
if (value < 0) {
|
|
105
|
-
throw new Error('Los días de prueba no pueden ser negativos');
|
|
106
|
-
}
|
|
107
|
-
if (value > 365) {
|
|
108
|
-
throw new Error('Los días de prueba no pueden exceder 365 días');
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
label: 'Activo',
|
|
114
|
-
attribute: 'is_active',
|
|
115
|
-
type: Boolean,
|
|
116
|
-
inList: true,
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
tab: "Características",
|
|
120
|
-
label: 'Gestión de Características',
|
|
121
|
-
attribute: 'features_management',
|
|
122
|
-
type: String,
|
|
123
|
-
custom: true,
|
|
124
|
-
inList: false,
|
|
125
|
-
component: SubscriptionPlanFeatures,
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
tab: "Vista Previa",
|
|
129
|
-
label: 'Vista Previa del Plan',
|
|
130
|
-
attribute: 'plan_preview',
|
|
131
|
-
type: String,
|
|
132
|
-
custom: true,
|
|
133
|
-
inList: false,
|
|
134
|
-
component: SubscriptionPlanPreview,
|
|
135
|
-
},
|
|
136
|
-
/*{
|
|
137
|
-
tab: "Estadísticas",
|
|
138
|
-
label: 'Estadísticas del Plan',
|
|
139
|
-
attribute: 'plan_stats',
|
|
140
|
-
type: String,
|
|
141
|
-
custom: true,
|
|
142
|
-
inList: false,
|
|
143
|
-
component: SubscriptionPlanStats,
|
|
144
|
-
},*/
|
|
145
|
-
{
|
|
146
|
-
tab: "Información Calculada",
|
|
147
|
-
label: 'Precio por Mes',
|
|
148
|
-
attribute: 'price_per_month',
|
|
149
|
-
type: Number,
|
|
150
|
-
inList: false,
|
|
151
|
-
custom: true,
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
tab: "Información Calculada",
|
|
155
|
-
label: 'Tiene Prueba',
|
|
156
|
-
attribute: 'has_trial',
|
|
157
|
-
type: Boolean,
|
|
158
|
-
inList: true,
|
|
159
|
-
custom: true,
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
tab: "Información Calculada",
|
|
163
|
-
label: 'Etiqueta del Ciclo',
|
|
164
|
-
attribute: 'billing_cycle_label',
|
|
165
|
-
type: String,
|
|
166
|
-
inList: false,
|
|
167
|
-
custom: true,
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
label: 'Fecha de Creación',
|
|
171
|
-
attribute: 'created_at',
|
|
172
|
-
type: String,
|
|
173
|
-
inList: true,
|
|
174
|
-
custom: true,
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
label: 'Fecha de Actualización',
|
|
178
|
-
attribute: 'updated_at',
|
|
179
|
-
type: String,
|
|
180
|
-
inList: false,
|
|
181
|
-
custom: true,
|
|
182
|
-
},
|
|
183
|
-
];
|
|
184
|
-
|
|
185
|
-
export default subscriptionPlanSchema;
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { IDashAutoAdminAttribute } from 'dash-auto-admin';
|
|
2
|
-
import { SelectInput, DateTimeInput } from 'react-admin';
|
|
3
|
-
import SubscriptionStatusIndicator from './components/SubscriptionStatusIndicator';
|
|
4
|
-
import SubscriptionPaymentHistory from './components/SubscriptionPaymentHistory';
|
|
5
|
-
import SubscriptionActions from './components/SubscriptionActions';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const subscriptionSchema: IDashAutoAdminAttribute[] = [
|
|
9
|
-
{
|
|
10
|
-
label: 'ID',
|
|
11
|
-
attribute: 'id',
|
|
12
|
-
type: Number,
|
|
13
|
-
inList: true,
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
label: 'Usuario',
|
|
17
|
-
attribute: 'user_id',
|
|
18
|
-
type: 'system/user.name',
|
|
19
|
-
pagination: false,
|
|
20
|
-
multiple: false,
|
|
21
|
-
component: SelectInput,
|
|
22
|
-
inList: true,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
label: 'Plan de Suscripción',
|
|
26
|
-
attribute: 'subscription_plan_id',
|
|
27
|
-
type: 'system/subscription-plan.name',
|
|
28
|
-
pagination: false,
|
|
29
|
-
multiple: false,
|
|
30
|
-
component: SelectInput,
|
|
31
|
-
inList: true,
|
|
32
|
-
validate: (value: any) => {
|
|
33
|
-
if (!value) {
|
|
34
|
-
throw new Error('El plan de suscripción es requerido');
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
label: 'Estado',
|
|
40
|
-
attribute: 'status',
|
|
41
|
-
type: String,
|
|
42
|
-
component: SelectInput,
|
|
43
|
-
componentProps: {
|
|
44
|
-
choices: [
|
|
45
|
-
{ id: 'active', name: 'Activa' },
|
|
46
|
-
{ id: 'trial', name: 'Período de Prueba' },
|
|
47
|
-
{ id: 'cancelled', name: 'Cancelada' },
|
|
48
|
-
{ id: 'expired', name: 'Expirada' },
|
|
49
|
-
]
|
|
50
|
-
},
|
|
51
|
-
inList: true,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
tab: "Estado y Fechas",
|
|
55
|
-
label: "Indicador de Estado",
|
|
56
|
-
attribute: 'status_indicator',
|
|
57
|
-
type: String,
|
|
58
|
-
custom: true,
|
|
59
|
-
inList: false,
|
|
60
|
-
component: SubscriptionStatusIndicator,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
tab: "Estado y Fechas",
|
|
64
|
-
label: 'Fin del Período de Prueba',
|
|
65
|
-
attribute: 'trial_ends_at',
|
|
66
|
-
type: Date,
|
|
67
|
-
|
|
68
|
-
inList: false,
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
tab: "Estado y Fechas",
|
|
72
|
-
label: 'Inicio del Período Actual',
|
|
73
|
-
attribute: 'current_period_start',
|
|
74
|
-
type: Date,
|
|
75
|
-
|
|
76
|
-
inList: false,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
tab: "Estado y Fechas",
|
|
80
|
-
label: 'Fin del Período Actual',
|
|
81
|
-
attribute: 'current_period_end',
|
|
82
|
-
type: Date,
|
|
83
|
-
|
|
84
|
-
inList: true,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
tab: "Estado y Fechas",
|
|
88
|
-
label: 'Fecha de Cancelación',
|
|
89
|
-
attribute: 'cancelled_at',
|
|
90
|
-
type: Date,
|
|
91
|
-
|
|
92
|
-
inList: false,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
tab: "Información de Pago",
|
|
96
|
-
label: 'ID de Suscripción Google',
|
|
97
|
-
attribute: 'google_subscription_id',
|
|
98
|
-
type: String,
|
|
99
|
-
inList: false,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
tab: "Información de Pago",
|
|
103
|
-
label: "Historial de Pagos",
|
|
104
|
-
attribute: 'payment_history',
|
|
105
|
-
type: String,
|
|
106
|
-
custom: true,
|
|
107
|
-
inList: false,
|
|
108
|
-
component: SubscriptionPaymentHistory,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
tab: "Acciones",
|
|
112
|
-
label: "Acciones de Suscripción",
|
|
113
|
-
attribute: 'subscription_actions',
|
|
114
|
-
type: String,
|
|
115
|
-
custom: true,
|
|
116
|
-
inList: false,
|
|
117
|
-
component: SubscriptionActions,
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
tab: "Información Calculada",
|
|
121
|
-
label: 'Activa',
|
|
122
|
-
attribute: 'is_active',
|
|
123
|
-
type: Boolean,
|
|
124
|
-
inList: true,
|
|
125
|
-
custom: true,
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
tab: "Información Calculada",
|
|
129
|
-
label: 'En Período de Prueba',
|
|
130
|
-
attribute: 'is_on_trial',
|
|
131
|
-
type: Boolean,
|
|
132
|
-
inList: true,
|
|
133
|
-
custom: true,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
tab: "Información Calculada",
|
|
137
|
-
label: 'Días hasta Expiración',
|
|
138
|
-
attribute: 'days_until_expiry',
|
|
139
|
-
type: Number,
|
|
140
|
-
inList: true,
|
|
141
|
-
custom: true,
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
label: 'Fecha de Creación',
|
|
145
|
-
attribute: 'created_at',
|
|
146
|
-
type: String,
|
|
147
|
-
inList: true,
|
|
148
|
-
custom: true,
|
|
149
|
-
},
|
|
150
|
-
];
|
|
151
|
-
|
|
152
|
-
export default subscriptionSchema;
|