@dashadmin/dash-admin 1.3.72 → 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.
Files changed (289) hide show
  1. package/dist/components/tenant/TenancyPlan.js +307 -0
  2. package/dist/systemResources.js +18 -2
  3. package/package.json +25 -22
  4. package/src/AppAsyncWrapper.tsx +0 -42
  5. package/src/AppWrapper.tsx +0 -45
  6. package/src/DASHAdmin.tsx +0 -502
  7. package/src/DASHAdmin.tsx.old +0 -456
  8. package/src/RoutingWrapper.tsx +0 -143
  9. package/src/classes/DASHStorageClass.tsx +0 -8
  10. package/src/components/Input/RichTextField.tsx +0 -27
  11. package/src/components/Redirect.tsx +0 -46
  12. package/src/components/avatar/Avatar.tsx +0 -71
  13. package/src/components/avatar/SingleImageUploader.tsx +0 -107
  14. package/src/components/currency/Format.tsx +0 -79
  15. package/src/components/custom/Redirect.tsx +0 -23
  16. package/src/components/error/Error.tsx +0 -168
  17. package/src/components/geocoding/GeocodingField.tsx +0 -167
  18. package/src/components/i18n/BridgedLocalesMenuButton.tsx +0 -160
  19. package/src/components/i18n/LangSwitcher.tsx +0 -204
  20. package/src/components/loader/GlobalLoader.tsx +0 -49
  21. package/src/components/logs/LogFile.tsx +0 -88
  22. package/src/components/logs/LogFileById.tsx +0 -68
  23. package/src/components/logs/LogViewer.tsx +0 -43
  24. package/src/components/menu/AppMenu.tsx +0 -22
  25. package/src/components/menu/CustomMenuItemLink.tsx +0 -61
  26. package/src/components/menu/DarkToggleMode.tsx +0 -65
  27. package/src/components/menu/LanguageToggleMode.tsx +0 -120
  28. package/src/components/misc/CustomImageInput.tsx +0 -62
  29. package/src/components/misc/DASHGlobalErrorHandler.tsx +0 -194
  30. package/src/components/misc/DarkModeSwitcher.tsx +0 -112
  31. package/src/components/misc/HorizontalScroller.tsx +0 -225
  32. package/src/components/misc/LanguageSwitcher.tsx +0 -199
  33. package/src/components/misc/MUIHtmlToolTip.tsx +0 -15
  34. package/src/components/misc/MuiSimpleJsonTable.tsx +0 -279
  35. package/src/components/misc/MultiLevelTable.tsx +0 -229
  36. package/src/components/misc/NoResults.tsx +0 -28
  37. package/src/components/misc/PDFViewer.tsx +0 -85
  38. package/src/components/navigation/Breadcrumbs.tsx +0 -220
  39. package/src/components/navigation/BreadcrumbsManager.tsx +0 -310
  40. package/src/components/navigation/index.tsx +0 -5
  41. package/src/components/panel/Error.tsx +0 -168
  42. package/src/components/permission/AvailablePermissionsContext.tsx +0 -173
  43. package/src/components/permission/PermissionsSelector.tsx +0 -834
  44. package/src/components/permission/PermissionsSelectorList.tsx +0 -473
  45. package/src/components/permission/tsx +0 -0
  46. package/src/components/racustombuttons/CustomRAButton.tsx +0 -87
  47. package/src/components/racustombuttons/QuickButton.tsx +0 -117
  48. package/src/components/racustombuttons/QuickEditButton.tsx +0 -115
  49. package/src/components/racustombuttons/QuickIconButton.tsx +0 -122
  50. package/src/components/scrollbar/Scrollbar.tsx +0 -31
  51. package/src/components/selects/MultiSelect.tsx +0 -53
  52. package/src/components/selects/RASearchableSelect.tsx +0 -282
  53. package/src/components/selects/RASearchableSelectChips.tsx +0 -308
  54. package/src/components/selects/SearchableSelect.tsx +0 -139
  55. package/src/components/serviceAccount/ApiKeyRevealDialog.tsx +0 -129
  56. package/src/components/serviceAccount/ServiceAccountStatusSwitch.tsx +0 -99
  57. package/src/components/subscription/BillingCycleSelectInput.tsx +0 -68
  58. package/src/components/subscription/PlanAddonsSettings.tsx +0 -563
  59. package/src/components/subscription/PlanAuditLog.tsx +0 -453
  60. package/src/components/subscription/PlanFeaturesSettings.tsx +0 -243
  61. package/src/components/subscription/PlanLimitsSettings.tsx +0 -230
  62. package/src/components/subscription/PlanMetadataSettings.tsx +0 -306
  63. package/src/components/subscription/PlanPricesSettings.tsx +0 -307
  64. package/src/components/subscription/index.ts +0 -7
  65. package/src/components/svgelements/SvgLoading.tsx +0 -229
  66. package/src/components/svgelements/SvgLogo.tsx +0 -53
  67. package/src/components/svgelements/SvgLogoMin.tsx +0 -64
  68. package/src/components/svgelements/SvgShipping.tsx +0 -673
  69. package/src/components/tenancy/GlobalTenantWrapper.tsx +0 -84
  70. package/src/components/tenancy/TenantSwitcher.tsx +0 -514
  71. package/src/components/tenant/AvailablePermissionsContext.tsx +0 -0
  72. package/src/components/tenant/SettingsSections.tsx +0 -151
  73. package/src/components/tenant/TenancySettings.tsx +0 -122
  74. package/src/components/tenant/TenantAttributes.tsx +0 -153
  75. package/src/components/tenant/TenantAttributesContext.tsx +0 -163
  76. package/src/components/tenant/TenantSelector.tsx +0 -142
  77. package/src/components/tenant/TenantSettings.tsx +0 -184
  78. package/src/components/tenant/TenantSettingsContext.tsx +0 -165
  79. package/src/components/tenant/TenantTheme.tsx +0 -172
  80. package/src/components/user/AvatarComponent.tsx +0 -317
  81. package/src/components/user/TenantAvatarComponent.tsx +0 -99
  82. package/src/components/user/UserPreferences.tsx +0 -677
  83. package/src/config/ACTIONS.tsx +0 -26
  84. package/src/config/ConstantsService.tsx +0 -44
  85. package/src/config/DASHAdminSystemConstants.tsx +0 -183
  86. package/src/config/PARSERS.tsx +0 -9
  87. package/src/contexts/DashQueryClientContext.tsx +0 -113
  88. package/src/contexts/DashResourceContext.tsx +0 -34
  89. package/src/contexts/I18nBridgeContext.tsx +0 -156
  90. package/src/contexts/I18nBridgeSetter.tsx +0 -39
  91. package/src/contexts/I18nReduxSync.tsx +0 -27
  92. package/src/contexts/SubscriptionPlanFormatsProvider.tsx +0 -217
  93. package/src/contexts/SystemRequestsCache.tsx +0 -215
  94. package/src/contexts/auth/AuthContext.tsx +0 -567
  95. package/src/contexts/auth/AuthContextLocalStorage.tsx +0 -140
  96. package/src/contexts/auth/DASHAuthenticationService.tsx +0 -915
  97. package/src/contexts/auth/WindowContext.tsx +0 -15
  98. package/src/contexts/auth/index.tsx +0 -3
  99. package/src/contexts/com/FCMContext.tsx +0 -415
  100. package/src/contexts/com/LaravelEchoContext.tsx +0 -41
  101. package/src/contexts/com/LaravelEchoMgr.tsx +0 -155
  102. package/src/contexts/com/components/DefaultNotificationComponent.tsx +0 -20
  103. package/src/contexts/com/components/EchoNotificationsCenter.tsx +0 -65
  104. package/src/contexts/com/components/NotificationAttributesTable.tsx +0 -54
  105. package/src/contexts/com/components/NotificationRenderer.tsx +0 -42
  106. package/src/contexts/com/components/NotificationsWidget.tsx +0 -182
  107. package/src/contexts/com/components/notificationFormats.tsx +0 -50
  108. package/src/contexts/com/useLaravelEcho.tsx +0 -432
  109. package/src/contexts/dictionary/DictionaryContext.tsx +0 -94
  110. package/src/declarations.d.ts +0 -17
  111. package/src/default-theme/DASHAppProviders.tsx +0 -117
  112. package/src/default-theme/DashThemeContext.tsx +0 -209
  113. package/src/default-theme/DashThemeContext.tsx.fast +0 -143
  114. package/src/default-theme/DashThemeContext.tsx.old +0 -306
  115. package/src/default-theme/DashThemeHelperProvider.tsx +0 -98
  116. package/src/default-theme/DomainAppLayout.tsx +0 -166
  117. package/src/default-theme/DomainHeader.tsx +0 -162
  118. package/src/default-theme/DomainTheme.tsx +0 -59
  119. package/src/default-theme/FullLayoutMarkup.tsx +0 -231
  120. package/src/default-theme/StaticLayout.tsx +0 -47
  121. package/src/default-theme/index.tsx +0 -11
  122. package/src/default-theme/menu/AppDashboardGrid.tsx +0 -279
  123. package/src/default-theme/menu/AppMaterialMenu.tsx +0 -546
  124. package/src/default-theme/menu/AppMenuComponents/SubmenuPortal.tsx +0 -61
  125. package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItem.tsx +0 -264
  126. package/src/default-theme/menu/AppMenuComponents/collapsed/CollapsedSidebarItems.tsx +0 -31
  127. package/src/default-theme/menu/AppMenuComponents/expanded/CollapsableSidebarMenu.tsx +0 -293
  128. package/src/default-theme/menu/AppMenuComponents/expanded/SidebarItem.tsx +0 -92
  129. package/src/default-theme/menu/AppMenuComponents/getItem.tsx +0 -17
  130. package/src/default-theme/menu/AppMenuComponents/interfaces.tsx +0 -41
  131. package/src/default-theme/menu/AppMenuComponents/submenuConstants.ts +0 -90
  132. package/src/default-theme/menu/AppSidebarMaterial.tsx +0 -339
  133. package/src/default-theme/menu/SidebarActions.tsx +0 -84
  134. package/src/default-theme/updateDomCssVariables.tsx +0 -176
  135. package/src/helpers/checkRole.tsx +0 -66
  136. package/src/helpers/parseAxiosError.tsx +0 -41
  137. package/src/hooks/audio/useAudio.tsx +0 -39
  138. package/src/hooks/axios.tsx +0 -165
  139. package/src/hooks/data/useDashboardStats.tsx +0 -65
  140. package/src/hooks/data/usePackageByClientsStats.tsx +0 -44
  141. package/src/hooks/data/usePackageByCommunesStats.tsx +0 -44
  142. package/src/hooks/data/usePackageStats.tsx +0 -69
  143. package/src/hooks/data/usePackageWithdrawDetails.tsx +0 -61
  144. package/src/hooks/data/useStats.tsx +0 -86
  145. package/src/hooks/isCurrentPath.tsx +0 -22
  146. package/src/hooks/notifications/WSMessagesManager.tsx +0 -152
  147. package/src/hooks/notifications/WSPusherManager.tsx +0 -92
  148. package/src/hooks/useBreadcrumbs.tsx +0 -329
  149. package/src/hooks/useClickOutside.tsx +0 -57
  150. package/src/hooks/useFormPersistance.tsx +0 -150
  151. package/src/hooks/useGlobalErrorMediator.tsx +0 -43
  152. package/src/hooks/useGlobalLoaderMgr.tsx +0 -21
  153. package/src/hooks/useHash.tsx +0 -27
  154. package/src/hooks/useLocalStorage.tsx +0 -196
  155. package/src/hooks/usePolyglotTranslation.tsx +0 -62
  156. package/src/hooks/usePrevious.tsx +0 -9
  157. package/src/hooks/usePrintSelected.tsx +0 -37
  158. package/src/hooks/useVirtualHash.tsx +0 -33
  159. package/src/hooks/window/useWindowSize.tsx +0 -36
  160. package/src/index.tsx +0 -134
  161. package/src/interfaces/IAppResourceConfig.tsx +0 -20
  162. package/src/interfaces/Log.tsx +0 -16
  163. package/src/interfaces/Tenant.tsx +0 -25
  164. package/src/interfaces/communication/IActions.tsx +0 -5
  165. package/src/interfaces/communication/INotification.tsx +0 -21
  166. package/src/interfaces/communication/IPayload.tsx +0 -3
  167. package/src/interfaces/communication/IRequestAction.tsx +0 -10
  168. package/src/interfaces/communication/IRequestPayload.tsx +0 -7
  169. package/src/interfaces/communication/IResponseAction.tsx +0 -7
  170. package/src/interfaces/misc/IAny.tsx +0 -3
  171. package/src/interfaces/misc/IFlashMessage.tsx +0 -10
  172. package/src/interfaces/navigation/IAppMenu.ts +0 -14
  173. package/src/interfaces/navigation/ICollapsableSidebarMenu.ts +0 -12
  174. package/src/interfaces/navigation/IMenuItem.ts +0 -16
  175. package/src/interfaces/notifications/IModel.tsx +0 -6
  176. package/src/interfaces/notifications/IModelField.tsx +0 -8
  177. package/src/interfaces/notifications/IUserNotification.tsx +0 -12
  178. package/src/interfaces/notifications/IUserNotificationData.tsx +0 -13
  179. package/src/interfaces/notifications/IUserNotificationPayload.tsx +0 -8
  180. package/src/interfaces/user/IGetAuth.tsx +0 -92
  181. package/src/interfaces/user/ITenantSettings.tsx +0 -3
  182. package/src/interfaces/user/IUser.tsx +0 -60
  183. package/src/interfaces/user/IUserSettings.tsx +0 -43
  184. package/src/interfaces.tsx +0 -6
  185. package/src/layout/AppLayout.tsx +0 -112
  186. package/src/layout/ApplicationLayout.tsx +0 -197
  187. package/src/layout/MotionWrapper.original.tsx +0 -236
  188. package/src/layout/MotionWrapper.tsx +0 -236
  189. package/src/layout/ResourceMenu.tsx +0 -164
  190. package/src/layout/ResoureLayout.tsx +0 -105
  191. package/src/layout/TransitionWrapper.tsx +0 -125
  192. package/src/pages/ChangePassword.tsx +0 -179
  193. package/src/pages/DASHLanding.tsx +0 -22
  194. package/src/pages/DASHLightWeightLogin.tsx +0 -611
  195. package/src/pages/DASHSimpleLogin.tsx +0 -260
  196. package/src/pages/Login.tsx +0 -111
  197. package/src/pages/Profile.tsx +0 -357
  198. package/src/pages/RecoverPassword.tsx +0 -175
  199. package/src/pages/SingleImageUploader.tsx +0 -55
  200. package/src/pages/VerifyAccount.tsx +0 -128
  201. package/src/providers/authProvider.tsx +0 -217
  202. package/src/providers/dataProvider.tsx +0 -672
  203. package/src/providers/i18n/en.ts +0 -646
  204. package/src/providers/i18n/es.ts +0 -652
  205. package/src/providers/i18n/languages.tsx +0 -8
  206. package/src/providers/i18n/mergeTranslations.ts +0 -53
  207. package/src/providers/i18nProvider.tsx +0 -23
  208. package/src/react-admin-dash/RADashComponent.tsx +0 -240
  209. package/src/react-admin-dash/Resource.tsx +0 -77
  210. package/src/resources/Brand/BrandResource.tsx +0 -130
  211. package/src/resources/DASHResourceLoader.ts +0 -180
  212. package/src/resources/Log/LogResource.tsx +0 -73
  213. package/src/resources/Tenant/ImpersonateTenantResource.tsx +0 -113
  214. package/src/resources/Trash/TrashTemplate.tsx +0 -180
  215. package/src/resources/User/components/AvatarUploadField.tsx +0 -57
  216. package/src/resources/User/components/PasswordFields.tsx +0 -73
  217. package/src/resources/User/getProfileMenu.ts +0 -57
  218. package/src/resources/User/profileResource.tsx +0 -51
  219. package/src/resources/User/userLayout.tsx +0 -62
  220. package/src/resources/User/userResource.tsx +0 -111
  221. package/src/resources/User/userSchema.tsx +0 -213
  222. package/src/resources/User/usersFilters.tsx +0 -21
  223. package/src/resources.tsx +0 -280
  224. package/src/schemas/log.tsx +0 -45
  225. package/src/schemas/notification.tsx +0 -42
  226. package/src/schemas/permissions.tsx +0 -44
  227. package/src/schemas/roles.tsx +0 -48
  228. package/src/schemas/rolesDataGrid.tsx +0 -48
  229. package/src/schemas/subscription/components/SubscriptionActions.tsx +0 -153
  230. package/src/schemas/subscription/components/SubscriptionPaymentHistory.tsx +0 -127
  231. package/src/schemas/subscription/components/SubscriptionPlanFeatures.tsx +0 -162
  232. package/src/schemas/subscription/components/SubscriptionPlanPreview.tsx +0 -141
  233. package/src/schemas/subscription/components/SubscriptionPlanStats.tsx +0 -318
  234. package/src/schemas/subscription/components/SubscriptionStatusIndicator.tsx +0 -72
  235. package/src/schemas/subscription/subscriptionPlanSchema.tsx +0 -185
  236. package/src/schemas/subscription/subscriptionSchema.tsx +0 -152
  237. package/src/schemas/subscriptionPlan.ts +0 -422
  238. package/src/schemas/tenant.tsx +0 -129
  239. package/src/schemas/tenantUser.tsx +0 -96
  240. package/src/schemas/tenant_superadmin.tsx +0 -119
  241. package/src/schemas/user.tsx +0 -26
  242. package/src/systemResources.old.tsx +0 -928
  243. package/src/systemResources.tsx +0 -1369
  244. package/src/templates/ResourceTemplate.tsx +0 -240
  245. package/src/templates/ResourceTemplate.tsx.memoized_experiment +0 -350
  246. package/src/templates/ResourceTemplate.tsx.original +0 -396
  247. package/src/templates/ResourceTemplateCreate.tsx +0 -182
  248. package/src/templates/ResourceTemplateEdit.tsx +0 -176
  249. package/src/templates/ResourceTemplateFull.tsx +0 -581
  250. package/src/templates/ResourceTemplateList.tsx +0 -340
  251. package/src/templates/ResourceTemplateOld.tsx.bkup +0 -567
  252. package/src/templates/ResourceTemplateShow.tsx +0 -88
  253. package/src/templates/TrashTemplate.tsx +0 -179
  254. package/src/tenantResources.tsx +0 -223
  255. package/src/test_portal_bubbles.tsx +0 -40
  256. package/src/theme/AppHeader.tsx +0 -52
  257. package/src/theme/AppLayoutSetting.tsx +0 -33
  258. package/src/theme/AppLogo.tsx +0 -13
  259. package/src/theme/AppSidebar.tsx +0 -12
  260. package/src/theme/AppSidebarContent.tsx +0 -105
  261. package/src/theme/AppSidebarLogo.tsx +0 -48
  262. package/src/theme/components/PageTitle.tsx +0 -37
  263. package/src/utils/cache/CacheInvalidatorContext.tsx +0 -125
  264. package/src/utils/cache/CacheInvalidatorListenerComponent.tsx +0 -10
  265. package/src/utils/cache/useCacheInvalidatorListener.tsx +0 -27
  266. package/src/utils/convertFileToBase64.tsx +0 -9
  267. package/src/utils/convertToFile.tsx +0 -14
  268. package/src/utils/cookies.tsx +0 -33
  269. package/src/utils/dashDefaultQueryClient.tsx +0 -34
  270. package/src/utils/dataUrlToBlob.tsx +0 -30
  271. package/src/utils/deepReplace.tsx +0 -19
  272. package/src/utils/getProfileMenu.tsx +0 -41
  273. package/src/utils/getTenantSettings.tsx +0 -9
  274. package/src/utils/getType.tsx +0 -8
  275. package/src/utils/getUserSettings.tsx +0 -8
  276. package/src/utils/hasCode.tsx +0 -14
  277. package/src/utils/index.ts +0 -19
  278. package/src/utils/injectTenantStyles.ts +0 -28
  279. package/src/utils/isComponent.tsx +0 -45
  280. package/src/utils/navEvents.tsx +0 -91
  281. package/src/utils/prototypes.tsx +0 -5
  282. package/src/utils/regexp.tsx +0 -4
  283. package/src/utils/resolveObjectPath.tsx +0 -4
  284. package/src/utils/setNativeValue.tsx +0 -24
  285. package/src/utils/slugify.tsx +0 -11
  286. package/src/utils/validators/emailValidator.tsx +0 -6
  287. package/src/utils/validators/requiredValidator.tsx +0 -5
  288. package/src/utils/validators/rutValidator.tsx +0 -31
  289. package/src/utils/validators.tsx +0 -96
@@ -1,105 +0,0 @@
1
- import React, { PropsWithChildren, useMemo } from 'react';
2
- import ResourceMenu from './ResourceMenu';
3
- import IAppResourceConfig from '../interfaces/IAppResourceConfig';
4
- import { IDashAutoAdminResourceConfig } from 'dash-auto-admin';
5
-
6
- /**
7
- * Resource Layout
8
- *
9
- * @description The resource is the wrapper for all the views methods available in the ResourceTemplate such as ['show','edit','list','view']
10
- * its parent HoC is the ResourceTemplate
11
- * The main goal is to provide a side navigation around the main content.
12
- *
13
- * Notice: side styles are not implemented in DASH V2 project
14
- *
15
- * @param {IResourceLayout} props - Functional Component Props
16
- * @param {IDashAutoAdminResourceConfig} props.resourceConfig - Resource Config
17
- * @param {string} props.position - "top"
18
- * @param {boolean} props.showToolbar - default true, shows or hide the navigation toolbar
19
- * @param {JSX.Element} props.children - Children content such as Show, Edit, DataGrid
20
- *
21
- * @returns {JSX.Element} - JSX element
22
- */
23
-
24
- export interface IResourceLayout extends PropsWithChildren {
25
- /** React Auto Admin Resource Config */
26
- resourceConfig: IAppResourceConfig;
27
- /** Current locale */
28
- locale?: string;
29
- }
30
-
31
- // Memoized ResourceMenu component
32
- const MemoizedResourceMenu = React.memo(({
33
- resourceConfig,
34
- locale
35
- }: {
36
- resourceConfig: IAppResourceConfig;
37
- locale?: string;
38
- }) => (
39
- <ResourceMenu resourceConfig={resourceConfig} locale={locale} />
40
- ), (prevProps, nextProps) => {
41
- return prevProps.resourceConfig === nextProps.resourceConfig && prevProps.locale === nextProps.locale;
42
- });
43
-
44
- const ResourceLayout: React.FC<IResourceLayout> = (props) => {
45
- const { resourceConfig, children, locale } = props;
46
-
47
- // Memoize the destructured values to prevent unnecessary recalculations
48
- const { resourceMenuDisabled, resourceMenuPosition } = useMemo(() => ({
49
- resourceMenuDisabled: resourceConfig.resourceMenuDisabled ?? false,
50
- resourceMenuPosition: resourceConfig.resourceMenuPosition ?? 'top'
51
- }), [resourceConfig.resourceMenuDisabled, resourceConfig.resourceMenuPosition]);
52
-
53
- // Memoize the condition for showing the menu
54
- const shouldShowMenu = useMemo(() => {
55
-
56
- return (resourceConfig.mainAction ||
57
- (resourceConfig.menu && resourceConfig.menu.length > 0)) &&
58
- !resourceMenuDisabled;
59
- }, [
60
- resourceConfig.mainAction,
61
- resourceConfig.menu,
62
- resourceMenuDisabled
63
- ]);
64
-
65
- // Memoize the header content
66
- const headerContent = useMemo(() => {
67
- if (!shouldShowMenu) return null;
68
-
69
- return (
70
- <div className='dash-module-box-header'>
71
- <div className='dash-module-sidenav dash-d-none dash-d-lg-flex'>
72
- <MemoizedResourceMenu resourceConfig={resourceConfig} locale={locale} />
73
- </div>
74
- </div>
75
- );
76
- }, [shouldShowMenu, resourceConfig]);
77
-
78
- return (
79
- <div className='dash-app-module'>
80
- <div className='dash-module-horizontal-box' style={{ maxWidth: '100%' }}>
81
- {headerContent}
82
- <div className='dash-module-box-content'>
83
- {children}
84
- </div>
85
- </div>
86
- </div>
87
- );
88
- };
89
-
90
- // Memoize the entire component
91
- export default React.memo(ResourceLayout, (prevProps, nextProps) => {
92
- // Compare resourceConfig reference and locale
93
- const propsEqual = prevProps.resourceConfig === nextProps.resourceConfig &&
94
- prevProps.locale === nextProps.locale;
95
-
96
- // Debug logging (remove in production)
97
- if (!propsEqual) {
98
- console.log('ResourceLayout re-rendering:', {
99
- resourceConfigChanged: prevProps.resourceConfig !== nextProps.resourceConfig,
100
- localeChanged: prevProps.locale !== nextProps.locale
101
- });
102
- }
103
-
104
- return propsEqual;
105
- });
@@ -1,125 +0,0 @@
1
- import React, { useState, useEffect } from 'react';
2
- import { Outlet, useLocation } from 'react-router-dom';
3
-
4
- export interface ITransitionWrapper {
5
- pageTransition?: boolean;
6
- loadingSpinner?: boolean;
7
- transitionDuration?: number;
8
- }
9
-
10
- const TransitionWrapper: React.FC<ITransitionWrapper> = (props) => {
11
- const {
12
- pageTransition = true,
13
- loadingSpinner = true,
14
- transitionDuration = 500 // in ms
15
- } = props;
16
-
17
- const location = useLocation();
18
- const [displayLocation, setDisplayLocation] = useState(location);
19
- const [showSpinner, setShowSpinner] = useState(false);
20
- const [spinnerOpacity, setSpinnerOpacity] = useState(0);
21
- const [isReady, setIsReady] = useState(true);
22
-
23
- useEffect(() => {
24
- // Skip transition for same route
25
- if (!pageTransition || location.pathname === displayLocation.pathname) {
26
- return;
27
- }
28
-
29
- // Sequence the transition
30
- const sequence = async () => {
31
- // Step 1: Mark as not ready (prevents premature outlet updates)
32
- setIsReady(false);
33
-
34
- // Step 2: Show spinner container with opacity 0
35
- setShowSpinner(true);
36
-
37
- // Step 3: Wait a frame to ensure DOM is updated
38
- await new Promise(resolve => requestAnimationFrame(resolve));
39
-
40
- // Step 4: Fade in spinner
41
- setSpinnerOpacity(1);
42
-
43
- // Step 5: Wait for spinner to fully fade in
44
- await new Promise(resolve => setTimeout(resolve, transitionDuration));
45
-
46
- // Step 6: Update outlet content (while spinner is fully visible)
47
- setDisplayLocation(location);
48
-
49
- // Step 7: Wait a moment to ensure outlet content is updated
50
- await new Promise(resolve => setTimeout(resolve, 100));
51
-
52
- // Step 8: Start fading out spinner
53
- setSpinnerOpacity(0);
54
-
55
- // Step 9: Wait for spinner to fully fade out
56
- await new Promise(resolve => setTimeout(resolve, transitionDuration));
57
-
58
- // Step 10: Hide spinner container
59
- setShowSpinner(false);
60
-
61
- // Step 11: Mark as ready for next transition
62
- setIsReady(true);
63
- };
64
-
65
- sequence();
66
- }, [location, displayLocation, pageTransition, transitionDuration]);
67
-
68
- return (
69
- <div className="transition-container" style={{ position: 'relative', height: '100%' }}>
70
- {/* Main content */}
71
- <div>
72
- <Outlet key={displayLocation.pathname} />
73
- </div>
74
-
75
- {/* Spinner overlay */}
76
- {loadingSpinner && showSpinner && (
77
- <div
78
- style={{
79
- position: 'fixed',
80
- top: 0,
81
- left: 0,
82
- right: 0,
83
- bottom: 0,
84
- backgroundColor: 'rgba(255, 255, 255, 0.8)',
85
- display: 'flex',
86
- justifyContent: 'center',
87
- alignItems: 'center',
88
- zIndex: 1000,
89
- opacity: spinnerOpacity,
90
- transition: `opacity ${transitionDuration}ms ease-in-out`,
91
- }}
92
- >
93
- <div className="spinner">
94
- <style>{`
95
- .spinner {
96
- display: inline-block;
97
- position: relative;
98
- width: 80px;
99
- height: 80px;
100
- }
101
- .spinner:after {
102
- content: " ";
103
- display: block;
104
- border-radius: 50%;
105
- width: 0;
106
- height: 0;
107
- margin: 8px;
108
- box-sizing: border-box;
109
- border: 32px solid #3f51b5;
110
- border-color: #3f51b5 transparent #3f51b5 transparent;
111
- animation: spinner 1.2s infinite;
112
- }
113
- @keyframes spinner {
114
- 0% { transform: rotate(0); }
115
- 100% { transform: rotate(360deg); }
116
- }
117
- `}</style>
118
- </div>
119
- </div>
120
- )}
121
- </div>
122
- );
123
- };
124
-
125
- export default TransitionWrapper;
@@ -1,179 +0,0 @@
1
- import { Alert, Box, Button, Input, InputLabel, TextField } from '@mui/material';
2
- import React, { useEffect, useState } from 'react';
3
- import { Link, useNavigate, useSearchParams } from 'react-router-dom';
4
- import useAxios from '../hooks/axios';
5
- import { FullLayoutMarkup } from '../default-theme';
6
-
7
- const getUrlParamsObject = (searchParams: any) => {
8
- let params: Record<string, any> = {};
9
- for (const entry of searchParams) {
10
- const [param, value] = entry;
11
- params = { ...params, [param]: value };
12
- }
13
- return Object.keys(params).length > 0 ? params : null;
14
- };
15
-
16
-
17
- interface ChangePasswordProps {
18
-
19
- onAuthChange?: (authenticated: any) => void;
20
- }
21
-
22
- const ChangePassword: React.FC<ChangePasswordProps> = ({
23
-
24
- }) => {
25
- const navigate = useNavigate();
26
- let [searchParams] = useSearchParams();
27
- // @ts-ignore - URLSearchParams.entries() type issue
28
- const urlQuery: any = getUrlParamsObject(searchParams.entries());
29
- // Fix: Remove any trailing non-email characters (like parenthesis) from email param
30
- const cleanEmail = urlQuery?.email ? decodeURIComponent(urlQuery.email).replace(/[)\]\s]+$/, '') : '';
31
-
32
- const [password, setPassword] = useState('');
33
- const [rePassword, setRePassword] = useState('');
34
- const [loading, setLoading] = useState(false);
35
- const [error, setError] = useState('');
36
- const [success, setSuccess] = useState(false);
37
- const { axios } = useAxios();
38
-
39
- useEffect(() => {
40
- if (!urlQuery?.token || !urlQuery?.email) {
41
- navigate('/login');
42
- }
43
- }, []);
44
-
45
- const handleSubmit = async (e) => {
46
- e.preventDefault();
47
- if (password === rePassword) {
48
- setError('');
49
- setLoading(true);
50
- try {
51
- const { data } = await axios.post(`password/reset`, {
52
- password,
53
- password_confirmation: rePassword,
54
- token: urlQuery?.token,
55
- email: cleanEmail,
56
- });
57
- setSuccess(true);
58
- // Optionally show notification here
59
- } catch (error: any) {
60
- let errorMsg = 'Error al cambiar contraseña';
61
- if (error?.response?.data) {
62
- const resp = error.response.data;
63
- // Prefer error from errors.email, then message, then fallback
64
- if (resp.errors && resp.errors.email && resp.errors.email.length > 0) {
65
- errorMsg = resp.errors.email[0];
66
- } else if (resp.message) {
67
- errorMsg = resp.message;
68
- }
69
- } else if (error?.message) {
70
- errorMsg = error.message;
71
- }
72
- setError(errorMsg);
73
- } finally {
74
- setLoading(false);
75
- }
76
- } else {
77
- setError('Las contraseñas no coinciden');
78
- }
79
- };
80
-
81
- return (
82
- <FullLayoutMarkup>
83
- {success ? (
84
- <Box
85
- sx={{
86
- display: 'flex',
87
- flexDirection: 'column',
88
- alignItems: 'center',
89
- justifyContent: 'center',
90
- boxShadow: 3,
91
- borderRadius: 2,
92
- p: 4,
93
- minWidth: 320,
94
- minHeight: 200,
95
- bgcolor: 'background.paper',
96
- mt: 8,
97
- mx: 'auto',
98
- }}
99
- >
100
- <h1 className="dash-app-login-form-title" style={{ margin: 0 }}>Contraseña cambiada</h1>
101
- <Alert severity="success" sx={{ mt: 2, mb: 2 }}>
102
- Tu contraseña ha sido cambiada correctamente.
103
- </Alert>
104
- <Button
105
- variant="contained"
106
- color="primary"
107
- onClick={() => navigate('/login')}
108
- sx={{ mt: 2 }}
109
- >
110
- Ir al Login
111
- </Button>
112
- </Box>
113
- ) : (
114
- <form
115
- onSubmit={handleSubmit}
116
- className="dash-app-login-form"
117
- autoComplete="on"
118
- method="post"
119
- >
120
- <h1 className="dash-app-login-form-title">Cambiar Contraseña</h1>
121
-
122
- {error && (
123
- <Alert severity="error" sx={{ mb: 2 }}>
124
- {error}
125
- </Alert>
126
- )}
127
-
128
- <div className="dash-app-form-item">
129
- <TextField
130
- fullWidth
131
- label="Contraseña"
132
- placeholder="Contraseña"
133
- required
134
- type="password"
135
- value={password}
136
- onChange={(e) => {
137
- setError('');
138
- setPassword(e.target.value);
139
- }}
140
- className="dash-app-form-item-input"
141
- disabled={loading}
142
- />
143
- </div>
144
-
145
- <div className="dash-app-form-item">
146
- <TextField
147
- fullWidth
148
- label="Repetir Contraseña"
149
- placeholder="Repetir Contraseña"
150
- required
151
- type="password"
152
- value={rePassword}
153
- onChange={(e) => {
154
- setError('');
155
- setRePassword(e.target.value);
156
- }}
157
- className="dash-app-form-item-input"
158
- disabled={loading}
159
- />
160
- </div>
161
-
162
- <div className="dash-app-form-item mt-1">
163
- <Button
164
- type="submit"
165
- variant="contained"
166
- className="submit"
167
- disabled={loading}
168
- sx={{ mb: 2, width: '100%' }}
169
- >
170
- {loading ? 'Cargando...' : 'Cambiar Contraseña'}
171
- </Button>
172
- </div>
173
- </form>
174
- )}
175
- </FullLayoutMarkup>
176
- );
177
- };
178
-
179
- export default ChangePassword;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { Box, Button, Typography } from '@mui/material';
3
- import { useForm } from 'react-hook-form';
4
-
5
- interface Props {
6
-
7
- }
8
-
9
- const DashLanding: React.FC<Props> = () => {
10
-
11
-
12
- return (
13
- <Box sx={{ p: 4 }}>
14
- <Typography variant="h4" gutterBottom>
15
- Welcome to DASH
16
- </Typography>
17
-
18
- </Box>
19
- );
20
- };
21
-
22
- export default DashLanding;