@noatgnu/cupcake-vanilla 1.3.4 → 1.3.5

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.
@@ -6260,19 +6260,38 @@ class ColumnTemplateEditModal {
6260
6260
  if (!customFilters || Object.keys(customFilters).length === 0) {
6261
6261
  return ontologyType;
6262
6262
  }
6263
+ console.log('[Template] Looking for ontology match:', {
6264
+ ontologyType,
6265
+ customFilters
6266
+ });
6263
6267
  const matchingOption = this.ontologyTypes.find(opt => {
6264
6268
  if (opt.value !== ontologyType)
6265
6269
  return false;
6266
6270
  if (!opt.customFilters)
6267
- return true;
6268
- const optFilters = JSON.stringify(opt.customFilters);
6269
- const templateFilters = JSON.stringify(customFilters);
6270
- return optFilters === templateFilters;
6271
+ return !customFilters || Object.keys(customFilters).length === 0;
6272
+ const optFilterKey = Object.keys(opt.customFilters)[0];
6273
+ const templateFilterKey = Object.keys(customFilters)[0];
6274
+ if (optFilterKey !== templateFilterKey) {
6275
+ return false;
6276
+ }
6277
+ const optFilterValue = opt.customFilters[optFilterKey];
6278
+ const templateFilterValue = customFilters[templateFilterKey];
6279
+ const optTermType = optFilterValue?.['term_type'];
6280
+ const templateTermType = templateFilterValue?.['term_type'];
6281
+ console.log('[Template] Comparing:', {
6282
+ label: opt.label,
6283
+ optTermType,
6284
+ templateTermType,
6285
+ matches: optTermType === templateTermType
6286
+ });
6287
+ return optTermType === templateTermType;
6271
6288
  });
6272
6289
  if (matchingOption) {
6273
6290
  const index = this.ontologyTypes.indexOf(matchingOption);
6291
+ console.log('[Template] Found match:', matchingOption.label, 'at index', index);
6274
6292
  return `${matchingOption.value}__${index}`;
6275
6293
  }
6294
+ console.warn('[Template] No match found, using base ontology type');
6276
6295
  return ontologyType;
6277
6296
  }
6278
6297
  onVisibilityChange() {