Skip to content

Commit

Permalink
Change help menu items
Browse files Browse the repository at this point in the history
  • Loading branch information
Tostti committed Jan 24, 2024
1 parent 3908fd8 commit 9e4501c
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/core/public/chrome/chrome_service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export class ChromeService {
branding={injectedMetadata.getBranding()}
logos={logos}
survey={injectedMetadata.getSurvey()}
darkmode={uiSettings.get('theme:darkMode')}
/>
),

Expand Down
2 changes: 2 additions & 0 deletions src/core/public/chrome/ui/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface HeaderProps {
branding: ChromeBranding;
logos: Logos;
survey: string | undefined;
darkmode: boolean;
}

export function Header({
Expand Down Expand Up @@ -238,6 +239,7 @@ export function Header({
opensearchDashboardsDocLink={opensearchDashboardsDocLink}
opensearchDashboardsVersion={opensearchDashboardsVersion}
surveyLink={survey}
darkmode={observables.darkmode}
/>
</EuiHeaderSectionItem>
</EuiHeaderSection>
Expand Down
39 changes: 29 additions & 10 deletions src/core/public/chrome/ui/header/header_help_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ import { ExclusiveUnion } from '@elastic/eui';
import { combineLatest } from 'rxjs';
import { HeaderExtension } from './header_extension';
import { ChromeHelpExtension } from '../../chrome_service';
import { GITHUB_CREATE_ISSUE_LINK } from '../../constants';

/** @public */
export type ChromeHelpExtensionMenuGitHubLink = EuiButtonEmptyProps & {
Expand Down Expand Up @@ -123,6 +122,7 @@ interface Props {
useDefaultContent?: boolean;
opensearchDashboardsDocLink: string;
surveyLink?: string;
darkmode: boolean;
}

interface State {
Expand Down Expand Up @@ -200,35 +200,54 @@ class HeaderHelpMenuUI extends Component<Props, State> {
useDefaultContent,
opensearchDashboardsDocLink,
surveyLink,
darkmode,
} = this.props;
const { helpExtension, helpSupportUrl } = this.state;

const defaultContent = useDefaultContent ? (
<Fragment>
<EuiButtonEmpty href={opensearchDashboardsDocLink} target="_blank" size="xs" flush="left">
<EuiButtonEmpty
href="https://documentation.wazuh.com/4.8/"
target="_blank"
size="xs"
flush="left"
iconType={darkmode ? '/ui/logos/icon_dark.svg' : '/ui/logos/icon_light.svg'}
>
<FormattedMessage
id="core.ui.chrome.headerGlobalNav.helpMenuOpenSearchDashboardsDocumentationTitle"
defaultMessage="Wazuh documentation"
defaultMessage="Documentation"
/>
</EuiButtonEmpty>

<EuiSpacer size="xs" />

<EuiButtonEmpty href={helpSupportUrl} target="_blank" size="xs" flush="left">
<EuiButtonEmpty
href="https://wazuh.com/community/join-us-on-slack/"
target="_blank"
size="xs"
flush="left"
iconType="logoSlack"
>
<FormattedMessage
id="core.ui.chrome.headerGlobalNav.helpMenuAskOpenSearchTitle"
defaultMessage="Ask Wazuh"
defaultMessage="Slack Channel"
/>
</EuiButtonEmpty>

<EuiSpacer size="xs" />

{surveyLink && (
<div>
<EuiButtonEmpty href={surveyLink} target="_blank" size="xs" flush="left">
<EuiButtonEmpty
href="https://github.com/wazuh/"
target="_blank"
size="xs"
flush="left"
iconType="logoGithub"
>
<FormattedMessage
id="core.ui.chrome.headerGlobalNav.helpMenuFeedbackSurveyTitle"
defaultMessage="Give feedback"
defaultMessage="Projects on Github"
/>
</EuiButtonEmpty>
<EuiSpacer size="xs" />
Expand All @@ -238,15 +257,15 @@ class HeaderHelpMenuUI extends Component<Props, State> {
<EuiSpacer size="xs" />

<EuiButtonEmpty
href={GITHUB_CREATE_ISSUE_LINK}
href="https://groups.google.com/forum/#!forum/wazuh/"
target="_blank"
size="xs"
iconType="logoGithub"
iconType="/ui/logos/google_groups.svg"
flush="left"
>
<FormattedMessage
id="core.ui.chrome.headerGlobalNav.helpMenuOpenGitHubIssueTitle"
defaultMessage="Open an issue in GitHub"
defaultMessage="Google Group"
/>
</EuiButtonEmpty>
</Fragment>
Expand Down

0 comments on commit 9e4501c

Please sign in to comment.