Skip to content

Commit d89702a

Browse files
committed
NEXT-35606 - disable-multiple-vue-compat-groups-part-2
1 parent b701aed commit d89702a

File tree

189 files changed

+1062
-238
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+1062
-238
lines changed

.run/Administration Jest.run.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
<option name="RunConfigurationTask" enabled="true" run_configuration_name="Framework Schema Dump" run_configuration_type="ComposerRunConfigurationType" />
1313
</method>
1414
</configuration>
15-
</component>
15+
</component>

src/Administration/Resources/app/administration/src/app/component/tree/sw-tree-item/sw-tree-item.html.twig

-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,6 @@
254254
<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
255255
{% block sw_tree_item_children_transition %}
256256
<transition name="fade">
257-
258257
<!-- eslint-disable-next-line sw-deprecation-rules/no-twigjs-blocks -->
259258
{% block sw_tree_item_children_content %}
260259
<div

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-affiliate-and-campaign-code-modal/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const { mapState } = Component.getComponentHelper();
1111
export default {
1212
template,
1313

14+
compatConfig: Shopware.compatConfig,
15+
1416
emits: ['process-finish', 'modal-close'],
1517

1618
mixins: [

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-affiliate-and-campaign-code-modal/sw-flow-affiliate-and-campaign-code-modal.spec.js

+9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { mount } from '@vue/test-utils';
22
import flowState from 'src/module/sw-flow/state/flow.state';
33

4+
/**
5+
* @package services-settings
6+
* @group disabledCompat
7+
*/
8+
49
Shopware.Service().register('flowBuilderService', () => {
510
return {
611
mapActionType: () => {},
@@ -113,6 +118,10 @@ async function createWrapper() {
113118
'sw-checkbox-field': await wrapTestComponent('sw-checkbox-field'),
114119
'sw-checkbox-field-deprecated': await wrapTestComponent('sw-checkbox-field-deprecated', { sync: true }),
115120
'sw-container': await wrapTestComponent('sw-container'),
121+
'sw-field-copyable': true,
122+
'sw-inheritance-switch': true,
123+
'sw-ai-copilot-badge': true,
124+
'sw-help-text': true,
116125
},
117126
},
118127
props: {

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-app-action-modal/index.js

+27-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const { Mixin, Classes: { ShopwareError } } = Shopware;
1010
export default {
1111
template,
1212

13+
compatConfig: Shopware.compatConfig,
14+
1315
inject: ['acl'],
1416

1517
emits: ['process-finish', 'modal-close'],
@@ -97,14 +99,29 @@ export default {
9799
}
98100

99101
if (field.required && !value && typeof value !== 'boolean') {
100-
this.$delete(this.config, [field.name]);
101-
this.$set(this.errors, field.name, new ShopwareError({
102-
code: 'c1051bb4-d103-4f74-8988-acbcafc7fdc3',
103-
}));
102+
if (this.isCompatEnabled('INSTANCE_DELETE')) {
103+
this.$delete(this.config, [field.name]);
104+
} else {
105+
delete this.config[field.name];
106+
}
107+
108+
if (this.isCompatEnabled('INSTANCE_SET')) {
109+
this.$set(this.errors, field.name, new ShopwareError({
110+
code: 'c1051bb4-d103-4f74-8988-acbcafc7fdc3',
111+
}));
112+
} else {
113+
this.errors[field.name] = new ShopwareError({
114+
code: 'c1051bb4-d103-4f74-8988-acbcafc7fdc3',
115+
});
116+
}
104117
return;
105118
}
106119

107-
this.$delete(this.errors, [field.name]);
120+
if (this.isCompatEnabled('INSTANCE_DELETE')) {
121+
this.$delete(this.errors, [field.name]);
122+
} else {
123+
delete this.errors[field.name];
124+
}
108125
},
109126

110127
onSave() {
@@ -138,7 +155,11 @@ export default {
138155
this.sequence.propsAppFlowAction?.config.forEach((config) => {
139156
this.config[config.name] = this.convertDefaultValue(config.type, config.defaultValue);
140157
this.fields.push(config);
141-
this.$delete(this.errors, config.name);
158+
if (this.isCompatEnabled('INSTANCE_DELETE')) {
159+
this.$delete(this.errors, config.name);
160+
} else {
161+
delete this.errors[config.name];
162+
}
142163
});
143164
},
144165

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-app-action-modal/sw-flow-app-action-modal.spec.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { mount } from '@vue/test-utils';
22

3+
/**
4+
* @package services-settings
5+
* @group disabledCompat
6+
*/
7+
38
const sequence = {
49
sequence: {
510
propsAppFlowAction: {
@@ -79,6 +84,13 @@ async function createWrapper() {
7984
'sw-entity-single-select': true,
8085
'sw-label': true,
8186
'sw-icon': true,
87+
'sw-highlight-text': true,
88+
'sw-select-result': true,
89+
'sw-select-result-list': true,
90+
'sw-loader': true,
91+
'sw-inheritance-switch': true,
92+
'sw-ai-copilot-badge': true,
93+
'sw-help-text': true,
8294
},
8395
provide: {
8496
validationService: {},
@@ -96,7 +108,7 @@ async function createWrapper() {
96108
});
97109
}
98110

99-
describe('module/sw-flow/component/sw-flow-tag-modal', () => {
111+
describe('module/sw-flow/component/sw-flow-app-action-modal', () => {
100112
it('should show these fields on modal', async () => {
101113
const wrapper = await createWrapper();
102114
await flushPromises();

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-change-customer-group-modal/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const { ShopwareError } = Shopware.Classes;
1212
export default {
1313
template,
1414

15+
compatConfig: Shopware.compatConfig,
16+
1517
inject: ['repositoryFactory'],
1618

1719
emits: ['modal-close', 'process-finish'],

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-change-customer-group-modal/sw-flow-change-customer-group-modal.spec.js

+10
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { mount } from '@vue/test-utils';
22
import flowState from 'src/module/sw-flow/state/flow.state';
33

4+
/**
5+
* @package services-settings
6+
* @group disabledCompat
7+
*/
8+
49
const customerGroupMock = [
510
{
611
translated: { name: 'Test net group' },
@@ -54,6 +59,11 @@ async function createWrapper() {
5459
'sw-popover': await wrapTestComponent('sw-popover'),
5560
'sw-popover-deprecated': await wrapTestComponent('sw-popover-deprecated', { sync: true }),
5661
'sw-loader': true,
62+
'router-link': true,
63+
'sw-inheritance-switch': true,
64+
'sw-ai-copilot-badge': true,
65+
'sw-help-text': true,
66+
'sw-icon-deprecated': true,
5767
},
5868
},
5969
});

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-change-customer-status-modal/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ const { mapState } = Component.getComponentHelper();
1010
export default {
1111
template,
1212

13+
compatConfig: Shopware.compatConfig,
14+
1315
inject: ['repositoryFactory'],
1416

1517
emits: ['modal-close', 'process-finish'],

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-change-customer-status-modal/sw-flow-change-customer-status-modal.spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { mount } from '@vue/test-utils';
22

3+
/**
4+
* @package services-settings
5+
* @group disabledCompat
6+
*/
7+
38
async function createWrapper() {
49
return mount(await wrapTestComponent('sw-flow-change-customer-status-modal', { sync: true }), {
510
global: {

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-create-mail-template-modal/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const utils = Shopware.Utils;
1313
export default {
1414
template,
1515

16+
compatConfig: Shopware.compatConfig,
17+
1618
inject: ['mailService', 'entityMappingService', 'repositoryFactory'],
1719

1820
emits: ['modal-close', 'process-finish'],

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-create-mail-template-modal/sw-flow-create-mail-template-modal.spec.js

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import { mount } from '@vue/test-utils';
22

3+
/**
4+
* @package services-settings
5+
* @group disabledCompat
6+
*/
7+
38
const fieldsClasses = [
49
'.sw-flow-create-mail-template-modal__type',
510
'.sw-flow-create-mail-template-modal__subject', // n
@@ -88,6 +93,13 @@ async function createWrapper(privileges = []) {
8893
template: '<div class="sw-popover"><slot></slot></div>',
8994
},
9095
'sw-loader': true,
96+
'sw-product-variant-info': true,
97+
'sw-field-copyable': true,
98+
'sw-textarea-field-deprecated': true,
99+
'sw-circle-icon': true,
100+
'sw-inheritance-switch': true,
101+
'sw-ai-copilot-badge': true,
102+
'sw-help-text': true,
91103
},
92104
provide: {
93105
repositoryFactory: {

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-event-change-confirm-modal/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ export default {
1414

1515
emits: ['modal-confirm', 'modal-close'],
1616

17+
compatConfig: Shopware.compatConfig,
18+
1719
computed: {
1820
...mapGetters('swFlowState', ['sequences']),
1921
},

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-event-change-confirm-modal/sw-flow-event-change-confirm-modal.spec.js

+5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import EntityCollection from 'src/core/data/entity-collection.data';
44

55
import { mount } from '@vue/test-utils';
66

7+
/**
8+
* @package services-settings
9+
* @group disabledCompat
10+
*/
11+
712
const fieldClasses = [
813
'.sw-flow-event-change-confirm-modal__title',
914
'.sw-flow-event-change-confirm-modal__text-confirmation',

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-generate-document-modal/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ const { ShopwareError } = Shopware.Classes;
1212
export default {
1313
template,
1414

15+
compatConfig: Shopware.compatConfig,
16+
1517
inject: [
1618
'repositoryFactory',
1719
],

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-generate-document-modal/sw-flow-generate-document-modal.spec.js

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { mount } from '@vue/test-utils';
22

33
import flowState from 'src/module/sw-flow/state/flow.state';
44

5+
/**
6+
* @package services-settings
7+
* @group disabledCompat
8+
*/
9+
510
const documentTypeMock = [
611
{
712
technicalName: 'invoice',
@@ -68,6 +73,10 @@ async function createWrapper() {
6873
'sw-label': true,
6974
'sw-icon': true,
7075
'sw-field-error': true,
76+
'sw-loader': true,
77+
'sw-inheritance-switch': true,
78+
'sw-ai-copilot-badge': true,
79+
'sw-help-text': true,
7180
},
7281
},
7382
props: {

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-grant-download-access-modal/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ const { mapState } = Component.getComponentHelper();
1111
export default {
1212
template,
1313

14+
compatConfig: Shopware.compatConfig,
15+
1416
emits: ['process-finish', 'modal-close'],
1517

1618
mixins: [

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-grant-download-access-modal/sw-flow-grant-download-access-modal.spec.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { mount } from '@vue/test-utils';
22
import flowState from 'src/module/sw-flow/state/flow.state';
33

4+
/**
5+
* @package services-settings
6+
* @group disabledCompat
7+
*/
8+
49
const { ShopwareError } = Shopware.Classes;
510

611
Shopware.State.registerModule('swFlowState', {
@@ -32,6 +37,12 @@ async function createWrapper(config = null) {
3237
stubs: {
3338
'sw-modal': await wrapTestComponent('sw-modal'),
3439
'sw-single-select': true,
40+
'sw-button': {
41+
emits: ['click'],
42+
template: '<button @click="$emit(\'click\')"><slot></slot></button>',
43+
},
44+
'sw-icon': true,
45+
'sw-loader': true,
3546
},
3647
provide: {
3748
shortcutService: {
@@ -96,7 +107,9 @@ describe('module/sw-flow/component/sw-flow-grant-download-access-modal', () => {
96107
const valueField = wrapper.find('.sw-flow-grant-download-access-modal__value-field');
97108
expect(valueField.attributes('error')).toBeUndefined();
98109

99-
await wrapper.find('.sw-flow-grant-download-access-modal__save-button').trigger('click');
110+
await wrapper.find('.sw-flow-grant-download-access-modal__save-button')
111+
.trigger('click');
112+
await flushPromises();
100113

101114
expect(valueField.attributes('error')).toBeUndefined();
102115
expect(wrapper.emitted('process-finish')).toBeTruthy();

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-leave-page-modal/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default {
88
template,
99

1010
emits: ['page-leave-confirm', 'page-leave-cancel'],
11+
12+
compatConfig: Shopware.compatConfig,
13+
1114
methods: {
1215
onConfirm() {
1316
this.$emit('page-leave-confirm');

src/Administration/Resources/app/administration/src/module/sw-flow/component/modals/sw-flow-mail-send-modal/index.js

+22-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const { mapState } = Component.getComponentHelper();
1313
export default {
1414
template,
1515

16+
compatConfig: Shopware.compatConfig,
17+
1618
inject: [
1719
'repositoryFactory',
1820
],
@@ -406,8 +408,13 @@ export default {
406408

407409
// Recheck error in current item
408410
if (!item.name && !item.email) {
409-
this.$set(this.recipients, index, { ...item, errorName: null });
410-
this.$set(this.recipients, index, { ...item, errorMail: null });
411+
if (this.isCompatEnabled('INSTANCE_SET')) {
412+
this.$set(this.recipients, index, { ...item, errorName: null });
413+
this.$set(this.recipients, index, { ...item, errorMail: null });
414+
} else {
415+
this.recipients[index] = { ...item, errorName: null };
416+
this.recipients[index] = { ...item, errorMail: null };
417+
}
411418
} else {
412419
this.validateRecipient(item, index);
413420
}
@@ -462,11 +469,19 @@ export default {
462469
const errorName = this.setNameError(item.name);
463470
const errorMail = this.setMailError(item.email);
464471

465-
this.$set(this.recipients, itemIndex, {
466-
...item,
467-
errorName,
468-
errorMail,
469-
});
472+
if (this.isCompatEnabled('INSTANCE_SET')) {
473+
this.$set(this.recipients, itemIndex, {
474+
...item,
475+
errorName,
476+
errorMail,
477+
});
478+
} else {
479+
this.recipients[itemIndex] = {
480+
...item,
481+
errorName,
482+
errorMail,
483+
};
484+
}
470485

471486
return errorName || errorMail;
472487
},

0 commit comments

Comments
 (0)