diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 2909bbd..1512034 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -15,6 +15,7 @@ import { MdSnackBarModule, MdListModule, MdIconModule, + MdProgressSpinnerModule, } from '@angular/material'; import { AppComponent } from './app.component'; @@ -54,6 +55,7 @@ import { Keyobject } from './pipes'; MdSnackBarModule, MdListModule, MdIconModule, + MdProgressSpinnerModule, // App Modules HeaderModule, AppRoutingModule, diff --git a/src/app/board-page/board-page.component.css b/src/app/board-page/board-page.component.css index bda6794..0a29830 100644 --- a/src/app/board-page/board-page.component.css +++ b/src/app/board-page/board-page.component.css @@ -37,9 +37,8 @@ md-list-item.color-1 { } .cards-column-title { display: flex; - flex-direction: row; - align-items: center; font-size: 40px; + justify-content: center; font-family: WhateverItTakes, helvetica; } @@ -124,6 +123,13 @@ md-list-item.color-1 { margin-right: -20px; } +.loading-spinner { + width: 26px; + height: 26px; + margin-left: 4px; + display: inline-block; +} + @media only screen and (min-device-width: 768px) and (-webkit-min-device-pixel-ratio: 1) { diff --git a/src/app/board-page/board-page.component.html b/src/app/board-page/board-page.component.html index 58f5c8c..f6b5c70 100644 --- a/src/app/board-page/board-page.component.html +++ b/src/app/board-page/board-page.component.html @@ -1,12 +1,12 @@
-

{{board?.name}}

+

{{ boardName }}

- {{column.title}} - {{cardEmoticon(column.title)}} + {{ column.title }} + {{ cardEmoticon(column.title) }}
{{board?.name}} + mdTextareaAutosize> + @@ -48,7 +51,9 @@

{{board?.name}}

- Invite more collaborators to this board: + + Invite more collaborators to this board: +
{{board?.name}} + [disabled]="!collaboratorsForm.valid || sendingInvite" + color="accent"> + Invite + +
diff --git a/src/app/board-page/board-page.component.ts b/src/app/board-page/board-page.component.ts index 44f860f..b65e4ee 100644 --- a/src/app/board-page/board-page.component.ts +++ b/src/app/board-page/board-page.component.ts @@ -28,8 +28,10 @@ export class BoardPageComponent implements OnInit { boardID: string; boardName: string; board: FirebaseListObservable; + boardObj: FirebaseObjectObservable; columns: FirebaseListObservable; collaboratorsForm: FormGroup; + sendingInvite: boolean; constructor( private fireBase: FirebaseService, @@ -44,16 +46,14 @@ export class BoardPageComponent implements OnInit { ngOnInit() { this.route.params - .switchMap((params: Params) => { - this.boardID = params['id']; - return this.fireBase.getBoardObject(this.boardID); - }) - .subscribe((res: IBoardObj) => { + .subscribe((res: {id: string}) => { + this.boardID = res.id; this.board = this.fireBase.getBoard(this.boardID); this.columns = this.fireBase.getBoard(`${this.boardID}/columns`); + this.boardObj = this.fireBase.getBoardObject(this.boardID); }); - this.fireBase.getBoardObject(this.boardID) + this.boardObj .subscribe((res: IBoardObj) => { this.boardName = res.name; }); @@ -125,6 +125,8 @@ export class BoardPageComponent implements OnInit { html: html, }; + self.sendingInvite = true; + const headers = new Headers({ 'Content-Type': 'application/json' }); // Set content type to JSON const options = new RequestOptions({ headers: headers }); // Create a request option @@ -142,7 +144,7 @@ export class BoardPageComponent implements OnInit { ); self.collaboratorsForm.reset(); - + self.sendingInvite = false; self.snackBar.open('Your message has been correctly delivered.', null, { duration: 6000 }); } else { self.errorHandler(); @@ -163,6 +165,8 @@ export class BoardPageComponent implements OnInit { } errorHandler(): Observable { + this.sendingInvite = false; + this.snackBar.open(`Is not possible to send the email at the moment. Please, try again later or contact the support.`, null, { duration: 6000 });