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

Edit templates for measurement registration #832

Merged

Conversation

KochTobi
Copy link
Member

@KochTobi KochTobi commented Sep 10, 2024

Introduces class to generate drop-down lists in excel.
Further
addresses #823 for the edit case
addresses #747
addresses #786

@KochTobi KochTobi requested a review from a team as a code owner September 10, 2024 09:15
@KochTobi KochTobi marked this pull request as draft September 10, 2024 09:15
@KochTobi KochTobi marked this pull request as ready for review September 13, 2024 15:55
Fixes the edit case and renames instrument to MS device

fixes #786
Uses the enum and enhanced switch to make sure all columns are covered and removes complexity.
Excel protected the visible sheet. I do not know why and can only speculate that some reordering was not complete. Creating the hidden sheet second solves the issue.
@KochTobi KochTobi linked an issue Sep 16, 2024 that may be closed by this pull request
1 task
@KochTobi KochTobi changed the title Generate dropdown lists in edit templates for measurement registration Edit templates for measurement registration Sep 16, 2024
@KochTobi KochTobi linked an issue Sep 16, 2024 that may be closed by this pull request
@KochTobi
Copy link
Member Author

Quality Gate Failed Quality Gate failed

Failed conditions 1 Security Hotspot

See analysis details on SonarCloud

Not an issue as the Random can be insecure in this case.

Copy link
Contributor

@Steffengreiner Steffengreiner left a comment

Choose a reason for hiding this comment

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

Heya @KochTobi! Awesome work, i see the benefit of a helper class. However i found an issue during registration and editing of NGS measurements and have some questions, for which a quick answer from your side would be awesome 😄

@@ -57,7 +57,10 @@ public class ProteomicsMeasurement {
private MeasurementId measurementId;

@Column(name = "instrument", columnDefinition = "longtext CHECK (json_valid(`instrument`))")
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this change also be reflected in the db?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes but this would break all existing measurements. So not sure yet how to go about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably best to keep as is right now.

Comment on lines +214 to +215
lockSheet(hiddenSheet);
hideSheet(workbook, hiddenSheet);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused, why do we need a seperate hidden sheet now?

Copy link
Member Author

Choose a reason for hiding this comment

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

The selection of possible values is stored in this hidden sheet. The values are included in a named area in this hidden sheet. This named area is used as formula for the dropdown.https://thecodeshewrites.com/2020/08/11/apache-poi-excel-java-dropdown-list-dependent/

KochTobi and others added 2 commits September 17, 2024 15:33
Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
Copy link
Contributor

@Steffengreiner Steffengreiner left a comment

Choose a reason for hiding this comment

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

Heya @KochTobi nice changes, sadly i think one column header is not correct blocking the ngs edit/registration

@@ -327,6 +342,7 @@ public String propertyName() {

enum NGSMeasurementProperty {
MEASUREMENT_ID("measurement id"),
SAMPLE_CODE("sample code"),
Copy link
Contributor

Choose a reason for hiding this comment

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

This property does not exist in the template sheets for ngs registration and editing, which leads to the issue that no measurements can be registered or edited.
Did you mean QBiC Sample Id ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes I did. The issue with the wrong properties being used seems to have been in the code already. It should be fixed now.

Co-authored-by: steffengreiner <steffen.greiner@qbic.uni-tuebingen.de>
Copy link

sonarcloud bot commented Sep 17, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarCloud

Copy link
Contributor

@Steffengreiner Steffengreiner left a comment

Choose a reason for hiding this comment

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

Well done 👍

@KochTobi KochTobi merged commit f99ebc2 into development Sep 17, 2024
3 of 4 checks passed
@KochTobi KochTobi deleted the feature-823/823-add-dropdowns-to-edit-measurement-metadata branch September 17, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants