@centreon/ui 24.7.1 → 24.7.3
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/package.json +66 -85
- package/public/mockServiceWorker.js +1 -1
- package/src/Graph/BarChart/BarChart.cypress.spec.tsx +85 -2
- package/src/Graph/BarChart/BarStack.tsx +8 -6
- package/src/Graph/BarChart/SingleBar.tsx +2 -2
- package/src/Graph/LineChart/Icons/Downtime.tsx +1 -1
- package/src/Graph/LineChart/helpers/index.ts +3 -0
- package/src/Graph/PieChart/PieChart.cypress.spec.tsx +0 -4
- package/src/{Home.stories.mdx → Home.mdx} +41 -39
- package/src/Image/index.stories.tsx +101 -101
- package/src/Listing/ActionBar/index.tsx +1 -0
- package/src/RichTextEditor/index.stories.tsx +102 -102
- package/src/ThemeProvider/index.tsx +5 -4
- package/src/TimePeriods/DateTimePickerInput.tsx +1 -1
- package/src/Typography/FluidTypography/index.stories.tsx +63 -63
- package/src/components/Form/AccessRights/AccessRights.stories.tsx +5 -5
- package/test/setupTests.js +1 -0
- package/src/Listing/index.test.tsx +0 -234
- /package/{public → src}/fonts/roboto-bold-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-bold-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-bold-webfont.woff2 +0 -0
- /package/{public → src}/fonts/roboto-light-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-light-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-light-webfont.woff2 +0 -0
- /package/{public → src}/fonts/roboto-medium-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-medium-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-medium-webfont.woff2 +0 -0
- /package/{public → src}/fonts/roboto-regular-webfont.ttf +0 -0
- /package/{public → src}/fonts/roboto-regular-webfont.woff +0 -0
- /package/{public → src}/fonts/roboto-regular-webfont.woff2 +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/ui",
|
|
3
|
-
"version": "24.7.
|
|
3
|
+
"version": "24.7.3",
|
|
4
4
|
"description": "Centreon UI Components",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update:deps": "pnpx npm-check-updates -i --format group",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"name": "centreon@centreon.com"
|
|
31
31
|
},
|
|
32
32
|
"baseCodeCoveragePercentage": 60,
|
|
33
|
-
"license": "
|
|
33
|
+
"license": "MIT",
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/centreon/centreon/issues"
|
|
36
36
|
},
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"exports": {
|
|
40
40
|
".": "./src/index.ts",
|
|
41
41
|
"./components": "./src/components/index.ts",
|
|
42
|
-
"./fonts/*": "./
|
|
42
|
+
"./fonts/*": "./src/fonts/*",
|
|
43
43
|
"./test/testRenderer": "./test/testRenderer.tsx"
|
|
44
44
|
},
|
|
45
45
|
"files": [
|
|
@@ -49,123 +49,104 @@
|
|
|
49
49
|
"test/*"
|
|
50
50
|
],
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@cypress/react": "^8.0.
|
|
53
|
-
"@cypress/webpack-dev-server": "^3.
|
|
52
|
+
"@cypress/react": "^8.0.2",
|
|
53
|
+
"@cypress/webpack-dev-server": "^3.10.0",
|
|
54
54
|
"@faker-js/faker": "^8.4.1",
|
|
55
55
|
"@mdx-js/react": "^3.0.1",
|
|
56
|
-
"@modern-js/prod-server": "^2.
|
|
57
|
-
"@modern-js/storybook": "^2.
|
|
58
|
-
"@simonsmith/cypress-image-snapshot": "^9.0.
|
|
59
|
-
"@storybook/addon-a11y": "^
|
|
60
|
-
"@storybook/addon-docs": "^
|
|
61
|
-
"@storybook/addon-essentials": "^
|
|
62
|
-
"@storybook/addon-interactions": "^
|
|
63
|
-
"@storybook/addon-
|
|
64
|
-
"@storybook/blocks": "^
|
|
65
|
-
"@storybook/
|
|
66
|
-
"@storybook/jest": "^0.1.0",
|
|
67
|
-
"@storybook/manager-api": "^7.0.9",
|
|
56
|
+
"@modern-js/prod-server": "^2.54.5",
|
|
57
|
+
"@modern-js/storybook": "^2.54.5",
|
|
58
|
+
"@simonsmith/cypress-image-snapshot": "^9.0.3",
|
|
59
|
+
"@storybook/addon-a11y": "^8.1.11",
|
|
60
|
+
"@storybook/addon-docs": "^8.1.11",
|
|
61
|
+
"@storybook/addon-essentials": "^8.1.11",
|
|
62
|
+
"@storybook/addon-interactions": "^8.1.11",
|
|
63
|
+
"@storybook/addon-themes": "^8.1.11",
|
|
64
|
+
"@storybook/blocks": "^8.1.11",
|
|
65
|
+
"@storybook/manager-api": "^8.1.11",
|
|
68
66
|
"@storybook/mdx2-csf": "^1.1.0",
|
|
69
|
-
"@storybook/preview-api": "^
|
|
70
|
-
"@storybook/react": "^
|
|
71
|
-
"@storybook/react-vite": "^
|
|
72
|
-
"@storybook/test
|
|
73
|
-
"@storybook/
|
|
74
|
-
"@storybook/theming": "^
|
|
75
|
-
"@testing-library/cypress": "^
|
|
76
|
-
"@testing-library/jest-dom": "^
|
|
77
|
-
"@testing-library/react": "^
|
|
67
|
+
"@storybook/preview-api": "^8.1.11",
|
|
68
|
+
"@storybook/react": "^8.1.11",
|
|
69
|
+
"@storybook/react-vite": "^8.1.11",
|
|
70
|
+
"@storybook/test": "^8.1.11",
|
|
71
|
+
"@storybook/test-runner": "^0.19.0",
|
|
72
|
+
"@storybook/theming": "^8.1.11",
|
|
73
|
+
"@testing-library/cypress": "^10.0.2",
|
|
74
|
+
"@testing-library/jest-dom": "^6.4.6",
|
|
75
|
+
"@testing-library/react": "^16.0.0",
|
|
78
76
|
"@testing-library/react-hooks": "^8.0.1",
|
|
79
77
|
"@types/jest": "^29.5.12",
|
|
80
|
-
"@types/mocha": "^10.0.
|
|
81
|
-
"@types/ramda": "^0.
|
|
82
|
-
"@types/react": "^18.
|
|
78
|
+
"@types/mocha": "^10.0.7",
|
|
79
|
+
"@types/ramda": "^0.30.0",
|
|
80
|
+
"@types/react": "^18.3.3",
|
|
83
81
|
"@types/testing-library__jest-dom": "^6.0.0",
|
|
84
|
-
"@vitejs/plugin-react": "^4.
|
|
85
|
-
"@vitejs/plugin-react-swc": "^3.
|
|
82
|
+
"@vitejs/plugin-react": "^4.3.1",
|
|
83
|
+
"@vitejs/plugin-react-swc": "^3.7.0",
|
|
86
84
|
"axios-mock-adapter": "^1.22.0",
|
|
87
|
-
"
|
|
85
|
+
"chai": "^5.1.1",
|
|
86
|
+
"cypress": "^13.13.0",
|
|
88
87
|
"identity-obj-proxy": "^3.0.0",
|
|
89
88
|
"jest-transform-stub": "^2.0.0",
|
|
90
89
|
"mochawesome": "^7.1.3",
|
|
91
|
-
"msw": "
|
|
92
|
-
"msw-storybook-addon": "^
|
|
93
|
-
"puppeteer": "^
|
|
94
|
-
"react": "^18.
|
|
95
|
-
"react-dom": "^18.
|
|
96
|
-
"react-test-renderer": "^18.
|
|
97
|
-
"remark-gfm": "^
|
|
98
|
-
"speed-measure-vite-plugin": "^0.1
|
|
99
|
-
"storybook": "^
|
|
100
|
-
"storybook-addon-mock": "^
|
|
101
|
-
"storybook-dark-mode": "^
|
|
102
|
-
"style-dictionary": "^
|
|
90
|
+
"msw": "2.3.1",
|
|
91
|
+
"msw-storybook-addon": "^2.0.2",
|
|
92
|
+
"puppeteer": "^22.12.1",
|
|
93
|
+
"react": "^18.3.1",
|
|
94
|
+
"react-dom": "^18.3.1",
|
|
95
|
+
"react-test-renderer": "^18.3.1",
|
|
96
|
+
"remark-gfm": "^4.0.0",
|
|
97
|
+
"speed-measure-vite-plugin": "^1.0.1",
|
|
98
|
+
"storybook": "^8.1.11",
|
|
99
|
+
"storybook-addon-mock": "^5.0.0",
|
|
100
|
+
"storybook-dark-mode": "^4.0.2",
|
|
101
|
+
"style-dictionary": "^4.0.0",
|
|
103
102
|
"ts-node": "^10.9.2",
|
|
104
103
|
"use-resize-observer": "^9.1.0",
|
|
105
|
-
"vite": "^
|
|
106
|
-
"vite-plugin-istanbul": "^
|
|
107
|
-
"vite-plugin-svgr": "^
|
|
104
|
+
"vite": "^5.3.3",
|
|
105
|
+
"vite-plugin-istanbul": "^6.0.2",
|
|
106
|
+
"vite-plugin-svgr": "^4.2.0",
|
|
108
107
|
"vite-plugin-turbosnap": "^1.0.3"
|
|
109
108
|
},
|
|
110
109
|
"dependencies": {
|
|
111
|
-
"@
|
|
112
|
-
"@lexical/
|
|
113
|
-
"@lexical/
|
|
114
|
-
"@lexical/
|
|
115
|
-
"@lexical/
|
|
116
|
-
"@lexical/
|
|
117
|
-
"@lexical/
|
|
110
|
+
"@centreon/ui-context": "file:../ui-context",
|
|
111
|
+
"@lexical/html": "^0.16.1",
|
|
112
|
+
"@lexical/link": "^0.16.1",
|
|
113
|
+
"@lexical/list": "^0.16.1",
|
|
114
|
+
"@lexical/react": "^0.16.1",
|
|
115
|
+
"@lexical/rich-text": "^0.16.1",
|
|
116
|
+
"@lexical/selection": "^0.16.1",
|
|
117
|
+
"@lexical/utils": "^0.16.1",
|
|
118
|
+
"@mui/material": "^5.15.21",
|
|
118
119
|
"@react-spring/web": "^9.7.3",
|
|
119
120
|
"@visx/clip-path": "^3.3.0",
|
|
120
|
-
"@visx/curve": "^
|
|
121
|
+
"@visx/curve": "^3.3.0",
|
|
121
122
|
"@visx/event": "^3.3.0",
|
|
122
123
|
"@visx/group": "^3.3.0",
|
|
123
124
|
"@visx/hierarchy": "^3.3.0",
|
|
124
|
-
"@visx/legend": "^3.
|
|
125
|
+
"@visx/legend": "^3.10.3",
|
|
125
126
|
"@visx/pattern": "^3.3.0",
|
|
126
127
|
"@visx/point": "^3.3.0",
|
|
127
128
|
"@visx/scale": "^3.5.0",
|
|
128
|
-
"@visx/shape": "^
|
|
129
|
+
"@visx/shape": "^3.5.0",
|
|
129
130
|
"@visx/text": "^3.3.0",
|
|
130
|
-
"@visx/threshold": "^
|
|
131
|
-
"@visx/visx": "
|
|
131
|
+
"@visx/threshold": "^3.5.0",
|
|
132
|
+
"@visx/visx": "3.11.0",
|
|
132
133
|
"@visx/zoom": "^3.3.0",
|
|
133
134
|
"anylogger": "^1.0.11",
|
|
134
135
|
"d3-array": "3.2.4",
|
|
135
|
-
"
|
|
136
|
-
"
|
|
136
|
+
"dayjs": "^1.11.11",
|
|
137
|
+
"humanize-duration": "^3.32.1",
|
|
138
|
+
"lexical": "^0.16.1",
|
|
137
139
|
"notistack": "^3.0.1",
|
|
138
140
|
"numeral": "^2.0.6",
|
|
139
|
-
"ramda": "0.
|
|
141
|
+
"ramda": "0.30.1",
|
|
140
142
|
"react-grid-layout": "^1.4.4",
|
|
141
143
|
"react-html-parser": "^2.0.2",
|
|
142
144
|
"react-resizable": "^3.0.5",
|
|
145
|
+
"react-router-dom": "^6.24.0",
|
|
143
146
|
"react-transition-group": "^4.4.5",
|
|
144
|
-
"sanitize-html": "^2.
|
|
147
|
+
"sanitize-html": "^2.13.0",
|
|
145
148
|
"ulog": "^2.0.0-beta.19"
|
|
146
149
|
},
|
|
147
|
-
"peerDependencies": {
|
|
148
|
-
"@centreon/ui-context": "file:../ui-context",
|
|
149
|
-
"@dnd-kit/core": "6.x",
|
|
150
|
-
"@dnd-kit/sortable": "6.x",
|
|
151
|
-
"@dnd-kit/utilities": "3.x",
|
|
152
|
-
"@mui/icons-material": "5.x",
|
|
153
|
-
"@mui/material": "5.x",
|
|
154
|
-
"@mui/styles": "5.x",
|
|
155
|
-
"@tanstack/react-query": "5.x",
|
|
156
|
-
"axios": ">= 1.6.4",
|
|
157
|
-
"dayjs": "1.x",
|
|
158
|
-
"formik": "2.x",
|
|
159
|
-
"jotai": "2.x",
|
|
160
|
-
"numeral": "2.x",
|
|
161
|
-
"ramda": "0.x",
|
|
162
|
-
"react-i18next": "12.x",
|
|
163
|
-
"react-router-dom": "6.x",
|
|
164
|
-
"react-scale-text": "1.x",
|
|
165
|
-
"resize-observer-polyfill": "1.x",
|
|
166
|
-
"ts.data.json": "2.x",
|
|
167
|
-
"tss-react": "4.x"
|
|
168
|
-
},
|
|
169
150
|
"jest-junit": {
|
|
170
151
|
"suiteName": "jest tests",
|
|
171
152
|
"output": "./junit.xml"
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - Please do NOT serve this file on production.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
const PACKAGE_VERSION = '2.
|
|
11
|
+
const PACKAGE_VERSION = '2.3.1'
|
|
12
12
|
const INTEGRITY_CHECKSUM = '26357c79639bfa20d64c0efca2a87423'
|
|
13
13
|
const IS_MOCKED_RESPONSE = Symbol('isMockedResponse')
|
|
14
14
|
const activeClientIds = new Set()
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
+
import { equals } from 'ramda';
|
|
2
3
|
|
|
3
4
|
import dataPingService from '../mockedData/pingService.json';
|
|
4
5
|
import dataPingServiceStacked from '../mockedData/pingServiceStacked.json';
|
|
@@ -56,6 +57,16 @@ describe('Bar chart', () => {
|
|
|
56
57
|
cy.contains('20').should('be.visible');
|
|
57
58
|
cy.contains(':40 AM').should('be.visible');
|
|
58
59
|
|
|
60
|
+
if (equals(orientation, 'horizontal')) {
|
|
61
|
+
cy.findByTestId('single-bar-3-2-0.08644')
|
|
62
|
+
.should('have.attr', 'height')
|
|
63
|
+
.should('equals', '295');
|
|
64
|
+
} else {
|
|
65
|
+
cy.findByTestId('single-bar-3-2-0.08644')
|
|
66
|
+
.should('have.attr', 'width')
|
|
67
|
+
.should('equals', '863');
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
cy.makeSnapshot();
|
|
60
71
|
});
|
|
61
72
|
|
|
@@ -66,6 +77,16 @@ describe('Bar chart', () => {
|
|
|
66
77
|
cy.contains('20').should('be.visible');
|
|
67
78
|
cy.contains(':40 AM').should('be.visible');
|
|
68
79
|
|
|
80
|
+
if (equals(orientation, 'horizontal')) {
|
|
81
|
+
cy.findByTestId('single-bar-3-2-0.08644')
|
|
82
|
+
.should('have.attr', 'height')
|
|
83
|
+
.should('equals', '171');
|
|
84
|
+
} else {
|
|
85
|
+
cy.findByTestId('single-bar-3-2-0.08644')
|
|
86
|
+
.should('have.attr', 'width')
|
|
87
|
+
.should('equals', '432');
|
|
88
|
+
}
|
|
89
|
+
|
|
69
90
|
cy.makeSnapshot();
|
|
70
91
|
});
|
|
71
92
|
|
|
@@ -76,6 +97,16 @@ describe('Bar chart', () => {
|
|
|
76
97
|
cy.contains('20').should('be.visible');
|
|
77
98
|
cy.contains(':40 AM').should('be.visible');
|
|
78
99
|
|
|
100
|
+
if (equals(orientation, 'horizontal')) {
|
|
101
|
+
cy.findByTestId('stacked-bar-3-0-0.12340000000000001')
|
|
102
|
+
.should('have.attr', 'height')
|
|
103
|
+
.should('equals', '187');
|
|
104
|
+
} else {
|
|
105
|
+
cy.findByTestId('stacked-bar-3-0-0.12340000000000001')
|
|
106
|
+
.should('have.attr', 'width')
|
|
107
|
+
.should('equals', '546');
|
|
108
|
+
}
|
|
109
|
+
|
|
79
110
|
cy.makeSnapshot();
|
|
80
111
|
});
|
|
81
112
|
|
|
@@ -86,6 +117,16 @@ describe('Bar chart', () => {
|
|
|
86
117
|
cy.contains('20').should('be.visible');
|
|
87
118
|
cy.contains(':40 AM').should('be.visible');
|
|
88
119
|
|
|
120
|
+
if (equals(orientation, 'horizontal')) {
|
|
121
|
+
cy.findByTestId('stacked-bar-3-0-0.08644')
|
|
122
|
+
.should('have.attr', 'height')
|
|
123
|
+
.should('equals', '265');
|
|
124
|
+
} else {
|
|
125
|
+
cy.findByTestId('stacked-bar-3-0-0.08644')
|
|
126
|
+
.should('have.attr', 'width')
|
|
127
|
+
.should('equals', '773');
|
|
128
|
+
}
|
|
129
|
+
|
|
89
130
|
cy.makeSnapshot();
|
|
90
131
|
});
|
|
91
132
|
|
|
@@ -100,6 +141,16 @@ describe('Bar chart', () => {
|
|
|
100
141
|
cy.contains('20').should('be.visible');
|
|
101
142
|
cy.contains(':40 AM').should('be.visible');
|
|
102
143
|
|
|
144
|
+
if (equals(orientation, 'horizontal')) {
|
|
145
|
+
cy.findByTestId('stacked-bar-3-0-0.12340000000000001')
|
|
146
|
+
.should('have.attr', 'height')
|
|
147
|
+
.should('equals', '94');
|
|
148
|
+
} else {
|
|
149
|
+
cy.findByTestId('stacked-bar-3-0-0.12340000000000001')
|
|
150
|
+
.should('have.attr', 'width')
|
|
151
|
+
.should('equals', '273');
|
|
152
|
+
}
|
|
153
|
+
|
|
103
154
|
cy.makeSnapshot();
|
|
104
155
|
});
|
|
105
156
|
|
|
@@ -114,7 +165,15 @@ describe('Bar chart', () => {
|
|
|
114
165
|
cy.contains('20').should('be.visible');
|
|
115
166
|
cy.contains(':40 AM').should('be.visible');
|
|
116
167
|
|
|
117
|
-
|
|
168
|
+
if (equals(orientation, 'horizontal')) {
|
|
169
|
+
cy.findByTestId('stacked-bar-3-0-0.08644')
|
|
170
|
+
.should('have.attr', 'height')
|
|
171
|
+
.should('equals', '133');
|
|
172
|
+
} else {
|
|
173
|
+
cy.findByTestId('stacked-bar-3-0-0.08644')
|
|
174
|
+
.should('have.attr', 'width')
|
|
175
|
+
.should('equals', '387');
|
|
176
|
+
}
|
|
118
177
|
});
|
|
119
178
|
|
|
120
179
|
it(`displays bar chart ${orientation}ly with a custom style`, () => {
|
|
@@ -128,7 +187,15 @@ describe('Bar chart', () => {
|
|
|
128
187
|
cy.contains('20').should('be.visible');
|
|
129
188
|
cy.contains(':40 AM').should('be.visible');
|
|
130
189
|
|
|
131
|
-
|
|
190
|
+
if (equals(orientation, 'horizontal')) {
|
|
191
|
+
cy.findByTestId('stacked-bar-3-0-0.08644')
|
|
192
|
+
.should('have.attr', 'height')
|
|
193
|
+
.should('equals', '265');
|
|
194
|
+
} else {
|
|
195
|
+
cy.findByTestId('stacked-bar-3-0-0.08644')
|
|
196
|
+
.should('have.attr', 'width')
|
|
197
|
+
.should('equals', '773');
|
|
198
|
+
}
|
|
132
199
|
});
|
|
133
200
|
});
|
|
134
201
|
|
|
@@ -149,6 +216,10 @@ describe('Bar chart', () => {
|
|
|
149
216
|
);
|
|
150
217
|
cy.contains('0.11 ms').should('be.visible');
|
|
151
218
|
|
|
219
|
+
cy.findByTestId('single-bar-3-2-0.08644')
|
|
220
|
+
.should('have.attr', 'height')
|
|
221
|
+
.should('equals', '295');
|
|
222
|
+
|
|
152
223
|
cy.makeSnapshot();
|
|
153
224
|
});
|
|
154
225
|
|
|
@@ -170,6 +241,10 @@ describe('Bar chart', () => {
|
|
|
170
241
|
|
|
171
242
|
cy.contains('06/19/2024').should('not.exist');
|
|
172
243
|
|
|
244
|
+
cy.findByTestId('stacked-bar-3-0-0.12340000000000001')
|
|
245
|
+
.should('have.attr', 'height')
|
|
246
|
+
.should('equals', '187');
|
|
247
|
+
|
|
173
248
|
cy.makeSnapshot();
|
|
174
249
|
});
|
|
175
250
|
|
|
@@ -203,6 +278,10 @@ describe('Bar chart', () => {
|
|
|
203
278
|
cy.contains('0.02 ms').should('be.visible');
|
|
204
279
|
cy.contains('0.11 ms').should('be.visible');
|
|
205
280
|
|
|
281
|
+
cy.findByTestId('stacked-bar-3-0-0.12340000000000001')
|
|
282
|
+
.should('have.attr', 'height')
|
|
283
|
+
.should('equals', '187');
|
|
284
|
+
|
|
206
285
|
cy.makeSnapshot();
|
|
207
286
|
});
|
|
208
287
|
|
|
@@ -228,6 +307,10 @@ describe('Bar chart', () => {
|
|
|
228
307
|
);
|
|
229
308
|
cy.contains('0.05 ms').should('be.visible');
|
|
230
309
|
|
|
310
|
+
cy.findByTestId('stacked-bar-3-0-0.12340000000000001')
|
|
311
|
+
.should('have.attr', 'height')
|
|
312
|
+
.should('equals', '187');
|
|
313
|
+
|
|
231
314
|
cy.makeSnapshot();
|
|
232
315
|
});
|
|
233
316
|
});
|
|
@@ -64,11 +64,13 @@ const BarStack = ({
|
|
|
64
64
|
<rect
|
|
65
65
|
data-testid={`stacked-bar-${bar.key}-${bar.index}-${bar.bar[1]}`}
|
|
66
66
|
fill={bar.color}
|
|
67
|
-
height={
|
|
67
|
+
height={Math.ceil(
|
|
68
|
+
isHorizontal ? Math.abs(bar.height) : barWidth
|
|
69
|
+
)}
|
|
68
70
|
key={`bar-stack-${barStack.index}-${bar.index}`}
|
|
69
71
|
opacity={barStyle.opacity}
|
|
70
|
-
width={isHorizontal ? barWidth : Math.abs(bar.width)}
|
|
71
|
-
x={
|
|
72
|
+
width={Math.ceil(isHorizontal ? barWidth : Math.abs(bar.width))}
|
|
73
|
+
x={Math.ceil(
|
|
72
74
|
isHorizontal
|
|
73
75
|
? barPadding
|
|
74
76
|
: getPadding({
|
|
@@ -76,8 +78,8 @@ const BarStack = ({
|
|
|
76
78
|
padding: bar.x,
|
|
77
79
|
size: bar.width
|
|
78
80
|
})
|
|
79
|
-
}
|
|
80
|
-
y={
|
|
81
|
+
)}
|
|
82
|
+
y={Math.ceil(
|
|
81
83
|
isHorizontal
|
|
82
84
|
? getPadding({
|
|
83
85
|
isNegativeValue,
|
|
@@ -85,7 +87,7 @@ const BarStack = ({
|
|
|
85
87
|
size: bar.height
|
|
86
88
|
})
|
|
87
89
|
: barPadding
|
|
88
|
-
}
|
|
90
|
+
)}
|
|
89
91
|
onMouseEnter={
|
|
90
92
|
isTooltipHidden
|
|
91
93
|
? undefined
|
|
@@ -35,10 +35,10 @@ const SingleBar = ({
|
|
|
35
35
|
<rect
|
|
36
36
|
data-testid={`single-bar-${bar.key}-${bar.index}-${bar.value}`}
|
|
37
37
|
fill={bar.color}
|
|
38
|
-
height={isHorizontal ? barLength : bar.height}
|
|
38
|
+
height={Math.ceil(isHorizontal ? barLength : bar.height)}
|
|
39
39
|
opacity={barStyle.opacity}
|
|
40
40
|
rx={(isHorizontal ? bar.width : bar.height) * barStyle.radius}
|
|
41
|
-
width={isHorizontal ? bar.width : barLength}
|
|
41
|
+
width={Math.ceil(isHorizontal ? bar.width : barLength)}
|
|
42
42
|
x={isHorizontal ? bar.x : barPadding}
|
|
43
43
|
y={isHorizontal ? barPadding : bar.y}
|
|
44
44
|
{...listeners}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvgIcon, SvgIconProps } from '@mui/material';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import IconDowntime from '../../../@assets/icons/downtime.icon.svg';
|
|
4
4
|
|
|
5
5
|
const Downtime = (props: SvgIconProps): JSX.Element => (
|
|
6
6
|
<SvgIcon component={IconDowntime} {...props} />
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
2
|
import { gt, gte, isEmpty, isNil, prop, propEq, reject, sortBy } from 'ramda';
|
|
3
|
+
import durationPlugin from 'dayjs/plugin/duration';
|
|
3
4
|
|
|
4
5
|
import { LinesData } from '../BasicComponents/Lines/models';
|
|
5
6
|
import { dateFormat, timeFormat } from '../common';
|
|
@@ -11,6 +12,8 @@ import {
|
|
|
11
12
|
} from '../../common/timeSeries';
|
|
12
13
|
import { LineChartData } from '../../common/models';
|
|
13
14
|
|
|
15
|
+
dayjs.extend(durationPlugin);
|
|
16
|
+
|
|
14
17
|
export const adjustGraphData = (graphData: LineChartData): LinesData => {
|
|
15
18
|
const lines = getLineData(graphData);
|
|
16
19
|
const sortedLines = sortBy(prop('name'), lines);
|
|
@@ -72,8 +72,6 @@ describe('Pie chart', () => {
|
|
|
72
72
|
it('renders as a pie when variant is set to "pie"', () => {
|
|
73
73
|
initialize({ variant: 'pie' });
|
|
74
74
|
cy.get('[data-variant="pie"]').should('exist');
|
|
75
|
-
|
|
76
|
-
cy.makeSnapshot();
|
|
77
75
|
});
|
|
78
76
|
|
|
79
77
|
it('displays tooltip with correct information on hover', () => {
|
|
@@ -134,8 +132,6 @@ describe('Pie chart', () => {
|
|
|
134
132
|
|
|
135
133
|
initialize({});
|
|
136
134
|
cy.findByTestId('Title').should('not.exist');
|
|
137
|
-
|
|
138
|
-
cy.makeSnapshot();
|
|
139
135
|
});
|
|
140
136
|
|
|
141
137
|
it('adjusts outer radius when chart dimensions are too small', () => {
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</
|
|
1
|
+
{/* Home.mdx */}
|
|
2
|
+
|
|
3
|
+
import { Meta } from '@storybook/addon-docs'
|
|
4
|
+
import { Typography, Link, Stack } from '@mui/material'
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
<Meta title="Home" />
|
|
8
|
+
|
|
9
|
+
<Typography variant="h4">Welcome to Centreon UI</Typography>
|
|
10
|
+
<br />
|
|
11
|
+
|
|
12
|
+
<Typography>This project contains design system's component used in every Centreon projects using ReactJS</Typography>
|
|
13
|
+
<br />
|
|
14
|
+
|
|
15
|
+
<Typography>Discover older versions of the Centreon UI's storybook</Typography>
|
|
16
|
+
<Stack>
|
|
17
|
+
<Link href="https://storybook.centreon.com/index.html" target="__blank" rel="noopener noreferrer">
|
|
18
|
+
<Typography>Latest</Typography>
|
|
19
|
+
</Link>
|
|
20
|
+
<Link href="https://storybook.centreon.com/23.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
21
|
+
<Typography>23.04</Typography>
|
|
22
|
+
</Link>
|
|
23
|
+
<Link href="https://storybook.centreon.com/22.10/index.html" target="__blank" rel="noopener noreferrer">
|
|
24
|
+
<Typography>22.10</Typography>
|
|
25
|
+
</Link>
|
|
26
|
+
<Link href="https://storybook.centreon.com/22.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
27
|
+
<Typography>22.04</Typography>
|
|
28
|
+
</Link>
|
|
29
|
+
<Link href="https://storybook.centreon.com/21.10/index.html" target="__blank" rel="noopener noreferrer">
|
|
30
|
+
<Typography>21.10</Typography>
|
|
31
|
+
</Link>
|
|
32
|
+
<Link href="https://storybook.centreon.com/21.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
33
|
+
<Typography>21.04</Typography>
|
|
34
|
+
</Link>
|
|
35
|
+
<Link href="https://storybook.centreon.com/20.10/index.html" target="__blank" rel="noopener noreferrer">
|
|
36
|
+
<Typography>20.10</Typography>
|
|
37
|
+
</Link>
|
|
38
|
+
<Link href="https://storybook.centreon.com/20.04/index.html" target="__blank" rel="noopener noreferrer">
|
|
39
|
+
<Typography>20.04</Typography>
|
|
40
|
+
</Link>
|
|
41
|
+
</Stack>
|