@centreon/js-config 23.10.46 → 23.10.48

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.
@@ -11,6 +11,8 @@ import { ThemeProvider } from '@centreon/ui';
11
11
  import '@testing-library/cypress/add-commands';
12
12
  import 'cypress-msw-interceptor';
13
13
 
14
+ import disableMotion from './disableCssTransitions';
15
+
14
16
  interface MountProps {
15
17
  Component: React.ReactNode;
16
18
  options?: object;
@@ -132,9 +134,16 @@ Cypress.Commands.add('makeSnapshot', (title?: string) => {
132
134
  cy.matchImageSnapshot(title);
133
135
  });
134
136
 
137
+ Cypress.Commands.add('cssDisableMotion', (): void => {
138
+ Cypress.on('window:before:load', (cyWindow) => {
139
+ disableMotion(cyWindow);
140
+ });
141
+ });
142
+
135
143
  declare global {
136
144
  namespace Cypress {
137
145
  interface Chainable {
146
+ cssDisableMotion: () => Cypress.Chainable;
138
147
  interceptAPIRequest: <T extends object>(
139
148
  props: InterceptAPIRequestProps<T>
140
149
  ) => Cypress.Chainable;
@@ -0,0 +1,19 @@
1
+ const disableMotion = (win): void => {
2
+ const injectedStyleEl = win.document.getElementById('__cy_disable_motion__');
3
+ if (injectedStyleEl) {
4
+ return;
5
+ }
6
+ win.document.head.insertAdjacentHTML(
7
+ 'beforeend',
8
+ `
9
+ <style id="__cy_disable_motion__">
10
+ /* Disable CSS transitions. */
11
+ *, *::before, *::after { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; -ms-transition: none !important; transition: none !important; }
12
+ /* Disable CSS animations. */
13
+ *, *::before, *::after { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; -ms-animation: none !important; animation: none !important; }
14
+ </style>
15
+ `.trim()
16
+ );
17
+ };
18
+
19
+ export default disableMotion;
@@ -5,6 +5,7 @@ import { execSync } from 'child_process';
5
5
 
6
6
  import { defineConfig } from 'cypress';
7
7
  import installLogsPrinter from 'cypress-terminal-report/src/installLogsPrinter';
8
+ import { config as configDotenv } from 'dotenv';
8
9
 
9
10
  import esbuildPreprocessor from './esbuild-preprocessor';
10
11
  import plugins from './plugins';
@@ -14,6 +15,7 @@ interface ConfigurationOptions {
14
15
  cypressFolder?: string;
15
16
  dockerName?: string;
16
17
  env?: Record<string, unknown>;
18
+ envFile?: string;
17
19
  isDevelopment?: boolean;
18
20
  specPattern: string;
19
21
  }
@@ -23,8 +25,13 @@ export default ({
23
25
  cypressFolder,
24
26
  isDevelopment,
25
27
  dockerName,
26
- env
28
+ env,
29
+ envFile
27
30
  }: ConfigurationOptions): Cypress.ConfigOptions => {
31
+ if (envFile) {
32
+ configDotenv({ path: envFile });
33
+ }
34
+
28
35
  const resultsFolder = `${cypressFolder || '.'}/results`;
29
36
 
30
37
  const webImageVersion = execSync('git rev-parse --abbrev-ref HEAD')
@@ -53,7 +60,7 @@ export default ({
53
60
  },
54
61
  env: {
55
62
  ...env,
56
- OPENID_IMAGE_VERSION: '23.04',
63
+ OPENID_IMAGE_VERSION: process.env.MAJOR || '24.04',
57
64
  WEB_IMAGE_OS: 'alma9',
58
65
  WEB_IMAGE_VERSION: webImageVersion,
59
66
  dockerName: dockerName || 'centreon-dev'
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.46",
4
+ "version": "23.10.48",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/centreon/centreon-frontend.git"
@@ -53,6 +53,7 @@
53
53
  "cypress-multi-reporters": "^1.6.3",
54
54
  "cypress-terminal-report": "^5.3.6",
55
55
  "dockerode": "^3.3.5",
56
+ "dotenv": "^16.3.1",
56
57
  "esbuild": "^0.19.3",
57
58
  "mochawesome": "^7.1.3"
58
59
  }