Skip to content

Commit dcb2fdf

Browse files
authored
Merge pull request #174 from ioet/166_enable_tabs_on_customer_edition
fix: #166 enable tabs on customer edition
2 parents 966a212 + 9e15934 commit dcb2fdf

File tree

4 files changed

+15
-2
lines changed

4 files changed

+15
-2
lines changed

src/app/modules/customer-management/components/customer-info/components/create-customer/create-customer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export class CreateCustomerComponent implements OnInit, OnDestroy {
8585

8686
setDataToUpdate(customerData: Customer) {
8787
if (customerData) {
88+
this.changeValueAreTabsActives.emit(true);
8889
this.customerForm.setValue({
8990
name: customerData.name,
9091
description: customerData.description,

src/app/modules/customer-management/components/management-customer-projects/management-customer-projects.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
>
4646
<app-create-customer
4747
[areTabsActive]="areTabsActive"
48-
(changeValueAreTabsActives)="areTabsActive = $event"
48+
(changeValueAreTabsActives)="activeTabs($event)"
4949
></app-create-customer>
5050
</div>
5151
<div class="tab-pane fade mt-3" id="projects" role="tabpanel" aria-labelledby="projects-tab">

src/app/modules/customer-management/components/management-customer-projects/management-customer-projects.component.spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,12 @@ describe('ManagmentCustomerProjectsComponent', () => {
2121
it('component should be created', () => {
2222
expect(component).toBeTruthy();
2323
});
24+
25+
it('should be enable tabs', () => {
26+
component.areTabsActive = false;
27+
component.activeTabs(true);
28+
setTimeout(() => {
29+
expect(component.areTabsActive).toBeTrue();
30+
}, 1);
31+
});
2432
});

src/app/modules/customer-management/components/management-customer-projects/management-customer-projects.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import { Component } from '@angular/core';
66
styleUrls: ['./management-customer-projects.component.scss'],
77
})
88
export class ManagementCustomerProjectsComponent {
9-
areTabsActive = false;
9+
areTabsActive: boolean;
1010

1111
constructor() {}
12+
13+
activeTabs($areTabsActive: boolean) {
14+
setTimeout(() => this.areTabsActive = $areTabsActive, 1);
15+
}
1216
}

0 commit comments

Comments
 (0)