Skip to content

Commit 9c6b86a

Browse files
committed
feat: TT-26 detect changes in projects and project types
1 parent 21a964c commit 9c6b86a

File tree

3 files changed

+29
-27
lines changed

3 files changed

+29
-27
lines changed

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,9 @@
2626
data-target="#editModal"
2727
class="btn btn-sm btn-primary"
2828
>
29-
<i class="fa fa-pencil fa-xs">{{ haveChanges}}</i>
29+
<i class="fa fa-pen fa-xs"></i>
3030
</button>
3131

32-
<app-dialog
33-
*ngIf="showModal"
34-
class="modal fade"
35-
id="editModal"
36-
tabindex="-1"
37-
role="dialog"
38-
aria-hidden="true"
39-
[title]="'Edit Customer'"
40-
[body]="message"
41-
(closeModalEvent)="discardChanges(customer.id)"
42-
>
43-
</app-dialog>
44-
4532
<button
4633
data-toggle="modal"
4734
data-target="#deleteModal"
@@ -68,4 +55,17 @@
6855
[body]="message"
6956
(closeModalEvent)="deleteCustomer()"
7057
>
58+
</app-dialog>
59+
60+
<app-dialog
61+
*ngIf="showModal"
62+
class="modal fade"
63+
id="editModal"
64+
tabindex="-1"
65+
role="dialog"
66+
aria-hidden="true"
67+
[title]="'Edit Customer'"
68+
[body]="message"
69+
(closeModalEvent)="discardChanges()"
70+
>
7171
</app-dialog>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
3232
changeCustomerSubscription: Subscription;
3333
showModal = false;
3434
idToDelete: string;
35+
idToEdit: string;
3536
message: string;
3637
isLoading$: Observable<boolean>;
3738

@@ -78,6 +79,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
7879
}
7980

8081
editCustomer(customerId: string) {
82+
this.idToEdit = customerId;
8183
if (this.haveChanges === true) {
8284
this.message = `Do you have changes in a client, do you want to discard them?`;
8385
this.showModal = true;
@@ -90,12 +92,12 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
9092
}
9193
}
9294

93-
discardChanges(customerId: string) {
94-
this.showCustomerForm = true;
95+
discardChanges() {
9596
this.showModal = false;
9697
this.changeValueShowCustomerForm.emit(this.showCustomerForm);
9798
this.resetProjectFieldsToEdit();
98-
this.store.dispatch(new SetCustomerToEdit(customerId));
99+
this.store.dispatch(new SetCustomerToEdit(this.idToEdit));
100+
this.showCustomerForm = true;
99101
}
100102

101103
private resetProjectFieldsToEdit() {

0 commit comments

Comments
 (0)