Skip to content

Commit

Permalink
Merge pull request #167 from wantero/master
Browse files Browse the repository at this point in the history
Ajustes Facilitador
  • Loading branch information
raffacabofrio authored Dec 29, 2018
2 parents 064652d + dd1fda6 commit 6c1785a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/app/components/book/form/form.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class FormComponent implements OnInit {
title: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(200)]],
author: ['', [Validators.required, Validators.minLength(3), Validators.maxLength(200)]],
categoryId: ['', [Validators.required]],
userIdFacilitator: ['', [Validators.required]],
userIdFacilitator: [''],
userId: ['', [Validators.required]],
freightOption: ['', [Validators.required]],
imageBytes: [''],
Expand Down Expand Up @@ -121,7 +121,7 @@ export class FormComponent implements OnInit {
title: x.title,
author: x.author,
categoryId: x.categoryId,
userIdFacilitator: x.userIdFacilitator,
userIdFacilitator: !!x.userIdFacilitator ? x.userIdFacilitator : null,
userId: x.userId,
freightOption: x.freightOption,
imageBytes: '',
Expand All @@ -131,6 +131,7 @@ export class FormComponent implements OnInit {
imageSlug: x.imageSlug,
synopsis: !!x.synopsis ? x.synopsis : ''
};
this.formGroup.get('userIdFacilitator').setValidators([Validators.required]); // Facilitador obrigatório para edição do admin
this.formGroup.setValue(bookForUpdate);
}
);
Expand Down
12 changes: 9 additions & 3 deletions src/app/components/book/list/list.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,25 @@ export class ListComponent implements OnInit {
author: {
title: 'Autor',
filter: false,
width: '20%'
width: '15%'
},
donor: {
title: 'Doador',
valuePrepareFunction: data => data ? data : '',
filter: false,
width: '20%'
width: '15%'
},
phoneDonor: {
title: 'Telefone',
valuePrepareFunction: data => data ? data : '',
filter: false,
width: '20%'
width: '15%'
},
facilitator: {
title: 'Facilitador',
valuePrepareFunction: data => data ? data : '',
filter: false,
width: '15%'
},
approved: {
title: 'Visível',
Expand Down

0 comments on commit 6c1785a

Please sign in to comment.