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

[Bug]: CodeSnippet suggests align value that isn't available yet #17585

Closed
1 task done
ev-codes opened this issue Sep 26, 2024 · 8 comments · Fixed by #17834
Closed
1 task done

[Bug]: CodeSnippet suggests align value that isn't available yet #17585

ev-codes opened this issue Sep 26, 2024 · 8 comments · Fixed by #17834
Assignees
Labels
afrohacks See https://ibm.biz/afrohacks-hackathon component: code-snippet good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. role: dev 🤖 severity: 3 https://ibm.biz/carbon-severity type: bug 🐛
Milestone

Comments

@ev-codes
Copy link

The problem

I currently use the component <CodeSnippet> with align property "bottom-right".

However, during test runs, <CodeSnippet> logs a console warning to use align property "bottom-end" instead. However, <CodeSnippet> does not currently support this align property.

Unnecessary/unaddressable warnings make it harder to see fixable errors and slow down CI workflows.

The solution

Either:

  • Support the "bottom-end" property in <CodeSnippet>
  • Do not log the warning until <CodeSnippet> supports "bottom-end"

Examples

Code sample:

<CodeSnippet
        wrapText
        align="bottom-right"
        type="multi"
        onClick={() => {
          copyDetail(value);
        }}
      >
        {value}
      </CodeSnippet>

Logs from test running this code:

console.warn
    Warning: "bottom-right" is a deprecated value for the "align" prop on the "Popover" component. Use "bottom-end" instead. "bottom-right" will be removed in the next major release.

Application/PAL

No response

Business priority

None

Available extra resources

No response

Code of Conduct

Copy link
Contributor

Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.

If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.

@sstrubberg
Copy link
Member

Can we get a repo using stackblitz?

@alisonjoseph
Copy link
Member

I'm unable to reproduce the error, the correct prop to use is bottom-end and it appears to be working as intended here.

@ev-codes
Copy link
Author

Thanks for your responses! And I'm glad to see this works in the stackblitz.

In the CodeSnippetProps, I don't see bottom-end as an option for the align property.

Since CodeSnippet supports bottom-end, may you please update the interface to reflect this? Or perhaps I'm missing something 🤔

Thank you 😄

@sstrubberg
Copy link
Member

Add bottom-end to the align prop, as suggested.

@tay1orjones
Copy link
Member

We'll need to make sure all the options for align are updated to the new values. This is really similar to what we had to do for DefinitionTooltip #16810

@github-project-automation github-project-automation bot moved this to Triage in Roadmap Oct 17, 2024
@tay1orjones tay1orjones added type: bug 🐛 severity: 3 https://ibm.biz/carbon-severity good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. and removed type: enhancement 💡 labels Oct 17, 2024
@tay1orjones tay1orjones added the afrohacks See https://ibm.biz/afrohacks-hackathon label Oct 17, 2024
@Shankar-CodeJunkie
Copy link
Contributor

@tay1orjones : Can you assign this issue to me ? Thank you

@sstrubberg sstrubberg removed this from Roadmap Oct 17, 2024
@sstrubberg sstrubberg changed the title [Feature Request]: CodeSnippet suggests align value that isn't available yet [Bug]: CodeSnippet suggests align value that isn't available yet Oct 17, 2024
@Shankar-CodeJunkie
Copy link
Contributor

@tay1orjones : I've updated the packages/react/src/components/CodeSnippet/CodeSnippet.tsx align props with the new values. However the yarn build command asked me to update the similar changes in the below files as well. The CodeSnippet inturn uses the Copy and CopyButton components, where I need to replicate the similar changes.

        modified:   packages/react/src/components/CodeSnippet/CodeSnippet.tsx
	modified:   packages/react/src/components/ComboButton/index.tsx
	modified:   packages/react/src/components/Copy/Copy.tsx
	modified:   packages/react/src/components/CopyButton/CopyButton.tsx
	modified:   packages/react/src/components/IconButton/index.tsx
	modified:   packages/react/src/components/OverflowMenu/next/index.tsx
	modified:   packages/react/src/components/Pagination/Pagination.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
afrohacks See https://ibm.biz/afrohacks-hackathon component: code-snippet good first issue 👋 Used by GitHub to elevate contribution opportunities hacktoberfest See https://hacktoberfest.com/ needs: community contribution Due to roadmap and resource availability, we are looking for outside contributions on this issue. role: dev 🤖 severity: 3 https://ibm.biz/carbon-severity type: bug 🐛
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants