New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WTH - Additional details #652
Conversation
Added link to Service form for adding an additional details survey. Pivotal Tracker ID - [#118787429]
I added a Questionnaire model, along with an Item model that belongs to the parent Questionnaire object. Enabled adding nested fields on the fly through the use of the Gem 'nested_fields_for'. Modified migrations to incorporate additional features that were included in Iowa's original interpretation.
I refactored into form partial
I successfully tested redirect to index action after successful form submission. Added controller tests to test creation of Questionnaire and Item objects.
… surveys if the user has not already taken them
First glance, this looks awesome!!!! |
@@ -144,6 +146,10 @@ def self.cents_to_dollars cents | |||
cents.to_i / 100.0 | |||
end | |||
|
|||
def has_additional_details |
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.
Should be a ? method
Only suggestions are:
|
@kyle-glick Thanks for the suggestions. These are really helpful. The reason I did partials is because they will render based on an Item's type.
So if item.item_type == 'checkbox' for example, the form will render the partial "checkbox_form_partial" Seemed like the best way to do it programatically as we are dealing with several different types of questions (checkboxes, radios, multiselects') |
= javascript_include_tag 'jquery.qtip.min.js' | ||
= csrf_meta_tags | ||
|
||
%body{ style: 'background: none;' } |
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.
Maybe this inline style should go into a stylesheet.
Killer PR! |
Looks great! |
Created new Additional Details module where Service Providers can create service specific surveys in order to gain feedback from users in SPARC-Request.
Users can create surveys through Catalog Manager where a user can click 'Add Additional Details', which redirects you to manage the surveys for specific Services.
There, a user can utilize the form builder tool to create surveys that accept multiple different types of questions. Also, a user can preview how a form would look like before they actually create a new Questionnaire record.
Once a Questionnaire is created, a user can then manage its 'active' state. Only 'active' questionnaires will be available to take in SPARC-Request. The link to take them will appear on the Document Management page when submitting a new Service Request.
A user does not have to complete the Questionnaire at that time, as they can also take them via links in their user dashboard.
Pivotal Tracker Story Ids
Additional Details Part 1 - #118787429
Additional Details Part 2 - #118787985