From 4179b78f302e99aede7987afd1c3dfb1bff6bd6c Mon Sep 17 00:00:00 2001 From: SirineMhedhbi <31127782+SirineMhedhbi@users.noreply.github.com> Date: Wed, 12 Jul 2023 10:25:20 +0200 Subject: [PATCH 1/2] Fix bug of select list view of ontology (#289) * Add Chosen.js functionality to fix bug of select views of ontolgy * Add Chosen.js functionality for list views ontologies * fix bug of update ontology where there is no view * Refactor code * Delete ponse = @ontology.update --- app/controllers/ontologies_controller.rb | 1 + app/views/shared/_ontology_picker_single.html.erb | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/controllers/ontologies_controller.rb b/app/controllers/ontologies_controller.rb index c8d38d3357..c1d76eab64 100644 --- a/app/controllers/ontologies_controller.rb +++ b/app/controllers/ontologies_controller.rb @@ -418,6 +418,7 @@ def update # Note: find_by_acronym includes ontology views @ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology][:acronym] || params[:id]).first @ontology.update_from_params(ontology_params) + @ontology.viewOf = nil if @ontology.isView.eql? "0" error_response = @ontology.update if response_error?(error_response) @categories = LinkedData::Client::Models::Category.all diff --git a/app/views/shared/_ontology_picker_single.html.erb b/app/views/shared/_ontology_picker_single.html.erb index dbcb731252..53e2b4f9df 100644 --- a/app/views/shared/_ontology_picker_single.html.erb +++ b/app/views/shared/_ontology_picker_single.html.erb @@ -10,8 +10,17 @@ <%disabled ||= nil%> From 9c5456c884d0203daf4a69fdf7bd99566e8b1f81 Mon Sep 17 00:00:00 2001 From: Syphax Bouazzouni Date: Wed, 12 Jul 2023 20:03:32 +0200 Subject: [PATCH 2/2] remove unsed text in NestedFormInputComponentPreview --- .../previews/nested_form_input_component_preview.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/components/previews/nested_form_input_component_preview.rb b/test/components/previews/nested_form_input_component_preview.rb index 60249be58a..20ef1783ed 100644 --- a/test/components/previews/nested_form_input_component_preview.rb +++ b/test/components/previews/nested_form_input_component_preview.rb @@ -15,10 +15,4 @@ def default(object_name: 'contact') end end end - - private - - def long_text - "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum." - end end \ No newline at end of file