diff --git a/app/controllers/concerns/ontology_updater.rb b/app/controllers/concerns/ontology_updater.rb index 64684a534..e0e9585d5 100644 --- a/app/controllers/concerns/ontology_updater.rb +++ b/app/controllers/concerns/ontology_updater.rb @@ -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]) diff --git a/app/controllers/ontologies_controller.rb b/app/controllers/ontologies_controller.rb index 9c440d68b..606fb3c64 100644 --- a/app/controllers/ontologies_controller.rb +++ b/app/controllers/ontologies_controller.rb @@ -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 diff --git a/app/views/ontologies/new.html.haml b/app/views/ontologies/new.html.haml index 92f88fc21..67a916386 100644 --- a/app/views/ontologies/new.html.haml +++ b/app/views/ontologies/new.html.haml @@ -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