From 0819ace1dc8f6fd61fc551a5d98cac0c6147b1ba Mon Sep 17 00:00:00 2001
From: Alexander Rose <alexander.rose@weirdbyte.de>
Date: Sun, 20 Jun 2021 13:49:42 -0700
Subject: [PATCH] use CustomProperty.Provider.ref

---
 src/extensions/dnatco/confal-pyramids/color.ts                  | 2 +-
 src/extensions/pdbe/structure-quality-report/color.ts           | 2 +-
 src/extensions/rcsb/assembly-symmetry/color.ts                  | 2 +-
 src/extensions/rcsb/validation-report/color/density-fit.ts      | 2 +-
 src/extensions/rcsb/validation-report/color/geometry-quality.ts | 2 +-
 .../rcsb/validation-report/color/random-coil-index.ts           | 2 +-
 src/mol-model-props/computed/themes/accessible-surface-area.ts  | 2 +-
 src/mol-model-props/computed/themes/interaction-type.ts         | 2 +-
 src/mol-model-props/integrative/cross-link-restraint/color.ts   | 2 +-
 src/mol-model-props/sequence/themes/best-database-mapping.ts    | 2 +-
 src/mol-theme/color/secondary-structure.ts                      | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/extensions/dnatco/confal-pyramids/color.ts b/src/extensions/dnatco/confal-pyramids/color.ts
index e13b52ec7..9f934e0ea 100644
--- a/src/extensions/dnatco/confal-pyramids/color.ts
+++ b/src/extensions/dnatco/confal-pyramids/color.ts
@@ -181,6 +181,6 @@ export const ConfalPyramidsColorThemeProvider: ColorTheme.Provider<ConfalPyramid
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.models.some(m => ConfalPyramids.isApplicable(m)),
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? ConfalPyramidsProvider.attach(ctx, data.structure.models[0], void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.models[0].customProperties.reference(ConfalPyramidsProvider.descriptor, false)
+        detach: (data) => data.structure && ConfalPyramidsProvider.ref(data.structure.models[0], false)
     }
 };
diff --git a/src/extensions/pdbe/structure-quality-report/color.ts b/src/extensions/pdbe/structure-quality-report/color.ts
index 62af7edf0..2ee57e131 100644
--- a/src/extensions/pdbe/structure-quality-report/color.ts
+++ b/src/extensions/pdbe/structure-quality-report/color.ts
@@ -115,6 +115,6 @@ export const StructureQualityReportColorThemeProvider: ColorTheme.Provider<Param
     isApplicable: (ctx: ThemeDataContext) => StructureQualityReport.isApplicable(ctx.structure?.models[0]),
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? StructureQualityReportProvider.attach(ctx, data.structure.models[0], void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.models[0].customProperties.reference(StructureQualityReportProvider.descriptor, false)
+        detach: (data) => data.structure && StructureQualityReportProvider.ref(data.structure.models[0], false)
     }
 };
\ No newline at end of file
diff --git a/src/extensions/rcsb/assembly-symmetry/color.ts b/src/extensions/rcsb/assembly-symmetry/color.ts
index 2540c6286..d91ada12f 100644
--- a/src/extensions/rcsb/assembly-symmetry/color.ts
+++ b/src/extensions/rcsb/assembly-symmetry/color.ts
@@ -109,6 +109,6 @@ export const AssemblySymmetryClusterColorThemeProvider: ColorTheme.Provider<Asse
     isApplicable: (ctx: ThemeDataContext) => AssemblySymmetry.isApplicable(ctx.structure),
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? AssemblySymmetryProvider.attach(ctx, data.structure, void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.customPropertyDescriptors.reference(AssemblySymmetryProvider.descriptor, false)
+        detach: (data) => data.structure && AssemblySymmetryProvider.ref(data.structure, false)
     }
 };
\ No newline at end of file
diff --git a/src/extensions/rcsb/validation-report/color/density-fit.ts b/src/extensions/rcsb/validation-report/color/density-fit.ts
index 70d4b4b0a..44e92d6d7 100644
--- a/src/extensions/rcsb/validation-report/color/density-fit.ts
+++ b/src/extensions/rcsb/validation-report/color/density-fit.ts
@@ -77,6 +77,6 @@ export const DensityFitColorThemeProvider: ColorTheme.Provider<{}, ValidationRep
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ValidationReport.isApplicable(ctx.structure.models[0]) && Model.isFromXray(ctx.structure.models[0]) && Model.probablyHasDensityMap(ctx.structure.models[0]),
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? ValidationReportProvider.attach(ctx, data.structure.models[0], void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.models[0].customProperties.reference(ValidationReportProvider.descriptor, false)
+        detach: (data) => data.structure && ValidationReportProvider.ref(data.structure.models[0], false)
     }
 };
\ No newline at end of file
diff --git a/src/extensions/rcsb/validation-report/color/geometry-quality.ts b/src/extensions/rcsb/validation-report/color/geometry-quality.ts
index 9ce9167c6..6e07f21af 100644
--- a/src/extensions/rcsb/validation-report/color/geometry-quality.ts
+++ b/src/extensions/rcsb/validation-report/color/geometry-quality.ts
@@ -115,6 +115,6 @@ export const GeometryQualityColorThemeProvider: ColorTheme.Provider<GeometricQua
     isApplicable: (ctx: ThemeDataContext) => ValidationReport.isApplicable(ctx.structure?.models[0]),
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? ValidationReportProvider.attach(ctx, data.structure.models[0], void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.models[0].customProperties.reference(ValidationReportProvider.descriptor, false)
+        detach: (data) => data.structure && ValidationReportProvider.ref(data.structure.models[0], false)
     }
 };
\ No newline at end of file
diff --git a/src/extensions/rcsb/validation-report/color/random-coil-index.ts b/src/extensions/rcsb/validation-report/color/random-coil-index.ts
index 48f3d918f..770fde98a 100644
--- a/src/extensions/rcsb/validation-report/color/random-coil-index.ts
+++ b/src/extensions/rcsb/validation-report/color/random-coil-index.ts
@@ -68,6 +68,6 @@ export const RandomCoilIndexColorThemeProvider: ColorTheme.Provider<{}, Validati
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ValidationReport.isApplicable(ctx.structure.models[0]) && Model.isFromNmr(ctx.structure.models[0]),
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? ValidationReportProvider.attach(ctx, data.structure.models[0], void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.models[0].customProperties.reference(ValidationReportProvider.descriptor, false)
+        detach: (data) => data.structure && ValidationReportProvider.ref(data.structure.models[0], false)
     }
 };
\ No newline at end of file
diff --git a/src/mol-model-props/computed/themes/accessible-surface-area.ts b/src/mol-model-props/computed/themes/accessible-surface-area.ts
index 2cb2c552a..c7bc1b940 100644
--- a/src/mol-model-props/computed/themes/accessible-surface-area.ts
+++ b/src/mol-model-props/computed/themes/accessible-surface-area.ts
@@ -83,6 +83,6 @@ export const AccessibleSurfaceAreaColorThemeProvider: ColorTheme.Provider<Access
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure,
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? AccessibleSurfaceAreaProvider.attach(ctx, data.structure, void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.customPropertyDescriptors.reference(AccessibleSurfaceAreaProvider.descriptor, false)
+        detach: (data) => data.structure && AccessibleSurfaceAreaProvider.ref(data.structure, false)
     }
 };
\ No newline at end of file
diff --git a/src/mol-model-props/computed/themes/interaction-type.ts b/src/mol-model-props/computed/themes/interaction-type.ts
index 8ab22e981..0a40272c5 100644
--- a/src/mol-model-props/computed/themes/interaction-type.ts
+++ b/src/mol-model-props/computed/themes/interaction-type.ts
@@ -117,6 +117,6 @@ export const InteractionTypeColorThemeProvider: ColorTheme.Provider<InteractionT
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure,
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? InteractionsProvider.attach(ctx, data.structure, void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.customPropertyDescriptors.reference(InteractionsProvider.descriptor, false)
+        detach: (data) => data.structure && InteractionsProvider.ref(data.structure, false)
     }
 };
\ No newline at end of file
diff --git a/src/mol-model-props/integrative/cross-link-restraint/color.ts b/src/mol-model-props/integrative/cross-link-restraint/color.ts
index 7fad48e5c..2b5dea6d1 100644
--- a/src/mol-model-props/integrative/cross-link-restraint/color.ts
+++ b/src/mol-model-props/integrative/cross-link-restraint/color.ts
@@ -70,6 +70,6 @@ export const CrossLinkColorThemeProvider: ColorTheme.Provider<CrossLinkColorThem
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && CrossLinkRestraint.isApplicable(ctx.structure),
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? CrossLinkRestraintProvider.attach(ctx, data.structure, void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.customPropertyDescriptors.reference(CrossLinkRestraintProvider.descriptor, false)
+        detach: (data) => data.structure && CrossLinkRestraintProvider.ref(data.structure, false)
     }
 };
\ No newline at end of file
diff --git a/src/mol-model-props/sequence/themes/best-database-mapping.ts b/src/mol-model-props/sequence/themes/best-database-mapping.ts
index 3f5d3a69c..c4588f431 100644
--- a/src/mol-model-props/sequence/themes/best-database-mapping.ts
+++ b/src/mol-model-props/sequence/themes/best-database-mapping.ts
@@ -98,7 +98,7 @@ export const BestDatabaseSequenceMappingColorThemeProvider: ColorTheme.Provider<
         detach: (data) => {
             if (!data.structure) return;
             for (const m of data.structure.models) {
-                m.customProperties.reference(BestDatabaseSequenceMapping.Provider.descriptor, false);
+                BestDatabaseSequenceMapping.Provider.ref(m, false);
             }
         }
     }
diff --git a/src/mol-theme/color/secondary-structure.ts b/src/mol-theme/color/secondary-structure.ts
index e132168e0..033c4f134 100644
--- a/src/mol-theme/color/secondary-structure.ts
+++ b/src/mol-theme/color/secondary-structure.ts
@@ -123,6 +123,6 @@ export const SecondaryStructureColorThemeProvider: ColorTheme.Provider<Secondary
     isApplicable: (ctx: ThemeDataContext) => !!ctx.structure,
     ensureCustomProperties: {
         attach: (ctx: CustomProperty.Context, data: ThemeDataContext) => data.structure ? SecondaryStructureProvider.attach(ctx, data.structure, void 0, true) : Promise.resolve(),
-        detach: (data) => data.structure && data.structure.customPropertyDescriptors.reference(SecondaryStructureProvider.descriptor, false)
+        detach: (data) => data.structure && SecondaryStructureProvider.ref(data.structure, false)
     }
 };
\ No newline at end of file
-- 
GitLab