Skip to content

Commit

Permalink
fix checkbox in json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
josxha committed Mar 14, 2024
1 parent de7b2f8 commit 4314652
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
var uiText = attributes.Label ?? Model.node.Meta.Label;
}

<label class="checkbox">
<input type="checkbox" class="input"
required="@attributes.Required"
value="@attributes.Value" autocomplete="@attributes.Autocomplete.ToString()?.ToLower()"
disabled="@attributes.Disabled" name="@attributes.Name"
onclick="@attributes.Onclick" pattern="@attributes.Pattern"/>
@OryTranslator.ForUiText(uiText)
<div class="field">
<label class="checkbox">
<input type="checkbox" class="checkbox"
@(attributes.Required ? "required" : "")
@(ReferenceEquals(attributes.Value, "on") ? "checked" : "")
@(attributes.Disabled ? "disabled" : "")
name="@attributes.Name"
value="true"
onclick="@attributes.Onclick" pattern="@attributes.Pattern"/>
@OryTranslator.ForUiText(uiText)
</label>
@await Component.InvokeAsync("KratosUiTextMessages", Model.node.Messages)
</label>
</div>
17 changes: 17 additions & 0 deletions ory/kratos/identity-default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@
"type": "string"
}
}
},
"compliance": {
"type": "object",
"properties": {
"privacy": {
"type": "boolean",
"title": "Accept the privacy policy"
},
"tos": {
"type": "boolean",
"title": "Accept the terms of service"
}
},
"required": [
"privacy",
"tos"
]
}
},
"required": [
Expand Down

0 comments on commit 4314652

Please sign in to comment.