From 387635b7a13368a1f41f53ff4e1fa21d31e868b9 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Mon, 27 Feb 2017 18:50:53 +0200 Subject: [PATCH 1/6] chore: update changelog --- CHANGELOG.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07fe6f7f..02c7fbff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,27 @@ + +## 1.10.1 (2017-02-27) + + +### Bug Fixes + +* improve x-servers dropdown animation performance ([69c7d98](https://github.com/Rebilly/ReDoc/commit/69c7d98)) + + + + +# 1.10.0 (2017-02-27) + + +### Bug Fixes +* Revert: remove unused hide-hostname option ([7031176](https://github.com/Rebilly/ReDoc/commit/7031176)) + +### Features + +* new option `required-props-first` ([c724df4](https://github.com/Rebilly/ReDoc/commit/c724df4)), closes [#191](https://github.com/Rebilly/ReDoc/issues/191) +* update fragment while scrolling and on menu clicks ([66c06b3](https://github.com/Rebilly/ReDoc/commit/66c06b3)), closes [#138](https://github.com/Rebilly/ReDoc/issues/138) [#202](https://github.com/Rebilly/ReDoc/issues/202) + + + # 1.9.0 (2017-02-25) From fb3ca07d6e20c021f9ab8bb6308240a1c77c8fa7 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 28 Feb 2017 22:03:03 +0200 Subject: [PATCH 2/6] fix: show warning for non-used in tagGroup tags closes #215 --- lib/services/menu.service.ts | 5 +++-- lib/services/warnings.service.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/services/menu.service.ts b/lib/services/menu.service.ts index eea660fb..452695e9 100644 --- a/lib/services/menu.service.ts +++ b/lib/services/menu.service.ts @@ -3,6 +3,7 @@ import { Injectable, EventEmitter } from '@angular/core'; import { Subscription } from 'rxjs/Subscription'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; import { ScrollService, INVIEW_POSITION } from './scroll.service'; +import { WarningsService } from './warnings.service'; import { Hash } from './hash.service'; import { SpecManager } from '../utils/spec-manager'; import { SchemaHelper } from './schema-helper.service'; @@ -351,7 +352,7 @@ export class MenuService { tags = tags.map(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; } this._tagsWithMethods[k].used = true; @@ -408,7 +409,7 @@ export class MenuService { checkAllTagsUsedInGroups() { for (let tag of Object.keys(this._tagsWithMethods)) { 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`) } } } diff --git a/lib/services/warnings.service.ts b/lib/services/warnings.service.ts index 54c29754..b547f564 100644 --- a/lib/services/warnings.service.ts +++ b/lib/services/warnings.service.ts @@ -1,11 +1,11 @@ 'use strict'; import { Injectable } from '@angular/core'; -import { Subject } from 'rxjs'; +import { BehaviorSubject } from 'rxjs/BehaviorSubject'; @Injectable() export class WarningsService { private static _warnings: Array = []; - private static _warningsObs = new Subject>(); + private static _warningsObs = new BehaviorSubject>([]); static get warnings() { return WarningsService._warningsObs; From 7b19417497e87883f7ac6ba0f0bd31dd9d933225 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 28 Feb 2017 22:04:24 +0200 Subject: [PATCH 3/6] docs: update docs for x-tagGroup, add warning #215 --- docs/redoc-vendor-extensions.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/redoc-vendor-extensions.md b/docs/redoc-vendor-extensions.md index 15546c64..2e6329cc 100644 --- a/docs/redoc-vendor-extensions.md +++ b/docs/redoc-vendor-extensions.md @@ -13,7 +13,8 @@ Backported from OpenAPI 3.0 [`servers`](https://github.com/OAI/OpenAPI-Specifica | x-tagGroups | [ [Tag Group Object](#tagGroupObject) ] | A list of tag groups | ###### Usage in Redoc -`x-tagGroups` is used to group tags in the side menu +`x-tagGroups` is used to group tags in the side menu. +If you are going to use `x-tagGroups`, please make sure you **add all tags to a group**, since a tag that is not in a group, **will not be displayed** at all! #### Tag Group Object Information about tags group From 929740ab287fb16feb01b904fdd0fe5ae5078ddb Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Tue, 28 Feb 2017 23:46:43 +0200 Subject: [PATCH 4/6] fix: clear page fragment when scroll to the beginning --- lib/services/hash.service.ts | 2 +- lib/services/menu.service.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/services/hash.service.ts b/lib/services/hash.service.ts index f115e65b..b1d4dbd2 100644 --- a/lib/services/hash.service.ts +++ b/lib/services/hash.service.ts @@ -28,7 +28,7 @@ export class Hash { } update(hash: string|null) { - if (!hash) return; + if (hash == undefined) return; this.noEmit = true; window.location.hash = hash; setTimeout(() => { diff --git a/lib/services/menu.service.ts b/lib/services/menu.service.ts index 452695e9..d0f95144 100644 --- a/lib/services/menu.service.ts +++ b/lib/services/menu.service.ts @@ -208,7 +208,10 @@ export class MenuService { this.deactivate(this.activeIdx); this.activeIdx = idx; - if (idx < 0) return; + if (idx < 0) { + this.hash.update(''); + return; + } item.active = true; @@ -409,7 +412,7 @@ export class MenuService { checkAllTagsUsedInGroups() { for (let tag of Object.keys(this._tagsWithMethods)) { if (!this._tagsWithMethods[tag].used) { - WarningsService.warn(`Tag "${tag}" is not added to any group`) + WarningsService.warn(`Tag "${tag}" is not added to any group`); } } } From 8da0f7ed82ca6021c81416bf7d3160ce369be252 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 1 Mar 2017 00:07:04 +0200 Subject: [PATCH 5/6] build: get rid of unused replacement plugin --- build/empty.js | 0 build/webpack.common.js | 4 +--- 2 files changed, 1 insertion(+), 3 deletions(-) delete mode 100644 build/empty.js diff --git a/build/empty.js b/build/empty.js deleted file mode 100644 index e69de29b..00000000 diff --git a/build/webpack.common.js b/build/webpack.common.js index 29cd5bee..5ff99d08 100644 --- a/build/webpack.common.js +++ b/build/webpack.common.js @@ -110,9 +110,7 @@ module.exports = function (options) { 'AOT': options.AOT }), - new StringReplacePlugin(), - new webpack.NormalModuleReplacementPlugin(/node_modules\/rxjs\/operator\/.*/, root('build/empty.js')), - new webpack.NormalModuleReplacementPlugin(/node_modules\/rxjs\/testing\//, root('build/empty.js')) + new StringReplacePlugin() ], node: { global: true, From 9ccfd52640e81b8c9b0d1c66950ccadd64f01e68 Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Wed, 1 Mar 2017 00:35:29 +0200 Subject: [PATCH 6/6] release: v1.10.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2e175d6e..d6153aa0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "redoc", "description": "Swagger-generated API Reference Documentation", - "version": "1.10.1", + "version": "1.10.2", "repository": { "type": "git", "url": "git://github.com/Rebilly/ReDoc"