Skip to content

Commit 29b4a1e

Browse files
feat: updated to latest version
1 parent 5b22b6f commit 29b4a1e

File tree

32 files changed

+4852
-860
lines changed

32 files changed

+4852
-860
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@ yarn-error.log*
3535
.cursor
3636

3737
# Local history
38-
.lh
38+
.lh
39+
40+
# Storybook
41+
*storybook.log
42+
storybook-static

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
@o2s:registry=https://registry.npmjs.org
2+
@dxp:registry=https://registry.npmjs.org

.storybook/data.ts

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
import { GlobalProviderProps } from '@dxp/ui/providers/GlobalProvider';
2+
3+
export const globalProviderConfig: GlobalProviderProps['config'] = {
4+
locales: [
5+
{
6+
value: 'en',
7+
label: 'EN',
8+
},
9+
{
10+
value: 'de',
11+
label: 'DE',
12+
},
13+
{
14+
value: 'pl',
15+
label: 'PL',
16+
},
17+
],
18+
common: {
19+
header: {
20+
id: 'fqj6nnyk4irqq5b7rnc4ogsj',
21+
title: 'MOCK_HEADER_EN',
22+
logoLabel: 'Go to home',
23+
logo: {
24+
url: 'https://raw.githubusercontent.com/o2sdev/openselfservice/refs/heads/main/packages/integrations/mocked/public/images/logo.svg',
25+
alt: 'Logo',
26+
width: 92,
27+
height: 24,
28+
},
29+
contextSwitcher: {
30+
showContextSwitcher: true,
31+
closeLabel: 'Close',
32+
},
33+
languageSwitcherLabel: 'Language',
34+
mobileMenuLabel: {
35+
open: 'Open menu',
36+
close: 'Close Menu',
37+
},
38+
items: [
39+
{
40+
__typename: 'NavigationGroup',
41+
title: 'Personal',
42+
url: '/personal',
43+
items: [
44+
{
45+
__typename: 'NavigationItem',
46+
label: 'Accounts',
47+
url: '/personal/accounts',
48+
},
49+
{
50+
__typename: 'NavigationItem',
51+
label: 'Cards',
52+
url: '/personal/cards',
53+
},
54+
],
55+
},
56+
{
57+
__typename: 'NavigationGroup',
58+
title: 'Business',
59+
url: '/business',
60+
items: [
61+
{
62+
__typename: 'NavigationItem',
63+
label: 'Accounts',
64+
url: '/business/accounts',
65+
},
66+
{
67+
__typename: 'NavigationItem',
68+
label: 'Cards',
69+
url: '/business/cards',
70+
},
71+
],
72+
},
73+
],
74+
},
75+
footer: {
76+
id: 'laee0xa1zmm9uraev3hpruho',
77+
title: 'Legal and privacy',
78+
logo: {
79+
url: 'https://raw.githubusercontent.com/o2sdev/openselfservice/refs/heads/main/packages/integrations/mocked/public/images/logo.svg',
80+
alt: 'Logo',
81+
width: 92,
82+
height: 24,
83+
},
84+
logoLabel: 'Go to home',
85+
items: [
86+
{
87+
__typename: 'NavigationGroup',
88+
title: 'Personal',
89+
url: '/personal',
90+
items: [
91+
{
92+
__typename: 'NavigationItem',
93+
label: 'Accounts',
94+
url: '/personal/accounts',
95+
},
96+
{
97+
__typename: 'NavigationItem',
98+
label: 'Cards',
99+
url: '/personal/cards',
100+
},
101+
],
102+
},
103+
{
104+
__typename: 'NavigationGroup',
105+
title: 'Business',
106+
url: '/business',
107+
items: [
108+
{
109+
__typename: 'NavigationItem',
110+
label: 'Accounts',
111+
url: '/business/accounts',
112+
},
113+
{
114+
__typename: 'NavigationItem',
115+
label: 'Cards',
116+
url: '/business/cards',
117+
},
118+
],
119+
},
120+
],
121+
copyright: '© Open Self Service 2025',
122+
},
123+
},
124+
labels: {
125+
errors: {
126+
requestError: {
127+
title: 'Uh oh! Something went wrong.',
128+
content: 'There was a problem with your request.',
129+
},
130+
},
131+
dates: {
132+
today: 'Today',
133+
yesterday: 'Yesterday',
134+
},
135+
actions: {
136+
showMore: 'Show more',
137+
showLess: 'Show less',
138+
show: 'Show',
139+
hide: 'Hide',
140+
edit: 'Edit',
141+
save: 'Save',
142+
cancel: 'Cancel',
143+
delete: 'Delete',
144+
logOut: 'Log out',
145+
settings: 'Settings',
146+
renew: 'Renew',
147+
details: 'Details',
148+
},
149+
}
150+
};
151+
152+
export const globalProviderLabels: GlobalProviderProps['labels'] = {
153+
errors: {
154+
requestError: {
155+
title: 'Uh oh! Something went wrong.',
156+
content: 'There was a problem with your request.',
157+
},
158+
},
159+
dates: {
160+
today: 'Today',
161+
yesterday: 'Yesterday',
162+
},
163+
actions: {
164+
showMore: 'Show more',
165+
showLess: 'Show less',
166+
show: 'Show',
167+
hide: 'Hide',
168+
edit: 'Edit',
169+
save: 'Save',
170+
cancel: 'Cancel',
171+
delete: 'Delete',
172+
logOut: 'Log out',
173+
settings: 'Settings',
174+
renew: 'Renew',
175+
details: 'Details',
176+
},
177+
};
178+
179+
export const globalProviderThemes: GlobalProviderProps['themes'] = {
180+
default: {
181+
name: 'default',
182+
logo: {
183+
url: 'https://raw.githubusercontent.com/o2sdev/openselfservice/refs/heads/main/packages/integrations/mocked/public/images/logo.svg',
184+
alt: 'Logo',
185+
width: 92,
186+
height: 24,
187+
},
188+
},
189+
personal: {
190+
name: 'personal',
191+
logo: {
192+
url: 'https://raw.githubusercontent.com/o2sdev/openselfservice/refs/heads/main/packages/integrations/mocked/public/images/logo.svg',
193+
alt: 'Logo',
194+
width: 92,
195+
height: 24,
196+
},
197+
},
198+
business: {
199+
name: 'business',
200+
logo: {
201+
url: 'https://raw.githubusercontent.com/o2sdev/openselfservice/refs/heads/main/packages/integrations/mocked/public/images/logo.svg',
202+
alt: 'Logo',
203+
width: 92,
204+
height: 24,
205+
},
206+
},
207+
};
208+
209+
export const globalProviderCurrentTheme: GlobalProviderProps['currentTheme'] = 'default';

.storybook/main.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import type { StorybookConfig } from '@storybook/nextjs';
2+
import * as dotenv from 'dotenv';
3+
import { dirname, join } from 'path';
4+
5+
const env: {
6+
NEXT_PUBLIC_API_URL?: string;
7+
} = {};
8+
9+
dotenv.config({
10+
path: 'apps/frontend/.env.development',
11+
processEnv: env,
12+
});
13+
14+
/**
15+
* This function is used to resolve the absolute path of a package.
16+
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
17+
*/
18+
function getAbsolutePath(value: string): any {
19+
return dirname(require.resolve(join(value, 'package.json')));
20+
}
21+
22+
const config: StorybookConfig = {
23+
stories: [
24+
'../apps/frontend/src/**/*.stories.@(js|jsx|mjs|ts|tsx)',
25+
'../packages/blocks/**/src/frontend/**/*.stories.@(js|jsx|mjs|ts|tsx)',
26+
],
27+
addons: [
28+
getAbsolutePath('@storybook/addon-docs'),
29+
getAbsolutePath('@storybook/addon-a11y'),
30+
getAbsolutePath('@storybook/addon-themes'),
31+
],
32+
framework: {
33+
name: getAbsolutePath('@storybook/nextjs'),
34+
options: {},
35+
},
36+
env: (config) => ({
37+
...config,
38+
...env,
39+
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL || env.NEXT_PUBLIC_API_URL || '',
40+
}),
41+
};
42+
export default config;

.storybook/preview-head.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<link rel="preconnect" href="https://fonts.googleapis.com">
2+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
3+
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">

.storybook/preview.tsx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import React from 'react';
2+
import { NextIntlClientProvider } from 'next-intl';
3+
import type { Preview } from '@storybook/nextjs';
4+
import { createRouter } from '@storybook/nextjs/router.mock';
5+
import { createNavigation } from '@storybook/nextjs/navigation.mock';
6+
import { withThemeByClassName } from '@storybook/addon-themes';
7+
8+
import { GlobalProvider } from '@dxp/ui/providers/GlobalProvider';
9+
import { AppSpinner } from '@dxp/ui/components/AppSpinner';
10+
import { Toaster } from '@dxp/ui/elements/toaster';
11+
import { TooltipProvider } from '@dxp/ui/elements/tooltip';
12+
13+
import { globalProviderConfig, globalProviderCurrentTheme, globalProviderLabels, globalProviderThemes } from './data';
14+
15+
import '../apps/frontend/src/styles/global.css';
16+
import messages from '../apps/frontend/src/i18n/messages/en.json'
17+
18+
createRouter({});
19+
createNavigation({});
20+
21+
const preview: Preview = {
22+
parameters: {
23+
controls: {
24+
matchers: {
25+
color: /(background|color)$/i,
26+
date: /Date$/i,
27+
},
28+
},
29+
},
30+
decorators: [
31+
withThemeByClassName({
32+
themes: {
33+
default: 'theme-default',
34+
personal: 'theme-personal',
35+
business: 'theme-business',
36+
dark: 'theme-dark',
37+
},
38+
defaultTheme: 'default',
39+
}),
40+
(Story) => {
41+
return(
42+
<NextIntlClientProvider locale="en" messages={messages}>
43+
<GlobalProvider config={globalProviderConfig} labels={globalProviderLabels} themes={globalProviderThemes} currentTheme={globalProviderCurrentTheme} locale="en">
44+
<TooltipProvider>
45+
<Story />
46+
47+
<Toaster />
48+
<AppSpinner />
49+
</TooltipProvider>
50+
</GlobalProvider>
51+
</NextIntlClientProvider>
52+
)
53+
}
54+
]
55+
};
56+
57+
export default preview;

apps/api-harmonization/package.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,27 @@
2020
"generate:component": "turbo gen api-component"
2121
},
2222
"dependencies": {
23-
"@dxp/blocks.bento-grid": "^0.1.0",
24-
"@dxp/blocks.cta-section": "^0.1.0",
25-
"@dxp/blocks.document-list": "^0.1.0",
26-
"@dxp/blocks.faq": "^0.1.1",
27-
"@dxp/blocks.feature-section": "^0.1.1",
28-
"@dxp/blocks.feature-section-grid": "^0.0.6",
29-
"@dxp/blocks.hero-section": "^0.1.0",
30-
"@dxp/blocks.media-section": "^0.1.0",
31-
"@dxp/blocks.pricing-section": "^0.1.0",
32-
"@dxp/blocks.quick-links": "^0.1.0",
23+
"@dxp/blocks.bento-grid": "^0.1.1",
24+
"@dxp/blocks.cta-section": "^0.1.2",
25+
"@dxp/blocks.document-list": "^0.1.1",
26+
"@dxp/blocks.faq": "^0.1.2",
27+
"@dxp/blocks.feature-section": "^0.1.3",
28+
"@dxp/blocks.feature-section-grid": "^0.0.7",
29+
"@dxp/blocks.hero-section": "^0.1.2",
30+
"@dxp/blocks.media-section": "^0.1.2",
31+
"@dxp/blocks.pricing-section": "^0.1.2",
32+
"@dxp/blocks.quick-links": "^0.1.1",
3333
"@dxp/configs.integrations": "*",
34-
"@dxp/framework": "^0.1.0",
35-
"@dxp/utils.api-harmonization": "*",
34+
"@dxp/framework": "^0.2.1",
35+
"@dxp/integrations.mocked": "^0.4.1",
36+
"@dxp/utils.api-harmonization": "^0.0.5",
3637
"@nestjs/axios": "^4.0.0",
3738
"@nestjs/common": "^11.1.1",
3839
"@nestjs/config": "^4.0.2",
3940
"@nestjs/core": "^11.1.1",
4041
"@nestjs/platform-express": "^11.1.1",
41-
"@o2s/telemetry": "*",
42-
"@o2s/utils.logger": "*",
42+
"@o2s/telemetry": "^1.0.8",
43+
"@o2s/utils.logger": "^1.1.0",
4344
"compression": "^1.8.0",
4445
"cookie": "^1.0.2",
4546
"cookie-parser": "^1.4.7",

apps/api-harmonization/src/modules/page/page.mapper.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export const mapPage = (
3131
noFollow: page.seo.noFollow,
3232
},
3333
locales,
34+
theme: page.theme,
35+
redirect: page.redirect,
3436
},
3537
data: {
3638
alternativeUrls,
@@ -138,6 +140,7 @@ export const mapInit = (
138140
header: CMS.Model.Header.Header,
139141
footer: CMS.Model.Footer.Footer,
140142
labels: CMS.Model.AppConfig.Labels,
143+
themes: CMS.Model.AppConfig.Themes,
141144
roles: Auth.Constants.Roles[],
142145
): Init => {
143146
return {
@@ -173,5 +176,6 @@ export const mapInit = (
173176
},
174177
},
175178
labels,
179+
themes,
176180
};
177181
};

0 commit comments

Comments
 (0)