sinequa / sba-angular

Sinequa's Angular-based Search Based Application (SBA) Framework
https://sinequa.github.io/sba-angular/
MIT License
30 stars 25 forks source link

Empty scalar rendering overridable #29

Closed meunierfrederic closed 3 years ago

meunierfrederic commented 3 years ago

A short fix allowing dev to override the default empty scalar rendering. Just add some messages in your locales. For instance, in projects\vanilla-search\src\locales\messages\en.json add the following:

"metadata": { "item": { "empty_boolean": "N/A", "empty_number": "N/A" } },

I've tried to remove ensureScalarValue(value: any) function but it has some non expected consequences. For instance: if an undefined scalar is the last item, <sq-metadata> will append a msg#metadata.item.separator at the end ; indeed, even if values haven't been pushed, items.length remains at its initial value.