@apollo-annotation/jbrowse-plugin-apollo 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -101,7 +101,7 @@ var ExpandMoreIcon__default = /*#__PURE__*/_interopDefaultLegacy(ExpandMoreIcon)
101
101
  var ErrorIcon__default = /*#__PURE__*/_interopDefaultLegacy(ErrorIcon);
102
102
  var SaveIcon__default = /*#__PURE__*/_interopDefaultLegacy(SaveIcon);
103
103
 
104
- var version = "0.2.0";
104
+ var version = "0.2.2";
105
105
 
106
106
  const ApolloConfigSchema = configuration.ConfigurationSchema('ApolloInternetAccount', {
107
107
  baseURL: {
@@ -627,7 +627,7 @@ const stopwords = genericEnglishStopwords;
627
627
  function applyPrefixes(uri, prefixes) {
628
628
  for (const [prefix, uriBase] of prefixes.entries()) {
629
629
  if (uri.startsWith(uriBase)) {
630
- return uri.replace(uriBase, prefix);
630
+ return uri.replace(uriBase, String(prefix));
631
631
  }
632
632
  }
633
633
  return uri;
@@ -637,8 +637,8 @@ function applyPrefixes(uri, prefixes) {
637
637
  */
638
638
  function expandPrefixes(uri, prefixes) {
639
639
  for (const [prefix, uriBase] of prefixes.entries()) {
640
- if (uri.startsWith(prefix)) {
641
- return uri.replace(prefix, uriBase);
640
+ if (uri.startsWith(String(prefix))) {
641
+ return uri.replace(String(prefix), uriBase);
642
642
  }
643
643
  }
644
644
  return uri;
@@ -2057,7 +2057,7 @@ function DownloadGFF3({ handleClose, session }) {
2057
2057
  continue;
2058
2058
  }
2059
2059
  for (const [, feature] of features) {
2060
- gff3Items.push(shared.makeGFF3Feature(mobxStateTree.getSnapshot(feature)));
2060
+ gff3Items.push(shared.annotationFeatureToGFF3(mobxStateTree.getSnapshot(feature)));
2061
2061
  }
2062
2062
  }
2063
2063
  for (const sequenceFeature of sequenceFeatures) {
@@ -9073,6 +9073,15 @@ class InMemoryFileDriver extends BackendDriver {
9073
9073
  });
9074
9074
  }
9075
9075
  async submitChange(_change, _opts = {}) {
9076
+ const { clientStore } = this;
9077
+ const { assemblies } = clientStore;
9078
+ clientStore.clearCheckResults();
9079
+ for (const [, assembly] of assemblies) {
9080
+ if (assembly.backendDriverType === 'InMemoryFileDriver') {
9081
+ const checkResults = await checkFeatures(assembly);
9082
+ clientStore.addCheckResults(checkResults);
9083
+ }
9084
+ }
9076
9085
  return new shared.ValidationResultSet();
9077
9086
  }
9078
9087
  async searchFeatures(_term, _assemblies) {
@@ -9186,7 +9195,7 @@ class DesktopFileDriver extends BackendDriver {
9186
9195
  for (const [, refSeq] of clientAssembly.refSeqs) {
9187
9196
  const { features } = refSeq;
9188
9197
  for (const [, feature] of features) {
9189
- gff3Items.push(shared.makeGFF3Feature(mobxStateTree.getSnapshot(feature)));
9198
+ gff3Items.push(shared.annotationFeatureToGFF3(mobxStateTree.getSnapshot(feature)));
9190
9199
  }
9191
9200
  }
9192
9201
  for (const [, refSeq] of clientAssembly.refSeqs) {
@@ -9282,6 +9291,9 @@ function clientDataStoreFactory(AnnotationFeatureExtended) {
9282
9291
  deleteCheckResult(checkResultId) {
9283
9292
  self.checkResults.delete(checkResultId);
9284
9293
  },
9294
+ clearCheckResults() {
9295
+ self.checkResults.clear();
9296
+ },
9285
9297
  }))
9286
9298
  .volatile((self) => ({
9287
9299
  changeManager: new ChangeManager(self),
@@ -9509,7 +9521,11 @@ function extendSession(pluginManager, sessionModel) {
9509
9521
  dynamicBlocks.forEach((block) => {
9510
9522
  if (block.regionNumber !== undefined) {
9511
9523
  const { assemblyName, end, refName, start } = block;
9512
- locations.push({ assemblyName, refName, start, end });
9524
+ const assembly = self.apolloDataStore.assemblies.get(assemblyName);
9525
+ if (assembly &&
9526
+ assembly.backendDriverType === 'CollaborationServerDriver') {
9527
+ locations.push({ assemblyName, refName, start, end });
9528
+ }
9513
9529
  }
9514
9530
  });
9515
9531
  }
@@ -9565,7 +9581,11 @@ function extendSession(pluginManager, sessionModel) {
9565
9581
  dynamicBlocks.forEach((block) => {
9566
9582
  if (block.regionNumber !== undefined) {
9567
9583
  const { assemblyName, end, refName, start } = block;
9568
- locations.push({ assemblyName, refName, start, end });
9584
+ const assembly = self.apolloDataStore.assemblies.get(assemblyName);
9585
+ if (assembly &&
9586
+ assembly.backendDriverType === 'CollaborationServerDriver') {
9587
+ locations.push({ assemblyName, refName, start, end });
9588
+ }
9569
9589
  }
9570
9590
  });
9571
9591
  }
@@ -9628,6 +9648,7 @@ function extendSession(pluginManager, sessionModel) {
9628
9648
  continue;
9629
9649
  }
9630
9650
  mobxStateTree.applySnapshot(jbrowse, jbrowseConfig);
9651
+ // @ts-expect-error snapshot seems to get wrong type?
9631
9652
  mobxStateTree.applySnapshot(self, sessionSnapshot);
9632
9653
  }
9633
9654
  }),
@@ -9739,7 +9760,7 @@ function extendSession(pluginManager, sessionModel) {
9739
9760
  };
9740
9761
  });
9741
9762
  return mobxStateTree.types.snapshotProcessor(sm, {
9742
- postProcessor(snap) {
9763
+ postProcessor(snap, node) {
9743
9764
  snap.apolloSelectedFeature = undefined;
9744
9765
  const assemblies = Object.fromEntries(Object.entries(snap.apolloDataStore.assemblies).filter(([, assembly]) => assembly.backendDriverType === 'InMemoryFileDriver'));
9745
9766
  // @ts-expect-error ontologyManager isn't actually required
@@ -9748,6 +9769,21 @@ function extendSession(pluginManager, sessionModel) {
9748
9769
  assemblies,
9749
9770
  checkResults: {},
9750
9771
  };
9772
+ if (!node) {
9773
+ return snap;
9774
+ }
9775
+ const { apolloDataStore } = node;
9776
+ const { checkResults } = apolloDataStore;
9777
+ for (const [, cr] of checkResults) {
9778
+ const [feature] = cr.ids;
9779
+ if (!feature) {
9780
+ continue;
9781
+ }
9782
+ const assembly = apolloDataStore.assemblies.get(feature.assemblyId);
9783
+ if (assembly && assembly.backendDriverType === 'InMemoryFileDriver') {
9784
+ snap.apolloDataStore.checkResults[cr._id] = mobxStateTree.getSnapshot(cr);
9785
+ }
9786
+ }
9751
9787
  return snap;
9752
9788
  },
9753
9789
  });