Skip to content

Commit

Permalink
Pequeno ajuste na tela Meus pedidos.
Browse files Browse the repository at this point in the history
  • Loading branch information
Raffaello Damgaard committed May 3, 2021
1 parent 962bdc6 commit a011f19
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/app/components/book/requesteds/requesteds.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export class RequestedsComponent implements OnInit, OnDestroy {
map(requestedBooks => {
requestedBooks.items.map(item => {
const badgeColor = this.getBadgeColor(item.status);
item.statusCode = item.status;
item.status = this.addBadgeToStatusColumn(badgeColor, item.status);

});

return requestedBooks;
Expand All @@ -43,8 +45,8 @@ export class RequestedsComponent implements OnInit, OnDestroy {

private inicializarTabela() {
const btnShowUserBookInfo =
'<span class="btn btn-light btn-sm ml-1 mb-1" data-toggle="tooltip" title="Informações de Usuários">' +
' <i class="fa fa-users"></i> </span>';
'<span class="btn btn-light btn-sm ml-1 mb-1" data-toggle="tooltip" title="Ver doador">' +
' <i class="fa fa-user"></i> </span>';

this.tableSettings = {
columns: {
Expand Down Expand Up @@ -104,6 +106,17 @@ export class RequestedsComponent implements OnInit, OnDestroy {
}

onCustomActionColum(event) {

if (event.data.statusCode === BookRequestStatus.AWAITING_ACTION) {
alert('Por favor aguarde a decisão do doador.');
return;
}

if (event.data.statusCode === BookRequestStatus.REFUSED) {
alert('Você não é o ganhador desse livro. =/');
return;
}

const modalRef = this._modalService.open(DonorModalComponent, {
backdropClass: 'light-blue-backdrop',
centered: true,
Expand Down
2 changes: 2 additions & 0 deletions src/app/core/models/MyRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export class MyRequest {
title?: string;
author?: string;
status?: string;
statusCode: string;
bookStatus?: string;
trackingNumber?: string;
bookId?: string;
Expand All @@ -24,6 +25,7 @@ export class MyRequest {
title: '',
author: '',
status: '',
statusCode: '',
bookStatus: '',
trackingNumber: '',
bookId: '',
Expand Down

0 comments on commit a011f19

Please sign in to comment.