diff --git a/src/app/modules/user/main/compose/sign-in-compose.component.html b/src/app/modules/user/main/compose/sign-in-compose.component.html index 45886c7..fc7fedc 100644 --- a/src/app/modules/user/main/compose/sign-in-compose.component.html +++ b/src/app/modules/user/main/compose/sign-in-compose.component.html @@ -11,11 +11,20 @@ > - + + {{ alert.message }} +
diff --git a/src/app/modules/user/main/compose/sign-in-compose.component.ts b/src/app/modules/user/main/compose/sign-in-compose.component.ts index f11bd61..42564ad 100644 --- a/src/app/modules/user/main/compose/sign-in-compose.component.ts +++ b/src/app/modules/user/main/compose/sign-in-compose.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit, ViewEncapsulation } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogRef } from '@angular/material/dialog'; +import { FuseAlertType } from '@fuse/components/alert'; import { AuthService } from 'app/core/auth/auth.service'; @Component({ @@ -9,19 +10,15 @@ import { AuthService } from 'app/core/auth/auth.service'; encapsulation: ViewEncapsulation.None, }) export class SignInComposeComponent implements OnInit { - composeForm!: FormGroup; - copyFields: { cc: boolean; bcc: boolean } = { - cc: false, - bcc: false, - }; - quillModules: any = { - toolbar: [ - ['bold', 'italic', 'underline'], - [{ align: [] }, { list: 'ordered' }, { list: 'bullet' }], - ['clean'], - ], + signInComposeForm!: FormGroup; + + alert: { type: FuseAlertType; message: string } = { + type: 'success', + message: '로그인이 성공하였습니다.', }; + showAlert: boolean = false; + /** * Constructor */ @@ -40,9 +37,9 @@ export class SignInComposeComponent implements OnInit { */ ngOnInit(): void { // Create the form - this.composeForm = this._formBuilder.group({ - username: ['', [Validators.required, Validators.email]], - password: ['', [Validators.email]], + this.signInComposeForm = this._formBuilder.group({ + username: ['', [Validators.required]], + password: ['', [Validators.required]], }); } @@ -50,21 +47,6 @@ export class SignInComposeComponent implements OnInit { // @ Public methods // ----------------------------------------------------------------------------------------------------- - /** - * Show the copy field with the given field name - * - * @param name - */ - showCopyField(name: string): void { - // Return if the name is not one of the available names - if (name !== 'cc' && name !== 'bcc') { - return; - } - - // Show the field - this.copyFields[name] = true; - } - /** * Save and close */ @@ -91,20 +73,25 @@ export class SignInComposeComponent implements OnInit { */ send(): void { // Return if the form is invalid - if (this.composeForm?.invalid) { + if (this.signInComposeForm?.invalid) { return; } // Disable the form - this.composeForm?.disable(); + this.signInComposeForm?.disable(); // Sign in this._authService - .signIn(this.composeForm?.value) - .then(() => {}) + .signIn(this.signInComposeForm?.value) + .then(() => { + console.log(); + this.showAlert = true; + }) .catch((e) => { + this.showAlert = true; + this.alert = { type: 'error', message: '등록에 실패하였습니다.' }; // Re-enable the form - this.composeForm?.enable(); + this.signInComposeForm?.enable(); // Reset the form });