@noatgnu/cupcake-vanilla 1.3.7 → 1.3.8

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.
@@ -4571,28 +4571,34 @@ class ColumnEditModal {
4571
4571
  }
4572
4572
  console.log('[Column] Looking for ontology match:', {
4573
4573
  ontologyType,
4574
- customFilters
4574
+ customFilters,
4575
+ keys: Object.keys(customFilters)
4575
4576
  });
4576
4577
  // Handle both wrapped and unwrapped formats
4577
- // Wrapped: {"ms_unique_vocabularies": {"term_type": "cell line"}}
4578
- // Unwrapped: {"term_type": "cell line"}
4579
- const actualFilters = customFilters[ontologyType] || customFilters;
4578
+ // Also handle camelCase from API vs snake_case in config
4579
+ // API returns: {"msUniqueVocabularies": {"termType": "cell line"}}
4580
+ // Config has: {"ms_unique_vocabularies": {"term_type": "cell line"}}
4581
+ // Convert ontologyType to camelCase to match API format
4582
+ const camelOntologyType = ontologyType.replace(/_([a-z])/g, (g) => g[1].toUpperCase());
4583
+ let actualFilters = customFilters[ontologyType] || customFilters[camelOntologyType] || customFilters;
4584
+ console.log('[Column] Actual filters after unwrapping:', actualFilters);
4580
4585
  const matchingIndex = this.ontologyTypes.findIndex(opt => {
4581
4586
  if (opt.value !== ontologyType)
4582
4587
  return false;
4583
4588
  if (!opt.customFilters)
4584
4589
  return false;
4585
- // Get the filter value from config (should be wrapped like {"ms_unique_vocabularies": {"term_type": "..."}})
4590
+ // Get the filter value from config (wrapped with snake_case key)
4586
4591
  const optFilterValue = opt.customFilters[ontologyType];
4587
4592
  if (!optFilterValue)
4588
4593
  return false;
4589
- const optFiltersJson = JSON.stringify(optFilterValue);
4590
- const templateFiltersJson = JSON.stringify(actualFilters);
4591
- const matches = optFiltersJson === templateFiltersJson;
4594
+ // Compare term_type values (handle both snake_case and camelCase)
4595
+ const optTermType = optFilterValue['term_type'];
4596
+ const actualTermType = actualFilters['term_type'] || actualFilters['termType'];
4597
+ const matches = optTermType === actualTermType;
4592
4598
  console.log('[Column] Comparing:', {
4593
4599
  label: opt.label,
4594
- optFilters: optFilterValue,
4595
- templateFilters: actualFilters,
4600
+ optTermType,
4601
+ actualTermType,
4596
4602
  matches
4597
4603
  });
4598
4604
  return matches;