feat(indicadores): "Fijar indicador" only from five indicators, like the search
How: the catalog card gets a `fijable` input and shows its pin button only when it is true; the page passes searchVisible(), so the button appears with the search, from MIN_BUSQUEDA (5) indicators in Resumen. Below that, saved pins are ignored when ordering the cards, so a pin from a longer catalog can't reorder cards that offer no way to unpin. Implications: cáncer de mama (three charts) has no pin buttons; CaCu and TEA keep them. Pins stay saved and come back if the domain grows past the threshold.
This commit is contained in:
@@ -331,6 +331,8 @@ export class IndicadoresPage {
|
||||
readonly searchResults = computed(() => {
|
||||
const selected = new Set(this.selectedIndicators());
|
||||
const items = this.catalogOrder().filter(item => selected.has(item.id));
|
||||
// Below MIN_BUSQUEDA there are no pin buttons, so saved pins don't reorder the cards either.
|
||||
if (!this.searchVisible()) return { items };
|
||||
return { items: [...items.filter(item => this.isPinned(item)), ...items.filter(item => !this.isPinned(item))] };
|
||||
});
|
||||
readonly catalogLoading = signal(true);
|
||||
|
||||
Reference in New Issue
Block a user