From 68b4b66058237b94b5fc584247f95715c022f599 Mon Sep 17 00:00:00 2001
From: hunicus <93150691+hunicus@users.noreply.github.com>
Date: Wed, 25 May 2022 23:20:12 -0400
Subject: [PATCH] Fix doc page titles
---
.../app/docs/api-docs/api-docs.component.ts | 3 ---
frontend/src/app/docs/docs/docs.component.ts | 5 ++++
frontend/src/locale/messages.xlf | 25 +++++++++++++------
3 files changed, 23 insertions(+), 10 deletions(-)
diff --git a/frontend/src/app/docs/api-docs/api-docs.component.ts b/frontend/src/app/docs/api-docs/api-docs.component.ts
index 9ede3c09f..0041fa8cd 100644
--- a/frontend/src/app/docs/api-docs/api-docs.component.ts
+++ b/frontend/src/app/docs/api-docs/api-docs.component.ts
@@ -1,7 +1,6 @@
import { Component, OnInit, Input, ViewChild, ElementRef } from '@angular/core';
import { Env, StateService } from '../../services/state.service';
import { Observable, merge, of } from 'rxjs';
-import { SeoService } from '../../services/seo.service';
import { tap } from 'rxjs/operators';
import { ActivatedRoute } from "@angular/router";
import { faqData, restApiDocsData, wsApiDocsData } from './api-docs-data';
@@ -27,7 +26,6 @@ export class ApiDocsComponent implements OnInit {
constructor(
private stateService: StateService,
- private seoService: SeoService,
private route: ActivatedRoute,
) { }
@@ -45,7 +43,6 @@ export class ApiDocsComponent implements OnInit {
ngOnInit(): void {
this.env = this.stateService.env;
- this.seoService.setTitle($localize`:@@e351b40b3869a5c7d19c3d4918cb1ac7aaab95c4:API`);
this.network$ = merge(of(''), this.stateService.networkChanged$).pipe(
tap((network: string) => {
if (this.env.BASE_MODULE === 'mempool' && network !== '') {
diff --git a/frontend/src/app/docs/docs/docs.component.ts b/frontend/src/app/docs/docs/docs.component.ts
index 9a06f1127..74cebc88f 100644
--- a/frontend/src/app/docs/docs/docs.component.ts
+++ b/frontend/src/app/docs/docs/docs.component.ts
@@ -2,6 +2,7 @@ import { Component, OnInit, HostBinding } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Env, StateService } from '../../services/state.service';
import { WebsocketService } from '../../services/websocket.service';
+import { SeoService } from '../../services/seo.service';
@Component({
selector: 'app-docs',
@@ -21,6 +22,7 @@ export class DocsComponent implements OnInit {
private route: ActivatedRoute,
private stateService: StateService,
private websocket: WebsocketService,
+ private seoService: SeoService,
) { }
ngOnInit(): void {
@@ -28,10 +30,13 @@ export class DocsComponent implements OnInit {
const url = this.route.snapshot.url;
if (url[0].path === "faq" ) {
this.activeTab = 0;
+ this.seoService.setTitle($localize`:@@docs.faq.button-title:FAQ`);
} else if( url[1].path === "rest" ) {
this.activeTab = 1;
+ this.seoService.setTitle($localize`:@@e351b40b3869a5c7d19c3d4918cb1ac7aaab95c4:API`);
} else {
this.activeTab = 2;
+ this.seoService.setTitle($localize`:@@e351b40b3869a5c7d19c3d4918cb1ac7aaab95c4:API`);
}
this.env = this.stateService.env;
diff --git a/frontend/src/locale/messages.xlf b/frontend/src/locale/messages.xlf
index 578865b5c..8ea9d70cf 100644
--- a/frontend/src/locale/messages.xlf
+++ b/frontend/src/locale/messages.xlf
@@ -3934,13 +3934,6 @@
api-docs.websocket.websocket
-
-
-
- src/app/docs/api-docs/api-docs.component.ts
- 48
-
-
@@ -3973,6 +3966,24 @@
API Docs API response
+
+
+
+ src/app/docs/docs/docs.component.ts
+ 33
+
+
+
+
+
+ src/app/docs/docs/docs.component.ts
+ 36
+
+
+ src/app/docs/docs/docs.component.ts
+ 39
+
+