From a5c3fac6b8444cea9cd9623ae8f15c5d8ed855f3 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Mon, 13 Apr 2020 12:24:11 -0700 Subject: [PATCH 01/28] Enable lineage graph in "Graph Detail View" --- .../controllers/exp/experimentRunGraphView.jsp | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp index c363fd690fa..d5c00b44879 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp +++ b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp @@ -41,7 +41,6 @@ <% ViewContext context = getViewContext(); ExperimentRunGraphModel model = (ExperimentRunGraphModel)HttpView.currentModel(); - boolean isSummaryView = !model.isDetail(); String uniqueId = "" + UniqueID.getServerSessionScopedUID(); String appId = "run-graph-app-" + uniqueId; @@ -61,9 +60,6 @@ model.isDetail(), model.getFocus(), model.getFocusType()); - - if (isSummaryView) - { %> <%=button("Toggle Beta Graph (new!)").id(toggleBtnId).style("display: inline-block; float: right;")%>
-<% - } -%>

Click on a node in the graph below for details. Run outputs have a bold outline.

Run Graph <% @@ -107,9 +100,6 @@
<%=h(e.getMessage())%>
<% } - - if (isSummaryView) - { %>
@@ -145,6 +135,3 @@ }); })(jQuery); -<% - } -%> \ No newline at end of file From a183c3731999a30c1973e8482769ac7dc07c5f6b Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Wed, 22 Apr 2020 23:38:15 -0700 Subject: [PATCH 02/28] Bump @labkey/components --- experiment/package-lock.json | 12 ++++++------ experiment/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index de06743fdea..05169f7f6fa 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.52.1", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.1.tgz", - "integrity": "sha1-tg4ma8yHL19yPClyj0QvAyJSj1o=", + "version": "0.52.2-fb-rungraph-deets.0", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.2-fb-rungraph-deets.0.tgz", + "integrity": "sha1-cec6USkdLUfLLNjIBBFywmprof8=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", @@ -5279,9 +5279,9 @@ "integrity": "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg==" }, "resolve": { - "version": "1.16.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.16.1.tgz", - "integrity": "sha512-rmAglCSqWWMrrBv/XM6sW0NuRFiKViw/W4d9EbC4pt+49H8JwHy+mcGmALTEg504AUDcLTvb1T2q3E9AnmY+ig==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "requires": { "path-parse": "^1.0.6" } diff --git a/experiment/package.json b/experiment/package.json index e5827e304ee..a7489d36f64 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.52.1" + "@labkey/components": "0.52.2-fb-rungraph-deets.0" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From b847c825789e8accafce5cd45a0114f3866e7be7 Mon Sep 17 00:00:00 2001 From: Kevin Krouse Date: Thu, 23 Apr 2020 15:10:15 -0700 Subject: [PATCH 03/28] Add expType property to lineage API response --- .../api/exp/api/ExperimentJSONConverter.java | 52 +++++++++++++++++-- .../assay/actions/GetAssayRunsAction.java | 2 +- .../experiment/api/ExperimentServiceImpl.java | 12 +++-- .../labkey/experiment/api/LineageTest.java | 2 +- .../controllers/exp/ExperimentController.java | 4 +- 5 files changed, 61 insertions(+), 11 deletions(-) diff --git a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java index f27fa5fc0c4..fcf63e50d52 100644 --- a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java +++ b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java @@ -67,6 +67,8 @@ public class ExperimentJSONConverter public static final String NAME = "name"; public static final String LSID = "lsid"; public static final String CPAS_TYPE = "cpasType"; + // Matches the expType parameted used in the linage api: "Data", "Material", "ExperimentRun", "Object" + public static final String EXP_TYPE = "expType"; public static final String URL = "url"; public static final String PROPERTIES = "properties"; public static final String COMMENT = "comment"; @@ -116,17 +118,19 @@ public static class Settings private final boolean includeProperties; private final boolean includeInputsAndOutputs; private final boolean includeRunSteps; + private final boolean includeExpType; public Settings() { - this(true, true, false); + this(true, true, false, false); } - public Settings(boolean includeProperties, boolean includeInputsAndOutputs, boolean includeRunSteps) + public Settings(boolean includeProperties, boolean includeInputsAndOutputs, boolean includeRunSteps, boolean includeExpType) { this.includeProperties = includeProperties; this.includeInputsAndOutputs = includeInputsAndOutputs; this.includeRunSteps = includeRunSteps; + this.includeExpType = includeExpType; } public boolean isIncludeProperties() @@ -144,14 +148,29 @@ public boolean isIncludeRunSteps() return includeRunSteps; } + public boolean isIncludeExpType() + { + return includeExpType; + } + public Settings withIncludeProperties(boolean b) { - return new Settings(b, includeInputsAndOutputs, includeRunSteps); + return new Settings(b, includeInputsAndOutputs, includeRunSteps, includeExpType); } public Settings withIncludeInputsAndOutputs(boolean b) { - return new Settings(includeProperties, b, includeRunSteps); + return new Settings(includeProperties, b, includeRunSteps, includeExpType); + } + + public Settings withIncludeRunSteps(boolean b) + { + return new Settings(includeProperties, includeInputsAndOutputs, b, includeExpType); + } + + public Settings withIncludeExpType(boolean b) + { + return new Settings(includeProperties, includeInputsAndOutputs, includeRunSteps, b); } } @@ -176,6 +195,10 @@ public static JSONObject serializeRunGroup(ExpExperiment runGroup, Domain domain { JSONObject jsonObject = serializeExpObject(runGroup, domain != null ? domain.getProperties() : Collections.emptyList(), settings); jsonObject.put(COMMENT, runGroup.getComments()); + if (settings.isIncludeExpType()) + { + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Experiment"); + } return jsonObject; } @@ -224,6 +247,10 @@ public static JSONObject serializeRun(ExpRun run, Domain domain, User user, @Not { jsonObject.put(CPAS_TYPE, protocol.getLSID()); } + if (settings.isIncludeExpType()) + { + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "ExperimentRun"); + } if (settings.isIncludeRunSteps()) { @@ -492,6 +519,10 @@ private static JSONObject serializeIdentifiableBean(@NotNull Identifiable obj) public static JSONObject serializeIdentifiable(@NotNull Identifiable obj, Settings settings) { JSONObject json = serializeIdentifiableBean(obj); + if (settings.isIncludeExpType()) + { + json.put(ExperimentJSONConverter.EXP_TYPE, "Object"); + } if (settings.isIncludeProperties()) { @@ -516,6 +547,11 @@ public static JSONObject serializeExpObject(@NotNull ExpObject object, @Nullable // instead and use serializeOntologyProperties(ExpObject) so the object properties will be // fetched using ExpObject.getProperty(). JSONObject jsonObject = serializeIdentifiableBean(object); + if (settings.isIncludeExpType()) + { + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Object"); + } + int rowId = object.getRowId(); if (rowId != 0) { @@ -659,6 +695,10 @@ public static JSONObject serializeData(@NotNull ExpData data, @Nullable User use } jsonObject.put(CPAS_TYPE, data.getCpasType()); + if (settings.isIncludeExpType()) + { + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Data"); + } return jsonObject; } @@ -702,6 +742,10 @@ public static JSONObject serializeMaterial(@NotNull ExpMaterial material, @NotNu } jsonObject.put(CPAS_TYPE, material.getCpasType()); + if (settings.isIncludeExpType()) + { + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Material"); + } return jsonObject; } diff --git a/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java b/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java index 67a843f4f93..e40fe4b50df 100644 --- a/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java +++ b/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java @@ -31,7 +31,7 @@ public ApiResponse execute(AssayRunsForm assayRunsForm, BindException errors) th { List runs = new ArrayList<>(); JSONObject result = new JSONObject(); - var settings = new ExperimentJSONConverter.Settings(assayRunsForm.includeProperties, assayRunsForm.includeInputsAndOutputs, assayRunsForm.includeRunSteps); + var settings = new ExperimentJSONConverter.Settings(assayRunsForm.includeProperties, assayRunsForm.includeInputsAndOutputs, assayRunsForm.includeRunSteps, false); if (assayRunsForm.getLsids() != null && !assayRunsForm.getLsids().isEmpty()) { diff --git a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java index b3a4456d7fd..3958260f3b6 100644 --- a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java @@ -6235,7 +6235,9 @@ public void registerExperimentRunTypeSource(ExperimentRunTypeSource source) @Override public void registerDataType(DataType type) { - _dataTypes.put(type.getNamespacePrefix(), type); + DataType existing = _dataTypes.put(type.getNamespacePrefix(), type); + if (existing != null) + throw new IllegalArgumentException(existing.getClass().getSimpleName() + " already claims namespace prefix '" + existing.getNamespacePrefix() + "'"); } @Override @@ -6264,7 +6266,9 @@ public DataType getDataType(String namespacePrefix) @Override public void registerProtocolImplementation(ProtocolImplementation impl) { - _protocolImplementations.put(impl.getName(), impl); + ProtocolImplementation existing = _protocolImplementations.put(impl.getName(), impl); + if (existing != null) + throw new IllegalArgumentException(existing.getClass().getSimpleName() + " already claims name '" + existing.getName() + "'"); } @Override @@ -6289,7 +6293,9 @@ public List getRunEditors() @Override public void registerProtocolInputCriteria(ExpProtocolInputCriteria.Factory factory) { - _protocolInputCriteriaFactories.put(factory.getName(), factory); + ExpProtocolInputCriteria.Factory existing = _protocolInputCriteriaFactories.put(factory.getName(), factory); + if (existing != null) + throw new IllegalArgumentException(existing.getClass().getSimpleName() + " already claims name '" + existing.getName() + "'"); } @NotNull diff --git a/experiment/src/org/labkey/experiment/api/LineageTest.java b/experiment/src/org/labkey/experiment/api/LineageTest.java index 2f7746e6e49..15ccc607daa 100644 --- a/experiment/src/org/labkey/experiment/api/LineageTest.java +++ b/experiment/src/org/labkey/experiment/api/LineageTest.java @@ -465,7 +465,7 @@ public void testObjectInputOutput() throws Exception assertEquals(Set.of(b1, b2), lineage.getNodeChildren(run)); // verify json structure - JSONObject json = lineage.toJSON(user, true, new ExperimentJSONConverter.Settings(false, false, false)); + JSONObject json = lineage.toJSON(user, true, new ExperimentJSONConverter.Settings(false, false, false, false)); assertEquals(a1Lsid.toString(), json.getString("seed")); JSONObject nodes = json.getJSONObject("nodes"); diff --git a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java index d2f2ce082a5..de1d68121e9 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java +++ b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java @@ -6336,7 +6336,7 @@ public class ResolveAction extends BaseResolveLsidApiAction @Override public Object execute(ResolveLsidsForm form, BindException errors) throws Exception { - var settings = new ExperimentJSONConverter.Settings(form.isIncludeProperties(), form.isIncludeInputsAndOutputs(), form.isIncludeRunSteps()); + var settings = new ExperimentJSONConverter.Settings(form.isIncludeProperties(), form.isIncludeInputsAndOutputs(), form.isIncludeRunSteps(), true); var data = _seeds.stream().map(n -> ExperimentJSONConverter.serialize(n, getUser(), settings)).collect(toList()); return new ApiSimpleResponse("data", data); } @@ -6350,7 +6350,7 @@ public class LineageAction extends BaseResolveLsidApiAction public Object execute(ExpLineageOptions options, BindException errors) { ExpLineage lineage = ExperimentServiceImpl.get().getLineage(getContainer(), getUser(), _seeds, options); - var settings = new ExperimentJSONConverter.Settings(options.isIncludeProperties(), options.isIncludeInputsAndOutputs(), options.isIncludeRunSteps()); + var settings = new ExperimentJSONConverter.Settings(options.isIncludeProperties(), options.isIncludeInputsAndOutputs(), options.isIncludeRunSteps(), true); return new ApiSimpleResponse(lineage.toJSON(getUser(), options.isSingleSeedRequested(), settings)); } } From ca76a1f3e45473a379536acc2ba210a5bb0b779a Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Thu, 23 Apr 2020 17:58:43 -0700 Subject: [PATCH 04/28] Bump @labkey/components --- experiment/package-lock.json | 6 +++--- experiment/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index 05169f7f6fa..33c27a11adf 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.52.2-fb-rungraph-deets.0", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.2-fb-rungraph-deets.0.tgz", - "integrity": "sha1-cec6USkdLUfLLNjIBBFywmprof8=", + "version": "0.52.2-fb-rungraph-deets.1", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.2-fb-rungraph-deets.1.tgz", + "integrity": "sha1-inqqmowetjzQwoQwPZkm2ZoRGK8=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", diff --git a/experiment/package.json b/experiment/package.json index a7489d36f64..b3eff113736 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.52.2-fb-rungraph-deets.0" + "@labkey/components": "0.52.2-fb-rungraph-deets.1" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From 24fb455fbf76516c0a12c2450c60caf78c8abf17 Mon Sep 17 00:00:00 2001 From: Kevin Krouse Date: Fri, 24 Apr 2020 15:08:18 -0700 Subject: [PATCH 05/28] Add ExperimentProtocolHandler to allow lineage API to provide query row reference for specific protocol types Use ExperimentRunType to provide query row reference for runs --- .../org/labkey/api/assay/AssayRunType.java | 2 +- .../api/exp/ExperimentProtocolHandler.java | 28 ++++++++++ .../org/labkey/api/exp/ExperimentRunType.java | 56 ++++++++++++++++--- .../org/labkey/api/exp/api/ExpProtocol.java | 6 +- .../api/exp/api/ExperimentJSONConverter.java | 54 +++++------------- .../labkey/api/exp/api/ExperimentService.java | 11 +++- .../api/exp/api/ProtocolImplementation.java | 32 ++++++++++- .../query/ExpProtocolApplicationTable.java | 8 ++- .../labkey/api/query/QueryRowReference.java | 5 ++ .../assay/actions/GetAssayRunsAction.java | 2 +- .../api/ExpProtocolApplicationImpl.java | 32 +++++++++++ .../api/ExpProtocolApplicationTableImpl.java | 29 ++++++++++ .../experiment/api/ExpProtocolImpl.java | 28 +++++++++- .../org/labkey/experiment/api/ExpRunImpl.java | 20 +++---- .../experiment/api/ExperimentServiceImpl.java | 32 ++++++++++- .../labkey/experiment/api/LineageTest.java | 2 +- .../controllers/exp/ExperimentController.java | 4 +- 17 files changed, 278 insertions(+), 73 deletions(-) create mode 100644 api/src/org/labkey/api/exp/ExperimentProtocolHandler.java diff --git a/api/src/org/labkey/api/assay/AssayRunType.java b/api/src/org/labkey/api/assay/AssayRunType.java index 4807d8fc798..c09e31d1450 100644 --- a/api/src/org/labkey/api/assay/AssayRunType.java +++ b/api/src/org/labkey/api/assay/AssayRunType.java @@ -48,7 +48,7 @@ public class AssayRunType extends ExperimentRunType public AssayRunType(ExpProtocol protocol, Container c) { - super(protocol.getName(), SchemaKey.fromParts(AssaySchema.NAME, AssayService.get().getProvider(protocol).getResourceName(), protocol.getName()).toString(), AssayProtocolSchema.RUNS_TABLE_NAME); + super(protocol.getName(), AssayProtocolSchema.schemaName(AssayService.get().getProvider(protocol), protocol).toString(), AssayProtocolSchema.RUNS_TABLE_NAME); _protocol = protocol; } diff --git a/api/src/org/labkey/api/exp/ExperimentProtocolHandler.java b/api/src/org/labkey/api/exp/ExperimentProtocolHandler.java new file mode 100644 index 00000000000..16380230814 --- /dev/null +++ b/api/src/org/labkey/api/exp/ExperimentProtocolHandler.java @@ -0,0 +1,28 @@ +package org.labkey.api.exp; + +import org.jetbrains.annotations.Nullable; +import org.labkey.api.exp.api.ExpProtocol; +import org.labkey.api.exp.api.ExpProtocolApplication; +import org.labkey.api.exp.api.ExpRun; +import org.labkey.api.query.QueryRowReference; + +/** + * Provides some basic recognition for protocols of a particular type. + */ +public interface ExperimentProtocolHandler extends Handler +{ + /** + * Get a query reference for the protocol type. + */ + public @Nullable QueryRowReference getQueryRowReference(ExpProtocol protocol); + + /** + * Get a query reference for the run of the protocol type. + */ + public @Nullable QueryRowReference getQueryRowReference(ExpProtocol protocol, ExpRun run); + + /** + * Get a query reference for the protocol application of the protocol type. + */ + public @Nullable QueryRowReference getQueryRowReference(ExpProtocol protocol, ExpProtocolApplication app); +} diff --git a/api/src/org/labkey/api/exp/ExperimentRunType.java b/api/src/org/labkey/api/exp/ExperimentRunType.java index 389aec33a57..62a28d2a152 100644 --- a/api/src/org/labkey/api/exp/ExperimentRunType.java +++ b/api/src/org/labkey/api/exp/ExperimentRunType.java @@ -16,11 +16,22 @@ package org.labkey.api.exp; -import org.labkey.api.data.*; +import org.jetbrains.annotations.Nullable; +import org.labkey.api.data.ButtonBar; +import org.labkey.api.data.Container; import org.labkey.api.data.ContainerFilter; +import org.labkey.api.data.TableInfo; +import org.labkey.api.data.TableSelector; import org.labkey.api.exp.api.ExpProtocol; +import org.labkey.api.exp.api.ExpProtocolApplication; +import org.labkey.api.exp.api.ExpRun; +import org.labkey.api.exp.query.ExpProtocolApplicationTable; +import org.labkey.api.exp.query.ExpRunTable; import org.labkey.api.exp.query.ExpSchema; +import org.labkey.api.query.FieldKey; +import org.labkey.api.query.QueryRowReference; import org.labkey.api.query.QueryService; +import org.labkey.api.query.SchemaKey; import org.labkey.api.query.UserSchema; import org.labkey.api.security.User; import org.labkey.api.view.DataView; @@ -37,19 +48,23 @@ * User: jeckels * Date: Sep 25, 2006 */ -public abstract class ExperimentRunType implements Comparable, Handler +public abstract class ExperimentRunType implements Comparable, ExperimentProtocolHandler { - private final String _description; - private final String _schemaName; - private final String _tableName; public static final ExperimentRunType ALL_RUNS_TYPE = new ExperimentRunType("All Runs", ExpSchema.SCHEMA_NAME, ExpSchema.TableType.Runs.toString()) { - public Priority getPriority(ExpProtocol object) + public Priority getPriority(ExpProtocol protocol) { - return Priority.LOW; + if (protocol.getApplicationType() == ExpProtocol.ApplicationType.ExperimentRun) + return Priority.LOW; + + return null; } }; + private final String _description; + private final String _schemaName; + private final String _tableName; + public ExperimentRunType(String description, String schemaName, String tableName) { _description = description; @@ -72,6 +87,33 @@ public String getTableName() return _tableName; } + /** + * Reference to the row that represents the protocol for this run type. + */ + @Nullable + public QueryRowReference getQueryRowReference(ExpProtocol protocol) + { + return new QueryRowReference(protocol.getContainer(), ExpSchema.SCHEMA_EXP, ExpSchema.TableType.Protocols.name(), ExpProtocolApplicationTable.Column.RowId, protocol.getRowId()); + } + + /** + * Reference to the row that represents the run of for this run type. + */ + @Nullable + public QueryRowReference getQueryRowReference(ExpProtocol protocol, ExpRun run) + { + return new QueryRowReference(run.getContainer(), SchemaKey.fromParts(_schemaName), _tableName, ExpRunTable.Column.RowId, run.getRowId()); + } + + /** + * Reference to the row that represents the protocol application for this run type. + */ + @Nullable + public QueryRowReference getQueryRowReference(ExpProtocol protocol, ExpProtocolApplication app) + { + return new QueryRowReference(app.getContainer(), ExpSchema.SCHEMA_EXP, ExpSchema.TableType.ProtocolApplications.name(), ExpProtocolApplicationTable.Column.RowId, app.getRowId()); + } + public long getRunCount(User user, Container c) { UserSchema schema = QueryService.get().getUserSchema(user, c, _schemaName); diff --git a/api/src/org/labkey/api/exp/api/ExpProtocol.java b/api/src/org/labkey/api/exp/api/ExpProtocol.java index 67b0afdf35d..ced5f9329f9 100644 --- a/api/src/org/labkey/api/exp/api/ExpProtocol.java +++ b/api/src/org/labkey/api/exp/api/ExpProtocol.java @@ -16,11 +16,12 @@ package org.labkey.api.exp.api; +import org.jetbrains.annotations.Nullable; +import org.labkey.api.assay.AbstractAssayProvider; import org.labkey.api.data.Container; import org.labkey.api.exp.ObjectProperty; import org.labkey.api.exp.ProtocolParameter; import org.labkey.api.security.User; -import org.labkey.api.assay.AbstractAssayProvider; import java.util.Collection; import java.util.List; @@ -105,7 +106,8 @@ enum ApplicationType ApplicationType getApplicationType(); void setApplicationType(ApplicationType type); - ProtocolImplementation getImplementation(); + @Nullable String getImplementationName(); + @Nullable ProtocolImplementation getImplementation(); String getDescription(); void setDescription(String description); diff --git a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java index fcf63e50d52..3c15f337ef4 100644 --- a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java +++ b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java @@ -118,19 +118,17 @@ public static class Settings private final boolean includeProperties; private final boolean includeInputsAndOutputs; private final boolean includeRunSteps; - private final boolean includeExpType; public Settings() { - this(true, true, false, false); + this(true, true, false); } - public Settings(boolean includeProperties, boolean includeInputsAndOutputs, boolean includeRunSteps, boolean includeExpType) + public Settings(boolean includeProperties, boolean includeInputsAndOutputs, boolean includeRunSteps) { this.includeProperties = includeProperties; this.includeInputsAndOutputs = includeInputsAndOutputs; this.includeRunSteps = includeRunSteps; - this.includeExpType = includeExpType; } public boolean isIncludeProperties() @@ -148,29 +146,19 @@ public boolean isIncludeRunSteps() return includeRunSteps; } - public boolean isIncludeExpType() - { - return includeExpType; - } - public Settings withIncludeProperties(boolean b) { - return new Settings(b, includeInputsAndOutputs, includeRunSteps, includeExpType); + return new Settings(b, includeInputsAndOutputs, includeRunSteps); } public Settings withIncludeInputsAndOutputs(boolean b) { - return new Settings(includeProperties, b, includeRunSteps, includeExpType); + return new Settings(includeProperties, b, includeRunSteps); } public Settings withIncludeRunSteps(boolean b) { - return new Settings(includeProperties, includeInputsAndOutputs, b, includeExpType); - } - - public Settings withIncludeExpType(boolean b) - { - return new Settings(includeProperties, includeInputsAndOutputs, includeRunSteps, b); + return new Settings(includeProperties, includeInputsAndOutputs, b); } } @@ -195,16 +183,14 @@ public static JSONObject serializeRunGroup(ExpExperiment runGroup, Domain domain { JSONObject jsonObject = serializeExpObject(runGroup, domain != null ? domain.getProperties() : Collections.emptyList(), settings); jsonObject.put(COMMENT, runGroup.getComments()); - if (settings.isIncludeExpType()) - { - jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Experiment"); - } + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Experiment"); return jsonObject; } public static JSONObject serializeRun(ExpRun run, Domain domain, User user, @NotNull Settings settings) { JSONObject jsonObject = serializeExpObject(run, domain == null ? null : domain.getProperties(), settings); + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "ExperimentRun"); if (settings.isIncludeProperties()) { jsonObject.put(COMMENT, run.getComments()); @@ -247,10 +233,6 @@ public static JSONObject serializeRun(ExpRun run, Domain domain, User user, @Not { jsonObject.put(CPAS_TYPE, protocol.getLSID()); } - if (settings.isIncludeExpType()) - { - jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "ExperimentRun"); - } if (settings.isIncludeRunSteps()) { @@ -279,6 +261,7 @@ public static JSONObject serializeProtocol(ExpProtocol protocol, User user) // Just include basic protocol properties for now. // See GetProtocolAction and GWTProtocol for serializing an assay protocol with domain fields. JSONObject jsonObject = serializeExpObject(protocol, null, DEFAULT_SETTINGS.withIncludeProperties(false)); + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Protocol"); return jsonObject; } @@ -371,6 +354,7 @@ else if (runInput instanceof ExpMaterialRunInput) protected static JSONObject serializeRunProtocolApplication(@NotNull ExpProtocolApplication protApp, ExpRun run, User user, Settings settings) { JSONObject json = serializeExpObject(protApp, null, settings); + json.put(ExperimentJSONConverter.EXP_TYPE, "ProtocolApplication"); json.put(ACTION_SEQUENCE, protApp.getActionSequence()); json.put(APPLICATION_TYPE, protApp.getApplicationType().toString()); @@ -519,10 +503,7 @@ private static JSONObject serializeIdentifiableBean(@NotNull Identifiable obj) public static JSONObject serializeIdentifiable(@NotNull Identifiable obj, Settings settings) { JSONObject json = serializeIdentifiableBean(obj); - if (settings.isIncludeExpType()) - { - json.put(ExperimentJSONConverter.EXP_TYPE, "Object"); - } + json.put(ExperimentJSONConverter.EXP_TYPE, (Object)null); if (settings.isIncludeProperties()) { @@ -547,10 +528,7 @@ public static JSONObject serializeExpObject(@NotNull ExpObject object, @Nullable // instead and use serializeOntologyProperties(ExpObject) so the object properties will be // fetched using ExpObject.getProperty(). JSONObject jsonObject = serializeIdentifiableBean(object); - if (settings.isIncludeExpType()) - { - jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Object"); - } + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Object"); int rowId = object.getRowId(); if (rowId != 0) @@ -670,6 +648,7 @@ public static JSONObject serializeData(@NotNull ExpData data, @Nullable User use final ExpDataClass dc = data.getDataClass(user); JSONObject jsonObject = serializeExpObject(data, null, settings); + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Data"); if (settings.isIncludeProperties()) { @@ -695,10 +674,6 @@ public static JSONObject serializeData(@NotNull ExpData data, @Nullable User use } jsonObject.put(CPAS_TYPE, data.getCpasType()); - if (settings.isIncludeExpType()) - { - jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Data"); - } return jsonObject; } @@ -742,10 +717,7 @@ public static JSONObject serializeMaterial(@NotNull ExpMaterial material, @NotNu } jsonObject.put(CPAS_TYPE, material.getCpasType()); - if (settings.isIncludeExpType()) - { - jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Material"); - } + jsonObject.put(ExperimentJSONConverter.EXP_TYPE, "Material"); return jsonObject; } diff --git a/api/src/org/labkey/api/exp/api/ExperimentService.java b/api/src/org/labkey/api/exp/api/ExperimentService.java index ed6d8f5ef49..73d8c75c8d9 100644 --- a/api/src/org/labkey/api/exp/api/ExperimentService.java +++ b/api/src/org/labkey/api/exp/api/ExperimentService.java @@ -28,6 +28,7 @@ import org.labkey.api.data.TableInfo; import org.labkey.api.exp.ExperimentDataHandler; import org.labkey.api.exp.ExperimentException; +import org.labkey.api.exp.ExperimentProtocolHandler; import org.labkey.api.exp.ExperimentRunListView; import org.labkey.api.exp.ExperimentRunType; import org.labkey.api.exp.ExperimentRunTypeSource; @@ -760,9 +761,11 @@ ExpRun derive(Map inputMaterials, Map inpu void registerProtocolImplementation(ProtocolImplementation impl); + void registerProtocolHandler(ExperimentProtocolHandler handler); + void registerProtocolInputCriteria(ExpProtocolInputCriteria.Factory factory); - ProtocolImplementation getProtocolImplementation(String name); + @Nullable ProtocolImplementation getProtocolImplementation(String name); ExpProtocolApplication getExpProtocolApplication(int rowId); @@ -827,6 +830,12 @@ ExpRun derive(Map inputMaterials, Map inpu List getExpProtocolsUsedByRuns(Container c, ContainerFilter containerFilter); + @Nullable + ExperimentProtocolHandler getExperimentProtocolHandler(@NotNull ExpProtocol protocol); + + @Nullable + ExperimentRunType getExperimentRunType(@NotNull ExpProtocol protocol); + @Nullable ExperimentRunType getExperimentRunType(@NotNull String description, @Nullable Container container); diff --git a/api/src/org/labkey/api/exp/api/ProtocolImplementation.java b/api/src/org/labkey/api/exp/api/ProtocolImplementation.java index 07492cacbfa..d14b8ae491f 100644 --- a/api/src/org/labkey/api/exp/api/ProtocolImplementation.java +++ b/api/src/org/labkey/api/exp/api/ProtocolImplementation.java @@ -16,13 +16,15 @@ package org.labkey.api.exp.api; +import org.jetbrains.annotations.Nullable; import org.labkey.api.data.Container; +import org.labkey.api.exp.ExperimentProtocolHandler; import org.labkey.api.query.QueryRowReference; import org.labkey.api.security.User; import java.util.List; -public class ProtocolImplementation +public class ProtocolImplementation implements ExperimentProtocolHandler { final protected String _name; public ProtocolImplementation(String name) @@ -60,8 +62,36 @@ public void onRunDeleted(Container container, User user) { } + @Override + public @Nullable Priority getPriority(ExpProtocol protocol) + { + if (getName().equals(protocol.getImplementationName())) + return Priority.HIGH; + + return null; + } + + /** + * Get a query reference for the protocol type. + */ + public QueryRowReference getQueryRowReference(ExpProtocol protocol) + { + return null; + } + + /** + * Get a query reference for the run of the protocol type. + */ public QueryRowReference getQueryRowReference(ExpProtocol protocol, ExpRun run) { return null; } + + /** + * Get a query reference for the protocol application of the protocol type. + */ + public QueryRowReference getQueryRowReference(ExpProtocol protocol, ExpProtocolApplication app) + { + return null; + } } diff --git a/api/src/org/labkey/api/exp/query/ExpProtocolApplicationTable.java b/api/src/org/labkey/api/exp/query/ExpProtocolApplicationTable.java index 7d4b3b5d9b2..5ec4db2dfde 100644 --- a/api/src/org/labkey/api/exp/query/ExpProtocolApplicationTable.java +++ b/api/src/org/labkey/api/exp/query/ExpProtocolApplicationTable.java @@ -27,11 +27,17 @@ enum Column { RowId, Name, + Comments, LSID, Protocol, Run, ActionSequence, - Type + Type, + ActivityDate, + StartTime, + EndTime, + RecordCount, + Properties } BaseColumnInfo createMaterialInputColumn(String alias, SamplesSchema schema, ExpSampleSet sampleSet, String... roleNames); diff --git a/api/src/org/labkey/api/query/QueryRowReference.java b/api/src/org/labkey/api/query/QueryRowReference.java index 8d77a3b816c..3b3853c5c2b 100644 --- a/api/src/org/labkey/api/query/QueryRowReference.java +++ b/api/src/org/labkey/api/query/QueryRowReference.java @@ -21,6 +21,11 @@ public class QueryRowReference final @NotNull String _queryName; final @NotNull List> _pkFilters; + public QueryRowReference(@NotNull Container c, @NotNull SchemaKey schemaKey, @NotNull String queryName, @NotNull Enum pkCol, int pkValue) + { + this(c, schemaKey, queryName, List.of(Pair.of(FieldKey.fromParts(pkCol), pkValue))); + } + public QueryRowReference(@NotNull Container c, @NotNull SchemaKey schemaKey, @NotNull String queryName, @NotNull FieldKey pkCol, int pkValue) { this(c, schemaKey, queryName, List.of(Pair.of(pkCol, pkValue))); diff --git a/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java b/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java index e40fe4b50df..67a843f4f93 100644 --- a/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java +++ b/assay/src/org/labkey/assay/actions/GetAssayRunsAction.java @@ -31,7 +31,7 @@ public ApiResponse execute(AssayRunsForm assayRunsForm, BindException errors) th { List runs = new ArrayList<>(); JSONObject result = new JSONObject(); - var settings = new ExperimentJSONConverter.Settings(assayRunsForm.includeProperties, assayRunsForm.includeInputsAndOutputs, assayRunsForm.includeRunSteps, false); + var settings = new ExperimentJSONConverter.Settings(assayRunsForm.includeProperties, assayRunsForm.includeInputsAndOutputs, assayRunsForm.includeRunSteps); if (assayRunsForm.getLsids() != null && !assayRunsForm.getLsids().isEmpty()) { diff --git a/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java b/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java index dbd29d9f378..e59dc0479fa 100644 --- a/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java @@ -24,6 +24,7 @@ import org.labkey.api.data.SqlExecutor; import org.labkey.api.data.Table; import org.labkey.api.data.dialect.SqlDialect; +import org.labkey.api.exp.ExperimentProtocolHandler; import org.labkey.api.exp.OntologyManager; import org.labkey.api.exp.api.ExpData; import org.labkey.api.exp.api.ExpDataProtocolInput; @@ -32,8 +33,13 @@ import org.labkey.api.exp.api.ExpProtocol; import org.labkey.api.exp.api.ExpProtocolApplication; import org.labkey.api.exp.api.ExpRun; +import org.labkey.api.exp.api.ExperimentService; +import org.labkey.api.exp.api.ProtocolImplementation; import org.labkey.api.exp.api.ProvenanceService; +import org.labkey.api.exp.query.ExpProtocolApplicationTable; +import org.labkey.api.exp.query.ExpSchema; import org.labkey.api.query.FieldKey; +import org.labkey.api.query.QueryRowReference; import org.labkey.api.security.User; import org.labkey.api.util.Pair; import org.labkey.api.view.ActionURL; @@ -66,6 +72,32 @@ public ActionURL detailsURL() return null; } + @Override + public @Nullable QueryRowReference getQueryRowReference() + { + ExpProtocolImpl protocol = getProtocol(); + if (protocol != null) + { + ProtocolImplementation impl = protocol.getImplementation(); + if (impl != null) + { + QueryRowReference ref = impl.getQueryRowReference(protocol, this); + if (ref != null) + return ref; + } + + ExperimentProtocolHandler handler = ExperimentService.get().getExperimentProtocolHandler(protocol); + if (handler != null) + { + QueryRowReference ref = handler.getQueryRowReference(protocol, this); + if (ref != null) + return ref; + } + } + + return new QueryRowReference(getContainer(), ExpSchema.SCHEMA_EXP, ExpSchema.TableType.ProtocolApplications.name(), FieldKey.fromParts(ExpProtocolApplicationTable.Column.RowId), getRowId()); + } + public Date getCreated() { ExpRun run = getRun(); diff --git a/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationTableImpl.java b/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationTableImpl.java index 3c44b61c2d9..f0cb79d671b 100644 --- a/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationTableImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationTableImpl.java @@ -31,6 +31,8 @@ import org.labkey.api.query.FieldKey; import org.labkey.api.query.UserSchema; +import java.util.List; + public class ExpProtocolApplicationTableImpl extends ExpTableImpl implements ExpProtocolApplicationTable { public ExpProtocolApplicationTableImpl(String name, UserSchema schema, ContainerFilter cf) @@ -63,6 +65,8 @@ public BaseColumnInfo createColumn(String alias, ExpProtocolApplicationTable.Col return rowIdColumnInfo; case Name: return wrapColumn(alias, _rootTable.getColumn("Name")); + case Comments: + return wrapColumn(alias, _rootTable.getColumn("Comments")); case LSID: return wrapColumn(alias, _rootTable.getColumn("LSID")); case Run: @@ -77,6 +81,16 @@ public BaseColumnInfo createColumn(String alias, ExpProtocolApplicationTable.Col var columnInfo = wrapColumn(alias, _rootTable.getColumn("ProtocolLSID")); columnInfo.setFk(getExpSchema().getProtocolForeignKey(getContainerFilter(), "LSID")); return columnInfo; + case ActivityDate: + return wrapColumn(alias, _rootTable.getColumn("ActivityDate")); + case StartTime: + return wrapColumn(alias, _rootTable.getColumn("StartTime")); + case EndTime: + return wrapColumn(alias, _rootTable.getColumn("EndTime")); + case RecordCount: + return wrapColumn(alias, _rootTable.getColumn("RecordCount")); + case Properties: + return (BaseColumnInfo) createPropertiesColumn(alias); } throw new IllegalArgumentException("Unknown column " + column); } @@ -148,11 +162,26 @@ protected void populateColumns() addColumn(Column.RowId); addColumn(Column.Name); setTitleColumn(Column.Name.toString()); + addColumn(Column.Comments); addColumn(Column.Run); addColumn(Column.LSID).setHidden(true); addColumn(Column.Protocol); addColumn(Column.Type); addColumn(Column.ActionSequence).setHidden(true); + addColumn(Column.ActivityDate); + addColumn(Column.StartTime); + addColumn(Column.EndTime); + addColumn(Column.RecordCount); + addColumn(Column.Properties).setHidden(true); + + setDefaultVisibleColumns(List.of( + FieldKey.fromParts(Column.Name), + FieldKey.fromParts(Column.Run), + FieldKey.fromParts(Column.Protocol), + FieldKey.fromParts(Column.Type) + )); + + _populated = true; } @Override diff --git a/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java b/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java index 02bca2634a3..42e743f67ba 100644 --- a/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java @@ -26,6 +26,8 @@ import org.labkey.api.data.Table; import org.labkey.api.data.TableSelector; import org.labkey.api.exp.ExperimentException; +import org.labkey.api.exp.ExperimentProtocolHandler; +import org.labkey.api.exp.ExperimentRunType; import org.labkey.api.exp.ObjectProperty; import org.labkey.api.exp.ProtocolParameter; import org.labkey.api.exp.api.ExpDataProtocolInput; @@ -72,6 +74,22 @@ public ActionURL detailsURL() @Override public @Nullable QueryRowReference getQueryRowReference() { + ProtocolImplementation impl = getImplementation(); + if (impl != null) + { + QueryRowReference ref = impl.getQueryRowReference(this); + if (ref != null) + return ref; + } + + ExperimentProtocolHandler handler = ExperimentService.get().getExperimentProtocolHandler(this); + if (handler != null) + { + QueryRowReference ref = handler.getQueryRowReference(this); + if (ref != null) + return ref; + } + return new QueryRowReference(getContainer(), ExpSchema.SCHEMA_EXP, ExpSchema.TableType.Protocols.name(), FieldKey.fromParts(ExpProtocolTable.Column.RowId.name()), getRowId()); } @@ -91,10 +109,14 @@ public ApplicationType getApplicationType() } } - public ProtocolImplementation getImplementation() + public @Nullable String getImplementationName() + { + return (String) getProperty(ExperimentProperty.PROTOCOLIMPLEMENTATION.getPropertyDescriptor()); + } + + public @Nullable ProtocolImplementation getImplementation() { - String implName = (String) getProperty(ExperimentProperty.PROTOCOLIMPLEMENTATION.getPropertyDescriptor()); - return ExperimentService.get().getProtocolImplementation(implName); + return ExperimentService.get().getProtocolImplementation(getImplementationName()); } public int getRowId() diff --git a/experiment/src/org/labkey/experiment/api/ExpRunImpl.java b/experiment/src/org/labkey/experiment/api/ExpRunImpl.java index bc7d903972a..577b3e1eb64 100644 --- a/experiment/src/org/labkey/experiment/api/ExpRunImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpRunImpl.java @@ -38,6 +38,7 @@ import org.labkey.api.data.TableSelector; import org.labkey.api.data.dialect.SqlDialect; import org.labkey.api.exp.ExperimentException; +import org.labkey.api.exp.ExperimentRunType; import org.labkey.api.exp.Lsid; import org.labkey.api.exp.OntologyManager; import org.labkey.api.exp.api.DataType; @@ -129,20 +130,17 @@ public ActionURL detailsURL() ProtocolImplementation impl = protocol.getImplementation(); if (impl != null) { - QueryRowReference coords = impl.getQueryRowReference(protocol, this); - if (coords != null) - return coords; + QueryRowReference ref = impl.getQueryRowReference(protocol, this); + if (ref != null) + return ref; } - AssayService assayService = AssayService.get(); - if (assayService != null) + ExperimentRunType type = ExperimentService.get().getExperimentRunType(protocol); + if (type != null) { - AssayProvider provider = assayService.getProvider(this); - if (provider != null) - { - SchemaKey schemaKey = AssayProtocolSchema.schemaName(provider, protocol); - return new QueryRowReference(getContainer(), schemaKey, ExpSchema.TableType.Runs.name(), FieldKey.fromParts(ExpRunTable.Column.RowId), getRowId()); - } + QueryRowReference ref = type.getQueryRowReference(protocol, this); + if (ref != null) + return ref; } } diff --git a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java index 3958260f3b6..d1347915b9e 100644 --- a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java @@ -84,6 +84,7 @@ import org.labkey.api.pipeline.PipelineValidationException; import org.labkey.api.query.BatchValidationException; import org.labkey.api.query.FieldKey; +import org.labkey.api.query.QueryRowReference; import org.labkey.api.query.QueryService; import org.labkey.api.query.QueryUpdateService; import org.labkey.api.query.SchemaKey; @@ -194,6 +195,7 @@ public class ExperimentServiceImpl implements ExperimentService protected Map _dataTypes = new HashMap<>(); protected Map _protocolImplementations = new HashMap<>(); protected Map _protocolInputCriteriaFactories = new HashMap<>(); + private Set _protocolHandlers = new HashSet<>(); private static final List _listeners = new CopyOnWriteArrayList<>(); @@ -313,6 +315,28 @@ public List getExpProtocolsUsedByRuns(Container c, ContainerFil return result; } + @Override + public @Nullable ExperimentProtocolHandler getExperimentProtocolHandler(@NotNull ExpProtocol protocol) + { + if (protocol.getApplicationType() == ExpProtocol.ApplicationType.ExperimentRun) + { + return getExperimentRunType(protocol); + } + else if (protocol.getApplicationType() == ExpProtocol.ApplicationType.ProtocolApplication) + { + return Handler.Priority.findBestHandler(_protocolHandlers, protocol); + } + return null; + } + + @Nullable + @Override + public ExperimentRunType getExperimentRunType(@NotNull ExpProtocol protocol) + { + Set types = getExperimentRunTypes(protocol.getContainer()); + return Handler.Priority.findBestHandler(types, protocol); + } + @Nullable @Override public ExperimentRunType getExperimentRunType(@NotNull String description, @Nullable Container container) @@ -6272,7 +6296,13 @@ public void registerProtocolImplementation(ProtocolImplementation impl) } @Override - public ProtocolImplementation getProtocolImplementation(String name) + public void registerProtocolHandler(ExperimentProtocolHandler handler) + { + _protocolHandlers.add(handler); + } + + @Override + public @Nullable ProtocolImplementation getProtocolImplementation(String name) { return _protocolImplementations.get(name); } diff --git a/experiment/src/org/labkey/experiment/api/LineageTest.java b/experiment/src/org/labkey/experiment/api/LineageTest.java index 15ccc607daa..2f7746e6e49 100644 --- a/experiment/src/org/labkey/experiment/api/LineageTest.java +++ b/experiment/src/org/labkey/experiment/api/LineageTest.java @@ -465,7 +465,7 @@ public void testObjectInputOutput() throws Exception assertEquals(Set.of(b1, b2), lineage.getNodeChildren(run)); // verify json structure - JSONObject json = lineage.toJSON(user, true, new ExperimentJSONConverter.Settings(false, false, false, false)); + JSONObject json = lineage.toJSON(user, true, new ExperimentJSONConverter.Settings(false, false, false)); assertEquals(a1Lsid.toString(), json.getString("seed")); JSONObject nodes = json.getJSONObject("nodes"); diff --git a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java index de1d68121e9..d2f2ce082a5 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java +++ b/experiment/src/org/labkey/experiment/controllers/exp/ExperimentController.java @@ -6336,7 +6336,7 @@ public class ResolveAction extends BaseResolveLsidApiAction @Override public Object execute(ResolveLsidsForm form, BindException errors) throws Exception { - var settings = new ExperimentJSONConverter.Settings(form.isIncludeProperties(), form.isIncludeInputsAndOutputs(), form.isIncludeRunSteps(), true); + var settings = new ExperimentJSONConverter.Settings(form.isIncludeProperties(), form.isIncludeInputsAndOutputs(), form.isIncludeRunSteps()); var data = _seeds.stream().map(n -> ExperimentJSONConverter.serialize(n, getUser(), settings)).collect(toList()); return new ApiSimpleResponse("data", data); } @@ -6350,7 +6350,7 @@ public class LineageAction extends BaseResolveLsidApiAction public Object execute(ExpLineageOptions options, BindException errors) { ExpLineage lineage = ExperimentServiceImpl.get().getLineage(getContainer(), getUser(), _seeds, options); - var settings = new ExperimentJSONConverter.Settings(options.isIncludeProperties(), options.isIncludeInputsAndOutputs(), options.isIncludeRunSteps(), true); + var settings = new ExperimentJSONConverter.Settings(options.isIncludeProperties(), options.isIncludeInputsAndOutputs(), options.isIncludeRunSteps()); return new ApiSimpleResponse(lineage.toJSON(getUser(), options.isSingleSeedRequested(), settings)); } } From e5c0f4bee1e9c852857043f88880665db40f1777 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Sun, 26 Apr 2020 13:01:35 -0700 Subject: [PATCH 06/28] Bump @labkey/components --- experiment/package-lock.json | 6 +++--- experiment/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index 33c27a11adf..30fabfef218 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.52.2-fb-rungraph-deets.1", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.2-fb-rungraph-deets.1.tgz", - "integrity": "sha1-inqqmowetjzQwoQwPZkm2ZoRGK8=", + "version": "0.52.3-fb-rungraph-deets.2", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.3-fb-rungraph-deets.2.tgz", + "integrity": "sha1-+Yu5dtg6NWOouftiiymMaz5L+jE=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", diff --git a/experiment/package.json b/experiment/package.json index b3eff113736..b1ecb05db6a 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.52.2-fb-rungraph-deets.1" + "@labkey/components": "0.52.3-fb-rungraph-deets.2" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From 699afd3c749a85c5d607b50d7fc20ee650a76071 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Sun, 26 Apr 2020 13:38:54 -0700 Subject: [PATCH 07/28] Bump @labkey/components --- experiment/package-lock.json | 6 +++--- experiment/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index 30fabfef218..db6aac65137 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.52.3-fb-rungraph-deets.2", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.3-fb-rungraph-deets.2.tgz", - "integrity": "sha1-+Yu5dtg6NWOouftiiymMaz5L+jE=", + "version": "0.52.3-fb-rungraph-deets.3", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.3-fb-rungraph-deets.3.tgz", + "integrity": "sha1-jg2iCSWF8STH7NHLCEXmSs1AfL4=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", diff --git a/experiment/package.json b/experiment/package.json index b1ecb05db6a..7e3e343b962 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.52.3-fb-rungraph-deets.2" + "@labkey/components": "0.52.3-fb-rungraph-deets.3" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From d47fc71c69b5ad305838b40707de51235a4f7fc8 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Sun, 26 Apr 2020 23:04:35 -0700 Subject: [PATCH 08/28] Bump @labkey/components --- experiment/package-lock.json | 6 +++--- experiment/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index db6aac65137..3c03098f937 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.52.3-fb-rungraph-deets.3", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.52.3-fb-rungraph-deets.3.tgz", - "integrity": "sha1-jg2iCSWF8STH7NHLCEXmSs1AfL4=", + "version": "0.53.3-fb-rungraph-deets.4", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.53.3-fb-rungraph-deets.4.tgz", + "integrity": "sha1-k2Ps5y3qnNJtj6PEzmtqy3pWngc=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", diff --git a/experiment/package.json b/experiment/package.json index 7e3e343b962..2ac8b02dfe2 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.52.3-fb-rungraph-deets.3" + "@labkey/components": "0.53.3-fb-rungraph-deets.4" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From ab437d6d8f38feb2c5d2a45d0841a7e3b8aca8a5 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Mon, 27 Apr 2020 17:25:20 -0700 Subject: [PATCH 09/28] Bump @labkey/components --- experiment/package-lock.json | 12 ++++++------ experiment/package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index 3c03098f937..a1db6f00f0a 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.53.3-fb-rungraph-deets.4", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.53.3-fb-rungraph-deets.4.tgz", - "integrity": "sha1-k2Ps5y3qnNJtj6PEzmtqy3pWngc=", + "version": "0.53.3-fb-rungraph-deets.5", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.53.3-fb-rungraph-deets.5.tgz", + "integrity": "sha1-UNqhsVAG+y7XEqqeRTgfA3D3VZw=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", @@ -1554,9 +1554,9 @@ } }, "css-box-model": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.0.tgz", - "integrity": "sha512-lri0br+jSNV0kkkiGEp9y9y3Njq2PmpqbeGWRFQJuZteZzY9iC9GZhQ8Y4WpPwM/2YocjHePxy14igJY7YKzkA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/css-box-model/-/css-box-model-1.2.1.tgz", + "integrity": "sha512-a7Vr4Q/kd/aw96bnJG332W9V9LkJO69JRcaCYDUqjp6/z0w6VcZjgAcTbgFxEPfBgdnAwlh3iwu+hLopa+flJw==", "requires": { "tiny-invariant": "^1.0.6" } diff --git a/experiment/package.json b/experiment/package.json index 2ac8b02dfe2..4ac6905aaac 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.53.3-fb-rungraph-deets.4" + "@labkey/components": "0.53.3-fb-rungraph-deets.5" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From 750e4803af948c12960a1cbb7f10fba94a3b4f44 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Mon, 27 Apr 2020 17:39:05 -0700 Subject: [PATCH 10/28] Revert "Enable lineage graph in "Graph Detail View"" This reverts commit a5c3fac6 --- .../controllers/exp/experimentRunGraphView.jsp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp index d5c00b44879..c363fd690fa 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp +++ b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp @@ -41,6 +41,7 @@ <% ViewContext context = getViewContext(); ExperimentRunGraphModel model = (ExperimentRunGraphModel)HttpView.currentModel(); + boolean isSummaryView = !model.isDetail(); String uniqueId = "" + UniqueID.getServerSessionScopedUID(); String appId = "run-graph-app-" + uniqueId; @@ -60,6 +61,9 @@ model.isDetail(), model.getFocus(), model.getFocusType()); + + if (isSummaryView) + { %> <%=button("Toggle Beta Graph (new!)").id(toggleBtnId).style("display: inline-block; float: right;")%>
+<% + } +%>

Click on a node in the graph below for details. Run outputs have a bold outline.

Run Graph <% @@ -100,6 +107,9 @@
<%=h(e.getMessage())%>
<% } + + if (isSummaryView) + { %>
@@ -135,3 +145,6 @@ }); })(jQuery); +<% + } +%> \ No newline at end of file From 75c6c013d4dc8fb80d8d13c496d54c3a3dac8f22 Mon Sep 17 00:00:00 2001 From: Kevin Krouse Date: Tue, 28 Apr 2020 13:52:43 -0700 Subject: [PATCH 11/28] code review feedback --- .../api/exp/api/ExperimentJSONConverter.java | 2 +- .../api/ExpProtocolApplicationImpl.java | 18 +++--------------- .../labkey/experiment/api/ExpProtocolImpl.java | 14 +++++++++++++- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java index 3c15f337ef4..dffdc44733c 100644 --- a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java +++ b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java @@ -67,7 +67,7 @@ public class ExperimentJSONConverter public static final String NAME = "name"; public static final String LSID = "lsid"; public static final String CPAS_TYPE = "cpasType"; - // Matches the expType parameted used in the linage api: "Data", "Material", "ExperimentRun", "Object" + // Matches the expType parameter used in the linage api: "Data", "Material", "ExperimentRun", "Object" public static final String EXP_TYPE = "expType"; public static final String URL = "url"; public static final String PROPERTIES = "properties"; diff --git a/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java b/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java index e59dc0479fa..d980a586888 100644 --- a/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpProtocolApplicationImpl.java @@ -78,21 +78,9 @@ public ActionURL detailsURL() ExpProtocolImpl protocol = getProtocol(); if (protocol != null) { - ProtocolImplementation impl = protocol.getImplementation(); - if (impl != null) - { - QueryRowReference ref = impl.getQueryRowReference(protocol, this); - if (ref != null) - return ref; - } - - ExperimentProtocolHandler handler = ExperimentService.get().getExperimentProtocolHandler(protocol); - if (handler != null) - { - QueryRowReference ref = handler.getQueryRowReference(protocol, this); - if (ref != null) - return ref; - } + QueryRowReference ref = protocol.getCustomQueryRowReference(); + if (ref != null) + return ref; } return new QueryRowReference(getContainer(), ExpSchema.SCHEMA_EXP, ExpSchema.TableType.ProtocolApplications.name(), FieldKey.fromParts(ExpProtocolApplicationTable.Column.RowId), getRowId()); diff --git a/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java b/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java index 42e743f67ba..8933ec85b39 100644 --- a/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpProtocolImpl.java @@ -73,6 +73,18 @@ public ActionURL detailsURL() @Override public @Nullable QueryRowReference getQueryRowReference() + { + QueryRowReference ref = getCustomQueryRowReference(); + if (ref != null) + return ref; + + return new QueryRowReference(getContainer(), ExpSchema.SCHEMA_EXP, ExpSchema.TableType.Protocols.name(), FieldKey.fromParts(ExpProtocolTable.Column.RowId.name()), getRowId()); + } + + /** + * Return a protocol specific query row reference or null if the default should be used. + */ + /*package*/ @Nullable QueryRowReference getCustomQueryRowReference() { ProtocolImplementation impl = getImplementation(); if (impl != null) @@ -90,7 +102,7 @@ public ActionURL detailsURL() return ref; } - return new QueryRowReference(getContainer(), ExpSchema.SCHEMA_EXP, ExpSchema.TableType.Protocols.name(), FieldKey.fromParts(ExpProtocolTable.Column.RowId.name()), getRowId()); + return null; } public ApplicationType getApplicationType() From 6e27b4ac5dc2d8946e772f3877da490315bdb26f Mon Sep 17 00:00:00 2001 From: Kevin Krouse Date: Tue, 28 Apr 2020 13:54:34 -0700 Subject: [PATCH 12/28] Use generic URL for data that have DataType but no detail URL (e.g. AssayDataType) --- experiment/src/org/labkey/experiment/api/ExpDataImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/experiment/src/org/labkey/experiment/api/ExpDataImpl.java b/experiment/src/org/labkey/experiment/api/ExpDataImpl.java index 909e947f76a..83ba057100b 100644 --- a/experiment/src/org/labkey/experiment/api/ExpDataImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpDataImpl.java @@ -139,7 +139,9 @@ public ActionURL detailsURL() DataType dataType = getDataType(); if (dataType != null) { - return dataType.getDetailsURL(this); + ActionURL url = dataType.getDetailsURL(this); + if (url != null) + return url; } return _object.detailsURL(); From bbcb2016a86cb2d521c8697707b540632aee8190 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Tue, 28 Apr 2020 23:01:37 -0700 Subject: [PATCH 13/28] Add "datafile" icon --- internal/webapp/_images/datafile.svg | 21 +++++++++++++++++++++ internal/webapp/_images/datafile_gray.svg | 21 +++++++++++++++++++++ internal/webapp/_images/datafile_light.svg | 21 +++++++++++++++++++++ internal/webapp/_images/datafile_orange.svg | 21 +++++++++++++++++++++ 4 files changed, 84 insertions(+) create mode 100644 internal/webapp/_images/datafile.svg create mode 100644 internal/webapp/_images/datafile_gray.svg create mode 100644 internal/webapp/_images/datafile_light.svg create mode 100644 internal/webapp/_images/datafile_orange.svg diff --git a/internal/webapp/_images/datafile.svg b/internal/webapp/_images/datafile.svg new file mode 100644 index 00000000000..1576726a524 --- /dev/null +++ b/internal/webapp/_images/datafile.svg @@ -0,0 +1,21 @@ + + + + file_node_alt_blue_64x64 + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/webapp/_images/datafile_gray.svg b/internal/webapp/_images/datafile_gray.svg new file mode 100644 index 00000000000..ef39c189152 --- /dev/null +++ b/internal/webapp/_images/datafile_gray.svg @@ -0,0 +1,21 @@ + + + + file_node_alt_gray_64x64 + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/webapp/_images/datafile_light.svg b/internal/webapp/_images/datafile_light.svg new file mode 100644 index 00000000000..8fda8ca537e --- /dev/null +++ b/internal/webapp/_images/datafile_light.svg @@ -0,0 +1,21 @@ + + + + file_node_alt_outline_64x64 + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/internal/webapp/_images/datafile_orange.svg b/internal/webapp/_images/datafile_orange.svg new file mode 100644 index 00000000000..2a18aea901f --- /dev/null +++ b/internal/webapp/_images/datafile_orange.svg @@ -0,0 +1,21 @@ + + + + file_node_alt_orange_64x64 + Created with Sketch. + + + + + + + + + + + + + + + + \ No newline at end of file From d0a212c2a01f690d2c947977593b5fd22adb7285 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Tue, 28 Apr 2020 23:01:44 -0700 Subject: [PATCH 14/28] Add "file" icon --- internal/webapp/_images/file.svg | 16 ++++++++++++++++ internal/webapp/_images/file_gray.svg | 16 ++++++++++++++++ internal/webapp/_images/file_light.svg | 16 ++++++++++++++++ internal/webapp/_images/file_orange.svg | 16 ++++++++++++++++ 4 files changed, 64 insertions(+) create mode 100644 internal/webapp/_images/file.svg create mode 100644 internal/webapp/_images/file_gray.svg create mode 100644 internal/webapp/_images/file_light.svg create mode 100644 internal/webapp/_images/file_orange.svg diff --git a/internal/webapp/_images/file.svg b/internal/webapp/_images/file.svg new file mode 100644 index 00000000000..ab7c2623f9c --- /dev/null +++ b/internal/webapp/_images/file.svg @@ -0,0 +1,16 @@ + + + + file_node_blue_64x64 + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/internal/webapp/_images/file_gray.svg b/internal/webapp/_images/file_gray.svg new file mode 100644 index 00000000000..0eaebb328cf --- /dev/null +++ b/internal/webapp/_images/file_gray.svg @@ -0,0 +1,16 @@ + + + + file_node_gray_64x64 + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/internal/webapp/_images/file_light.svg b/internal/webapp/_images/file_light.svg new file mode 100644 index 00000000000..f376b969656 --- /dev/null +++ b/internal/webapp/_images/file_light.svg @@ -0,0 +1,16 @@ + + + + file_node_outline_64x64 + Created with Sketch. + + + + + + + + + + + \ No newline at end of file diff --git a/internal/webapp/_images/file_orange.svg b/internal/webapp/_images/file_orange.svg new file mode 100644 index 00000000000..be3474ec165 --- /dev/null +++ b/internal/webapp/_images/file_orange.svg @@ -0,0 +1,16 @@ + + + + file_node_orange_64x64 + Created with Sketch. + + + + + + + + + + + \ No newline at end of file From 82ff762cb0333dd95b236556dcef93248b83f3f8 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Tue, 28 Apr 2020 23:56:13 -0700 Subject: [PATCH 15/28] LineageFilter on null expType nodes --- experiment/src/client/RunGraph/RunGraph.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/experiment/src/client/RunGraph/RunGraph.tsx b/experiment/src/client/RunGraph/RunGraph.tsx index fce36d81da3..04225cead38 100644 --- a/experiment/src/client/RunGraph/RunGraph.tsx +++ b/experiment/src/client/RunGraph/RunGraph.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { initQueryGridState, + LineageFilter, LineageGraph, LineageURLResolvers, } from '@labkey/components'; @@ -21,6 +22,7 @@ export class RunGraph extends React.Component { { From c1331724c81312b2c90bc465a5d600f05d921c62 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Tue, 28 Apr 2020 23:58:43 -0700 Subject: [PATCH 16/28] Bump @labkey/components --- experiment/package-lock.json | 6 +++--- experiment/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index a1db6f00f0a..abdc3d07de4 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.53.3-fb-rungraph-deets.5", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.53.3-fb-rungraph-deets.5.tgz", - "integrity": "sha1-UNqhsVAG+y7XEqqeRTgfA3D3VZw=", + "version": "0.54.0-fb-rungraph-deets.1", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.54.0-fb-rungraph-deets.1.tgz", + "integrity": "sha1-hae7dknG/EtTxVRrUv/u/69yRu8=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", diff --git a/experiment/package.json b/experiment/package.json index 4ac6905aaac..c64eacd1acc 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.53.3-fb-rungraph-deets.5" + "@labkey/components": "0.54.0-fb-rungraph-deets.1" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From c268ce9a893293ac067b67915bbf924ebd45bd59 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Wed, 29 Apr 2020 14:29:02 -0700 Subject: [PATCH 17/28] Use lineage node provided link --- experiment/src/client/RunGraph/RunGraph.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experiment/src/client/RunGraph/RunGraph.tsx b/experiment/src/client/RunGraph/RunGraph.tsx index 04225cead38..21b00b871a5 100644 --- a/experiment/src/client/RunGraph/RunGraph.tsx +++ b/experiment/src/client/RunGraph/RunGraph.tsx @@ -13,7 +13,7 @@ import '@labkey/components/dist/components.css'; initQueryGridState(); interface RunGraphProps { - context: AppContext + context: AppContext; } export class RunGraph extends React.Component { @@ -26,7 +26,7 @@ export class RunGraph extends React.Component { lsid={this.props.context.lsid} urlResolver={LineageURLResolvers.Server} navigate={(node) => { - if (node && node.lineageNode && node.lineageNode.links.lineage) { + if (node?.lineageNode?.links?.lineage) { window.location.href = node.lineageNode.links.lineage; } }} From 406fdc87ac7e96479c32863012baaa845dad0bb2 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Wed, 29 Apr 2020 14:47:26 -0700 Subject: [PATCH 18/28] Bump @labkey/components --- experiment/package-lock.json | 24 ++++++++++++------------ experiment/package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index abdc3d07de4..a76ae03043a 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -36,26 +36,26 @@ } }, "@babel/runtime": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", - "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz", + "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==", "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/runtime-corejs2": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.9.2.tgz", - "integrity": "sha512-ayjSOxuK2GaSDJFCtLgHnYjuMyIpViNujWrZo8GUpN60/n7juzJKK5yOo6RFVb0zdU9ACJFK+MsZrUnj3OmXMw==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.9.6.tgz", + "integrity": "sha512-TcdM3xc7weMrwTawuG3BTjtVE3mQLXUPQ9CxTbSKOrhn3QAcqCJ2fz+IIv25wztzUnhNZat7hr655YJa61F3zg==", "requires": { "core-js": "^2.6.5", "regenerator-runtime": "^0.13.4" } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "requires": { "@babel/helper-validator-identifier": "^7.9.5", "lodash": "^4.17.13", @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.54.0-fb-rungraph-deets.1", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.54.0-fb-rungraph-deets.1.tgz", - "integrity": "sha1-hae7dknG/EtTxVRrUv/u/69yRu8=", + "version": "0.55.0-fb-rungraph-deets.0", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.55.0-fb-rungraph-deets.0.tgz", + "integrity": "sha1-jcAD9QdUQNEj5NWEOc5LuWuw8CY=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", diff --git a/experiment/package.json b/experiment/package.json index c64eacd1acc..ed900e88e31 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.54.0-fb-rungraph-deets.1" + "@labkey/components": "0.55.0-fb-rungraph-deets.0" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From bb3a3c7bf9c063b4d70c9e4370a6d179e2d5d017 Mon Sep 17 00:00:00 2001 From: Kevin Krouse Date: Wed, 29 Apr 2020 16:50:38 -0700 Subject: [PATCH 19/28] Use SchemaKey in ExperimentRunType constructor --- api/src/org/labkey/api/assay/AssayRunType.java | 2 +- api/src/org/labkey/api/exp/ExperimentRunType.java | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/src/org/labkey/api/assay/AssayRunType.java b/api/src/org/labkey/api/assay/AssayRunType.java index c09e31d1450..55db9b29b31 100644 --- a/api/src/org/labkey/api/assay/AssayRunType.java +++ b/api/src/org/labkey/api/assay/AssayRunType.java @@ -48,7 +48,7 @@ public class AssayRunType extends ExperimentRunType public AssayRunType(ExpProtocol protocol, Container c) { - super(protocol.getName(), AssayProtocolSchema.schemaName(AssayService.get().getProvider(protocol), protocol).toString(), AssayProtocolSchema.RUNS_TABLE_NAME); + super(protocol.getName(), AssayProtocolSchema.schemaName(AssayService.get().getProvider(protocol), protocol), AssayProtocolSchema.RUNS_TABLE_NAME); _protocol = protocol; } diff --git a/api/src/org/labkey/api/exp/ExperimentRunType.java b/api/src/org/labkey/api/exp/ExperimentRunType.java index 62a28d2a152..feb33f48acf 100644 --- a/api/src/org/labkey/api/exp/ExperimentRunType.java +++ b/api/src/org/labkey/api/exp/ExperimentRunType.java @@ -50,7 +50,7 @@ */ public abstract class ExperimentRunType implements Comparable, ExperimentProtocolHandler { - public static final ExperimentRunType ALL_RUNS_TYPE = new ExperimentRunType("All Runs", ExpSchema.SCHEMA_NAME, ExpSchema.TableType.Runs.toString()) + public static final ExperimentRunType ALL_RUNS_TYPE = new ExperimentRunType("All Runs", ExpSchema.SCHEMA_EXP, ExpSchema.TableType.Runs.toString()) { public Priority getPriority(ExpProtocol protocol) { @@ -62,10 +62,15 @@ public Priority getPriority(ExpProtocol protocol) }; private final String _description; - private final String _schemaName; + private final SchemaKey _schemaName; private final String _tableName; public ExperimentRunType(String description, String schemaName, String tableName) + { + this(description, SchemaKey.fromString(schemaName), tableName); + } + + public ExperimentRunType(String description, SchemaKey schemaName, String tableName) { _description = description; _schemaName = schemaName; @@ -77,7 +82,7 @@ public String getDescription() return _description; } - public String getSchemaName() + public SchemaKey getSchemaName() { return _schemaName; } From db4916aaa497a74a50c131cb88a53988490adec0 Mon Sep 17 00:00:00 2001 From: Kevin Krouse Date: Wed, 29 Apr 2020 16:51:00 -0700 Subject: [PATCH 20/28] include container --- api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java index dffdc44733c..007bf47abca 100644 --- a/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java +++ b/api/src/org/labkey/api/exp/api/ExperimentJSONConverter.java @@ -60,6 +60,7 @@ public class ExperimentJSONConverter // General experiment object properties public static final String ID = "id"; public static final String ROW_ID = "rowId"; + public static final String CONTAINER = "container"; public static final String CREATED = "created"; public static final String CREATED_BY = "createdBy"; public static final String MODIFIED = "modified"; @@ -485,6 +486,8 @@ private static JSONObject serializeIdentifiableBean(@NotNull Identifiable obj) if (url != null) json.put(URL, url); + json.put(CONTAINER, obj.getContainer().getId()); + QueryRowReference rowRef = obj.getQueryRowReference(); if (rowRef != null) { From 07805a1e8c895fb9893608db48b070da1f15df4a Mon Sep 17 00:00:00 2001 From: Kevin Krouse Date: Wed, 29 Apr 2020 16:51:45 -0700 Subject: [PATCH 21/28] return an empty lineage for unknown materials --- .../experiment/api/ExperimentServiceImpl.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java index cf02c2fafba..f6f44c95c40 100644 --- a/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExperimentServiceImpl.java @@ -159,6 +159,7 @@ import java.util.stream.Collectors; import static java.util.Collections.emptyList; +import static java.util.Collections.emptySet; import static java.util.Collections.singleton; import static java.util.stream.Collectors.toList; import static java.util.stream.Collectors.toSet; @@ -1978,7 +1979,7 @@ private boolean assertLineage(ExpRunItem seed, Pair, Set, Set> getParentsOldAndBusted(ExpRunItem start) { if (isUnknownMaterial(start)) - return Pair.of(Collections.emptySet(), Collections.emptySet()); + return Pair.of(emptySet(), emptySet()); List runsToInvestigate = new ArrayList<>(); ExpRun parentRun = start.getRun(); @@ -2036,7 +2037,7 @@ public Pair, Set> getChildren(Container c, User user, private Pair, Set> getChildrenOldAndBusted(ExpRunItem start) { if (isUnknownMaterial(start)) - return Pair.of(Collections.emptySet(), Collections.emptySet()); + return Pair.of(emptySet(), emptySet()); List runsToInvestigate = new ArrayList<>(); if (start instanceof ExpData) @@ -2256,7 +2257,10 @@ else if (seed instanceof IdentifiableBase) throw new RuntimeException("Lineage not available for unknown object: " + seed.getLSID()); if (seed instanceof ExpRunItem && isUnknownMaterial((ExpRunItem) seed)) - throw new RuntimeException("Lineage not available for unknown material: " + seed.getLSID()); + { + LOG.warn("Lineage not available for unknown material: " + seed.getLSID()); + continue; + } // ensure that the protocol output lineage is in the same container as the request if (c != null && !c.equals(seed.getContainer())) @@ -2269,6 +2273,9 @@ else if (seed instanceof IdentifiableBase) throw new RuntimeException("Requested lineage for duplicate objectId seed: " + objectId); } + if (seedObjectIds.isEmpty()) + return new ExpLineage(seeds, emptySet(), emptySet(), emptySet(), emptySet(), emptySet()); + options.setUseObjectIds(true); SQLFragment sqlf = generateExperimentTreeSQLObjectIdsSeeds(seedObjectIds, options); Set dataIds = new HashSet<>(); @@ -2280,7 +2287,7 @@ else if (seed instanceof IdentifiableBase) for (Identifiable seed : seeds) { // create additional edges from the run for each ExpMaterial or ExpData seed - if (seed instanceof ExpRunItem) + if (seed instanceof ExpRunItem && !isUnknownMaterial((ExpRunItem)seed)) { Pair, Map> pair = collectRunsAndRolesToInvestigate((ExpRunItem)seed, options); @@ -2882,8 +2889,8 @@ private void syncRunEdges(int runId, Integer runObjectId, String runLsid, Contai toMaterialLsids.add(row); }); - Set> provenanceStartingInputs = Collections.emptySet(); - Set> provenanceFinalOutputs = Collections.emptySet(); + Set> provenanceStartingInputs = emptySet(); + Set> provenanceFinalOutputs = emptySet(); ProvenanceService pvs = ProvenanceService.get(); if (pvs != null) From 99d8890c15fb6e10d265142a0e606c56aead98c9 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Wed, 29 Apr 2020 23:34:35 -0700 Subject: [PATCH 22/28] Bump @labkey/components --- experiment/package-lock.json | 6 +++--- experiment/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index a76ae03043a..e989473c13c 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -249,9 +249,9 @@ "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" }, "@labkey/components": { - "version": "0.55.0-fb-rungraph-deets.0", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.55.0-fb-rungraph-deets.0.tgz", - "integrity": "sha1-jcAD9QdUQNEj5NWEOc5LuWuw8CY=", + "version": "0.55.0-fb-rungraph-deets.1", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.55.0-fb-rungraph-deets.1.tgz", + "integrity": "sha1-vd9v1GutDlbYyCxZg6gYFuFb5DA=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", diff --git a/experiment/package.json b/experiment/package.json index ed900e88e31..02dfe24d1f8 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.55.0-fb-rungraph-deets.0" + "@labkey/components": "0.55.0-fb-rungraph-deets.1" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From bcbb9baa912a8c71f61e4c9b0bbcca50fe5eb64a Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Wed, 29 Apr 2020 23:35:02 -0700 Subject: [PATCH 23/28] Set lineage API request options --- experiment/src/client/RunGraph/RunGraph.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/experiment/src/client/RunGraph/RunGraph.tsx b/experiment/src/client/RunGraph/RunGraph.tsx index 21b00b871a5..1b4dfb47e12 100644 --- a/experiment/src/client/RunGraph/RunGraph.tsx +++ b/experiment/src/client/RunGraph/RunGraph.tsx @@ -24,6 +24,10 @@ export class RunGraph extends React.Component { filterIn={false} filters={[new LineageFilter('expType', null)]} lsid={this.props.context.lsid} + request={{ + includeInputsAndOutputs: true, + includeRunSteps: true, + }} urlResolver={LineageURLResolvers.Server} navigate={(node) => { if (node?.lineageNode?.links?.lineage) { From 0a5fd56fe202c65daa129316a843dd1d7e207a49 Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Thu, 30 Apr 2020 13:13:59 -0700 Subject: [PATCH 24/28] Bump @labkey/components --- experiment/package-lock.json | 32 ++++++++++++++++---------------- experiment/package.json | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/experiment/package-lock.json b/experiment/package-lock.json index 29e95dec68f..ba261523ac4 100644 --- a/experiment/package-lock.json +++ b/experiment/package-lock.json @@ -36,26 +36,26 @@ } }, "@babel/runtime": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.2.tgz", - "integrity": "sha512-NE2DtOdufG7R5vnfQUTehdTfNycfUANEtCa9PssN9O/xmTzP4E08UI797ixaei6hBEVL9BI/PsdJS5x7mWoB9Q==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.6.tgz", + "integrity": "sha512-64AF1xY3OAkFHqOb9s4jpgk1Mm5vDZ4L3acHvAml+53nO1XbXLuDodsVpO4OIUsmemlUHMxNdYMNJmsvOwLrvQ==", "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/runtime-corejs2": { - "version": "7.9.2", - "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.9.2.tgz", - "integrity": "sha512-ayjSOxuK2GaSDJFCtLgHnYjuMyIpViNujWrZo8GUpN60/n7juzJKK5yOo6RFVb0zdU9ACJFK+MsZrUnj3OmXMw==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/runtime-corejs2/-/runtime-corejs2-7.9.6.tgz", + "integrity": "sha512-TcdM3xc7weMrwTawuG3BTjtVE3mQLXUPQ9CxTbSKOrhn3QAcqCJ2fz+IIv25wztzUnhNZat7hr655YJa61F3zg==", "requires": { "core-js": "^2.6.5", "regenerator-runtime": "^0.13.4" } }, "@babel/types": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.5.tgz", - "integrity": "sha512-XjnvNqenk818r5zMaba+sLQjnbda31UfUURv3ei0qPQw4u+j2jMyJ5b11y8ZHYTRSI3NnInQkkkRT4fLqqPdHg==", + "version": "7.9.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", + "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", "requires": { "@babel/helper-validator-identifier": "^7.9.5", "lodash": "^4.17.13", @@ -244,21 +244,21 @@ "integrity": "sha512-QPcGmICAPbGLGb6F/yNf/KzKqvFx8z5qx3D1yFqVAjoFmXK35EgyW+cJ57Te3CNsmzblwtzakLGFqHPqrfb4Tw==" }, "@labkey/api": { - "version": "0.2.2", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-0.2.2.tgz", - "integrity": "sha1-3uthffvyvoPrduPETCeAfGkcap0=" + "version": "0.2.5-fb-rungraph-deets.0", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/api/-/@labkey/api-0.2.5-fb-rungraph-deets.0.tgz", + "integrity": "sha1-bW1xxeB+wTFsI7E6SfqUaf4vcuQ=" }, "@labkey/components": { - "version": "0.54.0", - "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.54.0.tgz", - "integrity": "sha1-VWPU9sbho3A3y/wJdWSHronfYSQ=", + "version": "0.56.0-fb-rungraph-deets.0", + "resolved": "https://artifactory.labkey.com/artifactory/api/npm/libs-client/@labkey/components/-/@labkey/components-0.56.0-fb-rungraph-deets.0.tgz", + "integrity": "sha1-pndLS1ZXCusvF+MP1q9GQ4DYQJk=", "requires": { "@fortawesome/fontawesome-free": "5.9.0", "@fortawesome/fontawesome-svg-core": "1.2.19", "@fortawesome/free-regular-svg-icons": "5.11.2", "@fortawesome/free-solid-svg-icons": "5.9.0", "@fortawesome/react-fontawesome": "0.1.4", - "@labkey/api": "0.2.2", + "@labkey/api": "0.2.5-fb-rungraph-deets.0", "bootstrap": "3.4.1", "classnames": "2.2.6", "font-awesome": "4.7.0", diff --git a/experiment/package.json b/experiment/package.json index 4dca3627b6c..68a4ae9f426 100644 --- a/experiment/package.json +++ b/experiment/package.json @@ -29,7 +29,7 @@ } }, "dependencies": { - "@labkey/components": "0.54.0" + "@labkey/components": "0.56.0-fb-rungraph-deets.0" }, "devDependencies": { "@hot-loader/react-dom": "16.13.0", From aced0b9c0bcd4c179c2a6410541b359b7261a5dc Mon Sep 17 00:00:00 2001 From: labkey-nicka Date: Thu, 30 Apr 2020 15:53:08 -0700 Subject: [PATCH 25/28] betaGraph URL option --- experiment/src/client/RunGraph/RunGraph.tsx | 19 +++++++++++++++++-- .../exp/experimentRunGraphView.jsp | 11 ++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/experiment/src/client/RunGraph/RunGraph.tsx b/experiment/src/client/RunGraph/RunGraph.tsx index 1b4dfb47e12..28adf3dd4a6 100644 --- a/experiment/src/client/RunGraph/RunGraph.tsx +++ b/experiment/src/client/RunGraph/RunGraph.tsx @@ -30,8 +30,23 @@ export class RunGraph extends React.Component { }} urlResolver={LineageURLResolvers.Server} navigate={(node) => { - if (node?.lineageNode?.links?.lineage) { - window.location.href = node.lineageNode.links.lineage; + if (node?.lineageNode?.links) { + let target = node.lineageNode.links.lineage ?? node.lineageNode.links.overview; + + if (target) { + if (target.indexOf('showRunGraph.view') > -1) { + try { + const url = new URL(target, location.origin); + url.searchParams.append('betaGraph', '1'); + + target = url.href; + } catch (e) { + // whatever, I tried... + } + } + + window.location.href = target; + } } }} /> diff --git a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp index c363fd690fa..f11a2a25173 100644 --- a/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp +++ b/experiment/src/org/labkey/experiment/controllers/exp/experimentRunGraphView.jsp @@ -42,6 +42,7 @@ ViewContext context = getViewContext(); ExperimentRunGraphModel model = (ExperimentRunGraphModel)HttpView.currentModel(); boolean isSummaryView = !model.isDetail(); + boolean isBetaViewEnabled = getActionURL().getParameter("betaGraph") != null; String uniqueId = "" + UniqueID.getServerSessionScopedUID(); String appId = "run-graph-app-" + uniqueId; @@ -67,11 +68,11 @@ %> <%=button("Toggle Beta Graph (new!)").id(toggleBtnId).style("display: inline-block; float: right;")%>
-
+
" id="<%=h(graphTabId)%>"> <% } %> @@ -112,14 +113,14 @@ { %>
-
+
" id="<%=h(graphTabBetaId)%>">