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

Plate: expose container column as "Folder" #5168

Merged
merged 5 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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