Skip to content

Commit

Permalink
Merge pull request #12761 from ovh/release/gcj-w34
Browse files Browse the repository at this point in the history
New release - GCJ W34
  • Loading branch information
JacquesLarique authored Aug 19, 2024
2 parents edb696b + be1198e commit f5df62c
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 126 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React, { useState } from 'react';
import { useMediaQuery } from 'react-responsive';
import { useTranslation } from 'react-i18next';

Expand All @@ -13,7 +12,6 @@ import {
} from '@ovhcloud/ods-components/react';
import { ODS_RADIO_BUTTON_SIZE, ODS_TEXT_SIZE } from '@ovhcloud/ods-components';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';
import NavReshuffleSwitchBackModal from '@/container/common/nav-reshuffle-switch-back/Modal';
import useOnboarding from '@/core/onboarding';

function NavReshuffleSwitchBack(): JSX.Element {
Expand All @@ -24,7 +22,6 @@ function NavReshuffleSwitchBack(): JSX.Element {
const isSmallDevice = useMediaQuery({
query: `(max-width: ${SMALL_DEVICE_MAX_SIZE})`,
});
const [confirm, setConfirm] = useState<boolean>(false);
const onboarding = useOnboarding();

if (!betaVersion || isSmallDevice) {
Expand All @@ -42,24 +39,13 @@ function NavReshuffleSwitchBack(): JSX.Element {
if (value === 'beta') onboarding.forceOnboardingDisplayed(true);
};

const switchBack = (openSurvey = false) => {
if (openSurvey) {
window.open(
'https://survey.ovh.com/index.php/813778',
'_blank',
'noopener',
);
}
toggleVersion('classic');
};

return (
<>
<OsdsRadioGroup name="version" className="d-flex">
<OsdsRadio
name="version"
value="classic"
onOdsCheckedChange={() => setConfirm(true)}
onOdsCheckedChange={() => toggleVersion('classic')}
checked={!useBeta}
className="mr-1"
>
Expand Down Expand Up @@ -99,16 +85,6 @@ function NavReshuffleSwitchBack(): JSX.Element {
</OsdsRadioButton>
</OsdsRadio>
</OsdsRadioGroup>
{confirm && (
<NavReshuffleSwitchBackModal
onCancel={() => {
setConfirm(false);
}}
onConfirm={(openSurvey = false) => {
switchBack(openSurvey);
}}
/>
)}
</>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,19 +151,14 @@ export default function DedicatedSidebar() {
});
}

if (feature['dedicated-networks']) {
if (feature['dedicated-networks'] && feature['dedicated-cdn']) {
menu.push({
id: 'dedicated-nasha-cdn',
label: t('sidebar_nasha_cdn'),
id: 'dedicated-cdn',
label: t('sidebar_cdn'),
icon: getIcon('ovh-font ovh-font-network'),
routeMatcher: new RegExp(
'^(/configuration/cdn|/(paas/)?nasha)',
),
routeMatcher: new RegExp('^(/configuration/cdn)'),
async loader() {
const [cdn, nasha] = await Promise.all([
feature['dedicated-cdn'] ? loadServices('/cdn/dedicated') : [],
feature['dedicated-nasha'] ? loadServices('/dedicated/nasha') : [],
]);
const cdn = await loadServices('/cdn/dedicated');
return [
...cdn.map((cdnItem) => ({
...cdnItem,
Expand All @@ -178,15 +173,6 @@ export default function DedicatedSidebar() {
);
},
})),
...nasha.map((nashaItem) => ({
...nashaItem,
keywords: 'nasha nas-ha',
icon: getIcon('ovh-font ovh-font-cloudnas'),
href: navigation.getURL(
'dedicated',
`/nasha/${nashaItem.serviceName}`,
),
})),
];
},
});
Expand Down Expand Up @@ -339,14 +325,14 @@ export default function DedicatedSidebar() {
});
}

if (feature.netapp) {
if (feature.netapp || feature['dedicated-nasha']) {
menu.push({
id: 'dedicated-storage',
label: t('sidebar_storage_backup'),
icon: getIcon('ovh-font ovh-font-cloudnas'),
routeMatcher: new RegExp('^/netapp'),
routeMatcher: new RegExp('^(/netapp|/(paas/)?nasha)'),
subItems: [
{
feature.netapp && {
id: 'dedicated-storage-netapp',
label: t('sidebar_netapp'),
icon: getIcon('oui-icon oui-icon-enterprise-file-storage_concept'),
Expand All @@ -356,6 +342,24 @@ export default function DedicatedSidebar() {
return loadServices('/storage/netapp');
},
},
feature['dedicated-nasha'] && {
id: 'dedicated-nas-ha',
label: t('sidebar_nasha'),
icon: getIcon('ovh-font ovh-font-cloudnas'),
href: navigation.getURL('dedicated', '#/nasha'),
routeMatcher: new RegExp('^/(paas/)?nasha'),
async loader() {
const nasha = await loadServices('/dedicated/nasha');
return nasha.map((nashaItem) => ({
...nashaItem,
keywords: 'nasha nas-ha',
href: navigation.getURL(
'dedicated',
`/nasha/${nashaItem.serviceName}`,
),
}));
}
}
],
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import { useEffect } from 'react';
import { useShell } from '@/context';

const EloquantSurvey = () => {
const shell = useShell();
const environment = shell.getPlugin('environment').getEnvironment();
const user = environment.getUser();
const region = environment.getRegion();
const languages = [
{
code: 'fr_FR',
short: 'fr',
long: 'french',
},
{
code: 'en_GB',
short: 'en',
long: 'english',
},
{
code: 'fr_CA',
short: 'fr',
long: 'french',
},
{
code: 'pl_PL',
short: 'pl',
long: 'polsky',
},
{
code: 'de_DE',
short: 'de',
long: 'DE',
},
{
code: 'es_ES',
short: 'es',
long: 'spanish',
},
{
code: 'it_IT',
short: 'it',
long: 'italian',
},
{
code: 'pt_PT',
short: 'pt',
long: 'portugues',
},
];

const regions = {
EU: 'Europe',
CA: 'Asie',
US: 'USA'
};
const regionTerm = regions[region as 'EU'|'CA'|'US'];

useEffect(() => {
const { short, long } = languages.filter(
(lang) => lang.code === user.language,
)[0];

window.surveyLanguage = short;

const doc = window.document || document;
const script = doc.createElement('script');
const url = /MSIE \d|Trident.*rv:/.test(navigator.userAgent)
? 'https://cache.eloquant.cloud/ovh/itw/webtrigger-test-ie11.js?s=LpSH433M4z'
: 'https://cache.eloquant.cloud/ovh/itw/webtrigger-test.js?s=LpSH433M4z';

script.setAttribute('type', 'text/javascript');
script.defer = true;
script.src = url;

script.onload = function() {
const elq = window.elqwebtrigger;
// This condition is used to choose the correct publication according the language, and especially to display the popin's title in the correct language
// The condition is defined in the first publication's step => Capture3
elq.set('condition.language', function() {
return long;
});

// Data surveys : in this example there is an Eloquant text data defined in the project, called region => Capture4
// Do not forget to choose it during the publication's step "Parameters" => Capture1
// If the website exposes a javascript variable which may be used to fill this data, the following line of code is not necessary.
// Only fill the checkbox "variable javascript" and enter the name of the website variable.
elq.set('urlparameter.region', function() {
return regionTerm;
});
};
doc.body.appendChild(script);

return () => {
doc.body.removeChild(script);
};
}, []);

return <></>;
};

export default EloquantSurvey;
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import NavReshuffleFeedbackWidget from './feedback';
import Header from './header';
import Sidebar from './sidebar';
import NavReshuffleOnboardingWidget from './onboarding';
import EloquantSurvey from './eloquant-survey';

import style from './template.module.scss';
import Progress from '../common/Progress';
Expand Down Expand Up @@ -111,6 +112,9 @@ function NavReshuffleContainer(): JSX.Element {
{!productNavReshuffle.isLoading && <NavReshuffleOnboardingWidget />}
<NavReshuffleFeedbackWidget />
</Suspense>
<Suspense fallback="">
<EloquantSurvey />
</Suspense>
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,5 @@
"beta_modal_new": "Version beta",
"beta_modal_beta": "Beta",
"beta_modal_old": "Version classique",
"beta_modal_switch_title": "Vous voulez retourner à la version précédente du manager",
"beta_modal_switch_infos": "Pour être toujours au plus près de vos attentes, votre avis est important pour nous. Aidez-nous à nous améliorer!",
"beta_modal_switch_accept": "Je donne mon avis",
"beta_switch": "Basculer de version",
"beta_modal_switch_later": "Plus tard"
"beta_switch": "Basculer de version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"sidebar_cloud_connect": "OVHcloud Connect",
"sidebar_iplb": "Loadbalancer",
"sidebar_ip": "Öffentliche IP-Adressen",
"sidebar_cdn": "CDN Infrastruktur",
"sidebar_cdn": "Content Delivery Network",
"sidebar_domain_dns": "Domains &amp; DNS",
"sidebar_domain": "Domainnamen",
"sidebar_dns": "DNS-Zone",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"sidebar_cloud_connect": "OVHcloud Connect",
"sidebar_iplb": "Load Balancer",
"sidebar_ip": "Public IP Addresses",
"sidebar_cdn": "CDN Infrastructure",
"sidebar_cdn": "Content Delivery Network",
"sidebar_domain_dns": "Domains &amp; DNS",
"sidebar_domain": "Domain names",
"sidebar_dns": "DNS zones",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"sidebar_cloud_connect": "OVHcloud Connect",
"sidebar_iplb": "Load Balancer",
"sidebar_ip": "Direcciones IP públicas",
"sidebar_cdn": "Infraestructura CDN",
"sidebar_cdn": "Content Delivery Network",
"sidebar_domain_dns": "Dominios y DNS",
"sidebar_domain": "Dominios",
"sidebar_dns": "Zonas DNS",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
"sidebar_pci_load_error": "Une erreur est survenue lors de la récupération de la liste de projets",
"sidebar_storage": "Services de stockage",
"sidebar_nasha": "NAS-HA",
"sidebar_nasha_cdn": "NAS-HA et CDN",
"sidebar_netapp": "Enterprise File Storage",
"sidebar_cda": "Cloud Disk Array",
"sidebar_veeamcc": "Veeam Cloud Connect",
Expand All @@ -109,7 +108,7 @@
"sidebar_all_vrack_services": "Tous les services",
"sidebar_iplb": "Load Balancer",
"sidebar_ip": "Adresses IP Publiques",
"sidebar_cdn": "CDN Infrastructure",
"sidebar_cdn": "Content Delivery Network",
"sidebar_domain_dns": "Domaines & DNS",
"sidebar_domain_operations": "Opérations en cours",
"sidebar_domain": "Noms de domaine",
Expand Down
Loading

0 comments on commit f5df62c

Please sign in to comment.