diff --git a/src/app/main/content/apps/mail/dialogs/compose/compose.component.html b/src/app/main/content/apps/mail/dialogs/compose/compose.component.html new file mode 100644 index 00000000..9f8be19d --- /dev/null +++ b/src/app/main/content/apps/mail/dialogs/compose/compose.component.html @@ -0,0 +1,108 @@ + +
+ New Message + +
+
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ attachment-2.doc + (12 Kb) +
+ + +
+ +
+
+ attachment-1.jpg + (350 Kb) +
+ + +
+
+
+
+ +
+
+ + + +
+ + +
diff --git a/src/app/main/content/apps/mail/dialogs/compose/compose.component.scss b/src/app/main/content/apps/mail/dialogs/compose/compose.component.scss new file mode 100644 index 00000000..57edea45 --- /dev/null +++ b/src/app/main/content/apps/mail/dialogs/compose/compose.component.scss @@ -0,0 +1,33 @@ +:host { + display: flex; + flex-direction: column; +} + +.mail-compose-dialog { + .mat-dialog-container { + padding: 0; + max-width: 720px; + width: 720px; + + .attachment-list { + font-size: 13px; + padding-top: 16px; + + .attachment { + background-color: rgba(0, 0, 0, 0.08); + border: 1px solid rgba(0, 0, 0, 0.16); + padding-left: 16px; + margin-top: 8px; + border-radius: 2px; + + .filename { + font-weight: 500; + } + + &:last-child { + margin-bottom: 0; + } + } + } + } +} diff --git a/src/app/main/content/apps/mail/dialogs/compose/compose.component.ts b/src/app/main/content/apps/mail/dialogs/compose/compose.component.ts new file mode 100644 index 00000000..050b54e4 --- /dev/null +++ b/src/app/main/content/apps/mail/dialogs/compose/compose.component.ts @@ -0,0 +1,42 @@ +import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core'; +import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material'; +import { FormControl, FormGroup } from '@angular/forms'; + +@Component({ + selector : 'fuse-mail-compose', + templateUrl : './compose.component.html', + styleUrls : ['./compose.component.scss'], + encapsulation: ViewEncapsulation.None +}) +export class MailComposeDialogComponent implements OnInit +{ + composeForm: FormGroup; + + constructor( + public dialogRef: MdDialogRef, + @Inject(MD_DIALOG_DATA) private data: any + ) + { + this.composeForm = this.createComposeForm(); + } + + ngOnInit() + { + } + + createComposeForm() + { + return new FormGroup({ + from : new FormControl({ + value : 'johndoe@creapond.com', + disabled: true + }), + to : new FormControl(''), + cc : new FormControl(''), + bcc : new FormControl(''), + subject: new FormControl(''), + message: new FormControl('') + }); + } + +} diff --git a/src/app/main/content/apps/mail/mail.module.ts b/src/app/main/content/apps/mail/mail.module.ts index 36765edf..ed53bc99 100644 --- a/src/app/main/content/apps/mail/mail.module.ts +++ b/src/app/main/content/apps/mail/mail.module.ts @@ -7,6 +7,7 @@ import { MailListItemComponent } from './mail-list/mail-list-item/mail-list-item import { MailListComponent } from './mail-list/mail-list.component'; import { MailDetailsComponent } from './mail-details/mail-details.component'; import { MailService } from './mail.service'; +import { MailComposeDialogComponent } from './dialogs/compose/compose.component'; const routes: Routes = [ { @@ -58,20 +59,22 @@ const routes: Routes = [ ]; @NgModule({ - declarations: [ + declarations : [ MailComponent, MailListComponent, MailListItemComponent, MailDetailsComponent, - MainSidenavComponent + MainSidenavComponent, + MailComposeDialogComponent ], - imports : [ + imports : [ SharedModule, RouterModule.forChild(routes) ], - providers : [ + providers : [ MailService - ] + ], + entryComponents: [MailComposeDialogComponent] }) export class FuseMailModule { diff --git a/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.html b/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.html index f28c856a..e47e329e 100644 --- a/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.html +++ b/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.html @@ -22,6 +22,15 @@
+
+ +
+
- \ No newline at end of file + diff --git a/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.scss b/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.scss index 0c805a2e..947e4fba 100644 --- a/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.scss +++ b/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.scss @@ -21,4 +21,9 @@ width: 100%; } } + .content { + + .compose-dialog-button { + } + } } diff --git a/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.ts b/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.ts index 7a5ffae0..756b99c5 100644 --- a/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.ts +++ b/src/app/main/content/apps/mail/sidenavs/main/main-sidenav.component.ts @@ -1,6 +1,9 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { MailService } from '../../mail.service'; import { Subscription } from 'rxjs/Subscription'; +import { MailComposeDialogComponent } from '../../dialogs/compose/compose.component'; +import { MdDialog } from '@angular/material'; +import { FormGroup } from '@angular/forms'; @Component({ selector : 'fuse-mail-main-sidenav', @@ -14,13 +17,15 @@ export class MainSidenavComponent implements OnInit, OnDestroy labels: any[]; accounts: object; selectedAccount: string; + dialogRef: any; onFoldersChanged: Subscription; onFiltersChanged: Subscription; onLabelsChanged: Subscription; constructor( - private mailService: MailService + private mailService: MailService, + public dialog: MdDialog ) { // Data @@ -53,6 +58,37 @@ export class MainSidenavComponent implements OnInit, OnDestroy }); } + composeDialog() + { + this.dialogRef = this.dialog.open(MailComposeDialogComponent, { + panelClass: 'mail-compose-dialog' + }); + this.dialogRef.afterClosed() + .subscribe(response => { + if ( !response ) + { + return; + } + const actionType: string = response[0]; + const formData: FormGroup = response[1]; + switch ( actionType ) + { + /** + * Send + */ + case 'send': + console.log('new Mail', formData.getRawValue()); + break; + /** + * Delete + */ + case 'delete': + console.log('delete Mail'); + break; + } + }); + } + ngOnDestroy() { this.onFoldersChanged.unsubscribe(); diff --git a/src/app/main/content/apps/todo/sidenavs/main/main-sidenav.component.html b/src/app/main/content/apps/todo/sidenavs/main/main-sidenav.component.html index bf652a66..685fc6cd 100644 --- a/src/app/main/content/apps/todo/sidenavs/main/main-sidenav.component.html +++ b/src/app/main/content/apps/todo/sidenavs/main/main-sidenav.component.html @@ -22,8 +22,8 @@
-
-