Skip to content
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

Merged
merged 76 commits into from Sep 13, 2016
Merged

WTH - Additional details #652

merged 76 commits into from Sep 13, 2016

Conversation

wtholt
Copy link
Contributor

@wtholt wtholt commented Aug 25, 2016

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

William Holt added 30 commits July 25, 2016 14:13
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.
@amcates
Copy link
Collaborator

amcates commented Aug 25, 2016

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be a ? method

@kayla-glick
Copy link
Contributor

Only suggestions are:

  1. Most of the files are missing the copyright statement. Should it be there?
  2. Lots of YMLizing needs to be done
  3. You made a lot of 1-2 line partials, but do they need to be partials? What was your reasoning for doing it that way?

@wtholt
Copy link
Contributor Author

wtholt commented Aug 25, 2016

@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.

= render "additional_details/submissions/form_partials/#{item.item_type}_form_partial", item: item, qr: qr

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;' }
Copy link
Contributor

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.

@jayhardee9
Copy link
Contributor

Killer PR!

@jwiel86
Copy link
Contributor

jwiel86 commented Sep 13, 2016

Looks great!

@jleonardw9 jleonardw9 merged commit c7008a8 into master Sep 13, 2016
@jleonardw9 jleonardw9 deleted the additional-details branch September 13, 2016 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants