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

JM - (SPARCForms) View Response Likert Bug #1299

Merged
merged 2 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/assets/javascripts/likert.js.coffee
Expand Up @@ -21,3 +21,5 @@
$(document).ready ->
$(document). on 'click', '.likert-option', ->
$(this).find('input').prop('checked', true)

$(".disable-likert *").prop('disabled',true)
Expand Up @@ -36,7 +36,7 @@
.form-group
%p.question-description
= raw(question.description)
.question-options
.question-options{ class: ['new', 'edit', 'preview'].include?(action_name) ? '' : 'disable-likert' }
= render "surveyor/responses/form/form_partials/#{question.question_type}_form_partial", qr: qr, question: question, question_response: question_response
- if question.errors.any?
.alert.alert-danger
Expand Down
Expand Up @@ -31,5 +31,5 @@
- if ['new', 'edit', 'preview'].include?(action_name)
= qr.label :content, option.content, class: "radio-inline option no-padding", data: { question_id: question.id, option_id: option.id }
- else
%label.radio-inline.option.no-padding
%label.radio-inline.option.no-padding.disabled
= option.content
Expand Up @@ -41,7 +41,7 @@

expect(page).to have_content('System Satisfaction Survey')
expect(page).to have_selector('.question', count: 1)
expect(page).to have_selector('.likert input[disabled="disabled"]', count: 2)
expect(page).to have_selector('.disable-likert', count: 1)
expect(page).to have_selector('.likert input[checked="checked"]', count: 1)
end
end