From ed96d0ef8afc13213d8b272a029faed58c64ee0e Mon Sep 17 00:00:00 2001 From: Mohammad Arif Date: Sat, 18 Jan 2025 15:13:03 +0530 Subject: [PATCH] Login component clean-up --- .../src/app/remote-entry/entry.component.css | 16 ++++++ .../src/app/remote-entry/entry.component.html | 17 ++++++ .../src/app/remote-entry/entry.component.ts | 53 +++++-------------- 3 files changed, 46 insertions(+), 40 deletions(-) create mode 100644 apps/login/src/app/remote-entry/entry.component.css create mode 100644 apps/login/src/app/remote-entry/entry.component.html diff --git a/apps/login/src/app/remote-entry/entry.component.css b/apps/login/src/app/remote-entry/entry.component.css new file mode 100644 index 0000000..30cb06c --- /dev/null +++ b/apps/login/src/app/remote-entry/entry.component.css @@ -0,0 +1,16 @@ +.login-app { + width: 30vw; + border: 2px dashed black; + padding: 8px; + margin: 0 auto; +} +.login-form { + display: flex; + align-items: center; + flex-direction: column; + margin: 0 auto; + padding: 8px; +} +label { + display: block; +} \ No newline at end of file diff --git a/apps/login/src/app/remote-entry/entry.component.html b/apps/login/src/app/remote-entry/entry.component.html new file mode 100644 index 0000000..548b8c9 --- /dev/null +++ b/apps/login/src/app/remote-entry/entry.component.html @@ -0,0 +1,17 @@ +
+ + + +
User is logged in!
+
User is not logged in!
+
\ No newline at end of file diff --git a/apps/login/src/app/remote-entry/entry.component.ts b/apps/login/src/app/remote-entry/entry.component.ts index 70a79de..a2d894c 100644 --- a/apps/login/src/app/remote-entry/entry.component.ts +++ b/apps/login/src/app/remote-entry/entry.component.ts @@ -5,58 +5,31 @@ import { UserService } from '@ng-mf/data-access-user'; import { ChatBotComponent } from 'login/chatBot'; @Component({ - standalone: true, imports: [CommonModule, FormsModule, ChatBotComponent], selector: 'ng-mf-login-entry', - template: ` -
- - - -
User is logged in!
-
User is not logged in!
-
- `, - styles: [ - ` - .login-app { - width: 30vw; - border: 2px dashed black; - padding: 8px; - margin: 0 auto; - } - .login-form { - display: flex; - align-items: center; - flex-direction: column; - margin: 0 auto; - padding: 8px; - } - label { - display: block; - } - `, - ], + templateUrl: './entry.component.html', + styleUrls: ['./entry.component.css'], }) +/** + * This component is the entry point for the remote login application. + */ export class RemoteEntryComponent { username = ''; password = ''; isLoggedIn$; + /** + * Constructor for the RemoteEntryComponent. + * + * @param userService + */ constructor(private userService: UserService) { this.isLoggedIn$ = this.userService.isUserLoggedIn$; } + /** + * Method to log in the user. + */ login() { this.userService.checkCredentials(this.username, this.password); }