Skip to content

Commit 326b22c

Browse files
jloizelovhSBrendan
andcommitted
feat(web-domains): init new domain page
ref: #MANAGER-18842 Signed-off-by: Justine Loizel <[email protected]> Co-authored-by: Brendan Seiller <[email protected]>
1 parent 3f0da84 commit 326b22c

File tree

33 files changed

+1079
-8
lines changed

33 files changed

+1079
-8
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"title": "Noms de domaine",
3+
"domain_table_header_serviceName": "Nom de domaine",
4+
"domain_tab_name_general_information": "Informations générales",
5+
"domain_tab_name_dns_zone": "Zone DNS",
6+
"domain_tab_name_dns_server": "Serveurs DNS",
7+
"domain_tab_name_redirection": "Redirection",
8+
"domain_tab_name_dynhost": "DynHost",
9+
"domain_tab_name_host": "Hosts",
10+
"domain_tab_name_ds_records": "DS Records",
11+
"domain_tab_name_contact_management": "Gestion des contacts",
12+
"domain_back_to_service_list": "Retour à la liste de services",
13+
"domain_guide_button_label": "Guide d'utilisation"
14+
}

packages/manager/apps/web-domains/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
createHashRouter,
88
createRoutesFromElements,
99
} from 'react-router-dom';
10-
import Routes from '@/alldoms/routes/routes';
10+
import routes from '@/routes';
1111

1212
const queryClient = new QueryClient({
1313
defaultOptions: {
@@ -19,7 +19,7 @@ const queryClient = new QueryClient({
1919

2020
function App() {
2121
const { shell } = useContext(ShellContext);
22-
const routes = createHashRouter(createRoutesFromElements(Routes));
22+
const allRoutes = createHashRouter(createRoutesFromElements(routes));
2323

2424
useEffect(() => {
2525
shell.ux.hidePreloader();
@@ -28,7 +28,7 @@ function App() {
2828
return (
2929
<QueryClientProvider client={queryClient}>
3030
<Suspense>
31-
<RouterProvider router={routes} />
31+
<RouterProvider router={allRoutes} />
3232
</Suspense>
3333
<ReactQueryDevtools />
3434
</QueryClientProvider>

packages/manager/apps/web-domains/src/alldoms/routes/routes.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import { Navigate, Route } from 'react-router-dom';
33
import { PageType } from '@ovh-ux/manager-react-shell-client';
44
import { ErrorBoundary } from '@ovh-ux/manager-react-components';
5-
import NotFound from '@/alldoms/pages/404';
65
import { urls } from '@/alldoms/routes/routes.constant';
76

87
const LayoutPage = React.lazy(() => import('@/alldoms/pages/layout'));
@@ -23,11 +22,10 @@ const AllDomCancelTerminatePage = React.lazy(() =>
2322

2423
export default (
2524
<>
26-
<Route path={'/'} element={<Navigate to={urls.alldomsRoot} replace />} />
2725
<Route
2826
path={urls.alldomsRoot}
2927
Component={LayoutPage}
30-
id="root"
28+
id="alldom-root"
3129
errorElement={
3230
<ErrorBoundary
3331
redirectionApp="web-domains-alldoms-backup"
@@ -82,6 +80,5 @@ export default (
8280
></Route>
8381
</Route>
8482
</Route>
85-
<Route path="*" element={<NotFound />} />
8683
</>
8784
);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { TDomainResource } from '../types/domainResource';
2+
3+
export const serviceInfoDetail: TDomainResource = {
4+
id: 'example.com',
5+
checksum: 'b33b25a0c92de994bb085f4d3b1eee47',
6+
resourceStatus: 'READY',
7+
currentState: {
8+
name: 'example.com',
9+
extension: 'fr',
10+
mainState: 'OK',
11+
protectionState: 'PROTECTED',
12+
suspensionState: 'NOT_SUSPENDED',
13+
additionalStates: [],
14+
dnsConfiguration: {
15+
minDNS: 2,
16+
maxDNS: 8,
17+
hostSupported: true,
18+
glueRecordIPv6Supported: true,
19+
nameServers: [
20+
{
21+
nameServerType: 'HOSTING',
22+
nameServer: 'ns103.ovh.net',
23+
},
24+
{
25+
nameServerType: 'HOSTING',
26+
nameServer: 'dns103.ovh.net',
27+
},
28+
],
29+
configurationType: 'HOSTING',
30+
},
31+
},
32+
targetSpec: {
33+
dnsConfiguration: {
34+
nameServers: [
35+
{
36+
nameServer: 'ns103.ovh.net',
37+
},
38+
{
39+
nameServer: 'dns103.ovh.net',
40+
},
41+
],
42+
},
43+
},
44+
currentTasks: [],
45+
iam: {
46+
id: '87089d5d-11fd-45c9-9aba-54ad1c0e34bd',
47+
tags: {
48+
'ovh:whoisOwner': 'contact/123456',
49+
},
50+
urn: 'urn:v1:eu:resource:domain:example.com',
51+
},
52+
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { TDomainResource } from '../types/domainResource';
2+
3+
export const serviceList: TDomainResource[] = [
4+
{
5+
id: 'example.com',
6+
checksum: 'b33b25a0c92de994bb085f4d3b1eee47',
7+
resourceStatus: 'READY',
8+
currentState: {
9+
name: 'example.com',
10+
extension: 'fr',
11+
mainState: 'OK',
12+
protectionState: 'PROTECTED',
13+
suspensionState: 'NOT_SUSPENDED',
14+
additionalStates: [],
15+
dnsConfiguration: {
16+
minDNS: 2,
17+
maxDNS: 8,
18+
hostSupported: true,
19+
glueRecordIPv6Supported: true,
20+
nameServers: [
21+
{
22+
nameServerType: 'HOSTING',
23+
nameServer: 'ns103.ovh.net',
24+
},
25+
{
26+
nameServerType: 'HOSTING',
27+
nameServer: 'dns103.ovh.net',
28+
},
29+
],
30+
configurationType: 'HOSTING',
31+
},
32+
},
33+
targetSpec: {
34+
dnsConfiguration: {
35+
nameServers: [
36+
{
37+
nameServer: 'ns103.ovh.net',
38+
},
39+
{
40+
nameServer: 'dns103.ovh.net',
41+
},
42+
],
43+
},
44+
},
45+
currentTasks: [],
46+
iam: {
47+
id: '87089d5d-11fd-45c9-9aba-54ad1c0e34bd',
48+
tags: {
49+
'ovh:whoisOwner': 'contact/1234',
50+
},
51+
urn: 'urn:v1:eu:resource:domain:example.com',
52+
},
53+
},
54+
];
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { useNavigationGetUrl } from '@ovh-ux/manager-react-shell-client';
2+
import { DataGridTextCell } from '@ovh-ux/manager-react-components';
3+
import React from 'react';
4+
import { Link } from '@ovhcloud/ods-react';
5+
import config from '@/web-domains.config';
6+
7+
interface DatagridColumnServiceNameProps {
8+
readonly domainName: string;
9+
}
10+
11+
export default function DatagridColumnServiceName({
12+
domainName,
13+
}: DatagridColumnServiceNameProps) {
14+
const { data: url } = useNavigationGetUrl([
15+
config.rootLabel,
16+
`/domain/${domainName}/information`,
17+
{},
18+
]);
19+
20+
return (
21+
<DataGridTextCell>
22+
<Link href={url as string} data-testid={domainName}>
23+
{domainName}
24+
</Link>
25+
</DataGridTextCell>
26+
);
27+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import React from 'react';
2+
import { OdsSpinner } from '@ovhcloud/ods-components/react';
3+
4+
export default function Loading() {
5+
return (
6+
<div className="flex justify-center" data-testid="listing-page-spinner">
7+
<OdsSpinner />
8+
</div>
9+
);
10+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import { Tab, TabList, Tabs, TabsValueChangeEvent } from '@ovhcloud/ods-react';
2+
import React, { useEffect, useState } from 'react';
3+
import { useTranslation } from 'react-i18next';
4+
import { useLocation, useNavigate } from 'react-router-dom';
5+
import { ServiceDetailTabsProps } from '@/domain/constants/serviceDetail';
6+
7+
export default function ServiceDetailsTabs() {
8+
const { t } = useTranslation(['domain']);
9+
const location = useLocation();
10+
const [value, setValue] = useState('');
11+
const navigate = useNavigate();
12+
const handleValueChange = (event: TabsValueChangeEvent) => {
13+
navigate(`${event.value}`);
14+
setValue(event.value);
15+
};
16+
17+
useEffect(() => {
18+
if (location.pathname) {
19+
const path = location.pathname.split('/');
20+
setValue(path[path.length - 1]);
21+
}
22+
}, [location.pathname]);
23+
24+
return (
25+
<Tabs defaultValue={value} onValueChange={handleValueChange} value={value}>
26+
<TabList>
27+
{ServiceDetailTabsProps.map((tab) => {
28+
return (
29+
<Tab key={tab.id} value={tab.value} data-testid={tab.id}>
30+
{t(tab.name)}
31+
</Tab>
32+
);
33+
})}
34+
</TabList>
35+
</Tabs>
36+
);
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
export type LangCode =
2+
| 'FR'
3+
| 'EN'
4+
| 'DE'
5+
| 'ES'
6+
| 'IT'
7+
| 'PL'
8+
| 'PT'
9+
| 'DEFAULT';
10+
11+
export type GuideLinks = Record<LangCode, string>;
12+
export interface Guide {
13+
key: string;
14+
url: GuideLinks;
15+
}
16+
17+
const helpRoot = 'https://help.ovhcloud.com/csm/';
18+
19+
const baseGuideUrl = `${helpRoot}{{lang}}-documentation-web-cloud-domains?id=kb_browse_cat&kb_id=e17b4f25551974502d4c6e78b7421955&kb_category=54441955f49801102d4ca4d466a7fdb2`;
20+
21+
export const WEB_DOMAINS: GuideLinks = {
22+
FR: baseGuideUrl.replace('{{lang}}', 'fr'),
23+
EN: baseGuideUrl.replace('{{lang}}', 'en-gb'),
24+
DE: baseGuideUrl.replace('{{lang}}', 'de'),
25+
ES: baseGuideUrl.replace('{{lang}}', 'es-es'),
26+
IT: baseGuideUrl.replace('{{lang}}', 'it'),
27+
PL: baseGuideUrl.replace('{{lang}}', 'pl'),
28+
PT: baseGuideUrl.replace('{{lang}}', 'pt'),
29+
DEFAULT: baseGuideUrl.replace('{{lang}}', 'fr'),
30+
};
31+
32+
export const GUIDES_LIST = {
33+
domains: {
34+
key: 'web_domains',
35+
url: WEB_DOMAINS,
36+
},
37+
};
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import { ChangelogLinks } from '@ovh-ux/manager-react-components';
2+
import { DashboardTabItemProps } from '@/domain/types/serviceDetail';
3+
4+
export const ServiceDetailTabsProps: DashboardTabItemProps[] = [
5+
{
6+
id: 'information',
7+
name: 'domain_tab_name_general_information',
8+
value: 'information',
9+
},
10+
{
11+
id: 'zone',
12+
name: 'domain_tab_name_dns_zone',
13+
value: 'zone',
14+
},
15+
{
16+
id: 'dns',
17+
name: 'domain_tab_name_dns_server',
18+
value: 'dns',
19+
},
20+
{
21+
id: 'redirection',
22+
name: 'domain_tab_name_redirection',
23+
value: 'redirection',
24+
},
25+
{
26+
id: 'dynhost',
27+
name: 'domain_tab_name_dynhost',
28+
value: 'dynhost',
29+
},
30+
{
31+
id: 'hosts',
32+
name: 'domain_tab_name_host',
33+
value: 'hosts',
34+
},
35+
{
36+
id: 'dnssec',
37+
name: 'domain_tab_name_ds_records',
38+
value: 'dnssec',
39+
},
40+
{
41+
id: 'contact-management',
42+
name: 'domain_tab_name_contact_management',
43+
value: 'contact-management',
44+
},
45+
];
46+
47+
export const changelogLinks: ChangelogLinks = {
48+
changelog:
49+
'https://github.com/orgs/ovh/projects/18/views/2?sliceBy%5Bvalue%5D=Domain+Names&pane=info',
50+
roadmap:
51+
'https://github.com/orgs/ovh/projects/18/views/1?sliceBy%5Bvalue%5D=Domain+Names&pane=info',
52+
'feature-request':
53+
'https://github.com/ovh/hosting-domain-names-roadmap/issues/new?assignees=&labels=&projects=&template=feature_request.md&title=',
54+
};

0 commit comments

Comments
 (0)