Skip to content

Commit

Permalink
Show Moments bookmark toggle in production
Browse files Browse the repository at this point in the history
  • Loading branch information
julianguyen committed Oct 15, 2022
1 parent 5d865a1 commit 526ec9d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/helpers/moments_form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def moment_bookmarked
'bookmarked', 'switch', 'moments.form.bookmarked_question'
).merge(
value: true, uncheckedValue: false,
checked: params[:bookmarked] ? true : @moment.bookmarked,
checked: params[:bookmarked] ? true : @moment.bookmarked,
dark: true,
info: t('moments.form.bookmarked_info')
)
Expand All @@ -105,8 +105,8 @@ def moment_form_inputs(edit = false)
moment_name, moment_why, moment_fix, moment_category, moment_mood,
moment_strategy, get_viewers_input(
@viewers, 'moment', 'moments', @moment
), moment_comment, moment_publishing(edit),
Rails.env.development? ? moment_bookmarked : {}, moment_display_resources
), moment_comment, moment_publishing(edit), moment_bookmarked,
moment_display_resources
]
end

Expand Down
44 changes: 44 additions & 0 deletions spec/helpers/moments_form_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,17 @@
uncheckedValue: '1',
value: '0'
},
{
id: 'moment_bookmarked',
checked: false,
dark: true,
info: 'Bookmarked moments appear in your Care Plan',
label: 'Bookmark this moment?',
name: 'moment[bookmarked]',
type: 'switch',
uncheckedValue: false,
value: true
},
{
id: 'moment_resource_recommendations',
type: 'switch',
Expand Down Expand Up @@ -471,6 +482,17 @@
uncheckedValue: '1',
value: '0'
},
{
id: 'moment_bookmarked',
checked: false,
dark: true,
info: 'Bookmarked moments appear in your Care Plan',
label: 'Bookmark this moment?',
name: 'moment[bookmarked]',
type: 'switch',
uncheckedValue: false,
value: true
},
{
id: 'moment_resource_recommendations',
type: 'switch',
Expand Down Expand Up @@ -745,6 +767,17 @@
uncheckedValue: '1',
checked: true
},
{
id: 'moment_bookmarked',
checked: false,
dark: true,
info: 'Bookmarked moments appear in your Care Plan',
label: 'Bookmark this moment?',
name: 'moment[bookmarked]',
type: 'switch',
uncheckedValue: false,
value: true
},
{
id: 'moment_resource_recommendations',
type: 'switch',
Expand Down Expand Up @@ -1013,6 +1046,17 @@
uncheckedValue: '1',
checked: true
},
{
id: 'moment_bookmarked',
checked: false,
dark: true,
info: 'Bookmarked moments appear in your Care Plan',
label: 'Bookmark this moment?',
name: 'moment[bookmarked]',
type: 'switch',
uncheckedValue: false,
value: true
},
{
id: 'moment_resource_recommendations',
type: 'switch',
Expand Down

0 comments on commit 526ec9d

Please sign in to comment.