Skip to content

Commit

Permalink
fix(generator): update custom hook folder
Browse files Browse the repository at this point in the history
ref: MANAGER-11571

Signed-off-by: Alex Boungnaseng <alex.boungnaseng.ext@corp.ovh.com>
  • Loading branch information
aboungnaseng-ovhcloud authored and Nicolas Pierre-charles committed May 15, 2024
1 parent 781bc4c commit 1663b50
Show file tree
Hide file tree
Showing 43 changed files with 183 additions and 644 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { fetchIcebergV2, fetchIcebergV6, apiClient } from '@ovh-ux/manager-core-api';

{{#if unknownTypeList}}
{{!-- {{#if unknownTypeList}}
{{#each unknownTypeList}}
type {{this}} = unknown;
{{/each}}
{{/if}}
{{/if}} --}}
{{#each operationList}}

{{#if this.params}}
export type {{pascalCase this.functionName}}Params = {
{{#each this.params}}
/** {{this.description}} */
'{{this.name}}'{{#if this.required}}?{{/if}}: {{this.type}};
'{{this.name}}'{{#if this.required}}?{{/if}}: any;
{{/each}}
};

Expand All @@ -23,7 +23,7 @@ export const {{this.functionName}}QueryKey = {{#if this.urlParams}}(params: {{pa
* {{this.description}}
*/
{{/if}}
export const {{this.functionName}} = async ({{#if this.params}}params: {{pascalCase this.functionName}}Params{{/if}}): Promise<{{this.responseType}}> =>
export const {{this.functionName}} = async ({{#if this.params}}params: {{pascalCase this.functionName}}Params{{/if}}): Promise<any> =>
apiClient.{{this.apiVersion}}.{{this.httpMethod}}({{#if this.urlParams}}`{{this.url}}`{{else}}'{{this.url}}'{{/if}}{{#if this.bodyParams}}, { data: params }{{/if}});
{{/each}}
{{#ifEq arg1=apiVersion arg2=mainApiPathApiVersion}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import apiClient from '@ovh-ux/manager-core-api';

{{#if unknownTypeList}}
{{#each unknownTypeList}}
type {{this}} = unknown;
{{/each}}
{{/if}}
{{#each operationList}}

{{#each operationList}}
{{#if this.params}}
export type {{pascalCase this.functionName}}Params = {
{{#each this.params}}
Expand All @@ -23,6 +18,6 @@ export const {{this.functionName}}QueryKey = {{#if this.urlParams}}(params: {{pa
* {{this.description}}
*/
{{/if}}
export const {{this.functionName}} = async ({{#if this.params}}params: {{pascalCase this.functionName}}Params{{/if}}): Promise<{{this.responseType}}> =>
export const {{this.functionName}} = async ({{#if this.params}}params: {{pascalCase this.functionName}}Params{{/if}}): Promise<any> =>
apiClient.{{this.apiVersion}}.{{this.httpMethod}}({{#if this.urlParams}}`{{this.url}}`{{else}}'{{this.url}}'{{/if}}{{#if this.bodyParams}}, { data: params }{{/if}});
{{/each}}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React, { useState, useEffect } from 'react';
import { useResolvedPath } from 'react-router-dom';
import { useTranslation } from 'react-i18next';

import {
Outlet,
NavLink,
useLocation,
useNavigate,
useParams,
useResolvedPath,
} from 'react-router-dom';
import {
OsdsTabs,
Expand Down Expand Up @@ -72,14 +71,14 @@ export default function DashboardPage() {
<OsdsTabs panel={panel}>
<OsdsTabBar slot="top">
{tabsList.map((tab: DashboardTabItemProps) => (
<OsdsTabBarItem
key={`osds-tab-bar-item-${tab.name}`}
panel={tab.name}
>
<NavLink to={tab.to} className="no-underline">
{tab.title}
</NavLink>
</OsdsTabBarItem>
<NavLink to={tab.to} className="no-underline">
<OsdsTabBarItem
key={`osds-tab-bar-item-${tab.name}`}
panel={tab.name}
>
{tab.title}
</OsdsTabBarItem>
</NavLink>
))}
</OsdsTabBar>
</OsdsTabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ import { OsdsButton, OsdsLink } from '@ovhcloud/ods-components/react';
import { ODS_BUTTON_VARIANT } from '@ovhcloud/ods-components';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';

import { getListingIcebergV2 } from '@/api';
import {
Datagrid,
DataGridTextCell,
useDatagridSearchParams,
} from '@ovhcloud/manager-components';

import { getListingIcebergV2 } from '@/data/api/{{appName}}';

import Loading from '@/components/Loading/Loading';
import ErrorBanner from '@/components/Error/Error';
import Breadcrumb from '@/components/Breadcrumb/Breadcrumb';

import appConfig from '@/{{appName}}.config';

import {
Datagrid,
DataGridTextCell,
useDatagridSearchParams,
} from '@ovhcloud/manager-components';

export default function Listing() {
const { t } = useTranslation('listing');
const myConfig = appConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@ import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Navigate,{{#if isPCI }} useParams, {{/if}} useNavigate, useLocation } from 'react-router-dom';
import { useQuery } from '@tanstack/react-query';
import { getListingIcebergV6 } from '@/api';

import { OsdsLink } from '@ovhcloud/ods-components/react';
import { ODS_THEME_COLOR_INTENT } from '@ovhcloud/ods-common-theming';

import Loading from '@/components/Loading/Loading';
import ErrorBanner from '@/components/Error/Error';
import Breadcrumb from '@/components/Breadcrumb/Breadcrumb';

import {
Datagrid,
DataGridTextCell,
useDatagridSearchParams,
} from '@ovhcloud/manager-components';

import { getListingIcebergV6 } from '@/data/api/{{appName}}';

import Loading from '@/components/Loading/Loading';
import ErrorBanner from '@/components/Error/Error';
import Breadcrumb from '@/components/Breadcrumb/Breadcrumb';

import appConfig from '@/{{appName}}.config';

export default function Listing() {
Expand Down Expand Up @@ -45,7 +46,7 @@ export default function Listing() {
});

const navigateToDashabord = (label: string) => {
let path =
const path =
location.pathname.indexOf('pci') > -1 ? `${location.pathname}/` : '/';
navigate(`${path}${label}`);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Card, OnboardingLayout } from '@ovhcloud/manager-components';
import useGuideUtils from '@/hooks/guide/useGuideUtils';
import Breadcrumb from '@/components/Breadcrumb/Breadcrumb';
import onboardingImgSrc from './onboarding-img.png';

export default function Onboarding() {
const { t } = useTranslation('onboarding');
const link = useGuideUtils();

const tileList = [
{
id: 1,
texts: {
title: t('guide1Title'),
description: t('guide1Description'),
category: t('guideCategory'),
},
href: link?.guideLink1,
},
{
id: 2,
texts: {
title: t('guide2Title'),
description: t('guide2Description'),
category: t('guideCategory'),
},
href: link?.guideLink2,
},
{
id: 3,
texts: {
title: t('guide3Title'),
description: t('guide3Description'),
category: t('guideCategory'),
},
href: link?.guideLink3,
},
];

const title: string = t('title');
const description: string = t('description');
const imgSrc = {
src: onboardingImgSrc,
};

return (
<>
<Breadcrumb />
<OnboardingLayout
title={title}
img={imgSrc}
description={description}
orderButtonLabel={t('orderButtonLabel')}
orderHref={t('orderButtonLink')}
moreInfoButtonLabel={t('moreInfoButtonLabel')}
moreInfoHref={t('moreInfoButtonLink')}
>
<aside className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8 pt-12">
{tileList.map((tile) => (
<Card key={tile.id} href={tile.href} texts={tile.texts} />
))}
</aside>
</OnboardingLayout>
</>
);
}

This file was deleted.

Loading

0 comments on commit 1663b50

Please sign in to comment.