Skip to content

Commit

Permalink
Replace sample label by sample name (#768)
Browse files Browse the repository at this point in the history
* rename sample label to sample name

* restart actions

* adapt test to new header

* don't show label if 0 measurements are selected

* add bundles precompile

* restore original gitignore

* Refactor SamplePage UI to current Prototype (#702)

* Remove batch view button from batchregistration component

* Fix sample grid layout

* WIP in progress

* Update column width of batch component and remove unnecessary logic in BatchDetailsComponent

* Update column width of sample grid and remove unnecessary logic in SampleDetailsComponent

* Allow user to filter via organismId while searching for samples in SampleInformationMain

* Update CSS to behave similar to MeasurementMain

* Move search and download logic into samplemain and remove unnecessary logic and components

* Remove unused logger

* Make columns resizable, change sample label to name in spreadsheet and freeze action and id column

* Reset search field value if page is refreshed due to any reason (project switch etc.)

* rename sample ids field

---------

Co-authored-by: wow-such-code <[email protected]>
Co-authored-by: Tobias Koch <[email protected]>
Co-authored-by: Steffengreiner <[email protected]>
  • Loading branch information
4 people committed Aug 13, 2024
1 parent ad9eebd commit a63d57e
Show file tree
Hide file tree
Showing 13 changed files with 44 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public ValidationResult validateUpdate(NGSMeasurementMetadata metadata, ProjectI

public enum NGS_PROPERTY {
QBIC_SAMPLE_ID("qbic sample id"),
SAMPLE_LABEL("sample label"),
SAMPLE_LABEL("sample name"),
ORGANISATION_ID("organisation id"),
FACILITY("facility"),
INSTRUMENT("instrument"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public ValidationResult validateUpdate(ProteomicsMeasurementMetadata metadata,

public enum PROTEOMICS_PROPERTY {
QBIC_SAMPLE_ID("qbic sample id"),
SAMPLE_LABEL("sample label"),
SAMPLE_LABEL("sample name"),
ORGANISATION_ID("organisation id"),
FACILITY("facility"),
INSTRUMENT("instrument"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class MeasurementMeasurementProteomicsValidatorSpec extends Specification {

final ProjectInformationService projectInformationService = Mock(ProjectInformationService.class)

final static List<String> validPXPProperties = Collections.unmodifiableList(["qbic sample id", "sample label", "organisation id", "facility", "instrument",
final static List<String> validPXPProperties = Collections.unmodifiableList(["qbic sample id", "sample name", "organisation id", "facility", "instrument",
"sample pool group", "cycle/fraction name", "digestion method", "digestion enzyme",
"enrichment method", "injection volume (uL)", "lc column",
"lcms method", "labeling type", "label", "comment"])
Expand Down
32 changes: 32 additions & 0 deletions user-interface/src/main/bundles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
This directory is automatically generated by Vaadin and contains the pre-compiled
frontend files/resources for your project (frontend development bundle).

It should be added to Version Control System and committed, so that other developers
do not have to compile it again.

Frontend development bundle is automatically updated when needed:
- an npm/pnpm package is added with @NpmPackage or directly into package.json
- CSS, JavaScript or TypeScript files are added with @CssImport, @JsModule or @JavaScript
- Vaadin add-on with front-end customizations is added
- Custom theme imports/assets added into 'theme.json' file
- Exported web component is added.

If your project development needs a hot deployment of the frontend changes,
you can switch Flow to use Vite development server (default in Vaadin 23.3 and earlier versions):
- set `vaadin.frontend.hotdeploy=true` in `application.properties`
- configure `vaadin-maven-plugin`:
```
<configuration>
<frontendHotdeploy>true</frontendHotdeploy>
</configuration>
```
- configure `jetty-maven-plugin`:
```
<configuration>
<systemProperties>
<vaadin.frontend.hotdeploy>true</vaadin.frontend.hotdeploy>
</systemProperties>
</configuration>
```

Read more [about Vaadin development mode](https://vaadin.com/docs/next/configuration/development-mode/#pre-compiled-front-end-bundle-for-faster-start-up).
Binary file added user-interface/src/main/bundles/dev.bundle
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private void createNGSMeasurementGrid() {
expandSpan.addClickListener(event -> measurementPooledSamplesDialog.open());
return expandSpan;
})
.setHeader("Sample IDs")
.setHeader("Samples")
.setAutoWidth(true);
ngsMeasurementGrid.addColumn(NGSMeasurement::facility)
.setHeader("Facility")
Expand Down Expand Up @@ -289,7 +289,7 @@ private void createProteomicsGrid() {
expandSpan.addClickListener(event -> measurementPooledSamplesDialog.open());
return expandSpan;
})
.setHeader("Sample IDs")
.setHeader("Samples")
.setAutoWidth(true);
proteomicsMeasurementGrid.addComponentColumn(
proteomicsMeasurement -> renderOrganisation(proteomicsMeasurement.organisation()))
Expand Down Expand Up @@ -525,7 +525,7 @@ private void setPooledProteomicSampleDetails(
Grid<ProteomicsSpecificMeasurementMetadata> sampleDetailsGrid = new Grid<>();
sampleDetailsGrid.addColumn(
metadata -> retrieveSampleById(metadata.measuredSample()).orElseThrow().label())
.setHeader("Sample Label")
.setHeader("Sample Name")
.setTooltipGenerator(
metadata -> retrieveSampleById(metadata.measuredSample()).orElseThrow().label())
.setAutoWidth(true);
Expand Down Expand Up @@ -558,7 +558,7 @@ private void setPooledNgsSampleDetails(
Grid<NGSSpecificMeasurementMetadata> sampleDetailsGrid = new Grid<>();
sampleDetailsGrid.addColumn(
metadata -> retrieveSampleById(metadata.measuredSample()).orElseThrow().label())
.setHeader("Sample Label")
.setHeader("Sample Name")
.setTooltipGenerator(
metadata -> retrieveSampleById(metadata.measuredSample()).orElseThrow().label())
.setAutoWidth(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ private void routeToRawData(ComponentEvent<?> componentEvent) {
private void setSelectedMeasurementsInfo(int selectedMeasurements) {
String text = "%s measurements are currently selected.".formatted(
String.valueOf(selectedMeasurements));
measurementsSelectedInfoBox.setVisible(selectedMeasurements > 0);
measurementsSelectedInfoBox.setText(text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ enum NGSMeasurementColumns {
SAMPLEID("QBiC Sample Id", 1,
true),
SAMPLELABEL(
"Sample label", 2,
"Sample Name", 2,
true),
POOLGROUP("Sample Pool Group", 3,
true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private static void formatHeader(Row header, CellStyle readOnlyHeader, CellStyle
h2.setCellStyle(readOnlyHeader);

var h3 = header.createCell(2);
h3.setCellValue("Sample label");
h3.setCellValue("Sample Name");
h3.setCellStyle(readOnlyHeader);

var h4 = header.createCell(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public byte[] getContent() {
}
TSVBuilder<SamplePreview> tsvBuilder = new TSVBuilder<>(samples);
tsvBuilder.addColumn("Sample ID", SamplePreview::sampleCode);
tsvBuilder.addColumn("Label", SamplePreview::sampleLabel);
tsvBuilder.addColumn("Sample Name", SamplePreview::sampleLabel);
tsvBuilder.addColumn("Organism ID", SamplePreview::organismId);
tsvBuilder.addColumn("Batch", SamplePreview::batchLabel);
tsvBuilder.addColumn("Species", sample -> sample.species().getLabel());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public String getFileName() {
enum SamplePreviewColumn {

SAMPLE_ID("Sample ID", 0),
LABEL("Label", 1),
LABEL("Sample Name", 1),
ORGANISM_ID("Organism ID", 2),
BATCH("Batch", 3),
SPECIES("Species", 4),
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit a63d57e

Please sign in to comment.