Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 71 additions & 4 deletions frontend/main/src/app/carriers/carriers.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,27 +94,94 @@ <h2 class="text-uppercase">New Carrier</h2>

<table class="table table-bordered">
<thead>

<th>Item</th>
<th>Carrier name</th>
<th>Tax of transport</th>
<th>E-mail</th>
<th>Cnpj</th>
<th>Action</th>


</thead>
<tbody>
<tr *ngFor="let carrier of carriers;let i = index;">

<td>{{i+1}}</td>
<td>{{carrier.razao}}</td>
<td>{{carrier.taxa}}</td>
<td>{{carrier.email}}</td>
<td>{{carrier.cnpj}}</td>
<td>
<button class="btn btn-danger mr-2" (click)="deletar(carrier.id)">Delet</button>
<button class="btn btn-primary mr-2" (click)="alterar()">Edit</button>


<button class="btn btn-primary" (click)="openModalEdit()">Edit</button>

<div class="portfolio-modal modal fade show" id="modal3" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="close-modal" data-bs-dismiss="modal"><img src="" alt="" /></div>
<div class="container">
<div class="row">
<div class="col-lg-8">
<div class="modal-body">
<h2 class="text-uppercase">Edit Carrier</h2>
<p class="item-intro text-muted">Change the information below!</p>
<!-- <img class="img-fluid d-block mx-auto" src="assets/img/portfolio/2.jpg" alt="..." /> -->
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="razao" class="form-control"
razao="Razao" required tabindex="1">
</div>
<br>
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="taxa" class="form-control" taxa="Taxa"
required tabindex="1">
</div>
<br>
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="email" class="form-control"
email="E-mail" required tabindex="1">
</div>
<br>
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="cnpj" class="form-control" cnpj="CNPJ"
required tabindex="1">
</div>

<br>
<button class="btn btn-primary btn-xl text-uppercase"
data-bs-dismiss="modal" type="button" (click)="closeModalEdit()"
(click)="alterar()">
<i class="fas fa-xmark me-1"></i>
Save
</button>

<button class="btn btn-danger btn-xl text-uppercase "
data-bs-dismiss="modal" type="button" (click)="closeModalEdit()">
<i class="fas fa-xmark me-1"></i>
Close
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>





</td>

</tr>
Expand Down
23 changes: 23 additions & 0 deletions frontend/main/src/app/carriers/carriers.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,29 @@ export class CarriersComponent implements OnInit {

}


openModalEdit(){

var modal = document.getElementById('modal3')

modal?.setAttribute('style', 'display:block;')

modal?.setAttribute('class', 'portfolio-modal modal fade show')
modal?.removeAttribute('aria-hidden')

modal?.setAttribute('arial-modal', 'true')

}

closeModalEdit(){
var modal = document.getElementById('modal3')

modal?.setAttribute('class', 'portfolio-modal modal fade')
setTimeout(()=>{
modal?.setAttribute('style', 'display:none;')
},500)

}


}
4 changes: 2 additions & 2 deletions frontend/main/src/app/rct-qt/rct-qt.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ export class RctQtComponent implements OnInit {
console.log(id);


this.http.delete('http://localhost:8080/quote/recent/'+id)
this.http.delete('http://localhost:8080/quote/recent/'+id).subscribe();

setTimeout(()=>{
this.succeed = id
setTimeout(() => {
this.ngOnInit()
}, 2000);
}, 3000);
}, 1500)

}
Expand Down
70 changes: 69 additions & 1 deletion frontend/main/src/app/users/users.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,75 @@ <h2 class="text-uppercase">New User</h2>
<td>{{user.birth}}</td>
<td>
<button class="btn btn-danger mr-2" (click)="deletar(user.id)">Delet</button>
<button class="btn btn-primary mr-2" (click)="alterar()">Edit</button>


<button class="btn btn-primary" (click)="openModalEdit()">Edit</button>

<div class="portfolio-modal modal fade show" id="modal3" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="close-modal" data-bs-dismiss="modal"><img src="" alt="" /></div>
<div class="container">
<div class="row">
<div class="col-lg-8">
<div class="modal-body">
<h2 class="text-uppercase">Edit User</h2>
<p class="item-intro text-muted">Change the information below!</p>
<!-- <img class="img-fluid d-block mx-auto" src="assets/img/portfolio/2.jpg" alt="..." /> -->
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="name" class="form-control" name="Nome"
required tabindex="1">
</div>
<br>
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="email" class="form-control" email="E-mail"
required tabindex="1">
</div>
<br>
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="document" class="form-control" document="CPF"
required tabindex="1">
</div>
<br>
<div class="input-group" style="width: 100%;">
<span class="input-group-text"
style="border-radius: 5px; border-right: 10px;">🧑🏽‍💻</span>
<input type="text" [(ngModel)]="birth" class="form-control" birth="Data"
required tabindex="1">
</div>

<br>
<button class="btn btn-primary btn-xl text-uppercase" data-bs-dismiss="modal" type="button"
(click)="closeModalEdit()"
(click)="alterar()">
<i class="fas fa-xmark me-1"></i>
Save
</button>

<button class="btn btn-danger btn-xl text-uppercase " data-bs-dismiss="modal" type="button"
(click)="closeModalEdit()">
<i class="fas fa-xmark me-1"></i>
Close
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>






</td>
</tr>
</tbody>
Expand Down
23 changes: 23 additions & 0 deletions frontend/main/src/app/users/users.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,29 @@ id!: number
},500)

}

openModalEdit(){

var modal = document.getElementById('modal3')

modal?.setAttribute('style', 'display:block;')

modal?.setAttribute('class', 'portfolio-modal modal fade show')
modal?.removeAttribute('aria-hidden')

modal?.setAttribute('arial-modal', 'true')

}

closeModalEdit(){
var modal = document.getElementById('modal3')

modal?.setAttribute('class', 'portfolio-modal modal fade')
setTimeout(()=>{
modal?.setAttribute('style', 'display:none;')
},500)

}


}