From eaf38d43740db73ea5962e16040f95a3977bf769 Mon Sep 17 00:00:00 2001 From: Piotr Pekala Date: Mon, 24 Jun 2019 01:41:28 -0700 Subject: [PATCH] Help component added --- src/app/app-routing.module.ts | 2 ++ src/app/app.module.ts | 4 ++- src/app/components/help/help.component.html | 15 +++++++++++ src/app/components/help/help.component.scss | 0 .../components/help/help.component.spec.ts | 0 src/app/components/help/help.component.ts | 27 +++++++++++++++++++ .../default-layout.component.html | 6 +++-- 7 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 src/app/components/help/help.component.html create mode 100644 src/app/components/help/help.component.scss create mode 100644 src/app/components/help/help.component.spec.ts create mode 100644 src/app/components/help/help.component.ts diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 9da6cfde..25db77e8 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -52,6 +52,7 @@ import { CopyDockerTemplateComponent } from './components/preferences/docker/cop import { CopyIouTemplateComponent } from './components/preferences/ios-on-unix/copy-iou-template/copy-iou-template.component'; import { ListOfSnapshotsComponent } from './components/snapshots/list-of-snapshots/list-of-snapshots.component'; import { ConsoleComponent } from './components/settings/console/console.component'; +import { HelpComponent } from './components/help/help.component'; const routes: Routes = [ { @@ -62,6 +63,7 @@ const routes: Routes = [ { path: 'servers', component: ServersComponent }, { path: 'bundled', component: BundledServerFinderComponent }, { path: 'server/:server_id/projects', component: ProjectsComponent }, + { path: 'help', component: HelpComponent }, { path: 'settings', component: SettingsComponent }, { path: 'settings/console', component: ConsoleComponent }, { path: 'installed-software', component: InstalledSoftwareComponent }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index be596dd9..75724c39 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -186,6 +186,7 @@ import { DefaultConsoleService } from './services/settings/default-console.servi import { NodeCreatedLabelStylesFixer } from './components/project-map/helpers/node-created-label-styles-fixer'; import { NonNegativeValidator } from './validators/non-negative-validator'; import { RotationValidator } from './validators/rotation-validator'; +import { HelpComponent } from './components/help/help.component'; if (environment.production) { Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', { @@ -304,7 +305,8 @@ if (environment.production) { AdbutlerComponent, ConsoleDeviceActionComponent, ConsoleComponent, - NodesMenuComponent + NodesMenuComponent, + HelpComponent ], imports: [ BrowserModule, diff --git a/src/app/components/help/help.component.html b/src/app/components/help/help.component.html new file mode 100644 index 00000000..3c72475e --- /dev/null +++ b/src/app/components/help/help.component.html @@ -0,0 +1,15 @@ +
+

Help

+
+
+ + + + Third party components + +
+
+
+
+
+
diff --git a/src/app/components/help/help.component.scss b/src/app/components/help/help.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/app/components/help/help.component.spec.ts b/src/app/components/help/help.component.spec.ts new file mode 100644 index 00000000..e69de29b diff --git a/src/app/components/help/help.component.ts b/src/app/components/help/help.component.ts new file mode 100644 index 00000000..078494b9 --- /dev/null +++ b/src/app/components/help/help.component.ts @@ -0,0 +1,27 @@ +import { Component, OnInit } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; + +@Component({ +selector: 'app-help', +templateUrl: './help.component.html', +styleUrls: ['./help.component.scss'] +}) +export class HelpComponent implements OnInit { + thirdpartylicenses = ''; + + constructor( + private httpClient: HttpClient + ) {} + + ngOnInit() { + this.httpClient.get('/3rdpartylicenses.txt', {responseType: 'text'}) + .subscribe(data => { + this.thirdpartylicenses = data.replace(new RegExp('\n', 'g'), "
") + }, + error => { + if (error.status === 404) { + this.thirdpartylicenses = 'File not found'; + } + }); + } +} diff --git a/src/app/layouts/default-layout/default-layout.component.html b/src/app/layouts/default-layout/default-layout.component.html index 1be407af..6db74f4b 100644 --- a/src/app/layouts/default-layout/default-layout.component.html +++ b/src/app/layouts/default-layout/default-layout.component.html @@ -21,9 +21,12 @@ cloud_download Installed software + - @@ -34,4 +37,3 @@ -