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

[XI-6368] Enhance results page #77

Merged
merged 3 commits into from
May 2, 2024

Conversation

JuliaCasamitjana
Copy link
Collaborator

@JuliaCasamitjana JuliaCasamitjana commented Apr 26, 2024

Description

This PR enhances the results table by:

  • Commit 1: Introducing collapse/expand functionality for table rows. It truncates the questions text to 1 line in the collapsed state. For this we create the ResultsRow component.

  • Commit 2: Including answers with the last user selection. For this we create the ResultViewer component, which contains a representation of the question and answers form but in a static way.

    Screenshot 2024-04-26 at 10 03 17
  • It also improves the responsiveness (commit 3)

    See mobile view

    Screenshot 2024-04-26 at 09 59 26

Decisions / Choices I made

  • Markdown styles are reset to maintain the same font size and for the collapsed state they adopt the paragraph style (no colours, no font weight, no underline...)

    collapsed expanded
    Screenshot 2024-04-26 at 10 03 17 Screenshot 2024-04-26 at 10 03 24
  • To include a representation of non-checked radio and checkboxes the regular font awesome package is required.

  • Since the ResultViewer component is rather straightforward (not too much logic is involved), we're including its testing into the Results test. This way, we can also verify that the collapsed state gets passed from the entire row to the ResultViewer component.

Checklist

  • All checks pass successfully
  • All related commits are squashed together
  • The changes are properly documented / the relevant documentation is updated (if applicable)
  • Appropriate labels are added to this pull request

@JuliaCasamitjana JuliaCasamitjana added the enhancement New feature or request label Apr 26, 2024
@JuliaCasamitjana JuliaCasamitjana self-assigned this Apr 26, 2024
@JuliaCasamitjana JuliaCasamitjana force-pushed the jc/XI-6368_enhance_results_page branch from 95ac4f4 to c9dcd34 Compare April 26, 2024 08:21
@JuliaCasamitjana JuliaCasamitjana force-pushed the jc/XI-6368_enhance_results_page branch from c9dcd34 to 03a3b8f Compare April 26, 2024 09:29
@christophblessing
Copy link
Collaborator

As discussed, let's try to implement without reusing the Answers component:

  • We don't need inputs here because we don't have any interaction anymore
  • Could just be a list in a new component with props
    • Color codes and text with "correct" / "incorrect" as before
    • Selections make it bold, aria-label (?) "selected" (?), or use dot or circle icon
  • Resulting duplication of CSS is fine
  • Check if using an <article> makes sense here: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/article

@JuliaCasamitjana JuliaCasamitjana force-pushed the jc/XI-6368_enhance_results_page branch from 03a3b8f to 6fea0e2 Compare April 30, 2024 08:10
Rows can now be expanded or collapsed by clicking them. A chevron icon
indicates the state.
When collapsed, the question text truncates to one line and it becomes fully
visible when the row is expanded.
Markdown styles are reset to maintain the same font size and for the collapsed
state they adopt the paragraph style (no colors, font weight, underlines...)
@JuliaCasamitjana JuliaCasamitjana force-pushed the jc/XI-6368_enhance_results_page branch from 6fea0e2 to 63da2b2 Compare April 30, 2024 08:47
Copy link
Collaborator

@christophblessing christophblessing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice progress! I find the refactored solution much more straight forward.

src/components/Result.module.scss Show resolved Hide resolved
src/components/Result.test.tsx Outdated Show resolved Hide resolved
src/components/StaticQAndA.tsx Outdated Show resolved Hide resolved
src/components/StaticQAndA.tsx Outdated Show resolved Hide resolved
src/components/StaticQAndA.tsx Outdated Show resolved Hide resolved
src/components/Result.test.tsx Outdated Show resolved Hide resolved
@JuliaCasamitjana JuliaCasamitjana force-pushed the jc/XI-6368_enhance_results_page branch from 63da2b2 to 9decffb Compare April 30, 2024 13:44
The component style is based on the question and answers component.
Specific answers can highlighted. We use it to display the last selection
the user made. For that we need to extend the ResultType with a selections
property. This property will be updated every time the user submits an answer.

Extend result component tests and update documentation
Remove reference heading and replace attempts heading with icon
on mobile view
@JuliaCasamitjana JuliaCasamitjana force-pushed the jc/XI-6368_enhance_results_page branch from 9decffb to 65e1baa Compare April 30, 2024 14:14
@JuliaCasamitjana JuliaCasamitjana merged commit bc20dfb into main May 2, 2024
4 checks passed
@JuliaCasamitjana JuliaCasamitjana deleted the jc/XI-6368_enhance_results_page branch May 2, 2024 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants