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

Make teacher toolkit accessible for non-teachers #7419

Merged

Conversation

gabriellui1
Copy link
Collaborator

@gabriellui1 gabriellui1 commented May 8, 2024

fixes ENG-598
The teacher toolkit is now previewable for non-teachers.
image

Summary by CodeRabbit

  • New Features

    • Added a preview mode for non-teacher users in the teacher dashboard.
    • Introduced conditional rendering based on user roles to enhance user-specific views.
  • Improvements

    • Enhanced sidebar visibility controls with new CSS classes for a better user experience.
    • Improved the TitleBar component with a new preview mode prop for more flexible display options.

Copy link
Contributor

@mrfinch mrfinch left a comment

Choose a reason for hiding this comment

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

you seem to have added 'Manage Class' commit in this PR, can you remove it? I can help you if you don't find an easy way to get rid of it.

@gabriellui1 gabriellui1 force-pushed the gabriel/teacher-dashboard-accessible-for-nonteachers branch from 6b746f0 to 0efd083 Compare May 15, 2024 01:56
@mrfinch
Copy link
Contributor

mrfinch commented May 24, 2024

it shows Create Class modal. Can we hide it when a non-logged in user visits the URL?
Screenshot 2024-05-24 at 5 43 49 PM

Copy link

coderabbitai bot commented May 30, 2024

Walkthrough

The recent changes enhance the teacher dashboard by allowing non-teacher users to preview teacher-specific resources. This includes conditional rendering based on user roles and the introduction of preview modes. The modifications ensure that non-teacher users can access certain teacher toolkit content while keeping some features restricted.

Changes

Files/Components Change Summary
.../teacher-dashboard/BaseResourceHub/index.vue Added conditional check in mounted lifecycle hook to fetch data only if the user is a teacher.
.../teacher-dashboard/BaseTeacherDashboard/index.vue Introduced showNonTeacherPreview method, adjusted conditional rendering, and added .sidebar-hidden CSS.
.../teacher-dashboard/common/TitleBar.vue Added showPreviewMode prop with conditional rendering based on this prop.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant BaseResourceHub
    participant BaseTeacherDashboard
    participant TitleBar

    User->>BaseResourceHub: Access Teacher Toolkit
    BaseResourceHub->>BaseResourceHub: Check if user is teacher
    alt User is teacher
        BaseResourceHub->>BaseResourceHub: Fetch teacher prepaids and data
    end

    User->>BaseTeacherDashboard: Open Dashboard
    BaseTeacherDashboard->>BaseTeacherDashboard: Call showNonTeacherPreview
    alt showNonTeacherPreview is true
        BaseTeacherDashboard->>BaseTeacherDashboard: Render preview mode
    else
        BaseTeacherDashboard->>BaseTeacherDashboard: Render full dashboard
    end

    User->>TitleBar: View Title Bar
    TitleBar->>TitleBar: Check showPreviewMode prop
    alt showPreviewMode is true
        TitleBar->>TitleBar: Render sub-nav div
    else
        TitleBar->>TitleBar: Render full title bar
    end

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Make teacher toolkit content accessible to non-teacher users (ENG-598)
Ensure some content remains locked for non-paid teacher accounts (ENG-598)

Poem

In the code, a change so grand,
Teachers' tools now at hand.
Non-teachers peek, but can't unlock,
The full treasure trove, a teacher's stock.
With checks and props, the dashboard's bright,
Guiding users in the night.
🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a859d91 and c54bfe4.

Files selected for processing (3)
  • ozaria/site/components/teacher-dashboard/BaseResourceHub/index.vue (1 hunks)
  • ozaria/site/components/teacher-dashboard/BaseTeacherDashboard/index.vue (6 hunks)
  • ozaria/site/components/teacher-dashboard/common/TitleBar.vue (2 hunks)
Files skipped from review due to trivial changes (1)
  • ozaria/site/components/teacher-dashboard/BaseResourceHub/index.vue
Additional comments not posted (4)
ozaria/site/components/teacher-dashboard/common/TitleBar.vue (2)

32-35: The addition of the showPreviewMode prop is well-implemented.


183-186: The conditional rendering using showPreviewMode is correctly implemented to control the visibility of the sub-navigation bar.

ozaria/site/components/teacher-dashboard/BaseTeacherDashboard/index.vue (2)

95-97: The showNonTeacherPreview method is correctly implemented to determine the visibility of teacher-specific UI elements for non-teachers.


321-321: The usage of showNonTeacherPreview in the template effectively controls the visibility of restricted content, aligning with the PR objectives.

Also applies to: 332-334, 354-354

@mrfinch
Copy link
Contributor

mrfinch commented May 31, 2024

there is a conflict: ozaria/site/components/teacher-dashboard/BaseTeacherDashboard/index.vue in your PR @gabriellui1 , can you resolve it? You can do it from the UI or use git rebase to fix it. Let me know if you need help with it.

@gabriellui1 gabriellui1 force-pushed the gabriel/teacher-dashboard-accessible-for-nonteachers branch from e23cafe to 9a31974 Compare June 5, 2024 03:08
@mrfinch mrfinch merged commit 9cee5af into master Jun 5, 2024
2 checks passed
@mrfinch mrfinch deleted the gabriel/teacher-dashboard-accessible-for-nonteachers branch June 5, 2024 05:09
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