@centreon/js-config 23.10.3-feature-MON-18489.0 → 23.10.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/cypress/e2e/commands.ts +10 -2
- package/package.json +1 -1
- package/webpack/base/index.js +63 -10
- package/webpack/base/globalConfig.js +0 -74
package/cypress/e2e/commands.ts
CHANGED
|
@@ -37,6 +37,13 @@ Cypress.Commands.add(
|
|
|
37
37
|
}
|
|
38
38
|
);
|
|
39
39
|
|
|
40
|
+
Cypress.Commands.add(
|
|
41
|
+
'clickSubRootMenuItem',
|
|
42
|
+
(page: string): Cypress.Chainable => {
|
|
43
|
+
return cy.get('div[data-cy="collapse"]').eq(1).contains(page).click();
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
|
|
40
47
|
interface NavigateToProps {
|
|
41
48
|
page: string;
|
|
42
49
|
rootItemNumber: number;
|
|
@@ -49,8 +56,8 @@ Cypress.Commands.add(
|
|
|
49
56
|
if (subMenu) {
|
|
50
57
|
cy.hoverRootMenuItem(rootItemNumber)
|
|
51
58
|
.contains(subMenu)
|
|
52
|
-
.trigger('mouseover'
|
|
53
|
-
cy.
|
|
59
|
+
.trigger('mouseover');
|
|
60
|
+
cy.clickSubRootMenuItem(page);
|
|
54
61
|
|
|
55
62
|
return;
|
|
56
63
|
}
|
|
@@ -342,6 +349,7 @@ Cypress.Commands.add(
|
|
|
342
349
|
declare global {
|
|
343
350
|
namespace Cypress {
|
|
344
351
|
interface Chainable {
|
|
352
|
+
clickSubRootMenuItem: (page: string) => Cypress.Chainable;
|
|
345
353
|
copyFromContainer: (props: CopyFromContainerProps) => Cypress.Chainable;
|
|
346
354
|
copyToContainer: (props: CopyToContainerProps) => Cypress.Chainable;
|
|
347
355
|
execInContainer: ({
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@centreon/js-config",
|
|
3
3
|
"description": "Centreon Frontend shared build configuration",
|
|
4
|
-
"version": "23.10.3
|
|
4
|
+
"version": "23.10.3",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/centreon/centreon-frontend.git"
|
package/webpack/base/index.js
CHANGED
|
@@ -3,22 +3,75 @@ const path = require('path');
|
|
|
3
3
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
|
4
4
|
const { ModuleFederationPlugin } = require('webpack').container;
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
optimization,
|
|
9
|
-
output,
|
|
10
|
-
cache
|
|
11
|
-
} = require('./globalConfig');
|
|
6
|
+
const excludeNodeModulesExceptCentreonUi =
|
|
7
|
+
/node_modules(\\|\/)\.pnpm(\\|\/)(?!(@centreon))/;
|
|
12
8
|
|
|
13
9
|
const getBaseConfiguration = ({
|
|
14
10
|
moduleName,
|
|
15
11
|
moduleFederationConfig,
|
|
16
12
|
jscTransformConfiguration
|
|
17
13
|
}) => ({
|
|
18
|
-
cache,
|
|
19
|
-
module:
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
cache: false,
|
|
15
|
+
module: {
|
|
16
|
+
rules: [
|
|
17
|
+
{
|
|
18
|
+
parser: { system: false },
|
|
19
|
+
test: /\.[cm]?(j|t)sx?$/
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
exclude: excludeNodeModulesExceptCentreonUi,
|
|
23
|
+
test: /\.[jt]sx?$/,
|
|
24
|
+
use: {
|
|
25
|
+
loader: 'swc-loader',
|
|
26
|
+
options: {
|
|
27
|
+
jsc: {
|
|
28
|
+
parser: {
|
|
29
|
+
syntax: 'typescript',
|
|
30
|
+
tsx: true
|
|
31
|
+
},
|
|
32
|
+
transform: jscTransformConfiguration
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
test: /\.icon.svg$/,
|
|
39
|
+
use: ['@svgr/webpack']
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
exclude: excludeNodeModulesExceptCentreonUi,
|
|
43
|
+
test: /\.(bmp|png|jpg|jpeg|gif|svg)$/,
|
|
44
|
+
use: [
|
|
45
|
+
{
|
|
46
|
+
loader: 'url-loader',
|
|
47
|
+
options: {
|
|
48
|
+
limit: 10000,
|
|
49
|
+
name: '[name].[hash:8].[ext]'
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
generator: {
|
|
56
|
+
filename: '[name][ext]'
|
|
57
|
+
},
|
|
58
|
+
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
59
|
+
type: 'asset/resource'
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
},
|
|
63
|
+
optimization: {
|
|
64
|
+
splitChunks: {
|
|
65
|
+
chunks: 'all',
|
|
66
|
+
maxSize: 400 * 1024
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
output: {
|
|
70
|
+
chunkFilename: '[name].[chunkhash:8].chunk.js',
|
|
71
|
+
filename: '[name].[chunkhash:8].js',
|
|
72
|
+
libraryTarget: 'umd',
|
|
73
|
+
umdNamedDefine: true
|
|
74
|
+
},
|
|
22
75
|
plugins: [
|
|
23
76
|
new CleanWebpackPlugin(),
|
|
24
77
|
moduleName &&
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
const excludeNodeModulesExceptCentreonUi =
|
|
2
|
-
/node_modules(\\|\/)\.pnpm(\\|\/)(?!(@centreon))/;
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
cache: false,
|
|
6
|
-
excludeNodeModulesExceptCentreonUi,
|
|
7
|
-
getModuleConfiguration: (jscTransformConfiguration) => ({
|
|
8
|
-
rules: [
|
|
9
|
-
{
|
|
10
|
-
parser: { system: false },
|
|
11
|
-
test: /\.[cm]?(j|t)sx?$/
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
exclude: [
|
|
15
|
-
excludeNodeModulesExceptCentreonUi,
|
|
16
|
-
/www(\\|\/)widgets(\\|\/)bruh/
|
|
17
|
-
],
|
|
18
|
-
test: /\.[jt]sx?$/,
|
|
19
|
-
use: {
|
|
20
|
-
loader: 'swc-loader',
|
|
21
|
-
options: {
|
|
22
|
-
jsc: {
|
|
23
|
-
parser: {
|
|
24
|
-
syntax: 'typescript',
|
|
25
|
-
tsx: true
|
|
26
|
-
},
|
|
27
|
-
transform: jscTransformConfiguration
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
test: /\.icon.svg$/,
|
|
34
|
-
use: ['@svgr/webpack']
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
exclude: excludeNodeModulesExceptCentreonUi,
|
|
38
|
-
test: /\.(bmp|png|jpg|jpeg|gif|svg)$/,
|
|
39
|
-
use: [
|
|
40
|
-
{
|
|
41
|
-
loader: 'url-loader',
|
|
42
|
-
options: {
|
|
43
|
-
limit: 10000,
|
|
44
|
-
name: '[name].[hash:8].[ext]'
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
generator: {
|
|
51
|
-
filename: '[name][ext]'
|
|
52
|
-
},
|
|
53
|
-
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
54
|
-
type: 'asset/resource'
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
test: /\.css$/i,
|
|
58
|
-
use: ['style-loader', 'css-loader']
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
}),
|
|
62
|
-
optimization: {
|
|
63
|
-
splitChunks: {
|
|
64
|
-
chunks: 'all',
|
|
65
|
-
maxSize: 400 * 1024
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
output: {
|
|
69
|
-
chunkFilename: '[name].[chunkhash:8].chunk.js',
|
|
70
|
-
filename: '[name].[chunkhash:8].js',
|
|
71
|
-
libraryTarget: 'umd',
|
|
72
|
-
umdNamedDefine: true
|
|
73
|
-
}
|
|
74
|
-
};
|