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

fix size api selector and add basic test #3445

Merged

Conversation

eze9252
Copy link
Contributor

@eze9252 eze9252 commented Jul 7, 2021

Hi team, this resolves:

  • Adapt API selector when api name is too long

How to Test:

  • Register a second API in kibana/data/wazuh/config/wazuh.yml, it doesn't need to be active
  • Set the name of the active API (default if no other is set) to a very long name
  • The API selector should show full name

Closes #3334

@eze9252 eze9252 self-assigned this Jul 7, 2021
Copy link
Contributor

@pablomarga pablomarga left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Testing: ✔️

@@ -632,7 +632,7 @@ export const WzMenu = withWindowSize(class WzMenu extends Component {
}

getApiSelectorComponent() {
let style = { maxWidth: 100 };
let style = { minWidth: 'max-content' };
Copy link
Member

Choose a reason for hiding this comment

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

increasing the size the component can take is a good first step, but not limiting it in any way can lead to other issues, if the name is too long still, the other components in the menu will be squished and rendered incorrectly
image
I suggest you specify a max size and text-overflow: ellipsis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a very difficult case to happen (that the api name is so long) but I will consider it.

@Desvelao Desvelao linked an issue Jul 8, 2021 that may be closed by this pull request
Copy link
Member

@mpRegalado mpRegalado left a comment

Choose a reason for hiding this comment

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

CR: LGTM ✔️

Copy link
Contributor

@matiasmoreno876 matiasmoreno876 left a comment

Choose a reason for hiding this comment

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

CR: LGTM!

@eze9252 eze9252 merged commit c8188a3 into 4.3-7.10 Jul 16, 2021
@eze9252 eze9252 deleted the bugfix/3334-api-selector-breaks-when-api-name-is-long branch July 16, 2021 15:35
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.

Api name cuts off if the name of the api is too long
4 participants