Skip to content

Commit

Permalink
CR Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-nicka committed Nov 15, 2024
1 parent 0e68db5 commit 1bde87a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions assay/src/org/labkey/assay/AssayDomainServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ public GWTProtocol saveChanges(GWTProtocol assay, boolean replaceIfExisting) thr
}
else
{
updateDomainDescriptor(domain, protocol, assayProvider, false);
GWTDomain<GWTPropertyDescriptor> previous = DomainUtil.getDomainDescriptor(getUser(), domain.getDomainURI(), protocol.getContainer());
updateDomainDescriptor(domain, protocol, previous, assayProvider, false);
domainURIs.add(domain.getDomainURI());
}

Expand Down Expand Up @@ -566,7 +567,8 @@ public GWTProtocol saveChanges(GWTProtocol assay, boolean replaceIfExisting) thr

for (GWTDomain<GWTPropertyDescriptor> domain : assay.getDomains())
{
GWTDomain<GWTPropertyDescriptor> previous = updateDomainDescriptor(domain, protocol, provider, hasNameChange);
GWTDomain<GWTPropertyDescriptor> previous = DomainUtil.getDomainDescriptor(getUser(), domain.getDomainURI(), protocol.getContainer());
updateDomainDescriptor(domain, protocol, previous, provider, hasNameChange);
boolean hasExistingCalcFields = previous != null && !previous.getCalculatedFields().isEmpty();

GWTDomain<GWTPropertyDescriptor> savedDomain = DomainUtil.getDomainDescriptor(getUser(), domain.getDomainURI(), protocol.getContainer());
Expand All @@ -593,9 +595,14 @@ public GWTProtocol saveChanges(GWTProtocol assay, boolean replaceIfExisting) thr
}
}

private GWTDomain<GWTPropertyDescriptor> updateDomainDescriptor(GWTDomain<GWTPropertyDescriptor> domain, ExpProtocol protocol, AssayProvider provider, boolean hasNameChange) throws ValidationException
private void updateDomainDescriptor(
GWTDomain<GWTPropertyDescriptor> domain,
ExpProtocol protocol,
GWTDomain<GWTPropertyDescriptor> previous,
AssayProvider provider,
boolean hasNameChange
) throws ValidationException
{
GWTDomain<GWTPropertyDescriptor> previous = DomainUtil.getDomainDescriptor(getUser(), domain.getDomainURI(), protocol.getContainer());
for (GWTPropertyDescriptor prop : domain.getFields())
{
if (prop.getLookupQuery() != null)
Expand All @@ -614,8 +621,6 @@ private GWTDomain<GWTPropertyDescriptor> updateDomainDescriptor(GWTDomain<GWTPro
ValidationException domainErrors = DomainUtil.updateDomainDescriptor(previous, domain, getContainer(), getUser(), hasNameChange, auditComment);
if (domainErrors.hasErrors())
throw domainErrors;

return previous;
}

private boolean canUpdateProtocols()
Expand Down

0 comments on commit 1bde87a

Please sign in to comment.