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

Add welcome mat with homepage redirects #583

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Add welcome mat with homepage redirects #583

wants to merge 13 commits into from

Conversation

echappen
Copy link
Contributor

@echappen echappen commented Oct 30, 2024

Blocked by #524

Changes proposed in this pull request:

  • Redirects users to /login when navigating to root / and not authenticated
  • When authenticated and navigating to root, redirect users to one of their orgs: /orgs/:org_id
    • When lastViewedOrgId is set, take them to this org
    • If not, then make a CAPI request to get their first org and take them there
  • Implements welcome mat design for /orgs/:org_id as specified in Create "welcome mat" for authenticated users #529
  • Pulls in real blog data from https://cloud.gov/updates.xml

How to test

  • add NEXT_PUBLIC_BLOG_FEED_URL=https://cloud.gov/updates.xml to .env.local
  • Spin up a uaa-docker container (instructions)
  • Log into the CF CLI
  • Run the dev server npm run dev-cf
  • Try to access / - you should be redirected to UAA login
  • Use the credentials found in /uaa-docker/uaa.yml to log in
  • After log in, you should be redirected to /orgs/:org_id

Related issues

Closes #529

Submitter checklist

  • Added logging is not capturing sensitive data and is set to an appropriate level (DEBUG vs INFO etc)
  • Updated relevant documentation (README, ADRs, explainers, diagrams)

Security considerations

Uses org id stored in cookie to make CF API requests in order to show the content on the page

@echappen echappen changed the title WIP: authenticated homepage WIP: add authenticated homepage content Oct 30, 2024
@echappen echappen changed the title WIP: add authenticated homepage content WIP: add welcome mat content Nov 4, 2024
@beepdotgov
Copy link
Contributor

@echappen This looks so good already. Excited to see this (almost) live!

I spotted a couple things in this branch; I know it’s still a WIP, so logging them here for when/if you’re ready for them.

This is probably a setup thing on my end, but the blog area’s not loading for me:

image

The leading on the main card is a little tight; could we increase it a bit?

Screenshot 2024-11-05 at 11 30 29 AM

(Adding a line-height-sans-4 to that graf looked good to me, but let me know what you think.)

It looks like the org picker is overlapping the main content area:

Screenshot 2024-11-05 at 11 26 53 AM

And finally, will you be working the updated footer into this PR? (widescreen, small screen)

(If it’s out of scope for this week, that’s great — let me know, and I’ll open a separate issue for implementation!)

@echappen
Copy link
Contributor Author

echappen commented Nov 5, 2024

@beepdotgov Thanks for all this! Let's open up a separate issue to update the footer, as I think that will take some dedicated work and I wouldn't want that to hold up the rest.

@beepdotgov
Copy link
Contributor

beepdotgov commented Nov 5, 2024

@echappen On it! Edit: done! #591

@beepdotgov beepdotgov mentioned this pull request Nov 5, 2024
1 task
@beepdotgov
Copy link
Contributor

Thanks so much for the tip on the blog feed config, @echappen — it looks great now.

I’d love to suggest a couple tiny tweaks, if you have a minute! Here’s the current state:

current

Here’s a quick in-browser edit:

tweaks

Here’s the TLDR of what I changed:

  1. Changed .text-light to .text-normal on the h2
  2. Added a non-breaking space between “Cloud.gov” and “blog” in the h2, to prevent the orphaned word
  3. Removed the top margin on the article title
  4. Added line-height-sans-4 to the blog teaser

Do those seem doable to you?

(Also, it looks like the browser’s default link colors might be getting applied to links in that block; is that right? Can we apply our default blue for the dash?)

- moves manage users page to /orgs/:org_id/users
- makes /orgs/:org_id the welcome page
- redirects from root (/) to one of your org welcome pages
We were allowing devs to bypass page authentication in a local environment. This was getting confusing as middleware redirections became more complex, so we're getting rid of this bypass in order to have the same login flow that we have when deployed.
@echappen
Copy link
Contributor Author

echappen commented Nov 5, 2024

@beepdotgov All doable! Just pushed those updates.

@echappen echappen changed the title WIP: add welcome mat content Add welcome mat content Nov 5, 2024
@echappen echappen changed the title Add welcome mat content Add welcome mat with homepage redirects Nov 5, 2024
@echappen echappen marked this pull request as ready for review November 5, 2024 17:26
@echappen echappen requested a review from a team as a code owner November 5, 2024 17:26
@hursey013
Copy link
Contributor

I'm noticing on initial login that I'm directed to a blank homepage as opposed to the login page. If I reload the page, I'm properly directed to localhost:9001/login.

Screenshot 2024-11-05 at 1 24 10 PM

@echappen
Copy link
Contributor Author

echappen commented Nov 5, 2024

I'm noticing on initial login that I'm directed to a blank homepage as opposed to the login page. If I reload the page, I'm properly directed to localhost:9001/login

@hursey013 I noticed that middleware wasn't triggering at all for initial page loads of the root url /. Including it in the route matchers seems to fix that. Do you know if we'd need anything more specific for the matcher?

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.

Create "welcome mat" for authenticated users
3 participants