mirror of
https://github.com/ClaperCo/Claper.git
synced 2025-12-16 11:57:58 +01:00
Fix input length validation for polls
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -42,3 +42,4 @@ test/e2e/node_modules
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
priv/static/.well-known/apple-developer-merchantid-domain-association
|
priv/static/.well-known/apple-developer-merchantid-domain-association
|
||||||
priv/static/loaderio-eb3b956a176cdd4f54eb8570ce8bbb06.txt
|
priv/static/loaderio-eb3b956a176cdd4f54eb8570ce8bbb06.txt
|
||||||
|
.elixir_ls
|
||||||
|
|||||||
@@ -5,6 +5,10 @@
|
|||||||
- LTI 1.3 support
|
- LTI 1.3 support
|
||||||
- New layout for presentation manager
|
- New layout for presentation manager
|
||||||
|
|
||||||
|
### Fixes and improvements
|
||||||
|
|
||||||
|
- Fix input length validation for polls
|
||||||
|
|
||||||
## v2.0.1
|
## v2.0.1
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|||||||
@@ -37,5 +37,6 @@ defmodule Claper.Polls.Poll do
|
|||||||
|> cast(attrs, [:title, :presentation_file_id, :position, :enabled, :total, :multiple])
|
|> cast(attrs, [:title, :presentation_file_id, :position, :enabled, :total, :multiple])
|
||||||
|> cast_assoc(:poll_opts, required: true)
|
|> cast_assoc(:poll_opts, required: true)
|
||||||
|> validate_required([:title, :presentation_file_id, :position])
|
|> validate_required([:title, :presentation_file_id, :position])
|
||||||
|
|> validate_length(:title, max: 255)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -31,5 +31,6 @@ defmodule Claper.Polls.PollOpt do
|
|||||||
poll_opt
|
poll_opt
|
||||||
|> cast(attrs, [:content, :vote_count, :poll_id])
|
|> cast(attrs, [:content, :vote_count, :poll_id])
|
||||||
|> validate_required([:content])
|
|> validate_required([:content])
|
||||||
|
|> validate_length(:content, max: 255)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
<%= inputs_for f, :poll_opts, fn i -> %>
|
<%= inputs_for f, :poll_opts, fn i -> %>
|
||||||
<div class="flex space-x-3 mt-3 items-center justify-start">
|
<div class="flex space-x-3 mt-3 items-center justify-start">
|
||||||
<div>
|
<div class="flex-1">
|
||||||
<ClaperWeb.Component.Input.text
|
<ClaperWeb.Component.Input.text
|
||||||
form={i}
|
form={i}
|
||||||
labelClass={if @dark, do: "text-white"}
|
labelClass={if @dark, do: "text-white"}
|
||||||
|
|||||||
Reference in New Issue
Block a user