Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"pci_rancher_header": "Anleitungen",
"pci_rancher_header_all_guides": "Alle Anleitungen",
"pci_rancher_header_first_steps_with_instances": "Erste Schritte mit den Instanzen",
"pci_rancher_header_create_managed_rancher": "Managed Rancher Cluster erstellen",
"pci_rancher_header_update_managed_rancher": "Managed Rancher Cluster aktualisieren",
"pci_rancher_header_iam_rancher": "Identitäts- und Zugriffsverwaltung (IAM)",
"pci_rancher_header_authentification_iam": "IAM-Authentifizierung aktivieren (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"pci_rancher_header": "Guides",
"pci_rancher_header_all_guides": "All guides",
"pci_rancher_header_create_managed_rancher": "Create a Managed Rancher cluster",
"guides_pci_rancher_header_first_steps_with_instances": "Getting started with instances",
"pci_rancher_header_update_managed_rancher": "Update a Managed Rancher cluster",
"pci_rancher_header_iam_rancher": "Identity and Access Management (IAM)",
"pci_rancher_header_authentification_iam": "Enable IAM authentication (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"pci_rancher_header": "Guías",
"pci_rancher_header_all_guides": "Todas las guías",
"pci_rancher_header_first_steps_with_instances": "Primeros pasos con instancias",
"pci_rancher_header_create_managed_rancher": "Crear un cluster Managed Rancher",
"pci_rancher_header_update_managed_rancher": "Actualizar un cluster Managed Rancher",
"pci_rancher_header_iam_rancher": "Gestión de identidades y accesos (IAM)",
"pci_rancher_header_authentification_iam": "Activar autenticación IAM (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pci_rancher_header": "Guides",
"pci_rancher_header_all_guides": "Tous les guides",
"pci_rancher_header_first_steps_with_instances": "Premiers pas avec les instances",
"pci_rancher_header_authentification_iam": "Activer authentification IAM (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pci_rancher_header": "Guides",
"pci_rancher_header_all_guides": "Tous les guides",
"pci_rancher_header_first_steps_with_instances": "Premiers pas avec les instances",
"pci_rancher_header_authentification_iam": "Activer l'authentification IAM (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"pci_rancher_header": "Guide",
"pci_rancher_header_all_guides": "Tutte le guide",
"pci_rancher_header_first_steps_with_instances": "Iniziare a utilizzare le istanze",
"pci_rancher_header_create_managed_rancher": "Creare un cluster Managed Rancher",
"pci_rancher_header_update_managed_rancher": "Aggiornare un cluster Managed Rancher",
"pci_rancher_header_iam_rancher": "Gestione delle identità e degli accessi (IAM)",
"pci_rancher_header_authentification_iam": "Attivare l'autenticazione IAM (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"pci_rancher_header": "Przewodniki",
"pci_rancher_header_all_guides": "Wszystkie przewodniki",
"pci_rancher_header_create_managed_rancher": "Utwórz klaster Managed Rancher",
"guides_pci_rancher_header_first_steps_with_instances": "Pierwsze kroki z instancjami",
"pci_rancher_header_update_managed_rancher": "Zaktualizuj klaster Managed Rancher",
"pci_rancher_header_iam_rancher": "Zarządzanie tożsamością i dostępem (IAM)",
"pci_rancher_header_authentification_iam": "Aktywuj uwierzytelnianie IAM (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"pci_rancher_header": "Guias",
"pci_rancher_header_all_guides": "Todos os guias",
"pci_rancher_header_create_managed_rancher": "Criar um cluster Managed Rancher",
"pci_rancher_header_first_steps_with_instances": "Primeiros passos com as instâncias",
"pci_rancher_header_update_managed_rancher": "Atualizar um cluster Managed Rancher",
"pci_rancher_header_iam_rancher": "Gestão de identidades e acessos (IAM)",
"pci_rancher_header_authentification_iam": "Ativar autenticação IAM (EN)"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React from 'react';
import {
OsdsIcon,
OsdsButton,
OsdsMenuItem,
} from '@ovhcloud/ods-components/react';
import {
ODS_BUTTON_SIZE,
ODS_BUTTON_VARIANT,
ODS_ICON_NAME,
ODS_ICON_SIZE,
} from '@ovhcloud/ods-components';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core';
import { Guide } from './types';

interface GuidesHeaderItemProps {
guide: Guide;
href: string;
label: string;
tracking?: string;
onClick?: (guide: Guide) => void;
}

export function GuidesHeaderItem({
guide,
href,
label,
onClick,
}: GuidesHeaderItemProps) {
return (
<OsdsMenuItem>
<OsdsButton
size={ODS_BUTTON_SIZE.sm}
color={ODS_THEME_COLOR_INTENT.primary}
href={href}
variant={ODS_BUTTON_VARIANT.ghost}
target={OdsHTMLAnchorElementTarget._blank}
onClick={() => {
if (onClick) {
onClick(guide);
}
}}
>
<span slot="start">
{label}
<OsdsIcon
className="ml-4"
size={ODS_ICON_SIZE.xs}
name={ODS_ICON_NAME.EXTERNAL_LINK}
color={ODS_THEME_COLOR_INTENT.primary}
/>
</span>
</OsdsButton>
</OsdsMenuItem>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from 'react';
import {
OsdsButton,
OsdsIcon,
OsdsMenu,
OsdsMenuGroup,
OsdsPopover,
OsdsPopoverContent,
} from '@ovhcloud/ods-components/react';
import {
ODS_BUTTON_SIZE,
ODS_BUTTON_VARIANT,
ODS_ICON_NAME,
ODS_ICON_SIZE,
} from '@ovhcloud/ods-components';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';

import { GuidesHeaderItem } from './guides-header-item.component';
import { Guide } from './types';
import { Subsidiary } from '@ovh-ux/manager-config';

export interface GuidesHeaderProps {
label: string;
guides: Record<string, Guide>;
ovhSubsidiary: Subsidiary;
getGuideLabel: (guide: Guide) => string;
onGuideClick?: (guide: Guide) => void;
}

export function GuidesHeader({
label,
guides,
ovhSubsidiary,
getGuideLabel,
onGuideClick,
}: GuidesHeaderProps) {
return (
<OsdsMenu>
<OsdsButton
size={ODS_BUTTON_SIZE.sm}
slot={'menu-title'}
variant={ODS_BUTTON_VARIANT.ghost}
color={ODS_THEME_COLOR_INTENT.primary}
>
<span slot="start">
<OsdsIcon
color={ODS_THEME_COLOR_INTENT.primary}
size={ODS_ICON_SIZE.xs}
name={ODS_ICON_NAME.BOOK}
/>
</span>
{label}
</OsdsButton>

<div>
{Object.entries(guides).map(([key, guide]) => (
<GuidesHeaderItem
key={key}
guide={guide}
href={guide.url[ovhSubsidiary] ?? guide.url.DEFAULT}
label={getGuideLabel(guide)}
onClick={(g: Guide) => {
onGuideClick?.(g);
}}
/>
))}
</div>
</OsdsMenu>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './pci-guides-header.component';
export * from './types';
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { useTranslation } from 'react-i18next';
import { GuidesHeader } from './guides-header.component';
import { DEFAULT_GUIDES, GUIDES_LIST } from './pci-guides-header.constants';
import { Guide } from './types';
import { ShellContext } from '@ovh-ux/manager-react-shell-client';
import React, { useContext } from 'react';

interface PciGuidesHeaderProps {
category?: string;
}

export function PciGuidesHeader({ category }: PciGuidesHeaderProps) {
const context = useContext(ShellContext);
const { ovhSubsidiary } = context.environment.getUser();
const { t } = useTranslation('guide');
return (
<GuidesHeader
label={t('pci_rancher_header')}
guides={{ ...DEFAULT_GUIDES, ...GUIDES_LIST[category ?? 'rancher'] }}
ovhSubsidiary={ovhSubsidiary}
getGuideLabel={(guide: Guide) => t(`pci_rancher_header_${guide.key}`)}
/>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import { Guide, GuideLinksDefault } from './types';

export const PUBLIC_CLOUD_GUIDES: GuideLinksDefault = {
FR: 'https://docs.ovh.com/fr/public-cloud/',
GB: 'https://docs.ovh.com/gb/en/public-cloud/',
DE: 'https://docs.ovh.com/de/public-cloud/',
ES: 'https://docs.ovh.com/es/public-cloud/',
IT: 'https://docs.ovh.com/it/public-cloud/',
PL: 'https://docs.ovh.com/pl/public-cloud/',
PT: 'https://docs.ovh.com/pt/public-cloud/',
IE: 'https://docs.ovh.com/ie/en/public-cloud/',
DEFAULT: 'https://docs.ovh.com/gb/en/public-cloud/',
US:
'https://support.us.ovhcloud.com/hc/en-us/categories/115000515130-Public-Cloud-Services',
ASIA: 'https://docs.ovh.com/asia/en/public-cloud/',
AU: 'https://docs.ovh.com/au/en/public-cloud/',
CA: 'https://docs.ovh.com/ca/en/public-cloud/',
QC: 'https://docs.ovh.com/ca/fr/public-cloud/',
SG: 'https://docs.ovh.com/sg/en/public-cloud/',
WE: 'https://docs.ovh.com/us/en/public-cloud/',
WS: 'https://docs.ovh.com/us/es/public-cloud/',
MA: 'https://docs.ovh.com/fr/public-cloud/',
TN: 'https://docs.ovh.com/fr/public-cloud/',
SN: 'https://docs.ovh.com/fr/public-cloud/',
IN: 'https://docs.ovh.com/asia/en/public-cloud/',
};

export const FIRST_STEPS_WITH_INSTANCES: GuideLinksDefault = {
FR:
'https://docs.ovh.com/fr/public-cloud/premiers-pas-instance-public-cloud/',
GB: 'https://docs.ovh.com/gb/en/public-cloud/public-cloud-first-steps/',
DE: 'https://docs.ovh.com/de/public-cloud/public-cloud-erste-schritte/',
ES: 'https://docs.ovh.com/es/public-cloud/public-cloud-primeros-pasos/',
IT: 'https://docs.ovh.com/it/public-cloud/primi-passi-public-cloud/',
PL: 'https://docs.ovh.com/pl/public-cloud/public-cloud-pierwsze-kroki/',
PT: 'https://docs.ovh.com/pt/public-cloud/public-cloud-primeiros-passos/',
IE: 'https://docs.ovh.com/ie/en/public-cloud/public-cloud-first-steps/',
DEFAULT: 'https://docs.ovh.com/gb/en/public-cloud/public-cloud-first-steps/',
US:
'https://support.us.ovhcloud.com/hc/en-us/articles/4481009956243-How-to-Manage-Your-Public-Cloud-Instance',
ASIA: 'https://docs.ovh.com/asia/en/public-cloud/public-cloud-first-steps/',
AU: 'https://docs.ovh.com/au/en/public-cloud/public-cloud-first-steps/',
CA: 'https://docs.ovh.com/ca/en/public-cloud/public-cloud-first-steps/',
QC:
'https://docs.ovh.com/ca/fr/public-cloud/premiers-pas-instance-public-cloud/',
SG: 'https://docs.ovh.com/sg/en/public-cloud/public-cloud-first-steps/',
WE: 'https://docs.ovh.com/us/en/public-cloud/public-cloud-first-steps/',
WS: 'https://docs.ovh.com/us/es/public-cloud/public-cloud-primeros-pasos/',
IN: 'https://docs.ovh.com/asia/en/public-cloud/public-cloud-first-steps/',
};

export const IAM_AUTHENTICATION: GuideLinksDefault = {
DEFAULT:
'https://help.ovhcloud.com/csm/en-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073391',
ASIA:
'https://help.ovhcloud.com/csm/asia-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073398',
AU:
'https://help.ovhcloud.com/csm/en-au-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073388',
CA:
'https://help.ovhcloud.com/csm/en-ca-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073384',
DE:
'https://help.ovhcloud.com/csm/de-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073385',
ES:
'https://help.ovhcloud.com/csm/es-es-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073392',
FR:
'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073387',
GB:
'https://help.ovhcloud.com/csm/en-gb-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073389',
IE:
'https://help.ovhcloud.com/csm/en-ie-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073390',
IN:
'https://help.ovhcloud.com/csm/en-in-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073383',
IT:
'https://help.ovhcloud.com/csm/it-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073386',
MA:
'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073387',
NL:
'https://help.ovhcloud.com/csm/en-ie-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073390',
PL:
'https://help.ovhcloud.com/csm/pl-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073396',
PT:
'https://help.ovhcloud.com/csm/pt-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073394',
QC:
'https://help.ovhcloud.com/csm/fr-ca-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073397',
SG:
'https://help.ovhcloud.com/csm/en-sg-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073395',
SN:
'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073387',
TN:
'https://help.ovhcloud.com/csm/fr-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073387',
WE:
'https://help.ovhcloud.com/csm/en-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073391',
WS:
'https://help.ovhcloud.com/csm/es-public-cloud-managed-rancher-service-iam-authentication?id=kb_article_view&sysparm_article=KB0073393',
};

export const PREFIX_UNIVERSE_NAME = 'public-cloud';

export const DEFAULT_GUIDES: Record<string, Guide> = {
public_cloud_guides: {
url: PUBLIC_CLOUD_GUIDES,
key: 'all_guides',
tracking: '::guides::go_to_all_guides',
},
first_steps_with_instances: {
url: FIRST_STEPS_WITH_INSTANCES,
key: 'first_steps_with_instances',
tracking: '::guides::go_to_instances_guide',
},
};

export const GUIDES_LIST: Record<string, Record<string, Guide>> = {
rancher: {
iam_authentification: {
url: IAM_AUTHENTICATION,
key: 'authentification_iam',
tracking: '::guides::go_to_iam_authentication',
},
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Subsidiary } from '@ovh-ux/manager-config';

export type Guide = {
key: string;
url: GuideLinksDefault;
tracking?: string;
};

export type GuideLinks = Partial<Record<Subsidiary, string>>;
export type GuideLinksDefault = GuideLinks & Record<'DEFAULT', string>;
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
CHANGELOG_LINKS,
CHANGELOG_CHAPTERS,
} from '@/utils/changelog.constants';
import { PciGuidesHeader } from '@/components/guides-header';

export type DashboardTabItemProps = {
name: string;
Expand Down Expand Up @@ -123,6 +124,7 @@ const Dashboard: React.FC<DashboardLayoutProps> = ({ tabs, rancher }) => {
links={CHANGELOG_LINKS}
chapters={CHANGELOG_CHAPTERS}
/>
<PciGuidesHeader />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
CHANGELOG_CHAPTERS,
CHANGELOG_LINKS,
} from '@/utils/changelog.constants';
import { PciGuidesHeader } from '@/components/guides-header';

export interface ListingProps {
data: RancherService[];
Expand Down Expand Up @@ -57,6 +58,7 @@ const ListingTablePage: React.FC<ListingProps> = ({
links={CHANGELOG_LINKS}
chapters={CHANGELOG_CHAPTERS}
/>
<PciGuidesHeader />
</div>
</div>
<div className="my-3 mt-5">
Expand Down
Loading