]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | import { Component, OnInit, ViewChild } from '@angular/core'; |
2 | ||
3 | import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; | |
4 | ||
9f95a23c | 5 | import { Icons } from '../../../shared/enum/icons.enum'; |
f6b5b4d7 | 6 | import { DocService } from '../../../shared/services/doc.service'; |
11fdf7f2 TL |
7 | import { AboutComponent } from '../about/about.component'; |
8 | ||
9 | @Component({ | |
10 | selector: 'cd-dashboard-help', | |
11 | templateUrl: './dashboard-help.component.html', | |
12 | styleUrls: ['./dashboard-help.component.scss'] | |
13 | }) | |
14 | export class DashboardHelpComponent implements OnInit { | |
9f95a23c TL |
15 | @ViewChild('docsForm', { static: true }) |
16 | docsFormElement: any; | |
11fdf7f2 TL |
17 | docsUrl: string; |
18 | modalRef: BsModalRef; | |
9f95a23c | 19 | icons = Icons; |
11fdf7f2 | 20 | |
adb31ebb | 21 | constructor(private modalService: BsModalService, private docService: DocService) {} |
11fdf7f2 TL |
22 | |
23 | ngOnInit() { | |
f6b5b4d7 TL |
24 | this.docService.subscribeOnce('dashboard', (url: string) => { |
25 | this.docsUrl = url; | |
11fdf7f2 TL |
26 | }); |
27 | } | |
28 | ||
29 | openAboutModal() { | |
30 | this.modalRef = this.modalService.show(AboutComponent); | |
9f95a23c | 31 | this.modalRef.setClass('modal-lg'); |
11fdf7f2 TL |
32 | } |
33 | ||
34 | goToApiDocs() { | |
11fdf7f2 TL |
35 | this.docsFormElement.nativeElement.submit(); |
36 | } | |
37 | } |