Skip to content

Sample type color field and color configuration#7866

Open
XingY wants to merge 18 commits into
developfrom
fb_sampleColors
Open

Sample type color field and color configuration#7866
XingY wants to merge 18 commits into
developfrom
fb_sampleColors

Conversation

@XingY

@XingY XingY commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Rationale

This PR adds a new exp.material.ExpMaterialColor column so each sample can have its own color value. Previously sample color is defined at sample type level only.

Related Pull Requests

Changes

  • new Sample Colors experimental flag
  • exp.DataColor and exp.DataTypeColorExclusion schema, table and QUS and utils
  • exp.material.expmaterialcolor column: schema and attaching to samples tableInfo
  • Modified createSampleType and updateSampleType util to persist sample color exclusions and their auditing
  • AbstractQueryUpdateService: pass configParameters into _insertRowsUsingInsertRow so the INSERT audit honors the configured AuditBehavior.

Comment on lines +115 to +116
if (getColorCount(container) >= DataColorManager.MAX_DATA_COLORS)
throw new QueryUpdateServiceException("Cannot add more than " + DataColorManager.MAX_DATA_COLORS + " colors.");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this seems fine for now that this check includes all colors instead of just active ones, but I guess I was assuming this would not count the archived ones. either way this limit of 200 seems a bit arbitrary so we can adjust this accordingly if/when a client comes up agains the limit (which I doubt they will in practice)

Comment thread experiment/resources/schemas/dbscripts/postgresql/exp-26.007-26.008.sql Outdated
Comment thread experiment/src/org/labkey/experiment/api/DataColorTable.java
Comment thread experiment/src/org/labkey/experiment/api/DataColorTable.java
Comment thread experiment/src/org/labkey/experiment/api/DataColorTable.java
Comment thread experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java Outdated
Comment thread experiment/src/org/labkey/experiment/api/SampleTypeServiceImpl.java Outdated
Comment thread experiment/src/org/labkey/experiment/api/ExpMaterialTableImpl.java Outdated
@XingY
XingY requested a review from cnathe July 24, 2026 03:00
if (toAdd.isEmpty() && toRemove.isEmpty())
return false;

// Fix the sample type; vary the colors being disabled/re-enabled for it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this comment seems unnecessary

if (toAdd.isEmpty() && toRemove.isEmpty())
return Set.of();

// Fix the color; vary the sample types it's disabled/re-enabled for.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this comment seems unnecessary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants