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 vulnerability detail truncated text in big fields #6338

Merged

Conversation

lucianogorza
Copy link
Contributor

@lucianogorza lucianogorza commented Jan 17, 2024

Description

This PR allows scrolling when a large value is displayed in the Document details of the Vulnerability Detection inventory.

Issues Resolved

#6332

Evidence

Evidence

Test

  1. Edit the script: scripts/vulnerabilities-events-injector/dataInjectScript.py
  2. Modify line 111 adding a large description. For example:
    vulnerability['description'] = '''
    What is Lorem Ipsum?
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

    Why do we use it?
    It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).

    Where does it come from?
    Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

    The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from "de Finibus Bonorum et Malorum" by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham.

    Where can I get some?
    There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.
    '''
  1. Run python script.
  2. Navigate to App Settings -> Miscellaneous and run the health check.
  3. Navigate to Threat Hunting -> Vulnerability Detection -> Inventory Tab.
  4. Open the detail drawer and scroll to the field vulnerabilty.description.

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@lucianogorza lucianogorza self-assigned this Jan 17, 2024
Copy link
Contributor

Wazuh Core plugin code coverage (Jest) test % values
Statements 21.42% ( 186 / 868 )
Branches 17.99% ( 79 / 439 )
Functions 14.22% ( 36 / 253 )
Lines 21.65% ( 183 / 845 )

Copy link
Contributor

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.68% ( 171 / 223 )
Branches 57.57% ( 57 / 99 )
Functions 61.7% ( 29 / 47 )
Lines 76.68% ( 171 / 223 )

Copy link
Contributor

Main plugin code coverage (Jest) test % values
Statements 12.2% ( 4202 / 34417 )
Branches 8.26% ( 1911 / 23121 )
Functions 11.71% ( 958 / 8176 )
Lines 12.38% ( 4087 / 33009 )

@lucianogorza lucianogorza marked this pull request as ready for review January 17, 2024 16:24
@lucianogorza lucianogorza requested a review from a team as a code owner January 17, 2024 16:24
@lucianogorza lucianogorza linked an issue Jan 17, 2024 that may be closed by this pull request
Copy link
Member

@yenienserrano yenienserrano left a comment

Choose a reason for hiding this comment

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

CR: ✅
Test: ✅

image

Copy link
Member

@JuanGarriuz JuanGarriuz left a comment

Choose a reason for hiding this comment

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

LGTM!!

Test ✅

Test

Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

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

CR: ✔️
Test: ✔️

Peek 2024-01-18 11-57

@asteriscos asteriscos merged commit 7a9b3c9 into 4.8.0 Jan 18, 2024
4 checks passed
@asteriscos asteriscos deleted the fix/6332-vulnerability-detail-truncated-text-in-big-fields branch January 18, 2024 10:58
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.

Vulnerability detail truncated text in big fields
4 participants