Skip to content

Add instructor and administrator profile dashboard access - #23

Open
zacjones93 wants to merge 1 commit into
mainfrom
zac/fix-instructor-profile-cta
Open

Add instructor and administrator profile dashboard access#23
zacjones93 wants to merge 1 commit into
mainfrom
zac/fix-instructor-profile-cta

Conversation

@zacjones93

@zacjones93 zacjones93 commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Present contributor and admin accounts with role-specific profile messaging
  • Add dashboard CTAs linking to the canonical egghead builder URL
  • Extend the profile contract checks for staff account presentations and learner access

Testing

  • Profile contract checks passed for contributor, admin, and ordinary learner roles

Note

Add instructor and administrator profile dashboard access

  • Adds staffAccountPresentation in account-role.ts to map EggheadAccountRole ('admin' | 'contributor' | 'user') to role-specific presentation data (heading, status, description, actionLabel), returning null for 'user'.
  • Exports EGGHEAD_BUILDER_URL constant pointing to https://builder.egghead.io.
  • Updates ProfileContent to show a green status pill, role-specific text, and a CTA to the builder dashboard for staff accounts lacking library membership, instead of the subscription prompt.
  • Adds contract assertions in profile-contract.ts verifying the builder URL, instructor/admin presentation values, and null for 'user'.
📊 Macroscope summarized 2162975. 3 files reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
beta-egghead Ready Ready Preview Aug 28, 2026 3:01pm
course-builder-egghead Ready Ready Preview Aug 28, 2026 3:01pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 23 days. After that, they cost $0.25 per reviewed file.

Or wait 32 minutes for your next included review.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b86ba7e3-d2b2-4dc0-9c4a-3942d10f3b96

📥 Commits

Reviewing files that changed from the base of the PR and between 82aeb43 and 2162975.

📒 Files selected for processing (3)
  • apps/web/src/app/profile/page.tsx
  • apps/web/src/profile/account-role.ts
  • scripts/profile-contract.ts

Comment @coderabbitai help to get the list of available commands.

</p>
)}
</div>
) : !hasLibraryMembership && staffAccount ? (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟠 High profile/page.tsx:352

Contributors and administrators with egghead_staff_special_access do not receive the EGGHEAD_BUILDER_URL dashboard link when that entitlement sets hasLibraryMembership to true; the !hasLibraryMembership && staffAccount branch is therefore skipped and the ordinary membership panel is rendered instead. Make the staff CTA take precedence over the membership CTA (or otherwise remove this gate) so the normal staff-access state can open the builder.

🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/web/src/app/profile/page.tsx around line 352:

Contributors and administrators with `egghead_staff_special_access` do not receive the `EGGHEAD_BUILDER_URL` dashboard link when that entitlement sets `hasLibraryMembership` to `true`; the `!hasLibraryMembership && staffAccount` branch is therefore skipped and the ordinary membership panel is rendered instead. Make the staff CTA take precedence over the membership CTA (or otherwise remove this gate) so the normal staff-access state can open the builder.

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.

1 participant