Update dependencies, refactor authentication, and enhance UI components

- Upgraded @reduxjs/toolkit to version 2.9.0 and added new dependencies including @techniker-me/pcast-api and moment.
- Refactored authentication logic and added middleware for improved request handling.
- Introduced new UI components such as buttons, loaders, and forms, along with a theme system following SOLID principles.
- Updated routing to include protected routes and improved the login form with better error handling.
- Removed unused CSS and organized the project structure for better maintainability.
This commit is contained in:
2025-09-04 01:10:03 -04:00
parent 04488c43c5
commit 1469c7f52f
85 changed files with 3610 additions and 125 deletions

View File

@@ -20,6 +20,7 @@ export interface IPhenixWebSocketResponse {
sessionId: string;
redirect: string;
roles: string[];
[key: string]: unknown;
}
export class PhenixWebSocket extends MQWebSocket {
@@ -60,7 +61,9 @@ export class PhenixWebSocket extends MQWebSocket {
public async sendMessage<T>(kind: PhenixWebSocketMessage, message: T): Promise<IPhenixWebSocketResponse> {
if (this._status.value !== PhenixWebSocketStatus.Online) {
throw new Error(`Unable to send message, web socket is not [Online] WebSocket status [${PhenixWebSocketStatusMapping.convertPhenixWebSocketStatusToPhenixWebSocketStatusType(this._status.value)}]`);
throw new Error(
`Unable to send message, web socket is not [Online] WebSocket status [${PhenixWebSocketStatusMapping.convertPhenixWebSocketStatusToPhenixWebSocketStatusType(this._status.value)}]`
);
}
this._pendingRequests++;
@@ -89,27 +92,27 @@ export class PhenixWebSocket extends MQWebSocket {
private initialize(): void {
super.onEvent('connected', () => {
this.setStatus(PhenixWebSocketStatus.Online);
})
});
super.onEvent('disconnected', () => {
this.setStatus(PhenixWebSocketStatus.Offline);
})
});
super.onEvent('error', (error: unknown) => {
this._logger.error('Error [%s]', error);
this.setStatus(PhenixWebSocketStatus.Error);
})
});
super.onEvent('reconnecting', () => {
this.setStatus(PhenixWebSocketStatus.Reconnecting);
})
});
super.onEvent('reconnected', () => {
this.setStatus(PhenixWebSocketStatus.Online);
})
});
super.onEvent('timeout', () => {
this.setStatus(PhenixWebSocketStatus.Error);
})
});
}
}
}