Skip to content

Commit 1af87a8

Browse files
authored
Merge pull request #489 from sawankshrma/github_link_re-position
Move GitHub redirect link to Sidebar
2 parents a89227d + 2bef140 commit 1af87a8

File tree

6 files changed

+46
-26
lines changed

6 files changed

+46
-26
lines changed

src/app/app.component.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
{{ subtitle }}
1515
</div>
1616
</div>
17+
<div class="dummy"></div>
1718
</div>
1819
<span class="spacer"></span>
1920
<a

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>`;

src/index.html

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,32 @@
11
<!DOCTYPE html>
22
<html lang="en">
3-
4-
<head>
5-
<meta charset="utf-8" />
6-
<title>DSOMM</title>
7-
<base href="/" />
8-
<meta name="viewport" content="width=device-width, initial-scale=1" />
9-
<!-- <link rel="icon" type="image/png" href="assets/images/logo-image.png" />
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>DSOMM</title>
6+
<base href="/" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<!-- <link rel="icon" type="image/png" href="assets/images/logo-image.png" />
109
<link rel="icon" type="image/x-icon" href="favicon.ico" /> -->
1110

12-
<link rel="icon" type="image/png" href="assets/favicon/favicon-96x96.png" sizes="96x96" />
13-
<link rel="icon" type="image/svg+xml" href="assets/favicon/favicon.svg" />
14-
<link rel="shortcut icon" href="assets/favicon/favicon.ico" />
15-
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-touch-icon.png" />
16-
<link rel="manifest" href="assets/favicon/site.webmanifest" />
17-
18-
<link rel="preconnect" href="https://fonts.gstatic.com" />
19-
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet" />
20-
<link href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet" />
21-
<link rel="stylesheet"
22-
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
23-
</head>
11+
<link rel="icon" type="image/png" href="assets/favicon/favicon-96x96.png" sizes="96x96" />
12+
<link rel="icon" type="image/svg+xml" href="assets/favicon/favicon.svg" />
13+
<link rel="shortcut icon" href="assets/favicon/favicon.ico" />
14+
<link rel="apple-touch-icon" sizes="180x180" href="assets/favicon/apple-touch-icon.png" />
15+
<link rel="manifest" href="assets/favicon/site.webmanifest" />
2416

25-
<body>
26-
<app-root></app-root>
27-
</body>
17+
<link rel="preconnect" href="https://fonts.gstatic.com" />
18+
<link
19+
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap"
20+
rel="stylesheet" />
21+
<link
22+
href="https://fonts.googleapis.com/icon?family=Material+Icons|Material+Icons+Outlined"
23+
rel="stylesheet" />
24+
<link
25+
rel="stylesheet"
26+
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
27+
</head>
2828

29-
</html>
29+
<body>
30+
<app-root></app-root>
31+
</body>
32+
</html>

0 commit comments

Comments
 (0)