Skip to content

Commit

Permalink
feat(*): Helpcenter GA - Migration to SNOW - batch 1 (#10974)
Browse files Browse the repository at this point in the history
ref: MANAGER-13069

Signed-off-by: David Arsène <david.arsene.ext@ovhcloud.com>
Co-authored-by: CDS Translator Agent <opensource@ovh.net>
Co-authored-by: Maxime Bajeux <maxime.bajeux.ext@corp.ovh.com>
  • Loading branch information
3 people committed May 23, 2024
1 parent d78cd4a commit f3eb9fc
Show file tree
Hide file tree
Showing 73 changed files with 245 additions and 384 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { Environment, Region } from '@ovh-ux/manager-config';

const helpRoot = 'https://help.ovhcloud.com/csm';
const homeIndex = '-home?id=csm_index';
const support = `${helpRoot}?id=csm_cases_requests`;

interface ContentURLS {
help: {
[key in string]: string;
};
support?: string;
status: string;
}

Expand All @@ -30,6 +32,7 @@ const urls: URLLinks = {
SN: `${helpRoot}/fr-sn${homeIndex}`,
TN: `${helpRoot}/fr-tn${homeIndex}`,
},
support,
status: 'https://www.status-ovhcloud.com/',
},
CA: {
Expand All @@ -42,6 +45,7 @@ const urls: URLLinks = {
WE: `${helpRoot}/en${homeIndex}`,
WS: `${helpRoot}/es${homeIndex}`,
},
support,
status: 'https://www.status-ovhcloud.com/',
},
US: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ import { Region } from '@ovh-ux/manager-config';

const helpRoot = 'https://help.ovhcloud.com/csm';
const homeIndex = '-home?id=csm_index';
const createTicketSupportIndex = '?id=csm_get_help';
const ticketsSupportIndex = '?id=csm_cases_requests';

interface UsefulLinks {
help: {
[key in string]: string;
};
support?: {
createTicket: string;
tickets: string;
};
tasks: string;
}
type UsefulLinkConstants = {
Expand All @@ -29,6 +35,10 @@ const consts: UsefulLinkConstants = {
SN: `${helpRoot}/fr-sn${homeIndex}`,
TN: `${helpRoot}/fr-tn${homeIndex}`,
},
support: {
createTicket: `${helpRoot}${createTicketSupportIndex}`,
tickets: `${helpRoot}${ticketsSupportIndex}`
},
tasks: 'https://www.status-ovhcloud.com/',
},
CA: {
Expand All @@ -41,6 +51,10 @@ const consts: UsefulLinkConstants = {
WE: `${helpRoot}/en${homeIndex}`,
WS: `${helpRoot}/es${homeIndex}`,
},
support: {
createTicket: `${helpRoot}${createTicketSupportIndex}`,
tickets: `${helpRoot}${ticketsSupportIndex}`
},
tasks: 'https://www.status-ovhcloud.com/',
},
US: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const useUsefulLinks = (): UseUsefulLinks => {
const user = environment.getUser();
const { isLivechatEnabled, setChatbotReduced } = useContainer();

const isEUOrCA = ['EU', 'CA'].includes(region);

const getUsefulLinks = (): UsefulLink[] => {
const trackingPrefix = 'hub::sidebar::useful-links';
return [
Expand All @@ -34,15 +36,15 @@ const useUsefulLinks = (): UseUsefulLinks => {
icon: getOdsIcon(ODS_ICON_NAME.LIFEBUOY_CONCEPT), },
...(isLivechatEnabled
? [
{
id: 'chatbot',
action: () => {
shell.getPlugin('ux').openLiveChat();
setChatbotReduced(false);
},
icon: getOdsIcon(ODS_ICON_NAME.SPEECH_BUBBLE_CONCEPT),
{
id: 'chatbot',
action: () => {
shell.getPlugin('ux').openLiveChat();
setChatbotReduced(false);
},
]
icon: getOdsIcon(ODS_ICON_NAME.SPEECH_BUBBLE_CONCEPT),
},
]
: []),
{
id: 'tasks',
Expand All @@ -53,15 +55,17 @@ const useUsefulLinks = (): UseUsefulLinks => {
},
{
id: 'tickets',
href: navigation.getURL('dedicated', '#/ticket'),
external: isEUOrCA,
href: isEUOrCA ? constants[region].support.tickets : navigation.getURL('dedicated', '#/ticket'),
tracking: `${trackingPrefix}::go-to-tickets`,
icon: getOdsIcon(ODS_ICON_NAME.ENVELOP_CONCEPT),
},
...(['EU', 'CA'].includes(region)
...(isEUOrCA
? [
{
id: 'createTicket',
href: navigation.getURL('dedicated', '#/support/tickets/new'),
external: true,
href: constants[region].support.createTicket,
tracking: `${trackingPrefix}::go-to-create-ticket`,
icon: getOdsIcon(ODS_ICON_NAME.USER_SUPPORT_CONCEPT),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function ServerSidebarVirtual({
} else {
item.isOpen = !item.isOpen;
}
if (item.href) {
if (item.href && !item.isExternal) {
window.location.href = item.href;
}
onMenuChange();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import dedicatedShopConfig from '../order/shop-config/dedicated';
import OrderTrigger from '../order/OrderTrigger';
import { ShopItem } from '../order/OrderPopupContent';
import { features } from './DedicatedSidebar';
import constants from '../../account-sidebar/UsefulLinks/constants';

export default function AccountSidebar() {
const [menu, setMenu] = useState<SidebarMenuItem>(undefined);
Expand All @@ -31,6 +32,8 @@ export default function AccountSidebar() {

const menu = [];

const isEUOrCA = ['EU', 'CA'].includes(region);

menu.push({
id: 'back-to-home',
label: t('sidebar_back_home'),
Expand All @@ -52,7 +55,7 @@ export default function AccountSidebar() {
);
if (featureAvailability['identity-documents']) {
const { status } = await reketInstance.get(`/me/procedure/identity`);
if (['required','open'].includes(status)) {
if (['required', 'open'].includes(status)) {
menu.push({
id: 'my-identity-documents',
label: t('sidebar_account_identity_documents'),
Expand Down Expand Up @@ -101,7 +104,7 @@ export default function AccountSidebar() {
});
}

if (['EU', 'CA'].includes(region)) {
if (isEUOrCA) {
menu.push({
id: 'my-contacts',
label: t('sidebar_account_contacts'),
Expand All @@ -122,10 +125,9 @@ export default function AccountSidebar() {
menu.push({
id: 'my-support-tickets',
label: t('sidebar_assistance_tickets'),
href: navigation.getURL(
'dedicated',
region === 'US' ? '/ticket' : '/support',
),
isExternal: isEUOrCA,

href: isEUOrCA ? constants[region].support.tickets : navigation.getURL('dedicated', '/ticket'),
routeMatcher: new RegExp('^/(ticket|support)'),
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const AssistanceSidebar: React.FC<ComponentProps<Props>> = ({
const reketInstance = useReket();
const [selectedItem, setSelectedItem] = useState<string>(null);

const hasAdvancedSupport = ['EU', 'CA'].includes(environment.getRegion());
const isEUOrCA = ['EU', 'CA'].includes(environment.getRegion());
const [hasLiveChat, setHashLiveChat] = useState(false);

const { closeNavigationSidebar, openOnboarding } = useProductNavReshuffle();
Expand All @@ -60,10 +60,7 @@ const AssistanceSidebar: React.FC<ComponentProps<Props>> = ({
appHash.startsWith('/useraccount/support/level')
) {
setSelectedItem('support_level');
} else if (
appId === 'dedicated' &&
(appHash.startsWith('/ticket') || appHash.startsWith('/support/tickets'))
) {
} else if (appId === 'dedicated' && appHash.startsWith('/ticket')) {
setSelectedItem('tickets');
}
}, [containerURL]);
Expand Down Expand Up @@ -104,22 +101,23 @@ const AssistanceSidebar: React.FC<ComponentProps<Props>> = ({
/>
</li>
<li
className={`${
selectedItem === 'tickets' ? style.sidebar_selected : ''
}`}
className={`${selectedItem === 'tickets' ? style.sidebar_selected : ''
}`}
>
<SidebarLink
node={{
count: false,
translation: 'sidebar_assistance_tickets',
routing: {
routing: !isEUOrCA ? {
application: 'dedicated',
hash: '#/ticket',
},
count: false,
} : null,
isExternal: isEUOrCA,
url: isEUOrCA ? urls.get('support') : null,
}}
onClick={() => {
trackNode('assistance_tickets');
closeNavigationSidebar();
!isEUOrCA && closeNavigationSidebar();
}}
/>
</li>
Expand All @@ -134,11 +132,10 @@ const AssistanceSidebar: React.FC<ComponentProps<Props>> = ({
onClick={() => trackNode('assistance_status')}
/>
</li>
{hasAdvancedSupport && (
{isEUOrCA && (
<li
className={`${
selectedItem === 'support_level' ? style.sidebar_selected : ''
}`}
className={`${selectedItem === 'support_level' ? style.sidebar_selected : ''
}`}
>
<SidebarLink
node={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,6 @@ export const FEATURES = {

export const IN_SUBSIDIARY = 'IN';
export const USER_TYPE_ENTERPRISE = 'corporation';
export const NEW_SUPPORT_TICKET_PARAMS = {
categoryName: 'account',
preFetchData: true,
};

export default {
ENUM_TRANSLATION_RULES,
Expand All @@ -412,5 +408,4 @@ export default {
FEATURES,
IN_SUBSIDIARY,
USER_TYPE_ENTERPRISE,
NEW_SUPPORT_TICKET_PARAMS,
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
<span
data-translate="signup_information_banner_link_for_indian_subsidiary"
></span>
<span
class="oui-icon oui-icon-external-link"
aria-hidden="true"
></span>
</a>
</oui-message>
<oui-message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ import {
FEATURES,
IN_SUBSIDIARY,
USER_TYPE_ENTERPRISE,
NEW_SUPPORT_TICKET_PARAMS,
SUBSIDIARIES_VAT_FIELD_OVERRIDE,
} from './new-account-form-component.constants';
import { KYC_STATUS } from '../../../identity-documents/user-identity-documents.constant';
import { SUPPORT_URLS } from '../../user.constants';

export default class NewAccountFormController {
/* @ngInject */
Expand All @@ -36,7 +36,6 @@ export default class NewAccountFormController {
$anchorScroll,
$scope,
ovhFeatureFlipping,
coreURLBuilder,
) {
this.$q = $q;
this.$http = $http;
Expand All @@ -59,7 +58,6 @@ export default class NewAccountFormController {
this.$scope = $scope;
this.ovhFeatureFlipping = ovhFeatureFlipping;
this.SECTIONS = SECTIONS;
this.coreURLBuilder = coreURLBuilder;
}

$onInit() {
Expand All @@ -68,14 +66,7 @@ export default class NewAccountFormController {
// Indian subsidiary flag
this.isIndianSubsidiary = this.user.ovhSubsidiary === IN_SUBSIDIARY;
this.determineIsEditionDisabledByKyc(this.kycStatus);
this.newSupportTicketUrl = this.coreURLBuilder.buildURL(
'dedicated',
'#/support/tickets/new',
{
categoryName: NEW_SUPPORT_TICKET_PARAMS.categoryName,
preFetchData: NEW_SUPPORT_TICKET_PARAMS.preFetchData,
},
);
this.newSupportTicketUrl = SUPPORT_URLS.createTicket;

// backup of original model
this.originalModel = angular.copy(this.model);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { SUPPORT_URLS } from '../user.constants';

export default /* @ngInject */ function UserAccountEmailsController(
$q,
$location,
$scope,
$translate,
AccountUserEmailsService,
Alerter,
coreURLBuilder,
shellClient,
) {
const self = this;

Expand All @@ -28,11 +28,7 @@ export default /* @ngInject */ function UserAccountEmailsController(

$scope.getEmailIds();

shellClient.navigation
.getURL('dedicated', '#/support')
.then((supportUrl) => {
$scope.SUPPORT_URL = supportUrl;
});
$scope.SUPPORT_URL = SUPPORT_URLS.viewTickets;
};

$scope.getEmailIds = (refresh) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ export const ACCOUNT_INFORMATIONS = {
IN: 'https://docs.ovh.com/asia/en/customer/',
};

export const SUPPORT_URLS = {
createTicket: 'https://help.ovhcloud.com/csm?id=csm_get_help',
viewTickets: 'https://help.ovhcloud.com/csm?id=csm_cases_requests',
};

export const GUIDES_LIST = {
account_informations: {
url: ACCOUNT_INFORMATIONS,
Expand All @@ -33,4 +38,6 @@ export const GUIDES_LIST = {

export default {
GUIDES_LIST,
SUPPORT_URLS,
ACCOUNT_INFORMATIONS,
};
7 changes: 2 additions & 5 deletions packages/manager/apps/dedicated/client/app/otrs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ angular.module(moduleName, ['oc.lazyLoad', 'ui.router']).config(
} else {
$urlRouterProvider.rule(($injector, $location) => {
const path = $location.path();
if (path === '/ticket') {
return '/support';
}
if (/^\/ticket\//.test(path)) {
return path.replace(/^\/ticket\//, '/support/tickets/');
if (path.includes('/ticket') || path.includes('/support')) {
return '/configuration';
}
return undefined;
});
Expand Down
6 changes: 6 additions & 0 deletions packages/manager/apps/telecom/src/app/app.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ export const SYSTRAN_LOCALE_UNAVAILABLE = 'fr';
export const URL_SURVEY_SYSTRAN =
'https://survey.ovh.com/index.php/175287?lang=';

export const SUPPORT_URLS = {
createTicket: 'https://help.ovhcloud.com/csm?id=csm_get_help',
viewTickets: 'https://help.ovhcloud.com/csm?id=csm_cases_requests',
};

export default {
SYSTRAN_LOCALE_UNAVAILABLE,
URL_SURVEY_SYSTRAN,
SUPPORT_URLS,
};
Loading

0 comments on commit f3eb9fc

Please sign in to comment.