Closed reefdog closed 5 years ago
I'm curious where you think it should live if not the utilities
Theoretically, It'd make more sense to me as an instance method. Like I should be able to do doc.titleOrFallback()
or something. But of course we're often dealing with dumb JS objects, not actual model instances.
@isTravis ah that's a good idea. For now I'll leave it as a utility function since, as you say, it's an established pattern. Thanks all!
Documents without titles display some a placeholder title in various views. Before, this wasn’t centrally stored or generated, so each view (search results, organization profile, document page) generated their own slightly different placeholder title.
Now we generate them centrally with a utility function. However, this needs to be improved and formalized and maybe not even defined as a utility function.
Affects #24