@astral/features 4.0.0-alpha.7 → 4.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Example.story.d.ts +5 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Example.story.js +10 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Group.story.d.ts +8 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Group.story.js +14 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.d.ts +6 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.js +19 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.d.ts +8 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.js +14 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/common/index.d.ts +2 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/common/index.js +18 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.d.ts +27 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.js +119 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.d.ts +59 -0
- package/node/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.js +54 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.d.ts +5 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.js +9 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.d.ts +6 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.js +16 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/index.d.ts +2 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/index.js +18 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.d.ts +27 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.js +119 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.d.ts +47 -0
- package/node/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.js +58 -0
- package/package.json +2 -2
- package/productSwitcher/components/AstralProductSwitcher/stories/Example.story.d.ts +5 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/Example.story.js +6 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/Group.story.d.ts +8 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/Group.story.js +10 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.d.ts +6 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/Interaction.story.js +16 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.d.ts +8 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/Tenant.story.js +10 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/common/index.d.ts +2 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/common/index.js +2 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.d.ts +27 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/common/mockData.js +116 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.d.ts +59 -0
- package/productSwitcher/components/AstralProductSwitcher/stories/common/mockResponses.js +50 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.d.ts +5 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/Example.story.js +5 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.d.ts +6 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/Interaction.story.js +13 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/common/index.d.ts +2 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/common/index.js +2 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.d.ts +27 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockData.js +116 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.d.ts +47 -0
- package/productSwitcher/components/IdentityProductSwitcher/stories/common/mockResponses.js +54 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ASTRAL_PRODUCTS, ECO_PRODUCTS, IDENTITY_URL } from './mockData';
|
|
2
|
+
export const createProductsMockResponse = ({ searchParams }) => {
|
|
3
|
+
switch (searchParams.tenantId) {
|
|
4
|
+
case 'astral': {
|
|
5
|
+
return {
|
|
6
|
+
data: ASTRAL_PRODUCTS,
|
|
7
|
+
meta: {
|
|
8
|
+
totalCount: ASTRAL_PRODUCTS.length,
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
case 'eco': {
|
|
13
|
+
return {
|
|
14
|
+
data: ECO_PRODUCTS,
|
|
15
|
+
meta: {
|
|
16
|
+
totalCount: ECO_PRODUCTS.length,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
default: {
|
|
21
|
+
return {
|
|
22
|
+
data: [],
|
|
23
|
+
meta: {
|
|
24
|
+
totalCount: 0,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export const MOCK_FETCH_IDENTITY_PRODUCTS = [
|
|
31
|
+
{
|
|
32
|
+
url: `${IDENTITY_URL}/api/products/widget?tenantId=*`,
|
|
33
|
+
method: 'GET',
|
|
34
|
+
status: 200,
|
|
35
|
+
response: createProductsMockResponse,
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
export const MOCK_FETCH_IDENTITY_TENANTS = [
|
|
39
|
+
{
|
|
40
|
+
url: `${IDENTITY_URL}/api/tenants/widget`,
|
|
41
|
+
method: 'GET',
|
|
42
|
+
status: 200,
|
|
43
|
+
response: [
|
|
44
|
+
{
|
|
45
|
+
id: 'astral',
|
|
46
|
+
name: 'Астрал',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: 'eco',
|
|
50
|
+
name: 'Экосистема',
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
},
|
|
54
|
+
];
|