Open beniregev opened 10 months ago
Right, we don't allow the customization you are asking for here.
For document identification in the search results, we allow specifying the "title" attribute of the Result
component from within the Discovery UI, from Improve and customize > Improvement tools > Search results > Select field to display as titles:
I'm not sure I want to add params to handle what you suggest, since there is so much variability in what different consumers of this library may want; it would be a maintenance nightmare.
Instead, I think the best approach would be to fork this repo and then you can change Result
component to be whatever you want.
I created a ReactJS app and the client asked to put the document data, e.g., title, filename, publication date, authors, file type, etc. in the UI. I see this information is retrieved, in the Result (Result.tsx) component there's no![image](https://github.com/watson-developer-cloud/discovery-components/assets/20191956/ce5a50b4-d53a-4f77-8586-7d1107bacf9b)
div
element for it (see the screenshot)It's better from a UI/UX perspective to have some information about the document before the passages to enable the users to locate the documents they need faster.
Maybe there's a way to do that in the current library that I'm not aware of?
Tasks
div
element (with anid
attribute?) to have the option to display the document's data, e.g., title, filename, publication date, authors, file type, etc.false
(don't show it).Acceptance Criteria
When the show/no-show parameter value is
true
, then a div element showing the document data is visible. When the show/no-show parameter value isfalse
, then a div element showing the document data is not visible. When the show/no-show parameter is not set to any value (using its default value offalse
), then a div element showing the document data is not visible.Screenshot of current page UI (the before/AS-IS):![image](https://github.com/watson-developer-cloud/discovery-components/assets/20191956/dfb257b3-5f59-4b98-96f5-07a284f7fa10)
Screenshot of current page UI (the After/TO-BE):
(Using "Lorem Ipsum" for text).