-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: add portal configuration interface #929
base: development
Are you sure you want to change the base?
Conversation
attribute_to_delete = ["context", "links", "@id", "@type"] | ||
attribute_to_not_modify = ["id", "federated_portals", "fundedBy", "keyword", "numberOfArtefacts", "metrics", "numberOfClasses", "numberOfIndividuals", "numberOfProperties", "numberOfAxioms", "numberOfObjectProperties", "numberOfDataProperties", "numberOfLabels", "numberOfDeprecated", "numberOfUsingProjects", "numberOfEndorsements", "numberOfMappings", "numberOfUsers", "numberOfAgents" ] | ||
root_url = "#{rest_url}/?display=all" | ||
attributes_catalog = LinkedData::Client::HTTP.get(root_url, {display: :all}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to create a model in the UI, see the existent to get inspiration https://github.com/ontoportal-lirmm/ontologies_api_ruby_client/tree/master/lib/ontologies_api_client/models
With you can use
your_model.get
your_model.update
@@ -0,0 +1,25 @@ | |||
- if flash[:notice] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is this file called ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it called from this function
def change_portal_config
config_params = params.except(:controller, :action, :format, :authenticity_token, :commit)
root_url = "#{rest_url}/"
begin
response = LinkedData::Client::HTTP.patch(root_url, JSON.parse(config_params.to_json))
if response.success?
flash[:notice] = 'Configuration updated successfully'
else
flash[:alert] = "Update failed: #{response.body}"
end
rescue StandardError => e
flash[:error] = "An error occurred: #{e.message}"
end
end
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah ok, you did the rendering in the helper function.
move the render to the controller action it is the normal way of doing in Rails.
Context
What's new
Adding an interface for the admin of the portals to change the configurations of their portal (or Catalog) in the context of the MOD-API implementation. This interface will use the
/
route in the backend/
route in the api: Feature: add / route for SemanticartefactCatalog ontologies_api#117Screenshot