Skip to content
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 Details sub-tab and API cotextual button in Properties, Instances, Schemes, and Collections #754

Conversation

muhammedBkf
Copy link

@muhammedBkf muhammedBkf commented Sep 11, 2024

Context

Resolve #706, by adding details sub-tab and API contextual button in Properties, Instances, Schemes, and Collections views

Changes

  • Adopted same layout as in Classes (Details as a 1st sub-tab)
  • Adding in the right the API cotextual button.
367313189-e70e8a14-8cdb-4a6e-8d0d-3221ee37e2c9.mp4

Copy link
Collaborator

@syphax-bouazzouni syphax-bouazzouni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that you are a fast learner, good job on already undersanting our code.

I have reviewed the code, see the request changes bellow (or in the Files changed section), in addition to properties and instances, it need to be done also for collections and schemes.

Regading the pull request formating, here are some our required best practices:

  • The naming: if feature start by Feature: your title , if a fix start by Fix: your title .
  • The target branch: if feature or fix, open against the branch development, else if a hot fix open against the branch master.
  • The PR description: As context put the link to the issue that the PR resolves, add a small desctiption if needed, than list all the changes, with a screen shot of each of them.

Here a documentation of how we work for more details

app/controllers/instances_controller.rb Show resolved Hide resolved
app/controllers/properties_controller.rb Outdated Show resolved Hide resolved
app/views/properties/_show.html.haml Show resolved Hide resolved
app/views/properties/_show.html.haml Outdated Show resolved Hide resolved
app/views/properties/_details.html.haml Outdated Show resolved Hide resolved
app/views/ontologies/sections/properties.html.haml Outdated Show resolved Hide resolved
@muhammedBkf
Copy link
Author

Thank you for the review @syphax-bouazzouni, i'll be working on your suggestions

app/views/instances/_details.html.haml Dismissed Show dismissed Hide dismissed
@Bilelkihal
Copy link
Collaborator

Bilelkihal commented Sep 13, 2024

@muhammedBkf
Good job 👏.
Here's some remarks:
No need to start your commit message with "fix:" or other prefixes. Instead, aim to write concise, clear commit messages that accurately describe what you did.
Also, try to create a separate commit for each change. For example, using a message like "fix: resolve issues related to properties raised in code review" may not be very helpful when looking back at the commit history. It's much clearer if you commit each fix individually.

For pull requests, though, our practice is to begin the title with "Feature: ..." or "Fix: ...".

@muhammedBkf
Copy link
Author

Thank you @Bilelkihal

It's just that the commits are in the same PR and the new ones are meant to fix my first commits, that's why the last comments are a bit generic, i will take that into consideration for the upcoming contributions.

@muhammedBkf

This comment was marked as outdated.

@muhammedBkf muhammedBkf changed the base branch from master to development September 19, 2024 18:22
@muhammedBkf muhammedBkf changed the title Enhancement/properties instances layout Feature: Add Details sub-tab and API cotextual button in Properties, Instances, Schemes, and Collections Sep 19, 2024
app/controllers/collections_controller.rb Outdated Show resolved Hide resolved
app/controllers/instances_controller.rb Outdated Show resolved Hide resolved
app/controllers/properties_controller.rb Outdated Show resolved Hide resolved
app/controllers/schemes_controller.rb Outdated Show resolved Hide resolved
app/views/properties/_show.html.haml Outdated Show resolved Hide resolved
@muhammedBkf muhammedBkf force-pushed the enhancement/Properties_Instances_layout branch from 9846511 to 4a802ff Compare September 20, 2024 21:30
@syphax-bouazzouni syphax-bouazzouni force-pushed the enhancement/Properties_Instances_layout branch from d999db5 to f22d4f2 Compare September 30, 2024 05:46
Copy link
Collaborator

@syphax-bouazzouni syphax-bouazzouni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work @muhammedBkf,

I took this occasion to do also a global cleaning of our duplicate code and files, see my commits for details. You can test the code again, and if everything is OK, you can squash this PR.

@muhammedBkf
Copy link
Author

muhammedBkf commented Sep 30, 2024

Screenshot from 2024-09-30 12-15-09
An error get triggred when an empty string is passed by ontology controller.
Ex: if get_scheme(@ontology, scheme_id) returns an empty string

def schemes
@schemes = get_schemes(@ontology)
scheme_id = params[:schemeid] || @submission_latest.URI || nil
@scheme = scheme_id ? get_scheme(@ontology, scheme_id) : @schemes.first

fixed in this commit

@muhammedBkf muhammedBkf force-pushed the enhancement/Properties_Instances_layout branch from 70bab99 to 436bc12 Compare September 30, 2024 11:26
@muhammedBkf
Copy link
Author

I didn't get what does @submission_latest.URI do here

scheme_id = params[:schemeid] || @submission_latest.URI || nil

  • get_scheme(@ontology, @submission_latest.URI) always returns an empty string even though an ontology have a scheme.
  • if we browse to AGROVOC schemes section for example, nothing gets rendered because params[:schemeid] is nil and get_scheme(@ontology, @submission_latest.URI) returns nil too, unlike other sections like properties that renders the first property.

@syphax-bouazzouni
Copy link
Collaborator

I didn't get what does @submission_latest.URI do here

scheme_id = params[:schemeid] || @submission_latest.URI || nil

* `get_scheme(@ontology, @submission_latest.URI)`  always returns an empty string even though an ontology have a scheme.

* if we browse to [AGROVOC schemes section](https://agroportal.lirmm.fr/ontologies/AGROVOC?p=schemes) for example, nothing gets rendered because `params[:schemeid]` is nil and `get_scheme(@ontology, @submission_latest.URI)` returns nil too, unlike other sections like `properties` that renders the first property.

in @submission_latest.URI is saved the main scheme id (the default one) is, you can check it with https://stageportal.lirmm.fr/ontologies/INRAETHES?p=schemes, INRAE thesaurus is selected by default because its ID(URI) is set as default in the @submission_latest.URI

@muhammedBkf
Copy link
Author

I didn't get what does @submission_latest.URI do here

scheme_id = params[:schemeid] || @submission_latest.URI || nil

* `get_scheme(@ontology, @submission_latest.URI)`  always returns an empty string even though an ontology have a scheme.

* if we browse to [AGROVOC schemes section](https://agroportal.lirmm.fr/ontologies/AGROVOC?p=schemes) for example, nothing gets rendered because `params[:schemeid]` is nil and `get_scheme(@ontology, @submission_latest.URI)` returns nil too, unlike other sections like `properties` that renders the first property.

in @submission_latest.URI is saved the main scheme id (the default one) is, you can check it with https://stageportal.lirmm.fr/ontologies/INRAETHES?p=schemes, INRAE thesaurus is selected by default because its ID(URI) is set as default in the @submission_latest.URI

I get it now! Thank you

@syphax-bouazzouni syphax-bouazzouni merged commit 5ade600 into ontoportal-lirmm:development Sep 30, 2024
@syphax-bouazzouni
Copy link
Collaborator

Deployed in https://stageportal.lirmm.fr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants