-
Notifications
You must be signed in to change notification settings - Fork 51
Showcase: Batch 1 converting pages to TypeScript #2999
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 โ๏ธ
|
| return document.querySelector('#test-target-node-element'); | ||
| } | ||
|
|
||
| get targetMultipleNodeElements() { |
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: I removed this getter from the typescript version because:
- It was never used in the showcase template
- Hds::Copy::Button doesn't support copying multiple nodes like this
|
|
||
| <Hds::AppSideNav::Portal @targetName="sidenav-portal-demo-1" @ariaLabel="Primary on portal demo 1" as |Nav|> | ||
| <Nav.extraBefore><Shw::Placeholder @height="72px" @text="extraBefore" @background="#f3d9c5" /></Nav.extraBefore> | ||
| <Nav.ExtraBefore><Shw::Placeholder @height="72px" @text="extraBefore" @background="#f3d9c5" /></Nav.ExtraBefore> |
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 causes a small change in Percy because now the blocks are rendered (they weren't before)
| <Shw::Text::H4>Target types</Shw::Text::H4> | ||
|
|
||
| <Shw::Grid @columns={{3}} @gap="2rem" as |SF|> | ||
| <Shw::Flex @gap="2rem" as |SF|> |
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: columns isnt an argument on Flex (its only on Grid), opted to change it back to Flex and remove the columns argument to avoid changes in Percy.
| import Controller from '@ember/controller'; | ||
| import { action } from '@ember/object'; | ||
| import { tracked } from '@glimmer/tracking'; | ||
| import { inject as service } from '@ember/service'; |
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.
| import { inject as service } from '@ember/service'; | |
| import { service } from '@ember/service'; |
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.
For context, Alexey is referring to the following deprecation https://deprecations.emberjs.com/id/importing-inject-from-ember-service/. However, we're still supporting 3.28 at the moment, so we'd need to operate such changes closer to the major release โ and can be done across the library with a simple replace.
| import Route from '@ember/routing/route'; | ||
| import type { ModelFrom } from 'showcase/utils/ModelFromRoute'; | ||
|
|
||
| interface User { |
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.
[Suggestion] Since these mock api files are used across multiple component maybe we should define a types file for them somewhere.
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, I think that might be a good follow up ticket.. @aklkv suggested actually making a reusable fixture that imports the typed user data. So I think if we do that, we could have the type in that file.
didoo
left a comment
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!
Co-authored-by: Cristiano Rastelli <[email protected]>
๐ Summary
If merged, this PR would convert the following pages in the showcase to TypeScript:
๐ ๏ธ Detailed description
The best way to understand the changes in this PR is to walk through each commit in the "Files changed" tab, I have added comments there explaining why I made the changes.
๐ 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.