Only show audit and health faqs on official
This commit is contained in:
		
							parent
							
								
									38ce8b8dc1
								
							
						
					
					
						commit
						d8ebc5a92c
					
				@ -8671,6 +8671,7 @@ export const faqData = [
 | 
				
			|||||||
    type: "endpoint",
 | 
					    type: "endpoint",
 | 
				
			||||||
    category: "advanced",
 | 
					    category: "advanced",
 | 
				
			||||||
    showConditions: bitcoinNetworks,
 | 
					    showConditions: bitcoinNetworks,
 | 
				
			||||||
 | 
					    options: { officialOnly: true },
 | 
				
			||||||
    fragment: "how-do-block-audits-work",
 | 
					    fragment: "how-do-block-audits-work",
 | 
				
			||||||
    title: "How do block audits work?",
 | 
					    title: "How do block audits work?",
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
@ -8678,6 +8679,7 @@ export const faqData = [
 | 
				
			|||||||
    type: "endpoint",
 | 
					    type: "endpoint",
 | 
				
			||||||
    category: "advanced",
 | 
					    category: "advanced",
 | 
				
			||||||
    showConditions: bitcoinNetworks,
 | 
					    showConditions: bitcoinNetworks,
 | 
				
			||||||
 | 
					    options: { officialOnly: true },
 | 
				
			||||||
    fragment: "what-is-block-health",
 | 
					    fragment: "what-is-block-health",
 | 
				
			||||||
    title: "What is block health?",
 | 
					    title: "What is block health?",
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,4 @@
 | 
				
			|||||||
<div *ngFor="let item of tabData">
 | 
					<div *ngFor="let item of tabData">
 | 
				
			||||||
  <p *ngIf="( item.type === 'category' ) && ( item.showConditions.indexOf(network.val) > -1 )">{{ item.title }}</p>
 | 
					  <p *ngIf="( item.type === 'category' ) && ( item.showConditions.indexOf(network.val) > -1 )">{{ item.title }}</p>
 | 
				
			||||||
  <a *ngIf="( item.type !== 'category' ) && ( item.showConditions.indexOf(network.val) > -1 )" [routerLink]="['./']" fragment="{{ item.fragment }}" (click)="navLinkClick($event)">{{ item.title }}</a>
 | 
					  <a *ngIf="( item.type !== 'category' ) && ( item.showConditions.indexOf(network.val) > -1 ) && ( !item.hasOwnProperty('options') || ( item.hasOwnProperty('options') && item.options.hasOwnProperty('officialOnly') && item.options.hasOwnProperty.officialOnly && officialMempoolInstance ) )" [routerLink]="['./']" fragment="{{ item.fragment }}" (click)="navLinkClick($event)">{{ item.title }}</a>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,4 +1,5 @@
 | 
				
			|||||||
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
 | 
					import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
 | 
				
			||||||
 | 
					import { Env, StateService } from '../../services/state.service';
 | 
				
			||||||
import { restApiDocsData } from './api-docs-data';
 | 
					import { restApiDocsData } from './api-docs-data';
 | 
				
			||||||
import { faqData } from './api-docs-data';
 | 
					import { faqData } from './api-docs-data';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -12,11 +13,17 @@ export class ApiDocsNavComponent implements OnInit {
 | 
				
			|||||||
  @Input() network: any;
 | 
					  @Input() network: any;
 | 
				
			||||||
  @Input() whichTab: string;
 | 
					  @Input() whichTab: string;
 | 
				
			||||||
  @Output() navLinkClickEvent: EventEmitter<any> = new EventEmitter();
 | 
					  @Output() navLinkClickEvent: EventEmitter<any> = new EventEmitter();
 | 
				
			||||||
 | 
					  env: Env;
 | 
				
			||||||
  tabData: any[];
 | 
					  tabData: any[];
 | 
				
			||||||
 | 
					  officialMempoolInstance: boolean;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  constructor() { }
 | 
					  constructor(
 | 
				
			||||||
 | 
					    private stateService: StateService
 | 
				
			||||||
 | 
					  ) { }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  ngOnInit(): void {
 | 
					  ngOnInit(): void {
 | 
				
			||||||
 | 
					    this.env = this.stateService.env;
 | 
				
			||||||
 | 
					    this.officialMempoolInstance = this.env.OFFICIAL_MEMPOOL_SPACE;
 | 
				
			||||||
    if (this.whichTab === 'rest') {
 | 
					    if (this.whichTab === 'rest') {
 | 
				
			||||||
      this.tabData = restApiDocsData;
 | 
					      this.tabData = restApiDocsData;
 | 
				
			||||||
    } else if (this.whichTab === 'faq') {
 | 
					    } else if (this.whichTab === 'faq') {
 | 
				
			||||||
 | 
				
			|||||||
@ -15,6 +15,7 @@
 | 
				
			|||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <div class="doc-item-container" *ngFor="let item of faq">
 | 
					        <div class="doc-item-container" *ngFor="let item of faq">
 | 
				
			||||||
 | 
					          <div *ngIf="!item.hasOwnProperty('options') || ( item.hasOwnProperty('options') && item.options.hasOwnProperty('officialOnly') && item.options.hasOwnProperty.officialOnly && officialMempoolInstance )">
 | 
				
			||||||
            <h3 *ngIf="item.type === 'category'">{{ item.title }}</h3>
 | 
					            <h3 *ngIf="item.type === 'category'">{{ item.title }}</h3>
 | 
				
			||||||
            <div *ngIf="item.type !== 'category'" class="endpoint-container" id="{{ item.fragment }}">
 | 
					            <div *ngIf="item.type !== 'category'" class="endpoint-container" id="{{ item.fragment }}">
 | 
				
			||||||
              <a id="{{ item.fragment + '-tab-header' }}" class="section-header" (click)="anchorLinkClick( $event )" [routerLink]="['./']" fragment="{{ item.fragment }}"><table><tr><td>{{ item.title }}</td><td><span>{{ item.category }}</span></td></tr></table></a>
 | 
					              <a id="{{ item.fragment + '-tab-header' }}" class="section-header" (click)="anchorLinkClick( $event )" [routerLink]="['./']" fragment="{{ item.fragment }}"><table><tr><td>{{ item.title }}</td><td><span>{{ item.category }}</span></td></tr></table></a>
 | 
				
			||||||
@ -23,6 +24,7 @@
 | 
				
			|||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
 | 
					        </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user