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

Add extra check for sidebar item type #4065

Closed
wants to merge 2 commits into from

Conversation

pudek357
Copy link
Contributor

@pudek357 pudek357 commented Dec 27, 2023

Description

This PR aims to add extra check for sidebar item type.
To fixes the two warnings in Client Portal:
image
image

Here is how our Sidebar looks like in CP:

As you can see we have additional banner between the items.

How to test

  • checkout branch locally
  • run project
  • open console
  • you should not see mentioned warnings anymore

Development checks

Breaking change

  • n/a codemod is created and showcased in the changeset
  • test alpha package of Picasso in StaffPortal

All development checks should be done and set checked to pass the
GitHub Bot: TODOLess action

PR commands

List of available commands:

  • @toptal-bot run package:alpha-release - Release alpha version
  • @toptal-anvil ping reviewers - Ping FX team for review
PR Review Guidelines

When to approve? ✅

You are OK with merging this PR and

  1. You have no extra requests.
  2. You have optional requests.
    1. Add nit: to your comment. (ex. nit: I'd rename this variable from makeCircle to getCircle)

When to request changes? ❌

You are not OK with merging this PR because

  1. Something is broken after the changes.
  2. Acceptance criteria is not reached.
  3. Code is dirty.

When to comment (neither ✅ nor ❌)

You want your comments to be addressed before merging this PR in cases like:

  1. There are leftovers like unnecessary logs, comments, etc.
  2. You have an opinionated comment regarding the code that requires a discussion.
  3. You have questions.

How to handle the comments?

  1. An owner of a comment is the only one who can resolve it.
  2. An owner of a comment must resolve it when it's addressed.
  3. A PR owner must reply with ✅ when a comment is addressed.

@pudek357 pudek357 self-assigned this Dec 27, 2023
Copy link

changeset-bot bot commented Dec 27, 2023

🦋 Changeset detected

Latest commit: 1107bb2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@toptal/picasso Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pudek357
Copy link
Contributor Author

@toptal-bot run package:alpha-release

@toptal-devbot
Copy link
Collaborator

Your alpha package is ready 🎉
yarn add @topkit/analytics-charts@53.0.1-alpha-add-extra-check-for-child-type-0f48a47f5.22+0f48a47f5
yarn add @toptal/[email protected]+0f48a47f5
yarn add @toptal/picasso-charts@56.0.1-alpha-add-extra-check-for-child-type-0f48a47f5.22+0f48a47f5
yarn add @toptal/picasso-codemod@5.6.4-alpha-add-extra-check-for-child-type-0f48a47f5.72+0f48a47f5
yarn add @toptal/picasso-forms@66.1.2-alpha-add-extra-check-for-child-type-0f48a47f5.17+0f48a47f5
yarn add @toptal/picasso-pictograms@2.0.1-alpha-add-extra-check-for-child-type-0f48a47f5.142+0f48a47f5
yarn add @toptal/picasso-provider@3.4.3-alpha-add-extra-check-for-child-type-0f48a47f5.14+0f48a47f5
yarn add @toptal/picasso-query-builder@1.2.1-alpha-add-extra-check-for-child-type-0f48a47f5.10+0f48a47f5
yarn add @toptal/picasso-rich-text-editor@10.0.1-alpha-add-extra-check-for-child-type-0f48a47f5.22+0f48a47f5
yarn add @toptal/picasso-shared@13.1.2-alpha-add-extra-check-for-child-type-0f48a47f5.4+0f48a47f5
yarn add @toptal/picasso-tailwind@1.0.2-alpha-add-extra-check-for-child-type-0f48a47f5.2+0f48a47f5

@pudek357
Copy link
Contributor Author

@toptal-anvil ping reviewers

@pudek357 pudek357 force-pushed the add-extra-check-for-child-type branch from 1b78bd0 to 1107bb2 Compare December 28, 2023 04:49
@pudek357 pudek357 marked this pull request as ready for review December 28, 2023 08:28
@pudek357 pudek357 requested a review from a team as a code owner December 28, 2023 08:28
@github-actions github-actions bot added the contribution DO NOT ADD MANUALLY label Dec 28, 2023
@toptal-devbot
Copy link
Collaborator

Greetings from FX team, @pudek357 👋

Thank you so much for contributing 🙇

We have got high priority ticket generated on our Kanban board so we will do our best to make your experience supreme!

What's next? We will collaborate using this workflow. For you this practically means making sure DONE criteria is met and responding promptly to code review comments 😉

🙏 please, help us improve, rate your contributing experience after merge

Copy link
Contributor

@TomasSlama TomasSlama left a comment

Choose a reason for hiding this comment

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

thanks for the contribution!

@@ -50,7 +50,7 @@ export const SidebarMenu = forwardRef<HTMLUListElement, Props>(
}, [parentSidebarItemIndex, setExpandedItemKey, children])

const items = React.Children.map(children, (child, index) => {
if (React.isValidElement(child)) {
if (React.isValidElement(child) && child.type === SidebarItem) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think, it's kinda a strict requirement, because, some components may be extended from SidebarItem. We may break tha backward compatibility

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

good point

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it @dmaklygin 👍
For now, I don't see any other way to fix it, I will close the PR.

@pudek357 pudek357 closed this Jan 1, 2024
@pudek357 pudek357 deleted the add-extra-check-for-child-type branch January 1, 2024 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution DO NOT ADD MANUALLY no-jira
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants