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

[AI Tutor] CT-547: Restyle interactions table #58435

Merged
merged 7 commits into from
May 7, 2024

Conversation

ebeastlake
Copy link
Contributor

@ebeastlake ebeastlake commented May 7, 2024

The following PR:

  • Uses the Table from 'reactabular-table' that's used elsewhere in the codebase
  • Imports the necessary styles to use the reactabular-table component
  • Adds a loading state
  • Removes InteractionsTableRow, which is no longer needed
  • Adds the types for the reactabular-table, since this is the first time we're using it in a .tsx component

Before:

Screenshot 2024-05-06 at 10 11 02 PM

After (includes SegmentedButton merged to staging):

Screenshot 2024-05-06 at 10 18 51 PM

Links

Jira ticket: https://codedotorg.atlassian.net/browse/CT-545

Testing story

Tested locally.

Deployment strategy

Follow-up work

  1. Add more robust error handling if InteractionsTable data fails to fetch: https://codedotorg.atlassian.net/browse/CT-560https://codedotorg.atlassian.net/browse/CT-560
  2. Split InteractionsTable code into three components: InteractionsView, InteractionsFilters, and InteractionsTable: https://codedotorg.atlassian.net/browse/CT-561
  3. Add an effect that requires teachers to click to reveal profane/PII input: https://codedotorg.atlassian.net/browse/CT-563

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@ebeastlake ebeastlake requested a review from a team May 7, 2024 05:25
acc.push({label: message.studentName, value: userId});
}
return acc;
const generateStudentFilterOptions = (messages: StudentChatRow[]) => {
Copy link
Contributor Author

@ebeastlake ebeastlake May 7, 2024

Choose a reason for hiding this comment

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

I did two things here:

  1. Extracted the logic for the student filters into a "generateStudentFilterOptions" helper
  2. Combined the two useEffect blocks


const messageDate = moment(message.createdAt);
let timeMatch = false;
const isTimeMatch = (createdAt: string) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The time matching logic didn't change, but adding an isTimeMatch helper made the chat message filtering logic more readable.

@ebeastlake ebeastlake merged commit be7f35b into staging May 7, 2024
2 checks passed
@ebeastlake ebeastlake deleted the task/emily/ct-547/restyle-teacher-dashboard branch May 7, 2024 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants