diff --git a/package-lock.json b/package-lock.json
index 31f593150..920dec5ad 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
{
"name": "time-tracker",
- "version": "1.31.16",
+ "version": "1.31.20",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
diff --git a/package.json b/package.json
index c286b54b7..5bf34e977 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "time-tracker",
- "version": "1.31.16",
+ "version": "1.31.20",
"scripts": {
"preinstall": "npx npm-force-resolutions",
"ng": "ng",
diff --git a/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.html b/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.html
index 8279155e5..a6fda73bf 100644
--- a/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.html
+++ b/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.html
@@ -1,5 +1,8 @@
-
diff --git a/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.ts b/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.ts
index 9cb14ae8d..9274b7bc2 100644
--- a/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.ts
+++ b/src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.ts
@@ -27,6 +27,7 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
@Output() closeCustomerComponent = new EventEmitter
();
customerToEdit: Customer;
editSubscription: Subscription;
+ statusForm = false;
constructor(private formBuilder: FormBuilder, private store: Store) {
this.customerForm = this.formBuilder.group({
@@ -94,4 +95,10 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
this.store.dispatch(new ResetCustomerToEdit());
this.closeCustomerComponent.emit(false);
}
+ getStatusCreateCustomerForm(){
+ if (this.customerForm.dirty){
+ this.statusForm = true;
+ console.log(this.statusForm)
+ }
+ }
}
diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html
index 09b7a0b76..e0e08cc8c 100644
--- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html
+++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.html
@@ -4,8 +4,7 @@
class="table table-bordered table-striped mb-0"
datatable
[dtTrigger]="dtTrigger"
- [dtOptions]="dtOptions"
- >
+ [dtOptions]="dtOptions">
| Customer ID |
@@ -20,10 +19,11 @@
{{ customer.name }} |
|
@@ -50,6 +49,16 @@
aria-hidden="true"
[title]="'Delete Customer'"
[body]="message"
- (closeModalEvent)="deleteCustomer()"
->
+ (closeModalEvent)="deleteCustomer()">
+
+
diff --git a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts
index e5c9785ed..2a66ad54a 100644
--- a/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts
+++ b/src/app/modules/customer-management/components/customer-info/components/customer-list/customer-list.component.ts
@@ -13,6 +13,7 @@ import {
} from './../../../../store/customer-management.actions';
import { ResetProjectToEdit } from '../../../projects/components/store/project.actions';
import { ResetProjectTypeToEdit } from '../../../projects-type/store';
+import { EntryState } from 'src/app/modules/time-clock/store/entry.reducer';
@Component({
selector: 'app-customer-list',
templateUrl: './customer-list.component.html',
@@ -31,6 +32,7 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
changeCustomerSubscription: Subscription;
showModal = false;
idToDelete: string;
+ idToEdit: string;
message: string;
isLoading$: Observable;
@@ -76,10 +78,10 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
this.dtTrigger.unsubscribe();
}
- editCustomer(customerId: string) {
+ editCustomer() {
this.showCustomerForm = true;
this.changeValueShowCustomerForm.emit(this.showCustomerForm);
- this.store.dispatch(new SetCustomerToEdit(customerId));
+ this.store.dispatch(new SetCustomerToEdit(this.idToEdit));
this.resetProjectFieldsToEdit();
}
@@ -110,4 +112,13 @@ export class CustomerListComponent implements OnInit, OnDestroy, AfterViewInit {
this.showModal = true;
}
+ openEditModal(item: Customer) {
+ this.idToEdit = item.id;
+ if (this.showCustomerForm === true) {
+ this.message = `The changes will lose. Are you sure you change to customer ${item.name}?`;
+ this.showModal = true;
+ } else {
+ this.editCustomer();
+ }
+ }
}
diff --git a/src/app/modules/customer-management/components/management-customer-projects/management-customer-projects.component.ts b/src/app/modules/customer-management/components/management-customer-projects/management-customer-projects.component.ts
index 83caacb26..725f9ac1f 100644
--- a/src/app/modules/customer-management/components/management-customer-projects/management-customer-projects.component.ts
+++ b/src/app/modules/customer-management/components/management-customer-projects/management-customer-projects.component.ts
@@ -2,6 +2,7 @@ import { getCustomerUnderEdition } from './../../store/customer-management.selec
import { Customer } from 'src/app/modules/shared/models';
import { Store, select } from '@ngrx/store';
import { Component, Output, EventEmitter, OnInit } from '@angular/core';
+import { Form } from '@angular/forms';
@Component({
selector: 'app-management-customer-projects',
@@ -41,5 +42,4 @@ export class ManagementCustomerProjectsComponent implements OnInit {
showTab(activeTab: string) {
this.activeTab = activeTab;
}
-
}
diff --git a/src/app/modules/customer-management/components/projects-type/components/create-project-type/create-project-type.component.html b/src/app/modules/customer-management/components/projects-type/components/create-project-type/create-project-type.component.html
index 69ef61d4e..3752351e3 100644
--- a/src/app/modules/customer-management/components/projects-type/components/create-project-type/create-project-type.component.html
+++ b/src/app/modules/customer-management/components/projects-type/components/create-project-type/create-project-type.component.html
@@ -1,13 +1,26 @@
-