Skip to content

Commit cc93ed0

Browse files
style: TT-191 styling sidebar code
1 parent 4e31352 commit cc93ed0

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

src/app/modules/shared/components/sidebar/sidebar.component.spec.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,12 @@ describe('SidebarComponent', () => {
8989
const route = 'time-clock';
9090
router.navigate([route]);
9191

92-
component.itemsSidebar
93-
.filter((item) => item.route === `/${route}`)
94-
.map((item) => {
95-
expect(item.active).toBeTrue();
96-
});
97-
component.itemsSidebar
98-
.filter((item) => item.route !== `/${route}`)
99-
.map((item) => {
100-
expect(item.active).toBeFalse();
101-
});
92+
component.itemsSidebar.filter((item) => item.route === `/${route}`).map((item) => {
93+
expect(item.active).toBeTrue();
94+
});
95+
component.itemsSidebar.filter((item) => item.route !== `/${route}`).map((item) => {
96+
expect(item.active).toBeFalse();
97+
});
10298
});
10399

104100
it('List Technologies item is added when feature flag "ui-list-technologies" is enabled for user', () => {

src/app/modules/shared/components/sidebar/sidebar.component.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export class SidebarComponent implements OnInit, OnDestroy {
2525
private featureManagerService: FeatureManagerService,
2626
private featureSwitchGroup: FeatureSwitchGroupService
2727
) {
28-
this.navStart = this.router.events.pipe(filter((evt) => evt instanceof NavigationStart)) as Observable<
29-
NavigationStart
30-
>;
28+
this.navStart = this.router.events.pipe(
29+
filter((evt) => evt instanceof NavigationStart)
30+
) as Observable<NavigationStart>;
3131
}
3232

3333
ngOnInit(): void {
@@ -78,17 +78,19 @@ export class SidebarComponent implements OnInit, OnDestroy {
7878
}
7979

8080
toggleListTechnologies(itemsSidebar: ItemSidebar[]) {
81-
this.featureManagerService.isToggleEnabledForUser('ui-list-technologies').subscribe((enabled) => {
82-
if (enabled === true) {
83-
const listTechnologiesItem = {
84-
route: '/technology-report',
85-
icon: 'fas fa-user',
86-
text: 'Technology Report',
87-
active: false,
88-
};
89-
itemsSidebar.push(listTechnologiesItem);
90-
}
91-
});
81+
this.featureManagerService
82+
.isToggleEnabledForUser('ui-list-technologies')
83+
.subscribe((enabled) => {
84+
if (enabled === true) {
85+
const listTechnologiesItem = {
86+
route: '/technology-report',
87+
icon: 'fas fa-user',
88+
text: 'Technology Report',
89+
active: false,
90+
};
91+
itemsSidebar.push(listTechnologiesItem);
92+
}
93+
});
9294
}
9395

9496
highlightMenuOption(route) {

0 commit comments

Comments
 (0)