mirror of
https://github.com/mempool/mempool.git
synced 2025-03-15 04:11:48 +01:00
Switch audit faq conditions to env.audit
From OFFICIAL_MEMPOOL_SPACE.
This commit is contained in:
parent
c923a4bc22
commit
215e92d33e
5 changed files with 8 additions and 6 deletions
|
@ -8671,7 +8671,7 @@ export const faqData = [
|
||||||
type: "endpoint",
|
type: "endpoint",
|
||||||
category: "advanced",
|
category: "advanced",
|
||||||
showConditions: bitcoinNetworks,
|
showConditions: bitcoinNetworks,
|
||||||
options: { officialOnly: true },
|
options: { auditOnly: 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?",
|
||||||
},
|
},
|
||||||
|
@ -8679,7 +8679,7 @@ export const faqData = [
|
||||||
type: "endpoint",
|
type: "endpoint",
|
||||||
category: "advanced",
|
category: "advanced",
|
||||||
showConditions: bitcoinNetworks,
|
showConditions: bitcoinNetworks,
|
||||||
options: { officialOnly: true },
|
options: { auditOnly: 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 ) && ( !item.hasOwnProperty('options') || ( item.hasOwnProperty('options') && item.options.hasOwnProperty('officialOnly') && item.options.officialOnly && officialMempoolInstance ) )" [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('auditOnly') && item.options.auditOnly && auditEnabled ) )" [routerLink]="['./']" fragment="{{ item.fragment }}" (click)="navLinkClick($event)">{{ item.title }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,7 +15,7 @@ export class ApiDocsNavComponent implements OnInit {
|
||||||
@Output() navLinkClickEvent: EventEmitter<any> = new EventEmitter();
|
@Output() navLinkClickEvent: EventEmitter<any> = new EventEmitter();
|
||||||
env: Env;
|
env: Env;
|
||||||
tabData: any[];
|
tabData: any[];
|
||||||
officialMempoolInstance: boolean;
|
auditEnabled: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private stateService: StateService
|
private stateService: StateService
|
||||||
|
@ -23,7 +23,7 @@ export class ApiDocsNavComponent implements OnInit {
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.env = this.stateService.env;
|
this.env = this.stateService.env;
|
||||||
this.officialMempoolInstance = this.env.OFFICIAL_MEMPOOL_SPACE;
|
this.auditEnabled = this.env.AUDIT;
|
||||||
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,7 +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.officialOnly && officialMempoolInstance )">
|
<div *ngIf="!item.hasOwnProperty('options') || ( item.hasOwnProperty('options') && item.options.hasOwnProperty('auditOnly') && item.options.auditOnly && auditEnabled )">
|
||||||
<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>
|
||||||
|
|
|
@ -28,6 +28,7 @@ export class ApiDocsComponent implements OnInit, AfterViewInit {
|
||||||
wsDocs: any;
|
wsDocs: any;
|
||||||
screenWidth: number;
|
screenWidth: number;
|
||||||
officialMempoolInstance: boolean;
|
officialMempoolInstance: boolean;
|
||||||
|
auditEnabled: boolean;
|
||||||
|
|
||||||
@ViewChildren(FaqTemplateDirective) faqTemplates: QueryList<FaqTemplateDirective>;
|
@ViewChildren(FaqTemplateDirective) faqTemplates: QueryList<FaqTemplateDirective>;
|
||||||
dict = {};
|
dict = {};
|
||||||
|
@ -60,6 +61,7 @@ export class ApiDocsComponent implements OnInit, AfterViewInit {
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.env = this.stateService.env;
|
this.env = this.stateService.env;
|
||||||
this.officialMempoolInstance = this.env.OFFICIAL_MEMPOOL_SPACE;
|
this.officialMempoolInstance = this.env.OFFICIAL_MEMPOOL_SPACE;
|
||||||
|
this.auditEnabled = this.env.AUDIT;
|
||||||
this.network$ = merge(of(''), this.stateService.networkChanged$).pipe(
|
this.network$ = merge(of(''), this.stateService.networkChanged$).pipe(
|
||||||
tap((network: string) => {
|
tap((network: string) => {
|
||||||
if (this.env.BASE_MODULE === 'mempool' && network !== '') {
|
if (this.env.BASE_MODULE === 'mempool' && network !== '') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue