Skip to content

Commit 9db07be

Browse files
committed
fix: TT-29 Warn-of-unsaved-changes-on-customer-page
1 parent 597c66e commit 9db07be

File tree

2 files changed

+18
-31
lines changed

2 files changed

+18
-31
lines changed
Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
<div class="table-responsive-sm">
2-
<table
3-
*ngIf="customers"
4-
class="table table-bordered table-striped mb-0"
5-
datatable
6-
[dtTrigger]="dtTrigger"
7-
[dtOptions]="dtOptions"
8-
>
2+
<table *ngIf="customers" class="table table-bordered table-striped mb-0" datatable [dtTrigger]="dtTrigger"
3+
[dtOptions]="dtOptions">
94
<thead class="thead-blue">
105
<tr class="d-flex">
116
<th class="col-5 text-center">Customer ID</th>
@@ -19,20 +14,11 @@
1914
<td class="col-5 text-break">{{ customer.id }}</td>
2015
<td class="col-3 text-break">{{ customer.name }}</td>
2116
<td class="col-4 text-center">
22-
<button
23-
(click)="editCustomer(customer.id)"
24-
type="button"
25-
class="btn btn-sm btn-primary"
26-
>
17+
<button (click)="editCustomer(customer.id)" type="button" class="btn btn-sm btn-primary">
2718
<i class="fa fa-pencil fa-xs"></i>
2819
</button>
29-
<button
30-
data-toggle="modal"
31-
data-target="#deleteModal"
32-
(click)="openModal(customer)"
33-
type="button"
34-
class="btn btn-sm btn-danger ml-2"
35-
>
20+
<button data-toggle="modal" data-target="#deleteModal" (click)="openModal(customer)" type="button"
21+
class="btn btn-sm btn-danger ml-2">
3622
<i class="fa fa-trash-alt fa-xs"></i>
3723
</button>
3824
</td>
@@ -41,15 +27,6 @@
4127
</table>
4228
</div>
4329

44-
<app-dialog
45-
*ngIf="showModal"
46-
class="modal fade"
47-
id="deleteModal"
48-
tabindex="-1"
49-
role="dialog"
50-
aria-hidden="true"
51-
[title]="'Delete Customer'"
52-
[body]="message"
53-
(closeModalEvent)="deleteCustomer()"
54-
>
30+
<app-dialog *ngIf="showModal" class="modal fade" id="deleteModal" tabindex="-1" role="dialog" aria-hidden="true"
31+
[title]="'Delete Customer'" [body]="message" (closeModalEvent)="deleteCustomer()">
5532
</app-dialog>

src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import {
1313
} from './../../../../store/customer-management.actions';
1414
import { ResetProjectToEdit } from '../../../projects/components/store/project.actions';
1515
import { ResetProjectTypeToEdit } from '../../../projects-type/store';
16+
//import { EntryState } from 'src/app/modules/time-clock/store/entry.reducer';
17+
//import { ConsoleReporter } from 'jasmine';
1618
@Component({
1719
selector: 'app-customer-list',
1820
templateUrl: './customer-list.component.html',
@@ -109,5 +111,13 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
109111
this.message = `Are you sure you want to delete ${item.name}?`;
110112
this.showModal = true;
111113
}
112-
114+
/*openEditModal(customerId: string) {
115+
if(){
116+
editCustomer(customer.id)
117+
}else{
118+
this.idToDelete = item.id;
119+
this.message = `The changes will lose. Are you sure you change to customer ${item.name}?`;
120+
this.showModal = true;
121+
}
122+
}*/
113123
}

0 commit comments

Comments
 (0)