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

Refactor Session and Session_iba template #907

Open
8 tasks
eleanorreem opened this issue May 15, 2024 · 2 comments
Open
8 tasks

Refactor Session and Session_iba template #907

eleanorreem opened this issue May 15, 2024 · 2 comments
Labels
complexity: advanced Time needed to do this ticket will be large e.g. 2-3+ days help wanted Extra attention is needed maintenance Maintenance / chore work priority: 1+week Should be prioritized next week or longer. state: approved Ready to go. Not blocked or pending.

Comments

@eleanorreem
Copy link
Contributor

eleanorreem commented May 15, 2024

Overview

We created a duplicate but slightly different template for our IBA course. There is now a large amount of shared loginc between the regular session template and the session_iba template.

The IBA session page can be found in pages/courses/image-based-abuse/[sessionSlug].tsx and the regular session page can be found in pages/courses/[slug]/[sessionSlug].tsx

This ticket is to pull out duplicated logic / code between the two pages into either separate components or functions that can then be shared by the two pages.

Action Items

Here are some suggestions for possible refactors. These are suggestions and you may take a different route:

  • Extract logic which determines chat access into separate function
  • Extract logic which determines session completion into separate function
  • Create SessionHeader component which wraps around the Header component and its children
  • Create SessionVideo component to wrap around current implementation with SessionContentCard which contains Video and transcript as children
    • callStartSession can move into this component
    • the useEffect to open transcript modal can also be moved to this component
  • to handle Create Activity component to wrap around current implementation with SessionContentCard
  • Create Chat component to wrap around the current implementation of the Chat card

Testing

  • Once your refactor is complete, please compare your pages to the live pages.
  • Ensure you have run cypress tests and everything still works

It may make sense to split this ticket out into separate PRs as there could be a lot of changes.

Resources/Instructions

@eleanorreem eleanorreem added help wanted Extra attention is needed complexity: advanced Time needed to do this ticket will be large e.g. 2-3+ days maintenance Maintenance / chore work state: approved Ready to go. Not blocked or pending. priority: 1+week Should be prioritized next week or longer. labels May 15, 2024
@anmol-fzr
Copy link
Contributor

@eleanorreem I would like to contribute on this issue please assign me this issue

@kyleecodes
Copy link
Member

Hey @anmol-fzr thank you for your interest!
I can assign you after this PR is either closed or completed.
As per our Issue Limit policies sometimes we have to limit the number of issues assigned to help keep a sustainable flow of issues for all contributors. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity: advanced Time needed to do this ticket will be large e.g. 2-3+ days help wanted Extra attention is needed maintenance Maintenance / chore work priority: 1+week Should be prioritized next week or longer. state: approved Ready to go. Not blocked or pending.
Projects
None yet
Development

No branches or pull requests

3 participants