Skip to content

Commit

Permalink
fix: upload ontology on errors non returned values and no default val…
Browse files Browse the repository at this point in the history
…ues (#625)
  • Loading branch information
Bilelkihal committed Jun 14, 2024
1 parent 4287541 commit 19d59f9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/controllers/concerns/ontology_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ def show_new_errors(object, redirection = 'ontologies/new')
@selected_attributes = (Array(errors_attributes) + Array(params[:submission]&.keys)).uniq
@ontology = ontology_from_params if @ontology.nil?

@submission = submission_from_params(params[:submission]) if params[:submission] && @submission.nil?
@submission = submission_from_params(params[:submission]) if params[:submission] && (@submission.nil? || @submission.errors)

reset_agent_attributes
if redirection.is_a?(Hash) && redirection[:id]
render_turbo_stream replace(redirection[:id], partial: redirection[:partial])
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/ontologies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ def new
@ontology.viewOf = params.dig(:ontology, :viewOf)
@submission = LinkedData::Client::Models::OntologySubmission.new
@submission.hasOntologyLanguage = 'OWL'
@submission.released = Date.today.to_s
@submission.status = 'production'
@ontologies = LinkedData::Client::Models::Ontology.all(include: 'acronym', include_views: true, display_links: false, display_context: false)
@categories = LinkedData::Client::Models::Category.all
@groups = LinkedData::Client::Models::Group.all
Expand Down
2 changes: 1 addition & 1 deletion app/views/ontologies/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- @title = t("ontologies.submit_new_ontology")

%div{:style => "margin:10px;"}
= form_for :ontology, url: {action: "create"}, html: {id: "ontologyForm", multipart: true} do
= form_for :ontology, url: {action: "create"}, html: {id: "ontologyForm", multipart: true, novalidate: true} do
.upload-ontology-container
%div{style: 'width: 589px'}
= error_message_alert
Expand Down

0 comments on commit 19d59f9

Please sign in to comment.