Skip to content

Commit

Permalink
minor fixes to json model tree ui
Browse files Browse the repository at this point in the history
  • Loading branch information
mrin9 committed Feb 17, 2019
1 parent cc0ada9 commit 71d9b42
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 1,391 deletions.
81 changes: 0 additions & 81 deletions dist/index.html

This file was deleted.

Binary file removed dist/index.html.gz
Binary file not shown.
1,230 changes: 0 additions & 1,230 deletions dist/rapidoc-min.js

This file was deleted.

Binary file removed dist/rapidoc-min.js.gz
Binary file not shown.
1 change: 0 additions & 1 deletion dist/rapidoc-min.js.map

This file was deleted.

Binary file removed dist/rapidoc-min.js.map.gz
Binary file not shown.
Binary file removed dist/rapidoc-regular.woff2
Binary file not shown.
Binary file removed dist/rapidoc-semi-bold.woff2
Binary file not shown.
65 changes: 0 additions & 65 deletions dist/report.html

This file was deleted.

Binary file removed dist/roboto-mono-bold.woff2
Binary file not shown.
Binary file removed dist/roboto-mono-regular.woff2
Binary file not shown.
7 changes: 6 additions & 1 deletion docs/example100.html
Expand Up @@ -43,7 +43,12 @@
}
else if (attr==="header-color"){
arr = ['#2d87e2', "#ff6961", "#34A853", "#FBBC05", "#66757F", "#FFFFFF", "#3B5998", "#8B9DC3", "#7CBB00", "#7B0099", " #FF9900"];
getRapiDoc().setAttribute('primary-color', arr[rand] );
if (arr[rand] !== '#FFFFFF'){
getRapiDoc().setAttribute('primary-color', arr[rand] );
}
else{
getRapiDoc().setAttribute('primary-color', '#FF3D00' );
}
}
else if(attr==="spec-url"){
arr = [
Expand Down
6 changes: 1 addition & 5 deletions index.html
Expand Up @@ -67,14 +67,10 @@
>
</rapi-doc>
-->
<rapi-doc spec-url="https://api.apis.guru/v2/specs/bitbucket.org/2.0/swagger.json"
<rapi-doc spec-url="https://api.apis.guru/v2/specs/azure.com/workloadmonitor-Microsoft.WorkloadMonitor/2018-08-31-preview/swagger.json"
theme="light"
show-info="false"
>
<img slot="logo" src="https://img.icons8.com/color/48/000000/picture.png">
<p slot="top">Hey this content is added from outside</p>
<p slot="bottom">Hey this content is added from outside</p>

</rapi-doc>
</body>

Expand Down
9 changes: 6 additions & 3 deletions src/components/schema-tree.js
Expand Up @@ -93,11 +93,14 @@ export default class SchemaTree extends LitElement {
if (Object.keys(data).length===0){
return html`${ (Array.isArray(data)?'[ ]':'{ }') }`
}
if (Object.keys(data).length===1 && Object.keys(data)[0]===':description'){
return html`${ (Array.isArray(data)?'[ ]':'{ }') } <span class='obj-descr'> ${data[':description']} </span>`
if ((Object.keys(data).length===1) && Object.keys(data)[0]===':description' ){
return html`{ } <span class='obj-descr'> ${data[':description']} </span>`
}
if (detailType==='array' && data[0]==='~|~' ){
return html`[ ]`
}
return html`
<div class="left-bracket expanded ${detailType==='array'?'array':'object'} " @click="${this.toggleExpand}" > ${detailType==='array'?'[':'{'}</div>
<div class="left-bracket expanded ${detailType==='array'?'array':'object'} " @click="${this.toggleExpand}" > ${detailType==='array'?`[`:'{'}</div>
${data[':description']?html`<span class='obj-descr obj-content-part'> ${data[':description']} </span>`:''}
<div class="inside-bracket obj-content-part" >
${Object.keys(data).map(
Expand Down
8 changes: 4 additions & 4 deletions src/utils/common-utils.js
Expand Up @@ -32,9 +32,9 @@ function getTypeInfo(schema, overrideAttributes=null, inSingleLine=true){
if (schema.enum){
let opt=""
schema.enum.map(function(v){
opt = opt + v + ", "
opt = `${opt}${v}┃ `
});
html = `enum:\u3014 ${opt.slice(0,-2)} \u3015`
html = `enum:(${opt.slice(0,-2)})`
}
else if (schema.type){
html = html + schema.type ;
Expand All @@ -46,11 +46,11 @@ function getTypeInfo(schema, overrideAttributes=null, inSingleLine=true){
//html = html+" ( " + (schema.exclusiveMinimum?"> ":"") + schema.minimum + " to " + (schema.exclusiveMaximum?"< ":"") + schema.maximum + " )";
}
else if (schema.minimum!==undefined && schema.maximum===undefined){
html = `${html} (${schema.exclusiveMinimum?">":"\u2265"}${schema.minimum})`
html = `${html} (${schema.exclusiveMinimum?">":""}${schema.minimum})`
//html = html+" ( " + (schema.exclusiveMinimum?"> ":">=") + schema.minimum + " )";
}
else if (schema.minimum===undefined && schema.maximum!==undefined){
html = `(${schema.exclusiveMaximum?"<":"\u2264"}${schema.maximum})`
html = `(${schema.exclusiveMaximum?"<":""}${schema.maximum})`
//html = html+" ( " + (schema.exclusiveMaximum?"< ":"<=") + schema.maximum + " )";
}
if (schema.multipleOf!==undefined){
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Expand Up @@ -59,7 +59,7 @@ module.exports = {
}),
new CleanWebpackPlugin(['dist']),
new HtmlWebpackPlugin({title: 'RAPIDoc', template: 'index.html'}),
new BundleAnalyzerPlugin({analyzerMode:'static'}),
//new BundleAnalyzerPlugin({analyzerMode:'static'}),
new CompressionPlugin(),
new FileManagerPlugin({
onEnd : {
Expand Down

0 comments on commit 71d9b42

Please sign in to comment.