Merge branch 'master' into ft/big-spec-performance

This commit is contained in:
kyle
2017-11-10 16:45:20 -08:00
committed by GitHub
3 changed files with 26 additions and 12 deletions

View File

@@ -494,8 +494,8 @@ export const validateParam = (param, isXml, isOAS3 = false) => {
let listCheck = type === "array" && Im.List.isList(value) && value.count() let listCheck = type === "array" && Im.List.isList(value) && value.count()
let fileCheck = type === "file" && value instanceof win.File let fileCheck = type === "file" && value instanceof win.File
let booleanCheck = type === "boolean" && (value || value === false) let booleanCheck = type === "boolean" && (value || value === false)
let numberCheck = type === "number" && value let numberCheck = type === "number" && (value || value === 0)
let integerCheck = type === "integer" && value let integerCheck = type === "integer" && (value || value === 0)
if ( required && !(stringCheck || arrayCheck || listCheck || fileCheck || booleanCheck || numberCheck || integerCheck) ) { if ( required && !(stringCheck || arrayCheck || listCheck || fileCheck || booleanCheck || numberCheck || integerCheck) ) {
errors.push("Required field is not provided") errors.push("Required field is not provided")

View File

@@ -3,14 +3,16 @@
font-size: 12px; font-size: 12px;
font-weight: 300; font-weight: 300;
@include text_code();
.deprecated .deprecated
{ {
span, td { span,
td
{
color: $model-deprecated-font-color !important; color: $model-deprecated-font-color !important;
} }
} }
@include text_code();
&-toggle &-toggle
{ {
font-size: 10px; font-size: 10px;
@@ -87,7 +89,8 @@
background: rgba($model-hint-background-color,.7); background: rgba($model-hint-background-color,.7);
} }
p { p
{
margin: 0 0 1em 0; margin: 0 0 1em 0;
} }
} }
@@ -106,6 +109,7 @@ section.models
h4 h4
{ {
margin: 0 0 5px 0; margin: 0 0 5px 0;
border-bottom: 1px solid rgba($section-models-isopen-h4-border-bottom-color, .3); border-bottom: 1px solid rgba($section-models-isopen-h4-border-bottom-color, .3);
} }
} }
@@ -114,6 +118,7 @@ section.models
font-size: 16px; font-size: 16px;
display: flex; display: flex;
align-items: center;
margin: 0; margin: 0;
padding: 10px 20px 10px 10px; padding: 10px 20px 10px 10px;
@@ -122,7 +127,6 @@ section.models
transition: all .2s; transition: all .2s;
@include text_headline($section-models-h4-font-color); @include text_headline($section-models-h4-font-color);
align-items: center;
svg svg
{ {
@@ -218,7 +222,9 @@ section.models
{ {
font-size: 16px; font-size: 16px;
font-weight: 600; font-weight: 600;
margin-right: 1em; margin-right: 1em;
@include text_headline($_color-delete); @include text_headline($_color-delete);
} }
@@ -237,8 +243,8 @@ span
.prop-name .prop-name
{ {
display: inline-block; display: inline-block;
margin-right: 1em; margin-right: 1em;
width: 8em;
} }
.prop-type .prop-type

View File

@@ -700,6 +700,14 @@ describe("utils", function() {
} }
assertValidateParam(param, ["Required field is not provided"]) assertValidateParam(param, ["Required field is not provided"])
// valid integer, but 0 is falsy in JS
param = {
required: true,
type: "integer",
value: 0
}
assertValidateParam(param, [])
// valid integer // valid integer
param = { param = {
required: true, required: true,