Skip to content

Commit b3f04e3

Browse files
committed
Move GitHub redirect link to sidebar
1 parent d058f99 commit b3f04e3

6 files changed

Lines changed: 19 additions & 19 deletions

File tree

src/app/app.component.html

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@
1616
<div class="tag-subtitle">{{ subtitle }}</div>
1717
</div>
1818
<div class="dummy"></div>
19-
<a
20-
target="_blank"
21-
class="github-fork-ribbon"
22-
href="https://github.com/devsecopsmaturitymodel/DevSecOps-MaturityModel"
23-
data-ribbon="Fork me on GitHub"
24-
title="Fork me on GitHub"
25-
>Fork me on GitHub</a
26-
>
2719
</div>
2820
<mat-divider></mat-divider>
2921
<router-outlet></router-outlet>

src/app/app.component.spec.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,4 @@ describe('AppComponent', () => {
2222
it('should create the app', () => {
2323
expect(app).toBeTruthy();
2424
});
25-
26-
it('check for fork me on github ribbon generation', () => {
27-
const fixture = TestBed.createComponent(AppComponent);
28-
const HTMLElement: HTMLElement = fixture.nativeElement;
29-
var divTag = HTMLElement.querySelector('div')!;
30-
var aTag = divTag.querySelector('a')!;
31-
expect(aTag.textContent).toContain('GitHub');
32-
});
3325
});

src/app/component/sidenav-buttons/sidenav-buttons.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
<mat-icon mat-list-icon color="primary">{{ Icons[i] }}</mat-icon>
44
<h3 mat-line>{{ Options[i] }}</h3>
55
</a>
6+
<a mat-list-item href="https://github.com/wurstbrot/DevSecOps-MaturityModel/" target="_blank">
7+
<mat-icon mat-list-icon color="primary" svgIcon="github"></mat-icon>
8+
<h3 mat-line>GitHub</h3>
9+
</a>
610
</mat-nav-list>
711

812
<!-- Separate theme toggle outside nav-list -->

src/app/component/sidenav-buttons/sidenav-buttons.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ describe('SidenavButtonsComponent', () => {
3737
for (var x = 0; x < NavigationList.length; x += 1) {
3838
NavigationNamesBeingShown.push(NavigationList[x].textContent);
3939
}
40-
//console.log({ ...NavigationNamesBeingShown });
41-
//console.log(component.Options);
40+
NavigationNamesBeingShown.pop(); // Remove GitHub link
4241
expect(NavigationNamesBeingShown).toEqual(component.Options);
4342
});
4443

src/app/component/sidenav-buttons/sidenav-buttons.component.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import { Component, OnInit } from '@angular/core';
2+
import { MatIconRegistry } from '@angular/material/icon';
3+
import { DomSanitizer } from '@angular/platform-browser';
4+
import { GITHUB_SVG } from '../../../assets/svg_icons';
25
import { ThemeService } from '../../service/theme.service';
36

47
@Component({
@@ -43,7 +46,16 @@ export class SidenavButtonsComponent implements OnInit {
4346

4447
isNightMode = false;
4548

46-
constructor(private themeService: ThemeService) {}
49+
constructor(
50+
private themeService: ThemeService,
51+
private iconRegistry: MatIconRegistry,
52+
private sanitizer: DomSanitizer
53+
) {
54+
this.iconRegistry.addSvgIconLiteral(
55+
'github',
56+
this.sanitizer.bypassSecurityTrustHtml(GITHUB_SVG)
57+
);
58+
}
4759

4860
ngOnInit(): void {
4961
const currentTheme = this.themeService.getTheme();

src/assets/svg_icons.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const GITHUB_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/></svg>`;

0 commit comments

Comments
 (0)