-
Notifications
You must be signed in to change notification settings - Fork 51
Showcase - Convert Foundations, Layouts, Utilities pages to TS #3016
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git โ๏ธ
|
97eced4
to
624605b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note] All of the functionality of this file could be handled in a route file alone, so deleted this file and move its functionality to the route.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I implemented things in this way, tbh ๐คทโโ๏ธ๐คฆโโ๏ธ
3ff5ddf
get weights() { | ||
return [...FONT_WEIGHTS]; | ||
} | ||
get styles() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note] This variable, and the imports that make it up were unused in the template file so it was removed.
@@ -236,7 +234,7 @@ | |||
<Hds::Layout::Grid @gap="48" @align="center" as |LG|> | |||
<Shw::Placeholder @text="item #1" @height="48" /> | |||
<Shw::Placeholder @text="item #2" @height="48" /> | |||
<LG.Item @basis="25%" @grow="0" @shrink="0"> | |||
<LG.Item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note] The basis
, grow
and shrink
arguments are not present in the Layout::Grid
Item
subcomponent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably remnants of a copy&paste from a similar example in the layout flex page.
@@ -199,7 +197,7 @@ | |||
<Hds::Layout::Grid @gap="16" @align="center" as |LG|> | |||
<Shw::Placeholder @text="item #1" @height="48" /> | |||
<Shw::Placeholder @text="item #2" @height="48" /> | |||
<LG.Item @columnWidth="25%"> | |||
<LG.Item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note] The columnWidth
argument is not present on the Layout::Grid
Item
subcomponent
<SG.Item @label="3 column layout Card layout using columnWidth=33.33%"> | ||
<Hds::Layout::Grid @columnWidth="33.33%" @gap="32"> | ||
<Hds::Card::Container @level="mid" @hasBorder={{true}} {{style padding="24px"}}> | ||
<Hds::Card::Container @level={{@model.HdsCardLevelValues.Mid}} @hasBorder={{true}} {{style padding="24px"}}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note] Type errors were thrown when leaving this value as a string. Instead the card level values had to be added to the model and used here. Similar type errors are not thrown for other component values used.
Ex: When the Badge
is used below, there is no type error thrown when @color="success"
is set.
This is due to a difference in how the types for these two arrguments are defined.
HdsCardLevel
is defined using the union type
export type HdsCardLevel =
| HdsCardLevelValues.Base
| HdsCardLevelValues.Mid
| HdsCardLevelValues.High;
HdsBadgeColors
is defined using template literals
export type HdsBadgeColors = `${HdsBadgeColorValues}`;
The template literal method allows you to use raw strings directly, meanwhile the union method means you have to use the exact enum values.
Ideally we should have some alignment on how these types are set. That could be a future alignment effort. My preference would be to use the template literal method so we can avoid having to do things like this in the template files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agree - would you mind adding at ticket in the backlog where we can note all the components that have issues like this so we can fix them all at once?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created a ticket for this in the epic. https://hashicorp.atlassian.net/browse/HDS-5154
@@ -24,7 +25,8 @@ declare module '@glint/environment-ember-loose/registry' { | |||
PageTitle, | |||
RenderModifiersRegistry, | |||
ShowcaseTemplateRegistry, | |||
EmberComposableHelpersRegistry { | |||
EmberComposableHelpersRegistry, | |||
PowerSelectRegistry { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note] Without adding this to the registry template errors were thrown in the Power Select saying PowerSelect
was not defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Note] The diff can make this a little unclear, but the FocusRing
route was removed, as it was not needed. A base level Foundations
route file was separately added as it was missing previously. All other top level routes (components, overrides, utilities, etc) have route files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense! Thank you for clarifying.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
left a few comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why I implemented things in this way, tbh ๐คทโโ๏ธ๐คฆโโ๏ธ
3ff5ddf
@@ -236,7 +234,7 @@ | |||
<Hds::Layout::Grid @gap="48" @align="center" as |LG|> | |||
<Shw::Placeholder @text="item #1" @height="48" /> | |||
<Shw::Placeholder @text="item #2" @height="48" /> | |||
<LG.Item @basis="25%" @grow="0" @shrink="0"> | |||
<LG.Item> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, probably remnants of a copy&paste from a similar example in the layout flex page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ข
๐ Summary
If merged, this PR would convert the Foundations, Layouts, and Overrides showcase pages to TS.
๐ ๏ธ Detailed description
Summary of pages converted
๐ External links
Jira ticket: HDS-5076
๐ Component checklist
๐ฌ Please consider using conventional comments when reviewing this PR.
๐ PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.