Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into fix/global-iss…
Browse files Browse the repository at this point in the history
…ue-with-the-2023-Q2-release
  • Loading branch information
syphax-bouazzouni committed Nov 7, 2023
2 parents 97551bf + c00e115 commit 923cf35
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/components/switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
justify-content: space-between;
margin-bottom: 20px;
}
.switch-filter p{
.switch-filter > p, .switch-filter > div{
font-size: 16px;
color: #666666;
margin-bottom: 0;
Expand Down
3 changes: 2 additions & 1 deletion app/components/switch_input_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
class SwitchInputComponent < ViewComponent::Base


def initialize(id:, name: , label: '', value: '', checked: false, boolean_switch: false)
def initialize(id:, name: , label: '', value: '', checked: false, boolean_switch: false, style: nil)
super
@id = id
@name = name
@label = label
@value = value.nil? || value.empty? ? @name : value
@checked = checked
@boolean_switch = boolean_switch
@style = style
end

def boolean_switch_action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
- if @boolean_switch
= hidden_field_tag @name, @value
- if content || [email protected]?
%p
= content || @label
= content_tag(:div, content || @label, style: @style)
%label.switch{for: check_box_id}
= check_box_tag check_box_name, @value, @checked, class: '', id: check_box_id, onChange: "#{boolean_switch_action}"
%span.slider
4 changes: 2 additions & 2 deletions app/helpers/inputs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def check_input(id:, name:, value:, label: '', checked: false)
render ChipsComponent.new(name: name, id: id, label: label, value: value, checked: checked)
end

def switch_input(id:, name:, label:, checked: false, value: '', boolean_switch: false)
render SwitchInputComponent.new(id: id, name: name, label: label, checked: checked, value: value, boolean_switch: boolean_switch)
def switch_input(id:, name:, label:, checked: false, value: '', boolean_switch: false, style: nil)
render SwitchInputComponent.new(id: id, name: name, label: label, checked: checked, value: value, boolean_switch: boolean_switch, style: style)
end

def url_input(name:, value:, label: nil, help: nil)
Expand Down
10 changes: 6 additions & 4 deletions app/helpers/submission_inputs_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def attribute_input(attr_key, long_text: false, label: nil, show_tooltip: true,
elsif enforce_values?(attr)
if attr.type?('list')
generate_select_input(attr, multiple: true)
elsif attr.type?('boolean')
generate_boolean_input(attr)
else
generate_select_input(attr)
end
Expand Down Expand Up @@ -141,7 +143,7 @@ def ontology_visibility_input(ontology = @ontology)
select_input(label: "Visibility", name: "ontology[viewingRestriction]", values: %w[public private], selected: ontology.viewingRestriction )
end
content_tag(:div, class: 'upload-ontology-input-field-container') do
select_input(label: "Add or remove accounts that are allowed to view classes in this ontology using the account name", name: "ontology[acl]", values: @user_select_list, selected: ontology.acl, multiple: true)
select_input(label: "Add or remove accounts that are allowed to see this ontology in #{portal_name}.", name: "ontology[acl]", values: @user_select_list, selected: ontology.acl, multiple: true)
end
end
end
Expand All @@ -150,7 +152,7 @@ def ontology_view_of_input(ontology = @ontology)
render Layout::RevealComponent.new(init_show: ontology.view?) do |c|
c.button do
content_tag(:span, class: 'd-flex') do
switch_input(id: 'ontology_isView', name: 'ontology[isView]', label: 'Is this ontology a view of another ontology?', checked: ontology.view?)
switch_input(id: 'ontology_isView', name: 'ontology[isView]', label: 'Is this ontology a view of another ontology?', checked: ontology.view?, style: 'font-size: 14px;')
end
end

Expand All @@ -167,7 +169,7 @@ def contact_input(label: '', name: 'Contact', show_help: true)

render NestedFormInputsComponent.new(object_name: 'contact', default_empty_row: true) do |c|
c.header do
content_tag(:div, "#{name} name", class: 'w-50') + content_tag(:div, "#{name} email", class: 'w-50')
content_tag(:div, "#{name} Name", class: 'w-50') + content_tag(:div, "#{name} Email", class: 'w-50')
end

c.template do
Expand Down Expand Up @@ -312,7 +314,7 @@ def generate_boolean_input(attr)
value = value.to_s unless value.nil?
name = attr.name
content_tag(:div, class: 'd-flex') do
switch_input(id: name, name: name, label: attr_header_label(attr), checked: value.eql?('true'), value: value, boolean_switch: true)
switch_input(id: name, name: name, label: attr_header_label(attr), checked: value.eql?('true'), value: value, boolean_switch: true, style: 'font-size: 14px;')
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/ontologies/_submission_location_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
%label.title{for: "metadata_only"}
Metadata only (No file)
.upload-ontology-desc.mb-2
Allow users to view your ontology metadata, but not its content.
Allow users to view the metadata of your ontology (Summary) only.
#metadata-only-form

.location-choice
Expand Down
2 changes: 1 addition & 1 deletion app/views/submissions/_submission_format_form.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

= attribute_form_group_container('hasOntologyLanguage') do
%div{onchange: 'ontologyFormatChange(event)'}
= select_input(label: "Format", name: "submission[hasOntologyLanguage]", values: ["OBO", "OWL", "SKOS", "UMLS"], selected: @submission.hasOntologyLanguage)
= select_input(label: "Representation language", name: "submission[hasOntologyLanguage]", values: ["OBO", "OWL", "SKOS", "UMLS"], selected: @submission.hasOntologyLanguage)
%div#skos_options.upload-ontology-desc{style: "display:#{skos? ? 'block': 'none'}"}
SKOS vocabularies submitted to BioPortal must contain a minimum of one concept scheme and top concept assertion.
Please refer to the NCBO wiki for a more #{link_to 'detailed explanation', 'https://www.bioontology.org/wiki/index.php/SKOSSupport', target: "_blank" }
Expand Down

0 comments on commit 923cf35

Please sign in to comment.