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

Showcase - Add Mock::App component in showcase to easily mock a product application in a frameless page #2527

Merged
merged 9 commits into from
Nov 5, 2024

Conversation

didoo
Copy link
Contributor

@didoo didoo commented Oct 30, 2024

📌 Summary

This is a porting of https://github.com/hashicorp/hds-plus/pull/41 in HDS (with some tweaks, that later I'll port back to HDS+).

The idea comes from the observation of how much code @KristinLBradley (and then @philrenaud) had to write (copy&paste) to mock a "product application" in a frameless page.

That's why I've decided to abstract away all that code in a Mock::App so that ultimately to render this page:

screenshot_4324

it's enough to write this code:

<Mock::App>
  <:main as |M|>
    <M.PageHeader />
    <M.LongTextContent />
  </:main>
</Mock::App>

Note: I've used the Mock namespace because in the future we may want to mock other complex UI parts (tables with filter and pagination, forms, etc)

🛠️ Detailed description

In this PR I have:

  • added Mock::App component for showcase
    • removed an extra file from showcase types folder (leftover?)
  • converted existing “demo” frameless pages to use Mock::App

Preview of the converted pages:

(for the last two, I have used placeholders instead of the AppHeader/AppSideNav, for the time being; we can easily add these components to the Mock::App and demo pages, if/when we will publish the AppHeader/AppSideNav components)


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

@didoo didoo requested review from alex-ju, KristinLBradley and a team October 30, 2024 20:56
Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Nov 1, 2024 6:53pm
hds-website ✅ Ready (Inspect) Visit Preview Nov 1, 2024 6:53pm

Copy link
Member

@alex-ju alex-ju left a comment

Choose a reason for hiding this comment

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

Looking good overall – it should save us some time with future extensive page mocks.

showcase/app/components/mock/app/header/app-header.gts Outdated Show resolved Hide resolved
showcase/types/global.d.ts Show resolved Hide resolved
@KristinLBradley
Copy link
Contributor

This looks great and should be very convenient to use, thanks!

@didoo didoo merged commit 3ab78a7 into main Nov 5, 2024
14 checks passed
@didoo didoo deleted the showcase-add-mock-app branch November 5, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants