@configuratorware/configurator-frontendgui 1.29.4 → 1.30.0

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.
Files changed (30) hide show
  1. package/App/Modules/Creator/Components/Option/index.js +2 -2
  2. package/App/Modules/Creator/Components/OptionsList/index.js +54 -28
  3. package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +5 -6
  4. package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +1 -1
  5. package/App/Modules/Designer/Components/ImageEditDialog/index.js +3 -1
  6. package/App/Modules/Designer/Containers/ImageEditDialog.js +163 -113
  7. package/App/Modules/Designer/Utils/SvgFixers.js +59 -0
  8. package/App/Modules/Designer/Utils/Transformers.js +17 -10
  9. package/App/Reducers/ImageGallery/Selectors.js +6 -3
  10. package/App/Services/AnalyticsService.js +13 -64
  11. package/App/Services/ConfiguratorService.js +4 -2
  12. package/App/Services/DesignDataService.js +125 -138
  13. package/App/configuration.js +1 -1
  14. package/package.json +4 -4
  15. package/src/App/Modules/Creator/Components/Option/__snapshots__/index.test.js.snap +2 -2
  16. package/src/App/Modules/Creator/Components/Option/index.js +12 -2
  17. package/src/App/Modules/Creator/Components/OptionsList/index.js +46 -32
  18. package/src/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +5 -6
  19. package/src/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +1 -1
  20. package/src/App/Modules/Designer/Components/ImageEditDialog/index.js +3 -1
  21. package/src/App/Modules/Designer/Containers/ImageEditDialog.js +36 -12
  22. package/src/App/Modules/Designer/Utils/SvgFixers.js +36 -0
  23. package/src/App/Modules/Designer/Utils/Transformers.js +6 -3
  24. package/src/App/Modules/Designer/Utils/__tests__/Transformers.test.js +2 -2
  25. package/src/App/Reducers/ImageGallery/Selectors.js +5 -3
  26. package/src/App/Services/AnalyticsService.js +7 -20
  27. package/src/App/Services/ConfiguratorService.js +3 -2
  28. package/src/App/Services/DesignDataService.js +39 -24
  29. package/src/App/Services/__tests__/AnalyticsService.test.js +24 -37
  30. package/src/App/configuration.js +1 -1
@@ -23,16 +23,33 @@ describe('Services/AnalyticsService', () => {
23
23
  dispatch = jest.fn();
24
24
  }
25
25
 
26
+ class ConfiguratorService {
27
+ static serviceName = 'ConfiguratorService';
28
+
29
+ state = {
30
+ loadIdentifier: 'softshell_creator_2d',
31
+ };
32
+ }
33
+
26
34
  // add the mock services
27
- const storeSrvc = new StoreService();
28
- ServiceLocator.provide(storeSrvc);
35
+ ServiceLocator.provide(new StoreService());
36
+ ServiceLocator.provide(new ConfiguratorService());
37
+
38
+ const mockDataLayer = {
39
+ push: jest.fn(),
40
+ };
29
41
 
30
- test('Event load_request dispatches the correct action', () => {
42
+ test('Event load_request pushes the correct ga data to the dataLayer', () => {
31
43
  const analyticsSrvc = new AnalyticsService();
32
- analyticsSrvc.triggerEvent(EventTypes.load_request, {});
33
- expect(storeSrvc.dispatch).toBeCalledWith({
34
- type: 'header_load_configuration_request',
35
- data: {},
44
+ analyticsSrvc.setDataLayer(mockDataLayer);
45
+ analyticsSrvc.triggerEvent(EventTypes.load_request, 'softshell_designer_2d');
46
+ expect(mockDataLayer.push).toHaveBeenNthCalledWith(1, {
47
+ event: 'load_item',
48
+ item_identifier: 'softshell_creator_2d',
49
+ });
50
+ expect(mockDataLayer.push).toHaveBeenNthCalledWith(2, {
51
+ event: 'header_load_configuration_request',
52
+ configuration_code: 'softshell_designer_2d',
36
53
  });
37
54
  });
38
55
 
@@ -122,34 +139,4 @@ describe('Services/AnalyticsService', () => {
122
139
  };
123
140
  expect(result).toEqual(expected);
124
141
  });
125
-
126
- test('createMiddleware should return next action', () => {
127
- const store = {
128
- getState: jest.fn(() => ({})),
129
- dispatch: jest.fn(),
130
- };
131
- const analyticsSrvc = new AnalyticsService();
132
- const next = jest.fn(v => v);
133
- const action = { type: 'test_action' };
134
- const dataLayer = [];
135
-
136
- const result = analyticsSrvc.createMiddleware(dataLayer)(store)(next)(action);
137
-
138
- expect(result).toEqual(action);
139
- });
140
-
141
- test('action should be pushed into DataLayer if it is in trackList ', () => {
142
- const store = {
143
- getState: jest.fn(() => ({})),
144
- dispatch: jest.fn(),
145
- };
146
- const analyticsSrvc = new AnalyticsService();
147
- const next = jest.fn(v => v);
148
- const action = { type: 'preview_open' };
149
- const dataLayer = [];
150
-
151
- analyticsSrvc.createMiddleware(dataLayer)(store)(next)(action);
152
-
153
- expect(dataLayer.length).toBe(1);
154
- });
155
142
  });
@@ -13,7 +13,7 @@ const DEVELOPMENT_HOST_LOCAL = 'http://localhost:10030';
13
13
 
14
14
  const hostsByNodeEnv = {
15
15
  production: '',
16
- development: DEVELOPMENT_HOST_INT,
16
+ development: DEVELOPMENT_HOST_LOCAL,
17
17
  test: '',
18
18
  };
19
19