Skip to content

Commit

Permalink
Merge branch 'main' of github.com:inferno-framework/inferno-core into…
Browse files Browse the repository at this point in the history
… FI-3428-share-session
  • Loading branch information
AlyssaWang committed Jan 15, 2025
2 parents 1fea0c7 + 4620ff3 commit 6e13946
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/components/InputsModal/InputCheckboxGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const InputCheckboxGroup: FC<InputCheckboxGroupProps> = ({
color="secondary"
name={option.value}
tabIndex={0}
disabled={!!option.locked || viewOnly}
disabled={input.locked || !!option.locked || viewOnly}
aria-disabled={input.locked || viewOnly}
checked={values[option.value as keyof CheckboxValues] || false}
onBlur={(e) => {
Expand Down
24 changes: 24 additions & 0 deletions dev_suites/dev_demo_ig_stu1/groups/demo_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ class DemoGroup < Inferno::TestGroup
description: 'Checkbox description',
default: ['value2'],
optional: false,
locked: true,
options: {
list_options: [
{
Expand All @@ -333,6 +334,29 @@ class DemoGroup < Inferno::TestGroup
run { info "Received the following 'checkbox' variable: '#{locked_checkbox_group}'" }
end

test 'locked single checkbox in checkbox group input' do
input :locked_single_checkbox_group,
title: 'Locked Single Checkbox in Group Input Example',
type: 'checkbox',
description: 'Checkbox description',
default: ['value2'],
optional: false,
options: {
list_options: [
{
label: 'Label 1',
value: 'value1'
}, {
label: 'Label 2',
value: 'value2',
locked: true
}
]
}

run { info "Received the following 'checkbox' variable: '#{locked_single_checkbox_group}'" }
end

test 'single checkbox input' do
input :single_checkbox,
title: 'Single Checkbox Input Example',
Expand Down
9 changes: 9 additions & 0 deletions spec/inferno/utils/preset_template_generator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@
_title: 'Locked Checkbox Group Input Example',
_description: 'Checkbox description',
_optional: false,
_locked: true,
_options: { list_options: [{ label: 'Label 1', value: 'value1' },
{ label: 'Label 2', locked: true, value: 'value2' }] },
value: ['value2'] },
{ name: 'locked_single_checkbox_group',
_type: 'checkbox',
_title: 'Locked Single Checkbox in Group Input Example',
_description: 'Checkbox description',
_optional: false,
_options: { list_options: [{ label: 'Label 1', value: 'value1' },
{ label: 'Label 2', locked: true, value: 'value2' }] },
value: ['value2'] },
Expand Down

0 comments on commit 6e13946

Please sign in to comment.