-
Notifications
You must be signed in to change notification settings - Fork 7
Add detailed auditing of domain changes & comment ability #6655
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
Changes from all commits
c4c68d4
11b5243
9894ab1
6257385
724904e
4842438
ca526b9
0dd74aa
b255592
850e993
987dbcd
43cc174
cf08a84
24db680
95af4ec
2f33703
485de76
782f5ab
8c721f2
51b623a
39237ce
59d7f37
dcc884a
301f215
c28d300
b2bd762
606bdd7
a5b72b6
ec5aef7
423c00f
1ffc59d
92ac24f
c26f270
fcea799
a44b1ce
e1ed9e3
9243d92
410a9c9
7de2e20
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -74,6 +74,7 @@ | |
| import org.labkey.api.exp.api.IAssayDomainType; | ||
| import org.labkey.api.exp.property.Domain; | ||
| import org.labkey.api.exp.property.DomainProperty; | ||
| import org.labkey.api.exp.property.DomainUtil; | ||
| import org.labkey.api.exp.property.PropertyService; | ||
| import org.labkey.api.exp.query.ExpRunTable; | ||
| import org.labkey.api.files.FileContentService; | ||
|
|
@@ -1246,7 +1247,7 @@ public boolean hasUsefulDetailsPage() | |
| private static final String SCRIPT_PATH_DELIMITER = "|"; | ||
|
|
||
| @Override | ||
| public ValidationException setValidationAndAnalysisScripts(ExpProtocol protocol, @NotNull List<AnalysisScript> scripts) throws ExperimentException | ||
| public Pair<ValidationException, Pair<String, String>> setValidationAndAnalysisScripts(ExpProtocol protocol, @NotNull List<AnalysisScript> scripts) throws ExperimentException | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: A typed |
||
| { | ||
| Map<String, ObjectProperty> props = new HashMap<>(protocol.getObjectProperties()); | ||
| String propertyURI = ScriptType.TRANSFORM.getPropertyURI(protocol); | ||
|
|
@@ -1290,9 +1291,11 @@ public ValidationException setValidationAndAnalysisScripts(ExpProtocol protocol, | |
|
|
||
| // don't persist if any validation error has severity=ERROR | ||
| if (validationErrors.getErrors().stream().anyMatch(e -> SEVERITY.ERROR == e.getSeverity())) | ||
| return validationErrors; | ||
| return new Pair<>(validationErrors, null); | ||
|
|
||
| JSONArray json = AnalysisScript.toJson(scripts); | ||
| ObjectProperty oldProp = props.get(propertyURI); | ||
| String oldJson = oldProp == null ? null : oldProp.getStringValue(); | ||
| if (json != null) | ||
| { | ||
| ObjectProperty prop = new ObjectProperty(protocol.getLSID(), protocol.getContainer(), | ||
|
|
@@ -1305,7 +1308,7 @@ public ValidationException setValidationAndAnalysisScripts(ExpProtocol protocol, | |
| } | ||
| protocol.setObjectProperties(props); | ||
|
|
||
| return validationErrors; | ||
| return new Pair<>(validationErrors, new Pair<>(oldJson, json == null ? null : json.toString())); | ||
| } | ||
|
|
||
| /** For migrating legacy assay designs that have separate transform and validation script properties */ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ | |
| */ | ||
| package org.labkey.api.data; | ||
|
|
||
| import org.apache.commons.lang3.StringUtils; | ||
| import org.labkey.api.collections.CaseInsensitiveHashSet; | ||
| import org.labkey.api.exp.MvColumn; | ||
| import org.labkey.api.exp.PropertyDescriptor; | ||
|
|
@@ -500,6 +501,14 @@ public int hashCode() | |
| { | ||
| return Objects.hash(Arrays.hashCode(columnNames), isClustered, isClustered); | ||
| } | ||
|
|
||
| public String toStringVal() | ||
| { | ||
| if (columnNames == null) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Should this check for empty as well? Seems a bit incongruent to return when |
||
| return ""; | ||
|
|
||
| return StringUtils.join(columnNames, ", ") + ", unique: " + isUnique; | ||
| } | ||
| } | ||
|
|
||
| public enum Special | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can just return
Collections.emptyList()then callers do not need to worry about null values (and could be annotated@NotNull.