Skip to content
Merged
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
27 changes: 26 additions & 1 deletion packages/manager-wiki/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { I18nextProvider } from 'react-i18next';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { initialize, mswLoader } from 'msw-storybook-addon';
import { Preview } from '@storybook/react';
import { ShellContext, ShellContextType } from '@ovh-ux/manager-react-shell-client';
import './storybook.css';
import '@ovh-ux/muk/dist/style.css';

Expand Down Expand Up @@ -163,8 +164,32 @@ const withI18next = (story, context) => {
);
};

const withShellContext = (Story) => {
const mockShellContext: ShellContextType = {
shell: {
tracking: {
trackPage: () => {},
trackClick: () => {},
},
} as any,
environment: {
getRegion: () => 'EU',
} as any,
tracking: {
appName: 'test-app',
chapter1: 'test-chapter',
},
};

return (
<ShellContext.Provider value={mockShellContext}>
<Story />
</ShellContext.Provider>
);
};

// export decorators for storybook to wrap your stories in
export const decorators = [withI18next];
export const decorators = [withI18next, withShellContext];

export const globalTypes = {
locale: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meta } from '@storybook/blocks';
import { Markdown, Source } from '@storybook/blocks';
import Changelog from './../../../../manager-tools/manager-generator/CHANGELOG.md?raw';
import Changelog from './../../../../manager-tools/manager-legacy-tools/codename-generator/CHANGELOG.md?raw';

<Meta title="Core/generator/Changelog" />

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { Meta } from '@storybook/blocks';
import { Text } from '@ovh-ux/muk';
import { TEXT_PRESET } from '@ovhcloud/ods-react';

<Meta
title="Manager UI Kit/Templates/Dashboard/Documentation"
title="Manager UI Kit/Components/Dashboard/Documentation"
parameters={{ status: { type: 'deprecated' } }}
/>
<Text preset={TEXT_PRESET.heading1}>
Dashboard template - migrate from 1.X.0 from 2.X.0
</Text>

Dashboard template - migrate from 1.X.0 from 2.X.0

`Dashboard` has been removed from Manager UI Kit library.

You should use <a href="/?path=/story/templates-base--dashboard-template">BaseLayout components</a>
You should use <a href="/?path=/story/manager-ui-kit-components-base-layout--dashboard-template">BaseLayout components</a>
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { Canvas, Meta } from '@storybook/blocks';
import SpecificationsTabs from '@ovhcloud/ods-react';
import * as SpecificationsTabs from '@ovhcloud/ods-react';
import { Banner } from '../../../base-documents/components/banner/Banner';
import { Canvas as OdsCanvas } from '../../../base-documents/components/canvas/Canvas';
import { Heading } from '../../../base-documents/components/heading/Heading';
import { TechnicalSpecification } from '../../../base-documents/components/technicalSpecification/TechnicalSpecification';
import * as TabsStories from './tabs.stories';

<Meta of={ TabsStories } name="Technical information" />

<Banner of={ TabsStories } />

<Heading label="Overview" level={ 2 } />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ import {
GuideMenu,
GuideMenuItem,
Tile,
} from '@ovh-ux/muk';
import {
Badge,
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
Message,
MESSAGE_COLOR,
MessageIcon,
Tab,
Table,
TabList,
Tabs,
Table,
} from '@ovh-ux/muk';
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
} from '@ovhcloud/ods-react';

import { withRouter } from 'storybook-addon-react-router-v6';
Expand Down Expand Up @@ -75,7 +75,6 @@ const changelogLinks = {

const SampleTable = () => (
<Table>
<table className="w-full">
<thead>
<tr>
<th scope="col">Nom</th>
Expand All @@ -94,7 +93,6 @@ const SampleTable = () => (
</tr>
))}
</tbody>
</table>
</Table>
);

Expand All @@ -106,7 +104,7 @@ const SampleBreadcrumb = ({ items }) => (
<BreadcrumbItem>
<BreadcrumbLink href="#">{items[1]}</BreadcrumbLink>
</BreadcrumbItem>
</Breadcrumb>
</Breadcrumb>
);

const SampleTabs = () => (
Expand Down
Loading