From daf64fa49a7d07337e21deb74a050b11ca484b08 Mon Sep 17 00:00:00 2001 From: JuanGarriuz Date: Wed, 13 Dec 2023 12:49:35 +0100 Subject: [PATCH 1/4] Standardize titles and subtitles in the register agent wizard --- .../command-output/command-output.tsx | 3 +- .../components/command-output/os-warning.tsx | 69 +++++++++++++++++++ .../components/group-input/group-input.tsx | 2 +- .../optionals-inputs/optionals-inputs.tsx | 19 +++-- .../server-address/server-address.tsx | 2 +- .../register-agent/containers/steps/steps.tsx | 11 ++- .../utils/register-agent-data.tsx | 4 +- 7 files changed, 92 insertions(+), 18 deletions(-) create mode 100644 plugins/main/public/controllers/register-agent/components/command-output/os-warning.tsx diff --git a/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx b/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx index 31064c60fe..dfcf5da340 100644 --- a/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx +++ b/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx @@ -10,6 +10,7 @@ import { import React, { Fragment, useEffect, useState } from 'react'; import { tOperatingSystem } from '../../core/config/os-commands-definitions'; import { osdfucatePasswordInCommand } from '../../services/wazuh-password-service'; +import OsCommandWarning from './os-warning'; interface ICommandSectionProps { commandText: string; @@ -55,7 +56,6 @@ export default function CommandOutput(props: ICommandSectionProps) { const onChangeShowPassword = (event: EuiSwitchEvent) => { setShowPassword(event.target.checked); }; - return ( @@ -84,6 +84,7 @@ export default function CommandOutput(props: ICommandSectionProps) { )} + {showCommand && havePassword ? ( +
    +
  • + + You will need administrator privileges to perform this + installation. + +
  • +
  • + PowerShell 3.0 or greater is required. +
  • +
+

+ Keep in mind you need to run this command in a Windows PowerShell + terminal. +

+ + ), + LINUX: ( + +
    +
  • + + You will need administrator privileges to perform this + installation. + +
  • +
  • + Shell Bash is required. +
  • +
+

+ Keep in mind you need to run this command in a Shell Bash terminal. +

+
+ ), + macOS: ( + +
    +
  • + + You will need administrator privileges to perform this + installation. + +
  • +
  • + Shell Bash is required. +
  • +
+

+ Keep in mind you need to run this command in a Shell Bash terminal. +

+
+ ), + }; + + return osSelector[props?.os] || null; +} diff --git a/plugins/main/public/controllers/register-agent/components/group-input/group-input.tsx b/plugins/main/public/controllers/register-agent/components/group-input/group-input.tsx index e12c301850..afeab1b86e 100644 --- a/plugins/main/public/controllers/register-agent/components/group-input/group-input.tsx +++ b/plugins/main/public/controllers/register-agent/components/group-input/group-input.tsx @@ -45,7 +45,7 @@ const GroupInput = ({ value, options, onChange }) => { >

- Select one or more existing groups + Select one or more existing groups:

diff --git a/plugins/main/public/controllers/register-agent/components/optionals-inputs/optionals-inputs.tsx b/plugins/main/public/controllers/register-agent/components/optionals-inputs/optionals-inputs.tsx index 317e3b6c41..8a0364ed9c 100644 --- a/plugins/main/public/controllers/register-agent/components/optionals-inputs/optionals-inputs.tsx +++ b/plugins/main/public/controllers/register-agent/components/optionals-inputs/optionals-inputs.tsx @@ -27,7 +27,7 @@ const OptionalsInputs = (props: OptionalsInputsProps) => { const agentNameDocLink = webDocumentationLink( 'user-manual/reference/ossec-conf/client.html#enrollment-agent-name', PLUGIN_VERSION_SHORT, - ) + ); const popoverAgentName = ( Learn about{' '} @@ -64,7 +64,7 @@ const OptionalsInputs = (props: OptionalsInputsProps) => { gutterSize='s' > -

Assign an agent name

+

Assign an agent name:

{ /> {warningForAgentName}
} + title={ + + {warningForAgentName} + + + } iconType='iInCircle' className='warningForAgentName' /> diff --git a/plugins/main/public/controllers/register-agent/components/server-address/server-address.tsx b/plugins/main/public/controllers/register-agent/components/server-address/server-address.tsx index d8f1cd1c31..92369162aa 100644 --- a/plugins/main/public/controllers/register-agent/components/server-address/server-address.tsx +++ b/plugins/main/public/controllers/register-agent/components/server-address/server-address.tsx @@ -66,7 +66,7 @@ const ServerAddressInput = (props: ServerAddressInputProps) => { > - Assign a server address + Assign a server address: diff --git a/plugins/main/public/controllers/register-agent/containers/steps/steps.tsx b/plugins/main/public/controllers/register-agent/containers/steps/steps.tsx index 2c0dec80e2..80824af0ad 100644 --- a/plugins/main/public/controllers/register-agent/containers/steps/steps.tsx +++ b/plugins/main/public/controllers/register-agent/containers/steps/steps.tsx @@ -141,14 +141,14 @@ export const Steps = ({ status: getOSSelectorStepStatus(form.fields), }, { - title: 'Server address', + title: 'Server address:', children: , status: getServerAddressStepStatus(form.fields), }, ...(needsPassword && !wazuhPassword ? [ { - title: 'Wazuh password', + title: 'Wazuh password:', children: ( , status: getOptionalParameterStepStatus( form.fields, @@ -184,8 +184,7 @@ export const Steps = ({ ), }, { - title: - 'Run the following commands to download and install the Wazuh agent:', + title: 'Run the following commands to download and install the agent:', children: ( <> {missingStepsName?.length ? ( @@ -221,7 +220,7 @@ export const Steps = ({ status: installCommandStepStatus, }, { - title: 'Start the Wazuh agent:', + title: 'Start the agent:', children: ( <> {missingStepsName?.length ? ( diff --git a/plugins/main/public/controllers/register-agent/utils/register-agent-data.tsx b/plugins/main/public/controllers/register-agent/utils/register-agent-data.tsx index 378bf61d33..39d39d19bf 100644 --- a/plugins/main/public/controllers/register-agent/utils/register-agent-data.tsx +++ b/plugins/main/public/controllers/register-agent/utils/register-agent-data.tsx @@ -34,7 +34,7 @@ export const SERVER_ADDRESS_TEXTS = [ { title: 'Server address', subtitle: - 'This is the address the agent uses to communicate with the Wazuh server. Enter an IP address or a fully qualified domain name (FDQN).', + 'This is the address the agent uses to communicate with the server. Enter an IP address or a fully qualified domain name (FDQN).', }, ]; @@ -42,6 +42,6 @@ export const OPTIONAL_PARAMETERS_TEXT = [ { title: 'Optional settings', subtitle: - 'The deployment sets the endpoint hostname as the agent name by default. Optionally, you can set your own name in the field below.', + 'By default, the deployment uses the hostname as the agent name. Optionally, you can use a different agent name in the field below.', }, ]; From 90d1a5379400752083c9aa2d3e17238b598d15db Mon Sep 17 00:00:00 2001 From: JuanGarriuz Date: Wed, 13 Dec 2023 13:46:05 +0100 Subject: [PATCH 2/4] Add changelod --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2a06e2cc..dbb1b0707e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ All notable changes to the Wazuh app project will be documented in this file. ### Added +- Added contextual information in the register agent commands [#6208](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6208) - Support for Wazuh 4.7.2 - Added host name and board serial information to Agents > Inventory data [#6191](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6191) From 559af4eac7fed97be02a533718c4d8f02ba3ffef Mon Sep 17 00:00:00 2001 From: JuanGarriuz Date: Wed, 13 Dec 2023 14:04:02 +0100 Subject: [PATCH 3/4] remove one of the alerts --- .../command-output/command-output.tsx | 2 -- .../register-agent/containers/steps/steps.tsx | 20 ++++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx b/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx index dfcf5da340..9a167f5ae5 100644 --- a/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx +++ b/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx @@ -10,7 +10,6 @@ import { import React, { Fragment, useEffect, useState } from 'react'; import { tOperatingSystem } from '../../core/config/os-commands-definitions'; import { osdfucatePasswordInCommand } from '../../services/wazuh-password-service'; -import OsCommandWarning from './os-warning'; interface ICommandSectionProps { commandText: string; @@ -84,7 +83,6 @@ export default function CommandOutput(props: ICommandSectionProps) { )} - {showCommand && havePassword ? ( ) : null} {!missingStepsName?.length && !invalidFieldsName?.length ? ( - setInstallCommandWasCopied(true)} - password={registerAgentFormValues.optionalParams.wazuhPassword} - /> + <> + setInstallCommandWasCopied(true)} + password={registerAgentFormValues.optionalParams.wazuhPassword} + /> + + ) : null} ), From b9d1df650f75102700c0b1ef60f62e2caba26b8c Mon Sep 17 00:00:00 2001 From: Federico Rodriguez Date: Wed, 13 Dec 2023 19:15:17 +0100 Subject: [PATCH 4/4] Fix overlay styles in codeblock --- .../public/controllers/agent/components/agents-preview.scss | 2 +- .../components/command-output/command-output.tsx | 1 + .../controllers/register-agent/containers/steps/steps.scss | 4 ---- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/plugins/main/public/controllers/agent/components/agents-preview.scss b/plugins/main/public/controllers/agent/components/agents-preview.scss index 04f94f4f6f..e420ca4e33 100644 --- a/plugins/main/public/controllers/agent/components/agents-preview.scss +++ b/plugins/main/public/controllers/agent/components/agents-preview.scss @@ -57,7 +57,7 @@ position: absolute; top: 0; width: 100%; - height: 90%; + height: 100%; display: flex; flex-direction: column; justify-content: center; diff --git a/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx b/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx index 9a167f5ae5..1a8f604ccf 100644 --- a/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx +++ b/plugins/main/public/controllers/register-agent/components/command-output/command-output.tsx @@ -63,6 +63,7 @@ export default function CommandOutput(props: ICommandSectionProps) { diff --git a/plugins/main/public/controllers/register-agent/containers/steps/steps.scss b/plugins/main/public/controllers/register-agent/containers/steps/steps.scss index 17bdbef44c..5ea8024f31 100644 --- a/plugins/main/public/controllers/register-agent/containers/steps/steps.scss +++ b/plugins/main/public/controllers/register-agent/containers/steps/steps.scss @@ -32,10 +32,6 @@ margin-top: 10px; } - .euiToolTipAnchor { - margin-left: 7px; - } - .subtitleAgentName { flex-direction: 'row'; font-style: 'normal';