@pagamio/frontend-commons-lib 0.8.203 → 0.8.205
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.
|
@@ -110,6 +110,10 @@ export function PagamioLoginPage({ logo, text = loginPageDefaultText, appLabel,
|
|
|
110
110
|
window.location.href = createAccountRoute;
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
-
return (_jsx(AuthPageLayout, { appLabel: appLabel, title: text.welcomeTitle, subtitle: text.welcomeSubtitle, errorMessage: error ?? authError?.message, logo: logo, className: className, horizontal: false, children: _jsxs("div", { className: "mt-8", children: [_jsx(FormEngine, { fields: loginFields, onSubmit: handleSubmit, layout: "vertical", className: "mb-0 px-0", submitButtonClass: "w-full", submitButtonText: isLoading ? text.loadingButtonLabel : text.loginButtonLabel, onCancel: () => { }, showCancelButton: false, showSubmittingText: false, formRef: formRef
|
|
113
|
+
return (_jsx(AuthPageLayout, { appLabel: appLabel, title: text.welcomeTitle, subtitle: text.welcomeSubtitle, errorMessage: error ?? authError?.message, logo: logo, className: className, horizontal: false, children: _jsxs("div", { className: "mt-8", children: [_jsx(FormEngine, { fields: loginFields, onSubmit: handleSubmit, layout: "vertical", className: "mb-0 px-0", submitButtonClass: "w-full", submitButtonText: isLoading ? text.loadingButtonLabel : text.loginButtonLabel, onCancel: () => { }, showCancelButton: false, showSubmittingText: false, formRef: formRef, initialValues: {
|
|
114
|
+
username: '',
|
|
115
|
+
password: '',
|
|
116
|
+
rememberMe: false,
|
|
117
|
+
} }), _jsxs("div", { className: "flex items-center justify-center gap-x-4 mt-4", children: [onForgotPassword && (_jsx("button", { type: "button", onClick: onForgotPassword, className: "text-sm text-primary-500 hover:underline dark:text-primary-500", children: text.forgotPasswordLabel })), hasCreateAccount && (_jsxs(_Fragment, { children: [onForgotPassword && _jsx("span", { className: "text-gray-500", children: "|" }), _jsx("button", { type: "button", onClick: handleCreateAccount, className: "text-sm text-primary-500 hover:underline dark:text-primary-500", children: text.createAccountLabel })] }))] })] }) }));
|
|
114
118
|
}
|
|
115
119
|
export default PagamioLoginPage;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Complete authentication service implementation
|
|
3
|
+
* Handles auth operations with configurable endpoints and token management
|
|
4
|
+
*/
|
|
1
5
|
import type { ApiClient } from '../../api';
|
|
2
6
|
import type { AuthResponse, CustomAuthConfig } from '../types';
|
|
3
7
|
import { TokenManager } from '../utils';
|
|
@@ -85,7 +89,7 @@ export declare class AuthService<T extends CustomAuthConfig> {
|
|
|
85
89
|
/**
|
|
86
90
|
* Keeps a reference to the interval to clear it on unmount.
|
|
87
91
|
*/
|
|
88
|
-
intervalRef:
|
|
92
|
+
intervalRef: ReturnType<typeof setInterval> | null;
|
|
89
93
|
private readonly tokenManager;
|
|
90
94
|
private readonly apiClient;
|
|
91
95
|
private readonly endpoints;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Complete authentication service implementation
|
|
3
|
-
* Handles auth operations with configurable endpoints and token management
|
|
4
|
-
*/
|
|
5
|
-
import { useRef } from 'react';
|
|
6
1
|
import { transformStrapiResponse, } from '../authenticators/processors/StrapiAuthenticatorProcessor';
|
|
7
2
|
import { ResponseTransformerFactory, TokenManager } from '../utils';
|
|
8
3
|
/**
|
|
@@ -15,7 +10,7 @@ export class AuthService {
|
|
|
15
10
|
/**
|
|
16
11
|
* Keeps a reference to the interval to clear it on unmount.
|
|
17
12
|
*/
|
|
18
|
-
intervalRef =
|
|
13
|
+
intervalRef = null;
|
|
19
14
|
tokenManager;
|
|
20
15
|
apiClient;
|
|
21
16
|
endpoints;
|
|
@@ -390,7 +385,7 @@ export class AuthService {
|
|
|
390
385
|
const nextCheckInterval = timeUntilRefresh > 5 * 60 * 1000
|
|
391
386
|
? 60 * 1000 // check every minute
|
|
392
387
|
: Math.max(1000, Math.min(timeUntilRefresh / 10, 30 * 1000)); // check between 1-30 seconds
|
|
393
|
-
this.intervalRef
|
|
388
|
+
this.intervalRef = setTimeout(scheduleNextCheck, nextCheckInterval);
|
|
394
389
|
};
|
|
395
390
|
scheduleNextCheck();
|
|
396
391
|
}
|
|
@@ -398,8 +393,8 @@ export class AuthService {
|
|
|
398
393
|
* Stops automatic token refresh
|
|
399
394
|
*/
|
|
400
395
|
stopAutoRefresh() {
|
|
401
|
-
if (this.intervalRef
|
|
402
|
-
clearInterval(this.intervalRef
|
|
396
|
+
if (this.intervalRef) {
|
|
397
|
+
clearInterval(this.intervalRef);
|
|
403
398
|
}
|
|
404
399
|
}
|
|
405
400
|
/**
|
|
@@ -180,7 +180,7 @@ const DashboardWrapper = ({ data, showVisualHeader = true, showEventsTabbedLayou
|
|
|
180
180
|
currencyDisplaySymbol: metricData.currencyDisplaySymbol,
|
|
181
181
|
...metricData,
|
|
182
182
|
};
|
|
183
|
-
return (_jsx(Grid.Col, { span: matchesSmall ? 12 : span, offset: offset, children: _jsx(VisualComponent, { ...props }) }, `visual-${visual.id}`));
|
|
183
|
+
return (_jsx(Grid.Col, { span: matchesSmall ? 12 : span, offset: offset, children: _jsx(VisualComponent, { ...props }) }, `visual-${sectionTitle}-${visual.id}`));
|
|
184
184
|
}, [config.themeColor, isXs, isSm]);
|
|
185
185
|
const tabs = [
|
|
186
186
|
{
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pagamio/frontend-commons-lib",
|
|
3
3
|
"description": "Pagamio library for Frontend reusable components like the form engine and table container",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.205",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
7
7
|
"provenance": false
|
|
@@ -129,13 +129,14 @@
|
|
|
129
129
|
"lodash": "^4.17.21",
|
|
130
130
|
"lucide-react": "^0.441.0",
|
|
131
131
|
"mantine-react-table": "^1.3.4",
|
|
132
|
+
"next": "^16.0.10",
|
|
132
133
|
"papaparse": "^5.4.1",
|
|
133
|
-
"react": "^
|
|
134
|
+
"react": "^19.2.3",
|
|
134
135
|
"react-apexcharts": "^1.7.0",
|
|
135
136
|
"react-date-range": "^2.0.1",
|
|
136
137
|
"react-datepicker": "^7.6.0",
|
|
137
138
|
"react-day-picker": "^9.4.4",
|
|
138
|
-
"react-dom": "^
|
|
139
|
+
"react-dom": "^19.2.3",
|
|
139
140
|
"react-dropzone": "^14.2.3",
|
|
140
141
|
"react-hook-form": "^7.53.1",
|
|
141
142
|
"react-icons": "^5.3.0",
|