mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
parent
387635b7a1
commit
fb3ca07d6e
|
@ -3,6 +3,7 @@ import { Injectable, EventEmitter } from '@angular/core';
|
||||||
import { Subscription } from 'rxjs/Subscription';
|
import { Subscription } from 'rxjs/Subscription';
|
||||||
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
import { ScrollService, INVIEW_POSITION } from './scroll.service';
|
import { ScrollService, INVIEW_POSITION } from './scroll.service';
|
||||||
|
import { WarningsService } from './warnings.service';
|
||||||
import { Hash } from './hash.service';
|
import { Hash } from './hash.service';
|
||||||
import { SpecManager } from '../utils/spec-manager';
|
import { SpecManager } from '../utils/spec-manager';
|
||||||
import { SchemaHelper } from './schema-helper.service';
|
import { SchemaHelper } from './schema-helper.service';
|
||||||
|
@ -351,7 +352,7 @@ export class MenuService {
|
||||||
|
|
||||||
tags = tags.map(k => {
|
tags = tags.map(k => {
|
||||||
if (!this._tagsWithMethods[k]) {
|
if (!this._tagsWithMethods[k]) {
|
||||||
console.warn(`Non-existing tag "${k}" is specified in tag group "${tagGroup.name}"`);
|
WarningsService.warn(`Non-existing tag "${k}" is added to the group "${tagGroup.name}"`);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
this._tagsWithMethods[k].used = true;
|
this._tagsWithMethods[k].used = true;
|
||||||
|
@ -408,7 +409,7 @@ export class MenuService {
|
||||||
checkAllTagsUsedInGroups() {
|
checkAllTagsUsedInGroups() {
|
||||||
for (let tag of Object.keys(this._tagsWithMethods)) {
|
for (let tag of Object.keys(this._tagsWithMethods)) {
|
||||||
if (!this._tagsWithMethods[tag].used) {
|
if (!this._tagsWithMethods[tag].used) {
|
||||||
console.warn(`Tag "${tag}" is not added to any group`);
|
WarningsService.warn(`Tag "${tag}" is not added to any group`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Subject } from 'rxjs';
|
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class WarningsService {
|
export class WarningsService {
|
||||||
private static _warnings: Array<string> = [];
|
private static _warnings: Array<string> = [];
|
||||||
private static _warningsObs = new Subject<Array<string>>();
|
private static _warningsObs = new BehaviorSubject<Array<string>>([]);
|
||||||
|
|
||||||
static get warnings() {
|
static get warnings() {
|
||||||
return WarningsService._warningsObs;
|
return WarningsService._warningsObs;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user