refactoring..

This commit is contained in:
Park Byung Eun 2022-08-21 07:46:40 +00:00
parent 593b67d4e1
commit 36a9a756dd
43 changed files with 61 additions and 2231 deletions

View File

@ -0,0 +1,34 @@
import { NgModule } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
import { MatFormFieldModule } from '@angular/material/form-field';
import { MatTabsModule } from '@angular/material/tabs';
import { MatInputModule } from '@angular/material/input';
import { MatDialogModule } from '@angular/material/dialog';
import { MatSelectModule } from '@angular/material/select';
import { FuseCardModule } from '@fuse/components/card';
import { SharedModule } from 'app/shared/shared.module';
import { FuseAlertModule } from '@fuse/components/alert';
import { COMPOSE } from './compose';
@NgModule({
declarations: [COMPOSE],
imports: [
MatButtonModule,
MatIconModule,
MatFormFieldModule,
MatTabsModule,
MatInputModule,
MatDialogModule,
MatSelectModule,
FuseCardModule,
SharedModule,
FuseAlertModule,
],
})
export class ComposeModule {}

View File

@ -1,14 +1,15 @@
import { Component, ViewEncapsulation } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { CompComposeComponent } from './compose/comp-compose.component';
import { CustomerComposeComponent } from './compose/customer-compose.component';
import { DepositComposeComponent } from './compose/deposit-compose.component';
import { DepositHistoryComposeComponent } from './compose/deposit-history-compose.component';
import { NoticeComposeComponent } from './compose/notice-compose.component';
import { SignInComposeComponent } from './compose/sign-in-compose.component';
import { SignUpComposeComponent } from './compose/sign-up-compose.component';
import { WithdrawComposeComponent } from './compose/withdraw-compose.component';
import { WithdrawHistoryComposeComponent } from './compose/withdraw-history-compose.component';
import { CompComposeComponent } from 'app/modules/beteran/compose/compose/comp-compose.component';
import { CustomerComposeComponent } from 'app/modules/beteran/compose/compose/customer-compose.component';
import { DepositComposeComponent } from 'app/modules/beteran/compose/compose/deposit-compose.component';
import { DepositHistoryComposeComponent } from 'app/modules/beteran/compose/compose/deposit-history-compose.component';
import { NoticeComposeComponent } from 'app/modules/beteran/compose/compose/notice-compose.component';
import { SignInComposeComponent } from 'app/modules/beteran/compose/compose/sign-in-compose.component';
import { SignUpComposeComponent } from 'app/modules/beteran/compose/compose/sign-up-compose.component';
import { WithdrawComposeComponent } from 'app/modules/beteran/compose/compose/withdraw-compose.component';
import { WithdrawHistoryComposeComponent } from 'app/modules/beteran/compose/compose/withdraw-history-compose.component';
export enum ComposeMenuType {
signOut = 'signOut',

View File

@ -15,8 +15,7 @@ import { GameMainComponent } from 'app/modules/game/main/main.component';
import { FuseAlertModule } from '@fuse/components/alert';
import { COMPOSE } from './compose';
import { ComposeModule } from 'app/modules/beteran/compose/compose.module';
const mainRoutes: Route[] = [
{
path: '',
@ -25,7 +24,7 @@ const mainRoutes: Route[] = [
];
@NgModule({
declarations: [GameMainComponent, COMPOSE],
declarations: [GameMainComponent],
imports: [
RouterModule.forChild(mainRoutes),
MatButtonModule,
@ -39,6 +38,8 @@ const mainRoutes: Route[] = [
SharedModule,
FuseAlertModule,
ComposeModule,
],
})
export class GameMainModule {}

View File

@ -1,123 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">Comp</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
>
<!-- To -->
<mat-form-field>
<mat-label>To</mat-label>
<input matInput [formControlName]="'to'" />
<div class="copy-fields-toggles" matSuffix>
<span
class="text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.cc"
(click)="showCopyField('cc')"
>
Cc
</span>
<span
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.bcc"
(click)="showCopyField('bcc')"
>
Bcc
</span>
</div>
</mat-form-field>
<!-- Cc -->
<mat-form-field *ngIf="copyFields.cc">
<mat-label>Cc</mat-label>
<input matInput [formControlName]="'cc'" />
</mat-form-field>
<!-- Bcc -->
<mat-form-field *ngIf="copyFields.bcc">
<mat-label>Bcc</mat-label>
<input matInput [formControlName]="'bcc'" />
</mat-form-field>
<!-- Subject -->
<mat-form-field>
<mat-label>Subject</mat-label>
<input matInput [formControlName]="'subject'" />
</mat-form-field>
<!-- Body -->
<!-- <quill-editor
class="mt-2"
[formControlName]="'body'"
[modules]="quillModules"
></quill-editor> -->
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
>
<div class="-ml-2">
<!-- Attach file -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:paper-clip'"
></mat-icon>
</button>
<!-- Insert link -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:link'"
></mat-icon>
</button>
<!-- Insert emoji -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:emoji-happy'"
></mat-icon>
</button>
<!-- Insert image -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:photograph'"
></mat-icon>
</button>
</div>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
Discard
</button>
<!-- Save as draft -->
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
<span>Save as draft</span>
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
Send
</button>
</div>
</div>
</form>
</div>

View File

@ -1,94 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'comp-compose',
templateUrl: './comp-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class CompComposeComponent 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'],
],
};
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<CompComposeComponent>,
private _formBuilder: FormBuilder
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
to: ['', [Validators.required, Validators.email]],
cc: ['', [Validators.email]],
bcc: ['', [Validators.email]],
subject: [''],
body: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ 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
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {}
}

View File

@ -1,123 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">customer</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
>
<!-- To -->
<mat-form-field>
<mat-label>To</mat-label>
<input matInput [formControlName]="'to'" />
<div class="copy-fields-toggles" matSuffix>
<span
class="text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.cc"
(click)="showCopyField('cc')"
>
Cc
</span>
<span
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.bcc"
(click)="showCopyField('bcc')"
>
Bcc
</span>
</div>
</mat-form-field>
<!-- Cc -->
<mat-form-field *ngIf="copyFields.cc">
<mat-label>Cc</mat-label>
<input matInput [formControlName]="'cc'" />
</mat-form-field>
<!-- Bcc -->
<mat-form-field *ngIf="copyFields.bcc">
<mat-label>Bcc</mat-label>
<input matInput [formControlName]="'bcc'" />
</mat-form-field>
<!-- Subject -->
<mat-form-field>
<mat-label>Subject</mat-label>
<input matInput [formControlName]="'subject'" />
</mat-form-field>
<!-- Body -->
<!-- <quill-editor
class="mt-2"
[formControlName]="'body'"
[modules]="quillModules"
></quill-editor> -->
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
>
<div class="-ml-2">
<!-- Attach file -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:paper-clip'"
></mat-icon>
</button>
<!-- Insert link -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:link'"
></mat-icon>
</button>
<!-- Insert emoji -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:emoji-happy'"
></mat-icon>
</button>
<!-- Insert image -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:photograph'"
></mat-icon>
</button>
</div>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
Discard
</button>
<!-- Save as draft -->
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
<span>Save as draft</span>
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
Send
</button>
</div>
</div>
</form>
</div>

View File

@ -1,93 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'customer-compose',
templateUrl: './customer-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class CustomerComposeComponent 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'],
],
};
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<CustomerComposeComponent>,
private _formBuilder: FormBuilder
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
to: ['', [Validators.required, Validators.email]],
cc: ['', [Validators.email]],
bcc: ['', [Validators.email]],
subject: [''],
body: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ 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
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {}
}

View File

@ -1,123 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">deposit</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
>
<!-- To -->
<mat-form-field>
<mat-label>To</mat-label>
<input matInput [formControlName]="'to'" />
<div class="copy-fields-toggles" matSuffix>
<span
class="text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.cc"
(click)="showCopyField('cc')"
>
Cc
</span>
<span
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.bcc"
(click)="showCopyField('bcc')"
>
Bcc
</span>
</div>
</mat-form-field>
<!-- Cc -->
<mat-form-field *ngIf="copyFields.cc">
<mat-label>Cc</mat-label>
<input matInput [formControlName]="'cc'" />
</mat-form-field>
<!-- Bcc -->
<mat-form-field *ngIf="copyFields.bcc">
<mat-label>Bcc</mat-label>
<input matInput [formControlName]="'bcc'" />
</mat-form-field>
<!-- Subject -->
<mat-form-field>
<mat-label>Subject</mat-label>
<input matInput [formControlName]="'subject'" />
</mat-form-field>
<!-- Body -->
<!-- <quill-editor
class="mt-2"
[formControlName]="'body'"
[modules]="quillModules"
></quill-editor> -->
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
>
<div class="-ml-2">
<!-- Attach file -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:paper-clip'"
></mat-icon>
</button>
<!-- Insert link -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:link'"
></mat-icon>
</button>
<!-- Insert emoji -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:emoji-happy'"
></mat-icon>
</button>
<!-- Insert image -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:photograph'"
></mat-icon>
</button>
</div>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
Discard
</button>
<!-- Save as draft -->
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
<span>Save as draft</span>
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
Send
</button>
</div>
</div>
</form>
</div>

View File

@ -1,94 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'deposit-compose',
templateUrl: './deposit-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class DepositComposeComponent 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'],
],
};
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<DepositComposeComponent>,
private _formBuilder: FormBuilder
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
to: ['', [Validators.required, Validators.email]],
cc: ['', [Validators.email]],
bcc: ['', [Validators.email]],
subject: [''],
body: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ 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
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {}
}

View File

@ -1,123 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">Deposit History</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
>
<!-- To -->
<mat-form-field>
<mat-label>To</mat-label>
<input matInput [formControlName]="'to'" />
<div class="copy-fields-toggles" matSuffix>
<span
class="text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.cc"
(click)="showCopyField('cc')"
>
Cc
</span>
<span
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.bcc"
(click)="showCopyField('bcc')"
>
Bcc
</span>
</div>
</mat-form-field>
<!-- Cc -->
<mat-form-field *ngIf="copyFields.cc">
<mat-label>Cc</mat-label>
<input matInput [formControlName]="'cc'" />
</mat-form-field>
<!-- Bcc -->
<mat-form-field *ngIf="copyFields.bcc">
<mat-label>Bcc</mat-label>
<input matInput [formControlName]="'bcc'" />
</mat-form-field>
<!-- Subject -->
<mat-form-field>
<mat-label>Subject</mat-label>
<input matInput [formControlName]="'subject'" />
</mat-form-field>
<!-- Body -->
<!-- <quill-editor
class="mt-2"
[formControlName]="'body'"
[modules]="quillModules"
></quill-editor> -->
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
>
<div class="-ml-2">
<!-- Attach file -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:paper-clip'"
></mat-icon>
</button>
<!-- Insert link -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:link'"
></mat-icon>
</button>
<!-- Insert emoji -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:emoji-happy'"
></mat-icon>
</button>
<!-- Insert image -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:photograph'"
></mat-icon>
</button>
</div>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
Discard
</button>
<!-- Save as draft -->
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
<span>Save as draft</span>
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
Send
</button>
</div>
</div>
</form>
</div>

View File

@ -1,94 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'deposit-history-compose',
templateUrl: './deposit-history-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class DepositHistoryComposeComponent 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'],
],
};
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<DepositHistoryComposeComponent>,
private _formBuilder: FormBuilder
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
to: ['', [Validators.required, Validators.email]],
cc: ['', [Validators.email]],
bcc: ['', [Validators.email]],
subject: [''],
body: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ 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
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {}
}

View File

@ -1,20 +0,0 @@
import { CompComposeComponent } from './comp-compose.component';
import { CustomerComposeComponent } from './customer-compose.component';
import { DepositComposeComponent } from './deposit-compose.component';
import { DepositHistoryComposeComponent } from './deposit-history-compose.component';
import { NoticeComposeComponent } from './notice-compose.component';
import { WithdrawComposeComponent } from './withdraw-compose.component';
import { WithdrawHistoryComposeComponent } from './withdraw-history-compose.component';
import { SignUpComposeComponent } from './sign-up-compose.component';
import { SignInComposeComponent } from './sign-in-compose.component';
export const COMPOSE = [
DepositComposeComponent,
WithdrawComposeComponent,
CompComposeComponent,
CustomerComposeComponent,
DepositHistoryComposeComponent,
WithdrawHistoryComposeComponent,
NoticeComposeComponent,
SignUpComposeComponent,
SignInComposeComponent,
];

View File

@ -1,123 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">Notice</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
>
<!-- To -->
<mat-form-field>
<mat-label>To</mat-label>
<input matInput [formControlName]="'to'" />
<div class="copy-fields-toggles" matSuffix>
<span
class="text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.cc"
(click)="showCopyField('cc')"
>
Cc
</span>
<span
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.bcc"
(click)="showCopyField('bcc')"
>
Bcc
</span>
</div>
</mat-form-field>
<!-- Cc -->
<mat-form-field *ngIf="copyFields.cc">
<mat-label>Cc</mat-label>
<input matInput [formControlName]="'cc'" />
</mat-form-field>
<!-- Bcc -->
<mat-form-field *ngIf="copyFields.bcc">
<mat-label>Bcc</mat-label>
<input matInput [formControlName]="'bcc'" />
</mat-form-field>
<!-- Subject -->
<mat-form-field>
<mat-label>Subject</mat-label>
<input matInput [formControlName]="'subject'" />
</mat-form-field>
<!-- Body -->
<!-- <quill-editor
class="mt-2"
[formControlName]="'body'"
[modules]="quillModules"
></quill-editor> -->
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
>
<div class="-ml-2">
<!-- Attach file -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:paper-clip'"
></mat-icon>
</button>
<!-- Insert link -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:link'"
></mat-icon>
</button>
<!-- Insert emoji -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:emoji-happy'"
></mat-icon>
</button>
<!-- Insert image -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:photograph'"
></mat-icon>
</button>
</div>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
Discard
</button>
<!-- Save as draft -->
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
<span>Save as draft</span>
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
Send
</button>
</div>
</div>
</form>
</div>

View File

@ -1,94 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'notice-compose',
templateUrl: './notice-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class NoticeComposeComponent 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'],
],
};
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<NoticeComposeComponent>,
private _formBuilder: FormBuilder
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
to: ['', [Validators.required, Validators.email]],
cc: ['', [Validators.email]],
bcc: ['', [Validators.email]],
subject: [''],
body: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ 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
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {}
}

View File

@ -1,65 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">로그인</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<fuse-alert
class="mt-8 -mb-4"
*ngIf="showAlert"
[appearance]="'outline'"
[showIcon]="false"
[type]="alert.type"
[@shake]="alert.type === 'error'"
>
{{ alert.message }}
</fuse-alert>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="signInComposeForm"
>
<!-- 아이디 -->
<mat-form-field>
<mat-label>아이디</mat-label>
<input matInput [formControlName]="'username'" />
<div class="copy-fields-toggles" matSuffix></div>
</mat-form-field>
<!-- 비밀번호 -->
<mat-form-field>
<mat-label>비밀번호</mat-label>
<input matInput [formControlName]="'password'" />
</mat-form-field>
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
style="align-items: center"
>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
취소
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
로그인
</button>
</div>
</div>
</form>
</div>

View File

@ -1,99 +0,0 @@
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({
selector: 'sign-in-compose',
templateUrl: './sign-in-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class SignInComposeComponent implements OnInit {
signInComposeForm!: FormGroup;
alert: { type: FuseAlertType; message: string } = {
type: 'success',
message: '로그인이 성공하였습니다.',
};
showAlert: boolean = false;
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<SignInComposeComponent>,
private _formBuilder: FormBuilder,
private _authService: AuthService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.signInComposeForm = this._formBuilder.group({
username: ['', [Validators.required]],
password: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Save and close
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {
// Return if the form is invalid
if (this.signInComposeForm?.invalid) {
return;
}
// Disable the form
this.signInComposeForm?.disable();
// Sign in
this._authService
.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.signInComposeForm?.enable();
// Reset the form
});
}
}

View File

@ -1,280 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">회원가입</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<fuse-alert
class="mt-8 -mb-4"
*ngIf="showAlert"
[appearance]="'outline'"
[showIcon]="false"
[type]="alert.type"
[@shake]="alert.type === 'error'"
>
{{ alert.message }}
</fuse-alert>
<div class="flex-auto p-6 sm:p-10">
<div class="max-w-3xl">
<div class="flex flex-col p-8 pt-0">
<!-- Compose form -->
<form
class="flex flex-col items-start overflow-y-auto"
[formGroup]="signupComposeForm"
>
<!-- 아이디 -->
<mat-form-field class="w-full mt-6">
<mat-label>추천인 코드</mat-label>
<input
matInput
[formControlName]="'referalCode'"
(focusout)="__checkReferrerCode($event)"
/>
<mat-error
*ngIf="
signupComposeForm?.get('referalCode')?.hasError('required')
"
>
추천인 코드는 필수 입력입니다.
</mat-error>
<mat-error
*ngIf="
signupComposeForm
?.get('referalCode')
?.hasError('notExistReferalCode')
"
>
추천인 코드는 필수 입력입니다.
</mat-error>
</mat-form-field>
<!-- Divider -->
<div class="w-full mt-8 mb-7 border-b"></div>
<div class="flex flex-col w-full">
<div class="flex items-center w-full mt-6">
<!-- Icon name -->
<mat-form-field class="w-1/2 pr-2">
<mat-label>아이디</mat-label>
<input
matInput
[formControlName]="'username'"
(focusout)="__checkUsernameDuplicate($event)"
/>
<mat-error
*ngIf="
signupComposeForm?.get('username')?.hasError('required')
"
>
아이디는 필수 입력입니다.
</mat-error>
<mat-error
*ngIf="
signupComposeForm
?.get('username')
?.hasError('usernameDuplicate')
"
>
아이디가 중복됩니다.
</mat-error>
</mat-form-field>
<!-- Icon color -->
<!-- 닉네임 -->
<mat-form-field class="w-1/2 pl-2">
<mat-label>닉네임</mat-label>
<input
matInput
[formControlName]="'nickname'"
(focusout)="__checkNickname($event)"
/>
<mat-error
*ngIf="
signupComposeForm?.get('nickname')?.hasError('required')
"
>
닉네임은 필수 입력입니다.
</mat-error>
<mat-error
*ngIf="
signupComposeForm
?.get('nickname')
?.hasError('nicknameDuplicate')
"
>
닉네임이 중복됩니다.
</mat-error>
</mat-form-field>
</div>
</div>
<div class="flex flex-col w-full">
<div class="flex items-center w-full mt-6">
<!-- 비밀번호 -->
<mat-form-field class="w-1/2 pr-2">
<mat-label>비밀번호</mat-label>
<input matInput [formControlName]="'password'" />
<mat-error
*ngIf="
signupComposeForm?.get('password')?.hasError('required')
"
>
비밀번호는 필수 입력입니다.
</mat-error>
</mat-form-field>
<!-- 비밀번호 확인 -->
<mat-form-field class="w-1/2 pl-2">
<mat-label>비밀번호 확인</mat-label>
<input matInput [formControlName]="'passwordConfirm'" />
<mat-error
*ngIf="
signupComposeForm
?.get('passwordConfirm')
?.hasError('required')
"
>
비밀번호 확인은 필수 입력입니다.
</mat-error>
<mat-error
*ngIf="
signupComposeForm
?.get('passwordConfirm')
?.hasError('passwordNotMatch')
"
>
비밀번호가 동일하지 않습니다.
</mat-error>
</mat-form-field>
</div>
</div>
<div class="flex flex-col w-full">
<div class="flex items-center w-full mt-6">
<!-- 출금비밀번호 -->
<mat-form-field class="w-1/2 pr-2">
<mat-label>출금비밀번호</mat-label>
<input matInput [formControlName]="'exchangePassword'" />
<mat-error
*ngIf="
signupComposeForm
?.get('exchangePassword')
?.hasError('required')
"
>
출금 비밀번호는 필수 입력입니다.
</mat-error>
</mat-form-field>
<!-- 전화번호 -->
<mat-form-field class="w-1/2 pl-2">
<mat-label>전화번호</mat-label>
<input matInput [formControlName]="'mobilePhoneNumber'" />
<mat-error
*ngIf="
signupComposeForm
?.get('mobilePhoneNumber')
?.hasError('required')
"
>
전화번호는 필수 입력입니다.
</mat-error>
</mat-form-field>
</div>
</div>
<div class="flex flex-col w-full">
<div class="flex items-center w-full mt-6">
<!-- 은행명 -->
<mat-form-field class="w-1/2 pr-2">
<mat-label>은행명</mat-label>
<mat-select
[formControlName]="'bankId'"
placeholder="은행 선택"
>
<mat-option *ngFor="let bank of banks" [value]="bank.getId()">
{{ bank.getName() }}
</mat-option>
<!-- <mat-option [value]="'0'"> 국민은행 </mat-option> -->
</mat-select>
<mat-error
*ngIf="signupComposeForm?.get('bankId')?.hasError('required')"
>
은행명은 필수 입력입니다.
</mat-error>
</mat-form-field>
<!-- 계좌번호 -->
<mat-form-field class="w-1/2 pl-2">
<mat-label>계좌번호</mat-label>
<input matInput [formControlName]="'accountNumber'" />
<mat-error
*ngIf="
signupComposeForm
?.get('accountNumber')
?.hasError('required')
"
>
계좌번호는 필수 입력입니다.
</mat-error>
</mat-form-field>
</div>
</div>
<div class="flex flex-col w-full">
<div class="flex items-center w-full mt-6">
<!-- 예금주 -->
<mat-form-field class="w-1/2 pr-2">
<mat-label>예금주</mat-label>
<input matInput [formControlName]="'accountHolder'" />
<mat-error
*ngIf="
signupComposeForm
?.get('accountHolder')
?.hasError('required')
"
>
예금주는 필수 입력입니다.
</mat-error>
</mat-form-field>
</div>
</div>
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
style="align-items: center"
>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button
class="ml-auto sm:ml-0"
mat-stroked-button
(click)="discard()"
>
취소
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
[disabled]="isSendDisable"
>
회원가입
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

View File

@ -1,226 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import {
AbstractControl,
FormBuilder,
FormGroup,
ValidatorFn,
Validators,
} from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { fuseAnimations } from '@fuse/animations';
import { FuseAlertType } from '@fuse/components/alert';
import { BankService } from 'app/modules/polyglot/bank/services/bank.service';
import { IdentityService } from 'app/modules/polyglot/identity/services/identity.service';
import { MemberService } from 'app/modules/polyglot/member/services/member.service';
import { MemberReferrerService } from 'app/modules/polyglot/member_referrer/services/member_referrer.service';
import {
CreateMemberRequest,
CreateMemberResponse,
} from 'app/modules/proto/c2se/member_pb';
import { Bank } from 'app/modules/proto/models/bank_pb';
@Component({
selector: 'sign-up-compose',
templateUrl: './sign-up-compose.component.html',
encapsulation: ViewEncapsulation.None,
animations: fuseAnimations,
})
export class SignUpComposeComponent implements OnInit {
signupComposeForm!: FormGroup;
isSendDisable = false;
banks!: Bank[];
alert: { type: FuseAlertType; message: string } = {
type: 'success',
message: '등록이 성공하였습니다.',
};
showAlert: boolean = false;
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<SignUpComposeComponent>,
private _formBuilder: FormBuilder,
private _identityService: IdentityService,
private _memberService: MemberService,
private _memberReferrerService: MemberReferrerService,
private _bankService: BankService
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
this._bankService
.listBanks()
.then((result) => {
this.banks = result.getBanksList();
})
.catch((reson) => console.log(reson));
// Create the form
this.signupComposeForm = this._formBuilder.group({
referalCode: ['maejang0lvl1', [Validators.required]],
username: ['', [Validators.required]],
nickname: ['', Validators.required],
password: ['1234', [Validators.required]],
passwordConfirm: [
'1234',
[Validators.required, this.checkSameForPassword()],
],
exchangePassword: ['1234', [Validators.required]],
mobilePhoneNumber: ['01012345678', [Validators.required]],
bankId: ['', [Validators.required]],
accountNumber: ['123123123', [Validators.required]],
accountHolder: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ Public methods
// -----------------------------------------------------------------------------------------------------
/**
* Save and close
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {
if (!this.signupComposeForm?.valid) {
return;
}
this.isSendDisable = true;
const {
referalCode,
username,
nickname,
password,
passwordConfirm,
exchangePassword,
mobilePhoneNumber,
bankId,
accountNumber,
accountHolder,
} = this.signupComposeForm?.value;
let bank_account = new CreateMemberRequest.BankAccount();
bank_account.setBankId(bankId);
bank_account.setName(accountHolder);
bank_account.setAccountNumber(accountNumber);
bank_account.setExchangePassword(exchangePassword);
const member = new CreateMemberRequest();
member.setSiteId('d7cbae26-53b6-4cb1-85a4-66b956cbe1d4');
member.setUsername(username);
member.setPassword(password);
member.setMemberClassId('4598f07a-86d1-42a4-b038-25706683a7cd');
member.setMemberLevelId('c56231ac-2120-4a81-a30a-5d41fafb6c57');
member.setReferrerMemberUsername(referalCode);
member.setNickname(nickname);
member.setMobilePhoneNumber(mobilePhoneNumber);
member.setBankAccount(bank_account);
this._memberService
.createMember(member)
.then((res: CreateMemberResponse.Result) => {
console.log(res.getMember());
this.showAlert = true;
})
.catch((e) => {
this.showAlert = true;
this.alert = { type: 'error', message: '등록에 실패하였습니다.' };
})
.finally(() => setTimeout(() => this.close(), 5000));
}
__checkReferrerCode(event: FocusEvent): void {
const code = this.signupComposeForm.get('referalCode')?.value;
this._memberReferrerService.getMemberReferrerByCode(code).then((result) => {
if (!result) {
this.signupComposeForm
?.get('referalCode')
?.setErrors({ notExistReferalCode: true });
}
});
}
__checkUsernameDuplicate(event: FocusEvent): void {
const username = this.signupComposeForm?.get('username')?.value;
// console.log(event, '::', username);
this._identityService
.checkUsernameForDuplication(username)
.then((isUse: boolean) => {
if (!!isUse) {
this.signupComposeForm
?.get('username')
?.setErrors({ usernameDuplicate: true });
}
// this._changeDetectorRef.markForCheck();
});
}
__checkNickname(event: FocusEvent): void {
const nickname = this.signupComposeForm?.get('nickname')?.value;
this._identityService
.checkNicknameForDuplication(nickname)
.then((isUse: boolean) => {
if (!!isUse) {
this.signupComposeForm
?.get('nickname')
?.setErrors({ nicknameDuplicate: true });
}
// this._changeDetectorRef.markForCheck();
});
}
close(): void {
this.matDialogRef.close({
choice: true,
});
}
private checkSameForPassword(): ValidatorFn {
return (control: AbstractControl): { [key: string]: any } | null => {
if (!control || !control.value || control.value === '') {
return null;
}
const password = this.signupComposeForm?.get('password')?.value as string;
const passwordConfirm = control.value as string;
if (password !== passwordConfirm) {
return { passwordNotMatch: true };
}
return null;
};
}
}

View File

@ -1,123 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">Withdraw</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
>
<!-- To -->
<mat-form-field>
<mat-label>To</mat-label>
<input matInput [formControlName]="'to'" />
<div class="copy-fields-toggles" matSuffix>
<span
class="text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.cc"
(click)="showCopyField('cc')"
>
Cc
</span>
<span
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.bcc"
(click)="showCopyField('bcc')"
>
Bcc
</span>
</div>
</mat-form-field>
<!-- Cc -->
<mat-form-field *ngIf="copyFields.cc">
<mat-label>Cc</mat-label>
<input matInput [formControlName]="'cc'" />
</mat-form-field>
<!-- Bcc -->
<mat-form-field *ngIf="copyFields.bcc">
<mat-label>Bcc</mat-label>
<input matInput [formControlName]="'bcc'" />
</mat-form-field>
<!-- Subject -->
<mat-form-field>
<mat-label>Subject</mat-label>
<input matInput [formControlName]="'subject'" />
</mat-form-field>
<!-- Body -->
<!-- <quill-editor
class="mt-2"
[formControlName]="'body'"
[modules]="quillModules"
></quill-editor> -->
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
>
<div class="-ml-2">
<!-- Attach file -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:paper-clip'"
></mat-icon>
</button>
<!-- Insert link -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:link'"
></mat-icon>
</button>
<!-- Insert emoji -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:emoji-happy'"
></mat-icon>
</button>
<!-- Insert image -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:photograph'"
></mat-icon>
</button>
</div>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
Discard
</button>
<!-- Save as draft -->
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
<span>Save as draft</span>
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
Send
</button>
</div>
</div>
</form>
</div>

View File

@ -1,94 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'withdraw-compose',
templateUrl: './withdraw-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class WithdrawComposeComponent 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'],
],
};
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<WithdrawComposeComponent>,
private _formBuilder: FormBuilder
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
to: ['', [Validators.required, Validators.email]],
cc: ['', [Validators.email]],
bcc: ['', [Validators.email]],
subject: [''],
body: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ 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
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {}
}

View File

@ -1,123 +0,0 @@
<div class="flex flex-col max-w-240 md:min-w-160 max-h-screen -m-6">
<!-- Header -->
<div
class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary"
>
<div class="text-lg font-medium">Withdraw History</div>
<button mat-icon-button (click)="saveAndClose()" [tabIndex]="-1">
<mat-icon
class="text-current"
[svgIcon]="'heroicons_outline:x'"
></mat-icon>
</button>
</div>
<!-- Compose form -->
<form
class="flex flex-col flex-auto p-6 sm:p-8 overflow-y-auto"
[formGroup]="composeForm"
>
<!-- To -->
<mat-form-field>
<mat-label>To</mat-label>
<input matInput [formControlName]="'to'" />
<div class="copy-fields-toggles" matSuffix>
<span
class="text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.cc"
(click)="showCopyField('cc')"
>
Cc
</span>
<span
class="ml-2 text-sm font-medium cursor-pointer select-none hover:underline"
*ngIf="!copyFields.bcc"
(click)="showCopyField('bcc')"
>
Bcc
</span>
</div>
</mat-form-field>
<!-- Cc -->
<mat-form-field *ngIf="copyFields.cc">
<mat-label>Cc</mat-label>
<input matInput [formControlName]="'cc'" />
</mat-form-field>
<!-- Bcc -->
<mat-form-field *ngIf="copyFields.bcc">
<mat-label>Bcc</mat-label>
<input matInput [formControlName]="'bcc'" />
</mat-form-field>
<!-- Subject -->
<mat-form-field>
<mat-label>Subject</mat-label>
<input matInput [formControlName]="'subject'" />
</mat-form-field>
<!-- Body -->
<!-- <quill-editor
class="mt-2"
[formControlName]="'body'"
[modules]="quillModules"
></quill-editor> -->
<!-- Actions -->
<div
class="flex flex-col sm:flex-row sm:items-center justify-between mt-4 sm:mt-6"
>
<div class="-ml-2">
<!-- Attach file -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:paper-clip'"
></mat-icon>
</button>
<!-- Insert link -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:link'"
></mat-icon>
</button>
<!-- Insert emoji -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:emoji-happy'"
></mat-icon>
</button>
<!-- Insert image -->
<button mat-icon-button>
<mat-icon
class="icon-size-5"
[svgIcon]="'heroicons_solid:photograph'"
></mat-icon>
</button>
</div>
<div class="flex items-center mt-4 sm:mt-0">
<!-- Discard -->
<button class="ml-auto sm:ml-0" mat-stroked-button (click)="discard()">
Discard
</button>
<!-- Save as draft -->
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
<span>Save as draft</span>
</button>
<!-- Send -->
<button
class="order-first sm:order-last"
mat-flat-button
[color]="'primary'"
(click)="send()"
>
Send
</button>
</div>
</div>
</form>
</div>

View File

@ -1,94 +0,0 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
@Component({
selector: 'withdraw-history-compose',
templateUrl: './withdraw-history-compose.component.html',
encapsulation: ViewEncapsulation.None,
})
export class WithdrawHistoryComposeComponent 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'],
],
};
/**
* Constructor
*/
constructor(
public matDialogRef: MatDialogRef<WithdrawHistoryComposeComponent>,
private _formBuilder: FormBuilder
) {}
// -----------------------------------------------------------------------------------------------------
// @ Lifecycle hooks
// -----------------------------------------------------------------------------------------------------
/**
* On init
*/
ngOnInit(): void {
// Create the form
this.composeForm = this._formBuilder.group({
to: ['', [Validators.required, Validators.email]],
cc: ['', [Validators.email]],
bcc: ['', [Validators.email]],
subject: [''],
body: ['', [Validators.required]],
});
}
// -----------------------------------------------------------------------------------------------------
// @ 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
*/
saveAndClose(): void {
// Save the message as a draft
this.saveAsDraft();
// Close the dialog
this.matDialogRef.close();
}
/**
* Discard the message
*/
discard(): void {}
/**
* Save the message as a draft
*/
saveAsDraft(): void {}
/**
* Send the message
*/
send(): void {}
}

View File

@ -1,14 +1,14 @@
import { Component, ViewEncapsulation } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { CompComposeComponent } from './compose/comp-compose.component';
import { CustomerComposeComponent } from './compose/customer-compose.component';
import { DepositComposeComponent } from './compose/deposit-compose.component';
import { DepositHistoryComposeComponent } from './compose/deposit-history-compose.component';
import { NoticeComposeComponent } from './compose/notice-compose.component';
import { SignInComposeComponent } from './compose/sign-in-compose.component';
import { SignUpComposeComponent } from './compose/sign-up-compose.component';
import { WithdrawComposeComponent } from './compose/withdraw-compose.component';
import { WithdrawHistoryComposeComponent } from './compose/withdraw-history-compose.component';
import { CompComposeComponent } from 'app/modules/beteran/compose/compose/comp-compose.component';
import { CustomerComposeComponent } from 'app/modules/beteran/compose/compose/customer-compose.component';
import { DepositComposeComponent } from 'app/modules/beteran/compose/compose/deposit-compose.component';
import { DepositHistoryComposeComponent } from 'app/modules/beteran/compose/compose/deposit-history-compose.component';
import { NoticeComposeComponent } from 'app/modules/beteran/compose/compose/notice-compose.component';
import { SignInComposeComponent } from 'app/modules/beteran/compose/compose/sign-in-compose.component';
import { SignUpComposeComponent } from 'app/modules/beteran/compose/compose/sign-up-compose.component';
import { WithdrawComposeComponent } from 'app/modules/beteran/compose/compose/withdraw-compose.component';
import { WithdrawHistoryComposeComponent } from 'app/modules/beteran/compose/compose/withdraw-history-compose.component';
export enum ComposeMenuType {
signin = 'signin',

View File

@ -15,7 +15,7 @@ import { MainComponent } from 'app/modules/user/main/main.component';
import { FuseAlertModule } from '@fuse/components/alert';
import { COMPOSE } from './compose';
import { ComposeModule } from 'app/modules/beteran/compose/compose.module';
const mainRoutes: Route[] = [
{
@ -25,7 +25,7 @@ const mainRoutes: Route[] = [
];
@NgModule({
declarations: [MainComponent, COMPOSE],
declarations: [MainComponent],
imports: [
RouterModule.forChild(mainRoutes),
MatButtonModule,
@ -39,6 +39,8 @@ const mainRoutes: Route[] = [
SharedModule,
FuseAlertModule,
ComposeModule,
],
})
export class MainModule {}