mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-07 05:40:19 +03:00
Fixes for the scopes
This commit is contained in:
parent
addd10b762
commit
ab069bd91c
|
@ -336,6 +336,7 @@ paths:
|
||||||
summary: Finds Pets by tags
|
summary: Finds Pets by tags
|
||||||
description: 'Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.'
|
description: 'Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.'
|
||||||
operationId: findPetsByTags
|
operationId: findPetsByTags
|
||||||
|
deprecated: true
|
||||||
produces:
|
produces:
|
||||||
- application/xml
|
- application/xml
|
||||||
- application/json
|
- application/json
|
||||||
|
@ -858,4 +859,4 @@ definitions:
|
||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
xml:
|
xml:
|
||||||
name: User
|
name: User
|
|
@ -1,12 +1,13 @@
|
||||||
<ng-template [ngIf]="scopes">
|
<ng-template [ngIf]="scopes">
|
||||||
<span class="hint--html hint--bottom-left hint--large oauth-scopes-hint">
|
|
||||||
!
|
|
||||||
<div class="oauth-scopes hint__content">
|
<div class="oauth-scopes hint__content">
|
||||||
<span class="oauth-scopes-header">OAuth2 Scopes</span>
|
<span class="oauth-scopes-header">OAuth2 Scopes</span>
|
||||||
<div *ngFor="let scope of scopes.scopes" class="oauth-scope">
|
<div class="oauth-scope">
|
||||||
<p class="oauth-scope-name"> {{scope.name}} </p>
|
<span *ngFor="let scope of scopes.scopes" [attr.data-hint]="scope.name" class="hint--rounded hint--bounce hint--bottom">
|
||||||
<p class="oauth-scope-description"> {{scope.description}} </p>
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="20px" height="20px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
|
||||||
|
<path d="M384,224v-96C384,57.438,326.594,0,256,0c-70.578,0-128,57.438-128,128v96c-35.344,0-64,28.656-64,64v160c0,35.344,28.656,64,64,64h256c35.344,0,64-28.656,64-64V288C448,252.656,419.344,224,384,224z M272,379.094V432c0,8.844-7.156,16-16,16s-16-7.156-16-16v-52.906c-9.391-5.563-16-15.375-16-27.094c0-17.688,14.328-32,32-32s32,14.313,32,32C288,363.719,281.391,373.531,272,379.094z M320,224H192v-96c0-35.313,28.703-64,64-64c35.281,0,64,28.688,64,64V224z"/>
|
||||||
|
</svg>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</span>
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
$hint-color: #e53935;
|
|
||||||
|
|
||||||
.oauth-scopes-header {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oauth-scope {
|
|
||||||
padding-top: 1.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oauth-scope-description {
|
|
||||||
font-style: italic;
|
|
||||||
line-height: 0.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oauth-scopes {
|
|
||||||
text-align: left;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.oauth-scopes-hint {
|
|
||||||
width: 1.2em;
|
|
||||||
text-align: center;
|
|
||||||
border-radius: 50%;
|
|
||||||
vertical-align: middle;
|
|
||||||
color: $hint-color;
|
|
||||||
line-height: 1.2;
|
|
||||||
text-transform: none;
|
|
||||||
cursor: help;
|
|
||||||
border: 1px solid $hint-color;
|
|
||||||
float: right;
|
|
||||||
}
|
|
|
@ -7,7 +7,6 @@ import { ComponentParser } from '../../services/component-parser.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'auth-scopes',
|
selector: 'auth-scopes',
|
||||||
templateUrl: './auth-scopes.html',
|
templateUrl: './auth-scopes.html',
|
||||||
styleUrls: ['./auth-scopes.css'],
|
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush
|
changeDetection: ChangeDetectionStrategy.OnPush
|
||||||
})
|
})
|
||||||
export class AuthScopes extends BaseComponent implements OnInit {
|
export class AuthScopes extends BaseComponent implements OnInit {
|
||||||
|
|
|
@ -138,9 +138,8 @@ export class SpecManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
getOperationScopes(operationPtr:string) {
|
getOperationScopes(operationPtr:string) {
|
||||||
let that = this;
|
const getSecurityDefinition = (name: string, scope: string) => {
|
||||||
function getSecurityDefinition(name:string, scope:string) {
|
let secDefs = this._schema.securityDefinitions;
|
||||||
let secDefs = that._schema.securityDefinitions;
|
|
||||||
if (secDefs[name] && secDefs[name].type === 'oauth2') {
|
if (secDefs[name] && secDefs[name].type === 'oauth2') {
|
||||||
let availScopes = secDefs[name].scopes;
|
let availScopes = secDefs[name].scopes;
|
||||||
if (availScopes && availScopes[scope]) {
|
if (availScopes && availScopes[scope]) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ import 'prismjs/components/prism-markup.js'; // xml
|
||||||
|
|
||||||
import 'dropkickjs/build/css/dropkick.css';
|
import 'dropkickjs/build/css/dropkick.css';
|
||||||
import 'prismjs/themes/prism-dark.css';
|
import 'prismjs/themes/prism-dark.css';
|
||||||
import 'html-hint/dist/html-hint.css';
|
import 'hint.css/hint.base.css';
|
||||||
|
|
||||||
if (!IS_PRODUCTION) {
|
if (!IS_PRODUCTION) {
|
||||||
require('@angular/platform-browser');
|
require('@angular/platform-browser');
|
||||||
|
|
|
@ -72,7 +72,7 @@
|
||||||
"css-loader": "^0.28.1",
|
"css-loader": "^0.28.1",
|
||||||
"deploy-to-gh-pages": "^1.3.3",
|
"deploy-to-gh-pages": "^1.3.3",
|
||||||
"dropkickjs": "^2.1.10",
|
"dropkickjs": "^2.1.10",
|
||||||
"html-hint": "^0.2.4",
|
"hint.css": "^2.5.0",
|
||||||
"http-server": "^0.10.0",
|
"http-server": "^0.10.0",
|
||||||
"https-browserify": "^1.0.0",
|
"https-browserify": "^1.0.0",
|
||||||
"istanbul-instrumenter-loader": "^2.0.0",
|
"istanbul-instrumenter-loader": "^2.0.0",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user