Skip to content

Commit 1a59f54

Browse files
- ADD: Added support for plot-level 'friendly name', 'barcode' and 'pedigree'. These can be defined during trial creation or at a later time.
1 parent 2004506 commit 1a59f54

8 files changed

Lines changed: 262 additions & 60 deletions

File tree

.idea/workspace.xml

Lines changed: 210 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gridscore.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* tslint:disable */
22
/* eslint-disable */
3-
// Generated using typescript-generator version 3.2.1263 on 2025-01-14 11:11:37.
3+
// Generated using typescript-generator version 3.2.1263 on 2025-05-19 13:40:07.
44

55
export interface Trial {
66
name: string;
@@ -29,6 +29,7 @@ export interface Transaction {
2929
plotMarkedTransactions: { [index: string]: boolean };
3030
plotTraitDataChangeTransactions: { [index: string]: TraitMeasurement[] };
3131
plotGeographyChangeTransactions: { [index: string]: PlotGeographyContent };
32+
plotDetailsChangeTransaction: { [index: string]: PlotDetailContent };
3233
trialCommentAddedTransactions: TrialCommentContent[];
3334
trialCommentDeletedTransactions: TrialCommentContent[];
3435
trialEventAddedTransactions: TrialEventContent[];
@@ -91,6 +92,9 @@ export interface Layout {
9192
export interface Cell {
9293
brapiId: string;
9394
germplasm: string;
95+
barcode: string;
96+
friendlyName: string;
97+
pedigree: string;
9498
rep: string;
9599
isMarked: boolean;
96100
geography: Geography;
@@ -128,6 +132,12 @@ export interface PlotGeographyContent extends PlotContent {
128132
center: LatLng;
129133
}
130134

135+
export interface PlotDetailContent extends PlotContent {
136+
pedigree: string;
137+
friendlyName: string;
138+
barcode: string;
139+
}
140+
131141
export interface TrialCommentContent {
132142
content: string;
133143
timestamp: string;

src/main/java/jhi/gridscore/server/pojo/Cell.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ public class Cell
1414
{
1515
private String brapiId;
1616
private String germplasm;
17+
private String barcode;
18+
private String friendlyName;
19+
private String pedigree;
1720
private String rep;
1821
private Boolean isMarked;
1922
private Geography geography;
@@ -25,6 +28,9 @@ public Cell(Cell input)
2528
{
2629
this.brapiId = input.getBrapiId();
2730
this.germplasm = input.getGermplasm();
31+
this.barcode = input.getBarcode();
32+
this.friendlyName = input.getFriendlyName();
33+
this.pedigree = input.getPedigree();
2834
this.rep = input.getRep();
2935
this.isMarked = input.getIsMarked();
3036
this.geography = input.getGeography();

src/main/java/jhi/gridscore/server/pojo/Transaction.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class Transaction
1919
private Map<String, Boolean> plotMarkedTransactions;
2020
private Map<String, List<TraitMeasurement>> plotTraitDataChangeTransactions;
2121
private Map<String, PlotGeographyContent> plotGeographyChangeTransactions;
22+
private Map<String, PlotDetailContent> plotDetailsChangeTransaction;
2223
private List<TrialCommentContent> trialCommentAddedTransactions;
2324
private List<TrialCommentContent> trialCommentDeletedTransactions;
2425
private List<TrialEventContent> trialEventAddedTransactions;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package jhi.gridscore.server.pojo.transaction;
2+
3+
import lombok.*;
4+
import lombok.experimental.Accessors;
5+
6+
@Getter
7+
@Setter
8+
@Accessors(chain = true)
9+
@NoArgsConstructor
10+
@ToString(callSuper = true)
11+
public class PlotDetailContent extends PlotContent
12+
{
13+
private String pedigree;
14+
private String friendlyName;
15+
private String barcode;
16+
}

src/main/java/jhi/gridscore/server/resource/TrialTransactionResource.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,19 @@ else if (Objects.equals(shareCode, wrapper.getEditorCode()))
237237
}
238238
}
239239

240+
// Check if plot details have changed
241+
if (transaction.getPlotDetailsChangeTransaction() != null)
242+
{
243+
PlotDetailContent plotChanges = transaction.getPlotDetailsChangeTransaction().get(key);
244+
245+
if (plotChanges != null)
246+
{
247+
cell.setBarcode(plotChanges.getBarcode())
248+
.setFriendlyName(plotChanges.getFriendlyName())
249+
.setPedigree(plotChanges.getPedigree());
250+
}
251+
}
252+
240253
// Check if comments have been added
241254
if (transaction.getPlotCommentAddedTransactions() != null)
242255
{
@@ -313,9 +326,9 @@ else if (Objects.equals(shareCode, wrapper.getEditorCode()))
313326
{
314327
// Add new
315328
list.add(new Measurement()
316-
.setPersonId(m.getPersonId())
317-
.setValues(m.getValues())
318-
.setTimestamp(m.getTimestamp()));
329+
.setPersonId(m.getPersonId())
330+
.setValues(m.getValues())
331+
.setTimestamp(m.getTimestamp()));
319332
}
320333
}
321334
else

src/test/java/ConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
public abstract class ConfigTest
1414
{
15-
protected static String URL = "http://localhost:8180/gridscore-next-api/v3.1.1/api/trial";
15+
protected static String URL = "http://localhost:8180/gridscore-next-api/v3.3.0/api/trial";
1616
protected static Client client;
1717
protected static Invocation.Builder postBuilder;
1818

src/test/java/GerminateExportTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ void exportToGerminate()
6464
InputStream in = response.readEntity(InputStream.class);
6565

6666
XSSFWorkbook workbook = new XSSFWorkbook(in);
67-
Assertions.assertEquals(11, workbook.getNumberOfSheets());
67+
Assertions.assertEquals(12, workbook.getNumberOfSheets());
6868
// Check metadata
6969
Sheet metadata = workbook.getSheet("METADATA");
7070
Assertions.assertNotNull(metadata);

0 commit comments

Comments
 (0)