@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.
- package/App/Modules/Creator/Components/Option/index.js +2 -2
- package/App/Modules/Creator/Components/OptionsList/index.js +54 -28
- package/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +5 -6
- package/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +1 -1
- package/App/Modules/Designer/Components/ImageEditDialog/index.js +3 -1
- package/App/Modules/Designer/Containers/ImageEditDialog.js +163 -113
- package/App/Modules/Designer/Utils/SvgFixers.js +59 -0
- package/App/Modules/Designer/Utils/Transformers.js +17 -10
- package/App/Reducers/ImageGallery/Selectors.js +6 -3
- package/App/Services/AnalyticsService.js +13 -64
- package/App/Services/ConfiguratorService.js +4 -2
- package/App/Services/DesignDataService.js +125 -138
- package/App/configuration.js +1 -1
- package/package.json +4 -4
- package/src/App/Modules/Creator/Components/Option/__snapshots__/index.test.js.snap +2 -2
- package/src/App/Modules/Creator/Components/Option/index.js +12 -2
- package/src/App/Modules/Creator/Components/OptionsList/index.js +46 -32
- package/src/App/Modules/Designer/Components/ImageColorPicker/ImageColorPicker.js +5 -6
- package/src/App/Modules/Designer/Components/ImageEditDialog/ImageThumbnail.js +1 -1
- package/src/App/Modules/Designer/Components/ImageEditDialog/index.js +3 -1
- package/src/App/Modules/Designer/Containers/ImageEditDialog.js +36 -12
- package/src/App/Modules/Designer/Utils/SvgFixers.js +36 -0
- package/src/App/Modules/Designer/Utils/Transformers.js +6 -3
- package/src/App/Modules/Designer/Utils/__tests__/Transformers.test.js +2 -2
- package/src/App/Reducers/ImageGallery/Selectors.js +5 -3
- package/src/App/Services/AnalyticsService.js +7 -20
- package/src/App/Services/ConfiguratorService.js +3 -2
- package/src/App/Services/DesignDataService.js +39 -24
- package/src/App/Services/__tests__/AnalyticsService.test.js +24 -37
- 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
|
-
|
|
28
|
-
ServiceLocator.provide(
|
|
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
|
|
42
|
+
test('Event load_request pushes the correct ga data to the dataLayer', () => {
|
|
31
43
|
const analyticsSrvc = new AnalyticsService();
|
|
32
|
-
analyticsSrvc.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
});
|