Skip to content

Commit 74ce77f

Browse files
RedocBottravis@localhost
authored andcommitted
Merge branch 'master' into releases
2 parents 692be0a + 9b41e37 commit 74ce77f

File tree

9 files changed

+55
-13
lines changed

9 files changed

+55
-13
lines changed

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ deploy:
4141
secure: PuhWLERrCEFmXmdFpw2OVFlqpOIVDmgwk5JUJOYaFdVCh/smp0+jZCQ4vrdFpuG96rnDVirD+A8xvW6NgsNNaRthLgOB/LRdFN69rU6Gvn3At6wlnC55t5dlhxPvCfnzJcHVBLXX4EmMkjnZqDg2uczXTzPodr3FnQJNuXmP8B33fzDVLyHccvXZ90abwXWVrgRIXPU28niqCR8DOC2OTzs7wqz+BLNkYDRRbyYXsg62HWuD33x5iof5IqBmhzBt3usCGmF3QGcgHrXHdZw3sZnit8+Bua++3KrXR0x6HGXXN1AoXVmCAkCa5OTQ5R3tCRxiJN3P2KLnvWeZR74sTFkovJB/6pGCvbJ/c7Wnuw6sD7SgOUBD359ULB6lAf5OnxBLoNebX4JxxVXF+zA4E3Bl44VxkzDpPWc15xqBPMB5vBREzMVmJ5mExn2s5cmLQjADbl9h0y6gZnhnNJ+iTmqtrVyM0ZkF2rPrzrTdGD+ULmRIlTMkdD1bh+/TJ3RdXT3P4/zNUJmiNnvgnnJVYYvsGaXWF+7uCVHT/8k2RsoSHqgkqh0gkDqGSwVix55y5mC7T2Vk9lMBhm6MvFJXaonOX0kxJS4EDQ3plPd6/ybG+TLhwggYnQ8o9msU5Nt6FpUShKiezjKurIhbQZdwlVivX3tahjW2QjNDO58xGgY=
4242
on:
4343
tags: true
44+
- skip_cleanup: true
45+
provider: script
46+
script: npm run github-release
47+
on:
48+
tags: true
4449
- skip_cleanup: true
4550
provider: script
4651
script: npm run branch-release

build/paths.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
module.exports = {
1+
var path = require('path');
2+
3+
var paths = {
24
source: 'lib/**/*.js',
35
html: 'lib/**/*.html',
46
scss: 'lib/**/*.scss',
@@ -8,4 +10,8 @@ module.exports = {
810
tmp: '.tmp/',
911
demo: 'demo/**/*',
1012
tests: '{lib,tests}/**/*.spec.js'
11-
};
13+
}
14+
15+
paths.redocBuilt = path.join(paths.output, paths.outputName);
16+
17+
module.exports = paths;

build/tasks/build.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ var sass = require('gulp-sass');
1212
var replace = require('gulp-replace');
1313
var rename = require('gulp-rename');
1414

15-
paths.redocBuilt = path.join(paths.output, paths.outputName);
16-
1715
gulp.task('build', function (callback) {
1816
return runSequence(
1917
'clean',
@@ -96,7 +94,8 @@ function bundle(outputFile, minify, cb) {
9694
{ format:'umd', sourceMaps: true, mangle: false, lowResSourceMaps: true, minify: minify }
9795
)
9896
.then(function() {
99-
cb();
97+
// wait some time to allow flush
98+
setTimeout(() => cb(), 500);
10099
})
101100
.catch(function(err) {
102101
cb(new Error(err));

build/tasks/github-release.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
var gulp = require('gulp');
2+
var release = require('gulp-github-release');
3+
var path = require('path');
4+
var paths = require('../paths');
5+
6+
gulp.task('github-release', ['build'], function(){
7+
gulp.src(paths.redocBuilt + '.min.js')
8+
.pipe(release({
9+
token: process.env.GH_TOKEN,
10+
manifest: require(path.join(__dirname, '../../package.json'))
11+
}));
12+
});

lib/components/JsonSchema/json-schema.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010
</span>
1111
<table *ngIf="!schema.isTrivial" class="params-wrap" [ngClass]="{'params-array': schema._isArray}">
12-
<caption> {{_displayType}} </caption>
12+
<!-- <caption> {{_displayType}} </caption> -->
1313
<template ngFor [ngForOf]="schema.properties" #prop="$implicit" #last="last">
1414
<tr class="param" [ngClass]="{'last': last, 'discriminator': prop.isDiscriminator, 'complex': prop._pointer}">
1515
<td class="param-name">
@@ -38,7 +38,8 @@
3838
</tr>
3939
<tr class="param-schema" [ngClass]="{'param-array': prop._isArray, 'last': last}" *ngIf="prop._pointer">
4040
<td colspan="2">
41-
<json-schema pointer="{{prop._pointer}}" [isArray]='prop._isArray' class="nested-schema">
41+
<json-schema pointer="{{prop._pointer}}" [isArray]='prop._isArray'
42+
class="nested-schema" [nestOdd]="!nestOdd" [attr.nesteven]="!nestOdd">
4243
</json-schema>
4344
</td>
4445
</tr>

lib/components/JsonSchema/json-schema.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import JsonPointer from '../../utils/JsonPointer';
1111
templateUrl: './lib/components/JsonSchema/json-schema.html',
1212
styleUrls: ['./lib/components/JsonSchema/json-schema.css'],
1313
directives: [JsonSchema, Tabs, Tab],
14-
inputs: ['isArray', 'final']
14+
inputs: ['isArray', 'final', 'nestOdd']
1515
})
1616
@Reflect.metadata('parameters', [[SchemaManager], [ElementRef]])
1717
export default class JsonSchema extends BaseComponent {
@@ -161,7 +161,7 @@ const injectors = {
161161
simpleType: {
162162
check: (propertySchema) => {
163163
if (propertySchema.type === 'object') {
164-
return !propertySchema.properties;
164+
return !propertySchema.properties || !Object.keys(propertySchema.properties).length;
165165
}
166166
return (propertySchema.type !== 'array') && propertySchema.type;
167167
},

lib/components/JsonSchema/json-schema.scss

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $array-marker-line-height: 1.5;
2020
}
2121

2222
json-schema.nested-schema {
23-
background-color: $side-menu-active-bg-color;
23+
background-color: white;
2424
padding: 10px 20px;
2525
position: relative;
2626
border-radius: $border-radius;
@@ -35,7 +35,7 @@ json-schema.nested-schema {
3535
border-color: transparent;
3636
border-width: 10px 15px 0;
3737
margin-left: -7.5px;
38-
border-top-color: white;
38+
border-top-color: $side-menu-active-bg-color;
3939
}
4040
&:before {
4141
left: 10%;
@@ -46,7 +46,20 @@ json-schema.nested-schema {
4646
}
4747

4848
.param:first-of-type > .param-name:before, .param:last-of-type > .param-name:after {
49-
border-color: #f1f1f1;
49+
border-color: white;
50+
}
51+
}
52+
53+
json-schema[nesteven="true"] {
54+
background-color: $side-menu-active-bg-color;
55+
border-radius: $border-radius;
56+
57+
&:before, &:after {
58+
border-top-color: white;
59+
}
60+
61+
> .params-wrap > .param:first-of-type > .param-name:before, > .params-wrap > .param:last-of-type > .param-name:after {
62+
border-color: $side-menu-active-bg-color;
5063
}
5164
}
5265

lib/utils/pipes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ import 'hint.css/hint.base.css!css';
3131

3232
import marked from 'marked';
3333

34+
// in gfm mode marked doesn't parse #Heading (without space after #) as heading
35+
// https://github.com/chjj/marked/issues/642
36+
marked.Lexer.rules.gfm.heading = marked.Lexer.rules.normal.heading;
37+
marked.Lexer.rules.tables.heading = marked.Lexer.rules.normal.heading;
38+
3439
marked.setOptions({
3540
renderer: new marked.Renderer(),
3641
gfm: true,

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "redoc",
33
"description": "Swagger-generated API Reference Documentation",
4-
"version": "0.7.10",
4+
"version": "0.7.11",
55
"repository": {
66
"type": "git",
77
"url": "git://github.com/Rebilly/ReDoc"
@@ -64,6 +64,7 @@
6464
"gulp": "^3.9.1",
6565
"gulp-concat": "^2.6.0",
6666
"gulp-eslint": "^1.1.1",
67+
"gulp-github-release": "^1.1.2",
6768
"gulp-inline-ng2-template": "^1.1.2",
6869
"gulp-protractor": "^2.1.0",
6970
"gulp-rename": "^1.2.2",

0 commit comments

Comments
 (0)