Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding the document data summary to the DOM in the Result component #534

Open
beniregev opened this issue Oct 18, 2023 · 1 comment
Open

Comments

@beniregev
Copy link

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 div element for it (see the screenshot)
image

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

  1. Add a div element (with an id attribute?) to have the option to display the document's data, e.g., title, filename, publication date, authors, file type, etc.
  2. To keep backward compatibility, showing this div element should depend on a parameter with a default value 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 is false, 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 of false), then a div element showing the document data is not visible.

Screenshot of current page UI (the before/AS-IS):
image

Screenshot of current page UI (the After/TO-BE):
image
(Using "Lorem Ipsum" for text).

@beniregev beniregev changed the title Adding document data to the DOM in the Result component Adding the document data summary to the DOM in the Result component Oct 18, 2023
@jhpedemonte
Copy link
Member

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:

Screenshot 2023-10-23 at 10 30 37 AM

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants