-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12 +/- ##
====================================
Coverage 0% 0%
====================================
Files 8 13 +5
Lines 165 224 +59
====================================
- Misses 165 224 +59
Continue to review full report at Codecov.
|
This is very cool. The three leaf files are all exactly the same, from a quick glance, except for the type of the input. Suggest instead we create an input-field.leaf file that gets included and uses a #get(fieldType) and then those other 3 files can all just set the type and then use #embed |
Feature/flexibility review
@grosch at the moment they are the same. We will probably use 1 instead. We could create a generic input-field.leaf but we were not sure if we might want to specialize the different leaf files beyond just the input type. |
…dation Feature/pass entity into validation
Align logic, move req to last
README.md
Outdated
@@ -32,6 +32,8 @@ targets: [ | |||
] | |||
``` | |||
|
|||
Next, copy/paste the `Resources/Views/Submissions` folder into your project in order to be able to use the provided Leaf tags. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to make it extra clear that these leaf files can be customized?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is explained later in the docs, but I've added a link to it and a recommendation on how to go about it.
README.md
Outdated
@@ -276,14 +279,16 @@ and in `routes.swift` we'll add: | |||
router.get ("todos/create", use: frontendTodoController.renderCreate) | |||
``` | |||
|
|||
> Note how we're using the `privateContainer` on the `Request` to limit the scope of our form validation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds a bit vague. How about something like "... on the Request
since that is where the field cache is registered. Which is done to ensure the field cache does not outlive the request."
@@ -0,0 +1,19 @@ | |||
<div class="form-group"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we leave these duplicated leaf files for now? Or create one and point all of the config to that file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created one for now and then let's see if we need to split in the future.
@@ -0,0 +1,32 @@ | |||
import TemplateKit | |||
|
|||
public extension TagContext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API docs
let hasErrors: Bool | ||
} | ||
|
||
public func submissionsData() throws -> SubmissionsData { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API docs
/// any validation errors. | ||
/// - Returns: A `Future` of the `SubmissionType` value. | ||
public func validate(inContext context: ValidationContext, on container: Container) -> Future<T> { | ||
public func validate( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forget, did I have the order different here? Now it reads as if you're validating the submittable, which it not the case. The submittable is only for reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, updated to with submittable
and moved it to be the second argument.
Request
overWorker
to have a db connection.