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

feat(ai-label): add ts types #17295

Conversation

ariellalgilmore
Copy link
Member

Closes #17232

Add typescript types to AI-label

Changelog

Changed

  • Converted AILabel file from JS to TSX.
  • updated align to copy Popover syntax with deprecated values

Testing / Reviewing

functionality stay the same
checks still passing
storybook looks good

@ariellalgilmore
Copy link
Member Author

When checking the blame history in github you can still see the history even though it shows it as a new file

Screenshot 2024-08-28 at 8 21 25 AM

Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d296b91
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66cf405fece17c0008affa2f
😎 Deploy Preview https://deploy-preview-17295--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ariellalgilmore ariellalgilmore marked this pull request as ready for review August 28, 2024 15:26
@ariellalgilmore ariellalgilmore requested review from a team as code owners August 28, 2024 15:26
Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit d296b91
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66cf405f45dc3800083468e5
😎 Deploy Preview https://deploy-preview-17295--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 43d3070
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66e1ba2b0fd73a00086be07e
😎 Deploy Preview https://deploy-preview-17295--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Aug 28, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 43d3070
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66e1ba2bd88c0c0008008527
😎 Deploy Preview https://deploy-preview-17295--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me!

Copy link
Contributor

@2nikhiltom 2nikhiltom left a comment

Choose a reason for hiding this comment

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

LGTM 💯

Comment on lines 125 to 137
const propMappingFunction = (deprecatedValue) => {
const mapping = {
'top-left': 'top-start',
'top-right': 'top-end',
'bottom-left': 'bottom-start',
'bottom-right': 'bottom-end',
'left-bottom': 'left-end',
'left-top': 'left-start',
'right-bottom': 'right-end',
'right-top': 'right-start',
};
return mapping[deprecatedValue];
};
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker to merge at all, but at some point we should probably make this a reusable helper - we're going to be using this all over the codebase 😅

Copy link
Member

Choose a reason for hiding this comment

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

I totally forgot we have one already:

export function mapPopoverAlignProp(align) {
switch (align) {
case 'top-left':
return 'top-start';
case 'top-right':
return 'top-end';
case 'bottom-left':
return 'bottom-start';
case 'bottom-right':
return 'bottom-end';
case 'left-bottom':
return 'left-end';
case 'left-top':
return 'left-start';
case 'right-bottom':
return 'right-end';
case 'right-top':
return 'right-start';
default:
return align;
}
}
export { mapDownshiftProps };

Copy link
Member Author

@ariellalgilmore ariellalgilmore Sep 10, 2024

Choose a reason for hiding this comment

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

ooh thanks! I updated AI label!

@ariellalgilmore ariellalgilmore added this pull request to the merge queue Sep 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 10, 2024
Copy link

codecov bot commented Sep 11, 2024

Codecov Report

Attention: Patch coverage is 72.91667% with 13 lines in your changes missing coverage. Please review.

Project coverage is 76.83%. Comparing base (28032c3) to head (43d3070).

Files with missing lines Patch % Lines
packages/react/src/components/AILabel/index.tsx 72.91% 13 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #17295      +/-   ##
==========================================
- Coverage   76.83%   76.83%   -0.01%     
==========================================
  Files         408      408              
  Lines       13945    13949       +4     
  Branches     4323     4276      -47     
==========================================
+ Hits        10715    10718       +3     
- Misses       3056     3058       +2     
+ Partials      174      173       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ariellalgilmore ariellalgilmore added this pull request to the merge queue Sep 11, 2024
Merged via the queue into carbon-design-system:main with commit cfba956 Sep 11, 2024
23 checks passed
@ariellalgilmore ariellalgilmore deleted the fix/ai-label-test-branch branch September 11, 2024 16:14
@carbon-automation
Copy link
Contributor

Hey there! v11.66.0 was just released that references this issue/PR.

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.

Add TypeScript types to AI Label (formerly Slug)
5 participants