@rtsee/ngx 0.0.58 → 0.0.59
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/CHANGELOG.md +4 -0
- package/package.json +10 -7
- package/projects/ngx/src/lib/common/interfaces/index.ts +1 -0
- package/projects/ngx/src/lib/common/interfaces/server-errors.ts +5 -0
- package/projects/ngx/src/lib/components/rtsee-auth/auth/auth.component.html +14 -10
- package/projects/ngx/src/lib/components/rtsee-auth/auth/auth.component.ts +17 -1
- package/projects/ngx/src/lib/components/rtsee-auth/forgot-password/forgot-password.component.html +1 -1
- package/projects/ngx/src/lib/components/rtsee-auth/forgot-password/forgot-password.component.ts +10 -2
- package/projects/ngx/src/lib/components/rtsee-auth/reset-password/reset-password.component.ts +6 -2
- package/projects/ngx/src/lib/components/rtsee-auth/services/auth.service.ts +6 -3
- package/projects/ngx/src/lib/components/rtsee-auth/sign-in/sign-in.component.html +67 -29
- package/projects/ngx/src/lib/components/rtsee-auth/sign-in/sign-in.component.ts +94 -22
- package/projects/ngx/src/lib/components/rtsee-auth/sign-up/sign-up.component.html +1 -1
- package/projects/ngx/src/lib/components/rtsee-auth/sign-up/sign-up.component.ts +5 -0
- package/projects/ngx/src/lib/components/rtsee-auth/types/auth-form.type.ts +4 -3
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-container.component.html +25 -29
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-container.component.ts +5 -8
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-nav/rtsee-nav.component.html +25 -0
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-nav/rtsee-nav.component.ts +26 -0
- package/projects/ngx/src/lib/components/rtsee-presentation/presentation/presentation.component.html +18 -17
- package/projects/ngx/src/lib/components/rtsee-presentation/presentation/presentation.component.ts +0 -2
- package/projects/ngx/src/lib/components/rtsee-presentation/slide/slide.component.html +22 -18
- package/projects/ngx/src/lib/components/rtsee-presentation/slide/slide.component.ts +4 -3
- package/projects/ngx/src/lib/ngx.module.ts +14 -6
- package/projects/ngx/src/lib/theme/auth/auth-container.scss +189 -177
- package/projects/ngx/src/lib/theme/auth/index.scss +0 -1
- package/projects/ngx/src/lib/theme/auth/variables.scss +1 -64
- package/projects/ngx/src/lib/theme/common-variables.scss +1 -0
- package/projects/ngx/src/lib/theme/containers/index.scss +2 -2
- package/projects/ngx/src/lib/theme/containers/nav-item.scss +84 -55
- package/projects/ngx/src/lib/theme/containers/nav.scss +86 -0
- package/projects/ngx/src/lib/theme/containers/shell.scss +22 -31
- package/projects/ngx/src/lib/theme/containers/variables.scss +10 -1
- package/projects/ngx/src/lib/theme/forms/common.scss +51 -0
- package/projects/ngx/src/lib/theme/forms/index.scss +1 -0
- package/projects/ngx/src/lib/theme/forms/variables.scss +8 -0
- package/projects/ngx/src/lib/theme/styles.scss +1 -0
- package/tsconfig.json +2 -1
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-bottom-nav/rtsee-bottom-nav.component.html +0 -15
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-bottom-nav/rtsee-bottom-nav.component.ts +0 -20
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-sidenav/rtsee-sidenav.component.html +0 -32
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-sidenav/rtsee-sidenav.component.ts +0 -26
- package/projects/ngx/src/lib/theme/auth/auth.scss +0 -0
- package/projects/ngx/src/lib/theme/containers/bottom-nav.scss +0 -15
- package/projects/ngx/src/lib/theme/containers/sidenav.scss +0 -125
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 0.0.59 (2025-09-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @rtsee/ngx
|
|
9
|
+
|
|
6
10
|
## 0.0.58 (2025-08-11)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @rtsee/ngx
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.59",
|
|
3
3
|
"name": "@rtsee/ngx",
|
|
4
4
|
"module": "./dist/ngx/fesm2022/rtsee-ngx.mjs",
|
|
5
5
|
"types": "./dist/ngx/index.d.ts",
|
|
@@ -30,15 +30,18 @@
|
|
|
30
30
|
"@angular/platform-browser": "~20.1.2",
|
|
31
31
|
"@angular/platform-browser-dynamic": "~20.1.2",
|
|
32
32
|
"@angular/router": "~20.1.2",
|
|
33
|
-
"@
|
|
34
|
-
"@rtsee/
|
|
35
|
-
"@rtsee/
|
|
36
|
-
"@rtsee/
|
|
37
|
-
"@rtsee/
|
|
33
|
+
"@primeuix/themes": "^1.2.3",
|
|
34
|
+
"@rtsee/common": "^0.0.29",
|
|
35
|
+
"@rtsee/conference": "^0.0.30",
|
|
36
|
+
"@rtsee/events-dashboard": "^0.0.63",
|
|
37
|
+
"@rtsee/factory": "^0.0.72",
|
|
38
|
+
"@rtsee/messenger": "^0.0.63",
|
|
38
39
|
"@rtsee/signaling-client": "^0.0.66",
|
|
39
40
|
"dayjs": "^1.11.9",
|
|
40
41
|
"ngx-autosize": "^2.0.4",
|
|
42
|
+
"ngx-captcha": "^14.0.0",
|
|
41
43
|
"ngx-infinite-scroll": "20.0.0",
|
|
44
|
+
"primeng": "^20.1.2",
|
|
42
45
|
"rxjs": "~7.8.0",
|
|
43
46
|
"shave": "^5.0.0",
|
|
44
47
|
"swiper": "^11.1.15",
|
|
@@ -58,5 +61,5 @@
|
|
|
58
61
|
"publishConfig": {
|
|
59
62
|
"access": "public"
|
|
60
63
|
},
|
|
61
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "07cce216164a8c6a5639bf0e54e8ad7f71c9d6db"
|
|
62
65
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './server-errors';
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
<div class="rtsee-auth">
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
@if (authService.rtseeAuth) {
|
|
3
|
+
@if (activeComponent === 'sign-in') {
|
|
4
|
+
<rtsee-sign-in></rtsee-sign-in>
|
|
5
|
+
}
|
|
6
|
+
@if (activeComponent === 'sign-up') {
|
|
7
|
+
<rtsee-sign-up></rtsee-sign-up>
|
|
8
|
+
}
|
|
9
|
+
@if (activeComponent === 'forgot-password') {
|
|
10
|
+
<rtsee-forgot-password></rtsee-forgot-password>
|
|
11
|
+
}
|
|
12
|
+
@if (activeComponent === 'reset-password') {
|
|
13
|
+
<rtsee-reset-password *ngIf="activeComponent === 'reset-password'"></rtsee-reset-password>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
12
16
|
</div>
|
|
@@ -6,6 +6,7 @@ import {ResetPasswordComponent} from "../reset-password/reset-password.component
|
|
|
6
6
|
import {NgIf} from "@angular/common";
|
|
7
7
|
import {RTSeeAuthService} from "../services/auth.service";
|
|
8
8
|
import {RTSeeAuth} from "@rtsee/auth";
|
|
9
|
+
import {AuthEndpointsKeys, DEFAULT_ROUTE_NAMES} from "@rtsee/auth";
|
|
9
10
|
|
|
10
11
|
@Component({
|
|
11
12
|
selector: 'rtsee-auth',
|
|
@@ -24,7 +25,22 @@ export class RTSeeAuthComponent implements OnInit {
|
|
|
24
25
|
|
|
25
26
|
activeComponent: 'reset-password' | 'sign-up' | 'sign-in' | 'forgot-password' = 'sign-in' ;
|
|
26
27
|
|
|
27
|
-
constructor(
|
|
28
|
+
constructor(public authService: RTSeeAuthService) {
|
|
29
|
+
console.log('constructor', window.location.pathname);
|
|
30
|
+
|
|
31
|
+
if (window.location.pathname.includes(DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.SIGN_IN])) {
|
|
32
|
+
this.activeComponent = 'sign-in';
|
|
33
|
+
} else if (window.location.pathname.includes(DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.SIGN_UP])) {
|
|
34
|
+
this.activeComponent = 'sign-up';
|
|
35
|
+
} else if (window.location.pathname.includes(DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.FORGOT_PASSWORD])) {
|
|
36
|
+
this.activeComponent = 'forgot-password';
|
|
37
|
+
} else if (
|
|
38
|
+
window.location.pathname
|
|
39
|
+
.includes(DEFAULT_ROUTE_NAMES[AuthEndpointsKeys.RESET_PASSWORD].split('/')[0])
|
|
40
|
+
) {
|
|
41
|
+
this.activeComponent = 'reset-password';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
28
44
|
|
|
29
45
|
ngOnInit() {
|
|
30
46
|
this.authService.init(this.auth);
|
package/projects/ngx/src/lib/components/rtsee-auth/forgot-password/forgot-password.component.html
CHANGED
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
|
|
31
31
|
<!-- Redirect to Sign-In -->
|
|
32
32
|
<p class="auth-media-blue-gray-sm-normal">
|
|
33
|
-
Пам'ятаєте пароль? <a [routerLink]="
|
|
33
|
+
Пам'ятаєте пароль? <a [routerLink]="authConfiguration.getRoutePathSplit(AuthEndpointsKeys.SIGN_IN)" class="auth-deep-blue-sm-medium">Увійдіть</a>
|
|
34
34
|
</p>
|
|
35
35
|
</div>
|
package/projects/ngx/src/lib/components/rtsee-auth/forgot-password/forgot-password.component.ts
CHANGED
|
@@ -3,6 +3,8 @@ import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/
|
|
|
3
3
|
import { UtilsService } from '../services/utils.service';
|
|
4
4
|
import { ForgotPasswordForm, TypedReactiveForm } from '../types/auth-form.type';
|
|
5
5
|
import {RouterLink} from "@angular/router";
|
|
6
|
+
import { RTSeeAuthConfiguration, AuthEndpointsKeys } from "@rtsee/auth";
|
|
7
|
+
import { RTSeeAuthService } from "../services/auth.service";
|
|
6
8
|
|
|
7
9
|
@Component({
|
|
8
10
|
selector: 'rtsee-forgot-password',
|
|
@@ -17,18 +19,24 @@ export class ForgotPasswordComponent {
|
|
|
17
19
|
public isLoading: boolean = false;
|
|
18
20
|
public readonly emailForm: FormGroup<TypedReactiveForm<ForgotPasswordForm>>;
|
|
19
21
|
public readonly forgotPasswordFormKeys: Record<keyof ForgotPasswordForm, string>;
|
|
22
|
+
authConfiguration: RTSeeAuthConfiguration;
|
|
23
|
+
|
|
20
24
|
constructor(
|
|
21
|
-
private readonly formBuilder: FormBuilder
|
|
25
|
+
private readonly formBuilder: FormBuilder,
|
|
26
|
+
private authService: RTSeeAuthService
|
|
22
27
|
) {
|
|
23
28
|
this.emailForm= this.formBuilder.group<TypedReactiveForm<ForgotPasswordForm>>({
|
|
24
|
-
email: this.formBuilder.control(
|
|
29
|
+
email: this.formBuilder.nonNullable.control('', { validators: [Validators.required, Validators.email] }),
|
|
25
30
|
});
|
|
26
31
|
this.forgotPasswordFormKeys = UtilsService.getKeysAsValueObject(this.emailForm.getRawValue());
|
|
32
|
+
this.authConfiguration = this.authService.rtseeAuth.authConfiguration;
|
|
27
33
|
}
|
|
28
34
|
|
|
29
35
|
public submitEmail(): void {
|
|
30
36
|
if (this.emailForm.valid) {
|
|
31
37
|
}
|
|
32
38
|
}
|
|
39
|
+
|
|
40
|
+
protected readonly AuthEndpointsKeys = AuthEndpointsKeys;
|
|
33
41
|
}
|
|
34
42
|
|
package/projects/ngx/src/lib/components/rtsee-auth/reset-password/reset-password.component.ts
CHANGED
|
@@ -2,9 +2,11 @@ import { Component, OnInit } from '@angular/core';
|
|
|
2
2
|
import {FormBuilder, FormGroup, ReactiveFormsModule, ValidatorFn, Validators} from '@angular/forms';
|
|
3
3
|
import { ResetPasswordForm, TypedReactiveForm } from '../types/auth-form.type';
|
|
4
4
|
import { UtilsService } from '../services/utils.service';
|
|
5
|
-
import { ActivatedRoute
|
|
5
|
+
import { ActivatedRoute } from '@angular/router';
|
|
6
6
|
import { FormErrorKey } from '../../enums/form.enum';
|
|
7
7
|
import { COMMON_CONSTANTS } from '../../constans/common.const';
|
|
8
|
+
import { RTSeeAuthService } from "../services/auth.service";
|
|
9
|
+
import { RTSeeAuthConfiguration } from "@rtsee/auth";
|
|
8
10
|
|
|
9
11
|
@Component({
|
|
10
12
|
selector: 'rtsee-reset-password',
|
|
@@ -23,17 +25,19 @@ export class ResetPasswordComponent implements OnInit {
|
|
|
23
25
|
passwordConfirm: true
|
|
24
26
|
};
|
|
25
27
|
private token!: string;
|
|
28
|
+
authConfiguration: RTSeeAuthConfiguration;
|
|
26
29
|
|
|
27
30
|
constructor(
|
|
28
31
|
private formBuilder: FormBuilder,
|
|
29
32
|
private route: ActivatedRoute,
|
|
30
|
-
private
|
|
33
|
+
private authService: RTSeeAuthService
|
|
31
34
|
) {
|
|
32
35
|
this.resetPasswordForm = this.formBuilder.group({
|
|
33
36
|
password: this.formBuilder.control('', {validators: [Validators.required, Validators.minLength(COMMON_CONSTANTS.minPasswordLength)], nonNullable: true}),
|
|
34
37
|
passwordConfirm: this.formBuilder.control('', {validators: [Validators.required, Validators.minLength(COMMON_CONSTANTS.minPasswordLength)], nonNullable: true}),
|
|
35
38
|
}, {validators: [this.passwordMatchValidator()]});
|
|
36
39
|
this.passwordFormKeys = UtilsService.getKeysAsValueObject(this.resetPasswordForm.value);
|
|
40
|
+
this.authConfiguration = this.authService.authConfiguration;
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
public ngOnInit(): void {
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
IRTSeeSignInResponse,
|
|
7
7
|
IRtseeSignUpRequestOptions,
|
|
8
8
|
IRTSeeSignUpResponse,
|
|
9
|
+
AuthEndpointsKeys,
|
|
10
|
+
RTSeeAuthConfiguration
|
|
9
11
|
} from "@rtsee/auth";
|
|
10
12
|
import { Observable, tap } from "rxjs";
|
|
11
13
|
|
|
@@ -14,24 +16,25 @@ import { Observable, tap } from "rxjs";
|
|
|
14
16
|
})
|
|
15
17
|
export class RTSeeAuthService {
|
|
16
18
|
rtseeAuth!: RTSeeAuth<any>;
|
|
19
|
+
authConfiguration!: RTSeeAuthConfiguration;
|
|
17
20
|
|
|
18
21
|
constructor(
|
|
19
22
|
private http: HttpClient,
|
|
20
23
|
) {}
|
|
21
24
|
|
|
22
25
|
init(auth: RTSeeAuth<any>) {
|
|
23
|
-
console.log('init');
|
|
24
26
|
this.rtseeAuth = auth;
|
|
27
|
+
this.authConfiguration = this.rtseeAuth.authConfiguration;
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
signIn(credentials: IRtseeSignInRequestOptions): Observable<IRTSeeSignInResponse> {
|
|
28
31
|
return this.http
|
|
29
|
-
.post<IRTSeeSignInResponse>(
|
|
32
|
+
.post<IRTSeeSignInResponse>(this.authConfiguration.getEndpointPathByEndpointName(AuthEndpointsKeys.SIGN_IN), credentials)
|
|
30
33
|
.pipe(tap((res) => this.rtseeAuth.authenticate(res)))
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
signUp(credentials: IRtseeSignUpRequestOptions): Observable<IRTSeeSignUpResponse> {
|
|
34
37
|
return this.http
|
|
35
|
-
.post<IRTSeeSignUpResponse>(
|
|
38
|
+
.post<IRTSeeSignUpResponse>(this.authConfiguration.getEndpointPathByEndpointName(AuthEndpointsKeys.SIGN_UP), credentials)
|
|
36
39
|
}
|
|
37
40
|
}
|
|
@@ -1,45 +1,83 @@
|
|
|
1
|
-
<div class="auth-container">
|
|
2
|
-
<img ngSrc="
|
|
1
|
+
<div class="auth-container rtsee-form-container" >
|
|
2
|
+
<img [ngSrc]="authConfiguration.appLogo"
|
|
3
3
|
alt="Company Logo"
|
|
4
4
|
class="auth-logo"
|
|
5
|
-
height="
|
|
5
|
+
height="37"
|
|
6
6
|
width="37"
|
|
7
7
|
/>
|
|
8
|
-
<h2 class="auth-title"
|
|
8
|
+
<h2 class="auth-title">Вхід в Особистий Кабінет</h2>
|
|
9
9
|
<p class="auth-title-description">Аби переглядати казки, увійдіть в свій особистий кабінет</p>
|
|
10
10
|
|
|
11
|
-
<form class="auth-form" [formGroup]="signInForm" (ngSubmit)="login()">
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<
|
|
11
|
+
<form class="auth-form rtsee-form" [formGroup]="signInForm" (ngSubmit)="login()">
|
|
12
|
+
<div class="rtsee-form-field-container">
|
|
13
|
+
<p-inputgroup >
|
|
14
|
+
<p-floatlabel variant="on">
|
|
15
|
+
<input id="user-email"
|
|
16
|
+
pInputText
|
|
17
|
+
[formControl]="usernameField"
|
|
18
|
+
/>
|
|
19
|
+
<label for="user-email">Email</label>
|
|
20
|
+
</p-floatlabel>
|
|
21
|
+
</p-inputgroup>
|
|
22
|
+
@if (!usernameField.valid && usernameField.touched) {
|
|
23
|
+
<p-message class="rtsee-form-field-error-message"
|
|
24
|
+
severity="error"
|
|
25
|
+
variant="simple"
|
|
26
|
+
size="small"
|
|
27
|
+
>Email is invalid</p-message>
|
|
28
|
+
}
|
|
29
|
+
</div>
|
|
30
|
+
<div class="rtsee-form-field-container">
|
|
31
|
+
<p-inputgroup>
|
|
32
|
+
<p-floatlabel variant="on">
|
|
33
|
+
<p-password id="user-password"
|
|
34
|
+
[formControl]="passwordField"
|
|
35
|
+
[feedback]="false"
|
|
36
|
+
/>
|
|
37
|
+
<label for="user-password">Password</label>
|
|
38
|
+
</p-floatlabel>
|
|
39
|
+
</p-inputgroup>
|
|
40
|
+
|
|
41
|
+
@if (!passwordField.valid && passwordField.touched) {
|
|
42
|
+
<p-message class="rtsee-form-field-error-message"
|
|
43
|
+
severity="error"
|
|
44
|
+
variant="simple"
|
|
45
|
+
size="small"
|
|
46
|
+
>Password is required</p-message>
|
|
47
|
+
}
|
|
48
|
+
@if (serverSideError) {
|
|
49
|
+
<p-message class="rtsee-form-field-error-message"
|
|
50
|
+
severity="error"
|
|
51
|
+
variant="simple"
|
|
52
|
+
size="small"
|
|
53
|
+
>{{serverSideError}}</p-message>
|
|
54
|
+
}
|
|
55
|
+
</div>
|
|
56
|
+
<div class="rtsee-form-field-container">
|
|
57
|
+
<p-checkbox inputId="remember" [binary]="true" [formControl]="rememberField" />
|
|
58
|
+
<label for="remember" class="ml-2"> Remember me </label>
|
|
59
|
+
</div>
|
|
60
|
+
<div class="rtsee-form-field-container">
|
|
61
|
+
<a href="#"
|
|
62
|
+
[routerLink]="authConfiguration.getRoutePathSplit(AuthEndpointsKeys.FORGOT_PASSWORD)"
|
|
32
63
|
class="auth-deep-blue-sm-medium"
|
|
33
64
|
>Забули пароль?</a>
|
|
34
65
|
</div>
|
|
35
|
-
|
|
36
|
-
|
|
66
|
+
<div class="rtsee-form-submit-container">
|
|
67
|
+
<p-button type="submit"
|
|
68
|
+
label="Sign In"
|
|
69
|
+
[disabled]="loadInProgress"
|
|
70
|
+
/>
|
|
71
|
+
@if (loadInProgress) {
|
|
72
|
+
<p-progress-spinner class="rtsee-progress-spinner rtsee-progress-spinner-sm"></p-progress-spinner>
|
|
73
|
+
}
|
|
74
|
+
</div>
|
|
37
75
|
</form>
|
|
38
|
-
<p class="
|
|
76
|
+
<p class="rtsee-form-label">
|
|
39
77
|
<span>Немає акаунту?</span>
|
|
40
78
|
<span> </span>
|
|
41
79
|
<a href="#"
|
|
42
|
-
[routerLink]="
|
|
80
|
+
[routerLink]="authConfiguration.getRoutePathSplit(AuthEndpointsKeys.SIGN_UP)"
|
|
43
81
|
class="auth-deep-blue-sm-medium"
|
|
44
82
|
>Створіть!</a>
|
|
45
83
|
</p>
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
|
-
import {Router, RouterLink} from '@angular/router';
|
|
3
|
-
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
|
4
|
-
import { UtilsService } from '../services/utils.service';
|
|
2
|
+
import { Router, RouterLink } from '@angular/router';
|
|
3
|
+
import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
5
4
|
import { SignInForm, TypedReactiveForm } from '../types/auth-form.type';
|
|
6
|
-
import {NgOptimizedImage} from
|
|
7
|
-
import { RTSeeAuthService } from
|
|
5
|
+
import { NgOptimizedImage } from '@angular/common';
|
|
6
|
+
import { RTSeeAuthService } from '../services/auth.service';
|
|
7
|
+
import { AuthEndpointsKeys, RTSeeAuthConfiguration } from '@rtsee/auth';
|
|
8
|
+
import { ButtonModule } from 'primeng/button';
|
|
9
|
+
import { InputGroup } from 'primeng/inputgroup';
|
|
10
|
+
import { InputText } from 'primeng/inputtext';
|
|
11
|
+
import { Password } from 'primeng/password';
|
|
12
|
+
import { FloatLabel } from 'primeng/floatlabel';
|
|
13
|
+
import { Checkbox } from 'primeng/checkbox';
|
|
14
|
+
import { Message } from 'primeng/message';
|
|
15
|
+
import { ProgressSpinner } from 'primeng/progressspinner';
|
|
16
|
+
import {ServerSideError} from "../../../common/interfaces";
|
|
8
17
|
|
|
9
18
|
@Component({
|
|
10
19
|
selector: 'rtsee-sign-in',
|
|
@@ -12,37 +21,100 @@ import { RTSeeAuthService } from "../services/auth.service";
|
|
|
12
21
|
imports: [
|
|
13
22
|
NgOptimizedImage,
|
|
14
23
|
ReactiveFormsModule,
|
|
15
|
-
RouterLink
|
|
24
|
+
RouterLink,
|
|
25
|
+
ButtonModule,
|
|
26
|
+
InputGroup,
|
|
27
|
+
InputText,
|
|
28
|
+
Password,
|
|
29
|
+
FloatLabel,
|
|
30
|
+
Checkbox,
|
|
31
|
+
Message,
|
|
32
|
+
ProgressSpinner
|
|
16
33
|
],
|
|
17
34
|
standalone: true
|
|
18
35
|
})
|
|
19
36
|
export class SignInComponent {
|
|
20
|
-
public readonly signInForm: FormGroup<TypedReactiveForm<SignInForm>>
|
|
21
|
-
|
|
37
|
+
public readonly signInForm: FormGroup<TypedReactiveForm<SignInForm>> = this.formBuilder.group<TypedReactiveForm<SignInForm>>({
|
|
38
|
+
username: this.formBuilder.nonNullable.control({
|
|
39
|
+
value: '',
|
|
40
|
+
disabled: false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
validators: [ Validators.required, Validators.email ]
|
|
44
|
+
}),
|
|
45
|
+
password: this.formBuilder.nonNullable.control({
|
|
46
|
+
value: '',
|
|
47
|
+
disabled: false
|
|
48
|
+
}, { validators: [ Validators.required ]}),
|
|
49
|
+
remember: this.formBuilder.nonNullable.control(false),
|
|
50
|
+
});
|
|
51
|
+
public readonly authConfiguration: RTSeeAuthConfiguration;
|
|
52
|
+
protected readonly AuthEndpointsKeys = AuthEndpointsKeys;
|
|
53
|
+
public loadInProgress: boolean = false;
|
|
54
|
+
public serverSideError: string = '';
|
|
22
55
|
|
|
23
56
|
constructor(
|
|
24
57
|
private readonly formBuilder: FormBuilder,
|
|
25
58
|
private readonly router: Router,
|
|
26
|
-
|
|
59
|
+
public authService: RTSeeAuthService
|
|
27
60
|
) {
|
|
28
|
-
this.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
61
|
+
this.authConfiguration = this.authService.rtseeAuth.authConfiguration;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
get usernameField(): FormControl<string> {
|
|
65
|
+
return this.signInForm.get('username') as FormControl<string>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
get passwordField(): FormControl<string> {
|
|
69
|
+
return this.signInForm.get('password') as FormControl<string>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
get rememberField(): FormControl<boolean> {
|
|
73
|
+
return this.signInForm.get('remember') as FormControl<boolean>;
|
|
33
74
|
}
|
|
34
75
|
|
|
35
76
|
public login(): void {
|
|
36
77
|
if (this.signInForm.valid) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
78
|
+
this.disableFormFields();
|
|
79
|
+
this.authService.signIn(this.signInForm.getRawValue())
|
|
80
|
+
.subscribe({
|
|
81
|
+
next: (() => {
|
|
82
|
+
void this.router.navigate(this.authService.rtseeAuth.authConfiguration.defaultPostLoginRoute);
|
|
83
|
+
this.enableFormFields();
|
|
84
|
+
}),
|
|
85
|
+
error: ((error: ServerSideError) => {
|
|
86
|
+
console.log(error);
|
|
87
|
+
this.showServerSideErrorForXSeconds(error.error.message);
|
|
88
|
+
this.enableFormFields();
|
|
89
|
+
}),
|
|
90
|
+
complete: (() => {
|
|
91
|
+
this.enableFormFields();
|
|
92
|
+
})
|
|
45
93
|
});
|
|
94
|
+
} else {
|
|
95
|
+
this.signInForm.markAsTouched(); // this does not work after switching to "nonNullable" form fields
|
|
46
96
|
}
|
|
47
97
|
}
|
|
98
|
+
|
|
99
|
+
private showServerSideErrorForXSeconds(message: string, x: number = 3): void {
|
|
100
|
+
this.serverSideError = message;
|
|
101
|
+
|
|
102
|
+
setTimeout(() => {
|
|
103
|
+
this.serverSideError = '';
|
|
104
|
+
}, x * 1000); // we can do pop-up message instead
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private disableFormFields(): void {
|
|
108
|
+
this.loadInProgress = true;
|
|
109
|
+
this.usernameField.disable();
|
|
110
|
+
this.passwordField.disable();
|
|
111
|
+
this.rememberField.disable();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private enableFormFields(): void {
|
|
115
|
+
this.loadInProgress = false;
|
|
116
|
+
this.usernameField.enable(); // fuck me, but [disabled]="loadInProgress" on the field no longer works :(
|
|
117
|
+
this.passwordField.enable();
|
|
118
|
+
this.rememberField.enable();
|
|
119
|
+
}
|
|
48
120
|
}
|
|
@@ -46,6 +46,6 @@
|
|
|
46
46
|
|
|
47
47
|
<!-- Redirect to Sign-In -->
|
|
48
48
|
<p class="auth-media-blue-gray-sm-normal">
|
|
49
|
-
Вже маєте акаунт? <a href="#" [routerLink]="
|
|
49
|
+
Вже маєте акаунт? <a href="#" [routerLink]="authConfiguration.getRoutePathSplit(AuthEndpointsKeys.SIGN_IN)" class="auth-deep-blue-sm-medium">Увійдіть</a>
|
|
50
50
|
</p>
|
|
51
51
|
</div>
|
|
@@ -6,6 +6,7 @@ import {ConfirmPasswordValidator} from "../validators/form-fields-validators";
|
|
|
6
6
|
import {RouterLink} from "@angular/router";
|
|
7
7
|
import {NgOptimizedImage} from "@angular/common";
|
|
8
8
|
import {RTSeeAuthService} from "../services/auth.service";
|
|
9
|
+
import {RTSeeAuthConfiguration, AuthEndpointsKeys} from "@rtsee/auth";
|
|
9
10
|
|
|
10
11
|
@Component({
|
|
11
12
|
selector: 'rtsee-sign-up',
|
|
@@ -20,6 +21,7 @@ import {RTSeeAuthService} from "../services/auth.service";
|
|
|
20
21
|
export class SignUpComponent {
|
|
21
22
|
public readonly signUpForm: FormGroup<TypedReactiveForm<SignUpForm>>;
|
|
22
23
|
public readonly signUpFormKeys: Record<keyof SignUpForm, string>;
|
|
24
|
+
public readonly authConfiguration: RTSeeAuthConfiguration;
|
|
23
25
|
|
|
24
26
|
constructor(
|
|
25
27
|
private readonly formBuilder: FormBuilder,
|
|
@@ -39,6 +41,7 @@ export class SignUpComponent {
|
|
|
39
41
|
}),
|
|
40
42
|
}, { validators: [ ConfirmPasswordValidator.MatchFields ] });
|
|
41
43
|
this.signUpFormKeys = UtilsService.getKeysAsValueObject(this.signUpForm.getRawValue());
|
|
44
|
+
this.authConfiguration = this.authService.rtseeAuth.authConfiguration;
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
public signUp(): void {
|
|
@@ -59,4 +62,6 @@ export class SignUpComponent {
|
|
|
59
62
|
// this.authService.signUp(formValue);
|
|
60
63
|
}
|
|
61
64
|
}
|
|
65
|
+
|
|
66
|
+
protected readonly AuthEndpointsKeys = AuthEndpointsKeys;
|
|
62
67
|
}
|
|
@@ -26,10 +26,11 @@ export type ConfirmPasswordForm = {
|
|
|
26
26
|
};
|
|
27
27
|
|
|
28
28
|
export type ForgotPasswordForm = {
|
|
29
|
-
email: string
|
|
29
|
+
email: string;
|
|
30
30
|
};
|
|
31
31
|
|
|
32
32
|
export type SignInForm = {
|
|
33
|
-
username: string
|
|
34
|
-
password: string
|
|
33
|
+
username: string;
|
|
34
|
+
password: string;
|
|
35
|
+
remember: boolean;
|
|
35
36
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<div class="rtsee-shell"
|
|
2
|
-
[class.rtseeShellConferenceMode]="rtsee.eventsDashboard && rtsee.activeTab === 'events-dashboard'"
|
|
3
2
|
[ngClass]="{
|
|
4
3
|
'rtsee-shell-conference-mode': rtsee.conference && rtsee.conference.isInActiveCall,
|
|
5
4
|
'rtsee-shell-messenger-active': rtsee.messenger && rtsee.activeTab === 'messenger',
|
|
@@ -8,43 +7,40 @@
|
|
|
8
7
|
'rtsee-shell-side-nav-expanded': isSidenavExpanded
|
|
9
8
|
}"
|
|
10
9
|
>
|
|
11
|
-
<div class="rtsee-
|
|
12
|
-
<rtsee-
|
|
10
|
+
<div class="rtsee-nav-block">
|
|
11
|
+
<rtsee-nav [config]="navigationConfig"></rtsee-nav>
|
|
13
12
|
</div>
|
|
14
13
|
|
|
15
14
|
<div class="rtsee-shell-panel">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
@if (rtsee.conference && rtsee.conference.isInActiveCall) {
|
|
16
|
+
<div class="rtsee-conference-container">
|
|
17
|
+
<rtsee-conference [rtSee]="rtsee.conference"
|
|
18
|
+
></rtsee-conference>
|
|
19
|
+
</div>
|
|
20
|
+
}
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
@if (rtsee.messenger) {
|
|
23
|
+
<div class="rtsee-messenger-container">
|
|
24
|
+
<rtsee-messenger [messenger]="rtsee.messenger"
|
|
25
|
+
></rtsee-messenger>
|
|
26
|
+
</div>
|
|
27
|
+
}
|
|
29
28
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
@if (rtsee.eventsDashboard && rtsee.eventsDashboard.isReady) {
|
|
30
|
+
<div class="rtsee-events-dashboard-container">
|
|
31
|
+
<rtsee-events-dashboard [eventsDashboard]="rtsee.eventsDashboard"
|
|
32
|
+
></rtsee-events-dashboard>
|
|
33
|
+
</div>
|
|
34
|
+
}
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
@if (rtsee.presentation && rtsee.presentation.isActive) {
|
|
37
|
+
<div class="rtsee-presentation-container">
|
|
38
|
+
<rtsee-presentation [presentation]="rtsee.presentation"></rtsee-presentation>
|
|
39
|
+
</div>
|
|
40
|
+
}
|
|
42
41
|
</div>
|
|
43
42
|
|
|
44
43
|
<div class="rtsee-content">
|
|
45
44
|
<ng-content></ng-content>
|
|
46
45
|
</div>
|
|
47
|
-
<div class="rtsee-bottom-nav-block">
|
|
48
|
-
<rtsee-bottom-nav [config]="navigationConfig"></rtsee-bottom-nav>
|
|
49
|
-
</div>
|
|
50
46
|
</div>
|