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 documentation links to point to correct version instead of current #4301

Merged

Conversation

Desvelao
Copy link
Member

@Desvelao Desvelao commented Jun 30, 2022

Description

This PR changes the web documentation URLs to point using the plugin short version instead of current.

Closes #4294 #4296.

Changes

  • Created service to generate the web documentation URLs
  • Added tests for the service
  • Fixed not found URLs
  • Changed some link texts
  • Refactored some prompts to match other similar elements
  • Updated the script to generate the API info that creates the URLs for the
    endpoints

Screenshots

2022-06-30_12-16
2022-06-30_12-17
2022-06-30_12-18

Test

Manual tests

  • Test each web documentation link work as expected and points to the plugin short version

Automatic tests

  • 3 tests are added related to the new service. Run them with:
    yarn test:jest common/services/web_documentation.test.ts

Expected result:

$ node scripts/jest common/services/web_documentation.test.ts
 PASS  common/services/web_documentation.test.ts
  ✓ Generate a web documentation URL using to the plugin short version (2 ms)
  ✓ Generate a web documentation URL to the base URL using to the plugin short version
  ✓ Generate a web documentation URL using a specific version


=============================== Coverage summary ===============================
Statements   : 0.28% ( 101/36348 )
Branches     : 0% ( 1/28223 )
Functions    : 0.01% ( 1/8890 )
Lines        : 0.29% ( 101/34765 )
================================================================================
Test Suites: 1 passed, 1 total
Tests:       3 passed, 3 total
Snapshots:   0 total
Time:        14.986 s
Ran all test suites matching /common\/services\/web_documentation.test.ts/i.
Done in 17.22s.

Created service to generate the web documentation URLs
Fixed not found URLs
Changed some link texts
Refactored some prompts to match other similar elements
Updated the script to generate the API info that create the URLs for the
endpoints
@Desvelao Desvelao force-pushed the feat/4296-documentation-links-point-to-short-version branch from 9c23f6c to bbcf407 Compare June 30, 2022 14:12
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: ✔️

Solves the title overflow
Solves title overflow
Some of the documenatation links titles were outdated or too long,
causing the title to overflow.

These titles have been updated to the titltes on their Wazuh
documentation page.

Also, a new link has been aded to the Docker Listener section.
Copy link
Member

@AlexRuiz7 AlexRuiz7 left a comment

Choose a reason for hiding this comment

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

Review

  • Code: ✔️
  • Test: ✔️

common/services/web_documentation.ts Show resolved Hide resolved
@@ -1,190 +0,0 @@
/*
Copy link
Member

Choose a reason for hiding this comment

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

Why was this file deleted?

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

Jest Test Coverage % values
Statements 5.5% ( 1999 / 36348 )
Branches 2.28% ( 643 / 28223 )
Functions 3.67% ( 326 / 8890 )
Lines 5.57% ( 1938 / 34765 )

@AlexRuiz7 AlexRuiz7 merged commit 463665e into 4.3-7.10 Jul 4, 2022
@AlexRuiz7 AlexRuiz7 deleted the feat/4296-documentation-links-point-to-short-version branch July 4, 2022 13:10
github-actions bot pushed a commit that referenced this pull request Jul 4, 2022
* feat: web documentation URLs point to plugin short version

Created service to generate the web documentation URLs
Fixed broken links
Changed some link texts
Refactored some prompts to match other similar elements
Updated the script to generate the API info that create the URLs for the
endpoints

* changelog: add PR entries

* fix: replaced the title for agent enrollment link

* feat: added tests to webDocumentationLink function

* Change documentation title of Wazuh agent enrollment

* Update documentation links titles

Some documentation links titles were outdated or too long,
causing the title to overflow.

These titles have been updated to the titles on their Wazuh
documentation page.

Also, a new link has been added to the Docker Listener section.

Co-authored-by: Alex Ruiz Becerra <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 463665e)
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2022

The backport to 4.3-1.2-wzd failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.3-1.2-wzd 4.3-1.2-wzd
# Navigate to the new working tree
cd .worktrees/backport-4.3-1.2-wzd
# Create a new branch
git switch --create backport-4301-to-4.3-1.2-wzd
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 463665ef2a01ace783162adea48952e6bfe3a54d
# Push it to GitHub
git push --set-upstream origin backport-4301-to-4.3-1.2-wzd
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.3-1.2-wzd

Then, create a pull request where the base branch is 4.3-1.2-wzd and the compare/head branch is backport-4301-to-4.3-1.2-wzd.

AlexRuiz7 pushed a commit that referenced this pull request Jul 4, 2022
…ion (#4304)

Web documentation URLs point to plugin short version (#4301)

* feat: web documentation URLs point to plugin short version

Created service to generate the web documentation URLs
Fixed broken links
Changed some link texts
Refactored some prompts to match other similar elements
Updated the script to generate the API info that create the URLs for the
endpoints

* changelog: add PR entries

* fix: replaced the title for agent enrollment link

* feat: added tests to webDocumentationLink function

* Change documentation title of Wazuh agent enrollment

* Update documentation links titles

Some documentation links titles were outdated or too long,
causing the title to overflow.

These titles have been updated to the titles on their Wazuh
documentation page.

Also, a new link has been added to the Docker Listener section.

Co-authored-by: Alex Ruiz Becerra <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 463665e)

Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com>
AlexRuiz7 pushed a commit that referenced this pull request Jul 4, 2022
* feat: web documentation URLs point to plugin short version

Created service to generate the web documentation URLs
Fixed broken links
Changed some link texts
Refactored some prompts to match other similar elements
Updated the script to generate the API info that create the URLs for the
endpoints

* changelog: add PR entries

* fix: replaced the title for agent enrollment link

* feat: added tests to webDocumentationLink function

* Change documentation title of Wazuh agent enrollment

* Update documentation links titles

Some documentation links titles were outdated or too long,
causing the title to overflow.

These titles have been updated to the titles on their Wazuh
documentation page.

Also, a new link has been added to the Docker Listener section.

Co-authored-by: Alex Ruiz Becerra <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 463665e)
AlexRuiz7 added a commit that referenced this pull request Jul 4, 2022
…ersion (#4305)

Web documentation URLs point to plugin short version (#4301)

* feat: web documentation URLs point to plugin short version

Created service to generate the web documentation URLs
Fixed broken links
Changed some link texts
Refactored some prompts to match other similar elements
Updated the script to generate the API info that create the URLs for the
endpoints

* changelog: add PR entries

* fix: replaced the title for agent enrollment link

* feat: added tests to webDocumentationLink function

* Change documentation title of Wazuh agent enrollment

* Update documentation links titles

Some documentation links titles were outdated or too long,
causing the title to overflow.

These titles have been updated to the titles on their Wazuh
documentation page.

Also, a new link has been added to the Docker Listener section.

Co-authored-by: Alex Ruiz Becerra <alejandro.ruiz.becerra@wazuh.com>
(cherry picked from commit 463665e)

Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com>
@gdiazlo gdiazlo changed the title Web documentation URLs point to plugin short version Use app version instead of 'current' in documentation links Jul 15, 2022
@gdiazlo gdiazlo changed the title Use app version instead of 'current' in documentation links Fix documentation links to point to correct version instead of current Jul 15, 2022
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.

Documentation links must redirect to the App version Broken link to documentation
3 participants