Skip to content

Commit

Permalink
Plate: expose container column as "Folder" (#5168)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-nicka authored Jan 31, 2024
1 parent c363720 commit 26e0425
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
3 changes: 2 additions & 1 deletion assay/src/org/labkey/assay/plate/PlateManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,8 @@ public ContainerFilter getPlateContainerFilter(@Nullable ExpProtocol protocol, C
*/
public boolean plateExists(Container c, String name)
{
return PlateCache.getPlate(c, name) != null;
Plate plate = PlateCache.getPlate(c, name);
return plate != null && plate.getName().equals(name);
}

private Collection<Plate> getPlates(Container c)
Expand Down
14 changes: 13 additions & 1 deletion assay/src/org/labkey/assay/plate/query/PlateSetTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class PlateSetTable extends SimpleUserSchema.SimpleTable<UserSchema>
static
{
defaultVisibleColumns.add(FieldKey.fromParts("Name"));
defaultVisibleColumns.add(FieldKey.fromParts("Container"));
defaultVisibleColumns.add(FieldKey.fromParts("Folder"));
defaultVisibleColumns.add(FieldKey.fromParts("Description"));
defaultVisibleColumns.add(FieldKey.fromParts("PlateCount"));
defaultVisibleColumns.add(FieldKey.fromParts("Created"));
Expand Down Expand Up @@ -93,6 +93,18 @@ public MutableColumnInfo wrapColumn(ColumnInfo col)
return columnInfo;
}

@Override
protected void fixupWrappedColumn(MutableColumnInfo wrap, ColumnInfo col)
{
super.fixupWrappedColumn(wrap, col);

if ("Container".equalsIgnoreCase(col.getName()))
{
wrap.setFieldKey(FieldKey.fromParts("Folder"));
wrap.setLabel(getContainer().hasProductProjects() ? "Project" : "Folder");
}
}

private void addPlateCountColumn()
{
SQLFragment sql = new SQLFragment("(SELECT COUNT(*) AS plateCount FROM ")
Expand Down
12 changes: 12 additions & 0 deletions assay/src/org/labkey/assay/plate/query/PlateTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,18 @@ public void addColumns()
addWellsFilledColumn();
}

@Override
protected void fixupWrappedColumn(MutableColumnInfo wrap, ColumnInfo col)
{
super.fixupWrappedColumn(wrap, col);

if ("Container".equalsIgnoreCase(col.getName()))
{
wrap.setFieldKey(FieldKey.fromParts("Folder"));
wrap.setLabel(getContainer().hasProductProjects() ? "Project" : "Folder");
}
}

@Override
public List<FieldKey> getDefaultVisibleColumns()
{
Expand Down

0 comments on commit 26e0425

Please sign in to comment.