Skip to content

Commit 2ce86e2

Browse files
committed
fix: refund modal
1 parent fa8bdb0 commit 2ce86e2

File tree

7 files changed

+106
-71
lines changed

7 files changed

+106
-71
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 9.7.4
2+
- Fixes an issue, where input fields of the refund modal could be missing
3+
14
# 9.7.3
25
- Fixes an issue, where card fields were not displayed in the after order payment process (shopware/shopware#7643)
36

CHANGELOG_de-DE.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 9.7.4
2+
- Behebt ein Problem, bei dem die Eingabefelder des Modals für Rückerstattungen fehlen konnten
3+
14
# 9.7.3
25
- Behebt ein Problem, bei dem Kartenfelder im Zahlungsprozess nach einer Bestellung nicht angezeigt wurden (shopware/shopware#7643)
36

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "swag/paypal",
33
"description": "PayPal integration for Shopware 6",
4-
"version": "9.7.3",
4+
"version": "9.7.4",
55
"type": "shopware-platform-plugin",
66
"license": "MIT",
77
"authors": [

src/Resources/app/administration/src/module/swag-paypal-payment/component/swag-paypal-text-field/index.js

+44-6
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,51 @@ import template from './swag-paypal-text-field.html.twig';
33
const { Component } = Shopware;
44

55
/**
6-
* @protected
6+
* @deprecated tag:v10.0.0 - Will be removed, use `max-length` of mt-text-field
7+
*
78
* @description Simple text field. But this one allows attribute downpassing to the input field instead of the block.
8-
* @status ready
9-
* @example-type dynamic
10-
* @component-example
11-
* <swag-paypal-text-field label="Name" placeholder="placeholder goes here..."></swag-paypal-text-field>
129
*/
13-
Component.extend('swag-paypal-text-field', 'sw-text-field', {
10+
Component.register('swag-paypal-text-field', {
1411
template,
12+
13+
emits: ['update:value'],
14+
15+
props: {
16+
value: {
17+
type: String,
18+
required: false,
19+
default: null,
20+
},
21+
maxLength: {
22+
type: [String, Number],
23+
required: false,
24+
default: null,
25+
},
26+
},
27+
28+
computed: {
29+
allowedLength() {
30+
return this.maxLength ? Number(this.maxLength) : null;
31+
},
32+
33+
currentLength() {
34+
return this.maxLength ? (this.value ?? '').length : null;
35+
},
36+
37+
hintText() {
38+
return this.allowedLength
39+
? `${this.currentLength}/${this.allowedLength}`
40+
: null;
41+
},
42+
},
43+
44+
methods: {
45+
updateValue(value) {
46+
if (this.allowedLength && (value ?? '').length > this.allowedLength) {
47+
value = (value ?? '').substring(0, this.allowedLength);
48+
}
49+
50+
this.$emit('update:value', value);
51+
},
52+
},
1553
});
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,9 @@
11
{% block sw_text_field %}
2-
<sw-contextual-field
2+
<sw-text-field
3+
ref="field"
34
v-bind="$attrs"
4-
class="sw-field--text"
5-
:name="formFieldName"
6-
@inheritance-restore="$emit('inheritance-restore', $event)"
7-
@inheritance-remove="$emit('inheritance-remove', $event)"
8-
>
9-
10-
<template v-if="hasPrefix" #sw-contextual-field-prefix="{ disabled, identification }">
11-
<slot name="prefix" v-bind="{disabled, identification}" />
12-
</template>
13-
14-
<template #sw-field-input="{ identification, error, disabled, size, setFocusClass, removeFocusClass, hasSuffix, hasPrefix }">
15-
<input
16-
v-bind="$attrs"
17-
:id="identification"
18-
type="text"
19-
:name="identification"
20-
:disabled="disabled"
21-
:value="currentValue"
22-
:placeHolder="placeholder"
23-
v-on="additionalListeners"
24-
@input="onInput"
25-
@change="onChange"
26-
@focus="setFocusClass"
27-
@blur="removeFocusClass"
28-
>
29-
</template>
30-
31-
<template v-if="copyable || hasSuffix" #sw-contextual-field-suffix="{disabled, identification}">
32-
<slot name="suffix" v-bind="{ identification }" />
33-
<sw-field-copyable
34-
v-if="copyable"
35-
:displayName="identification"
36-
:copyableText="currentValue"
37-
:tooltip="copyableTooltip"
38-
/>
39-
</template>
40-
</sw-contextual-field>
5+
:value="value"
6+
:hint="hintText"
7+
@update:value="updateValue"
8+
/>
419
{% endblock %}

src/Resources/app/administration/src/module/swag-paypal-payment/component/swag-paypal-textarea-field/index.js

+44-6
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,51 @@ import template from './swag-paypal-textarea-field.html.twig';
33
const { Component } = Shopware;
44

55
/**
6-
* @protected
6+
* @deprecated tag:v10.0.0 - Will be removed, use `max-length` of mt-textarea
7+
*
78
* @description textarea input field. But this one allows attribute downpassing to the input field instead of the block.
8-
* @status ready
9-
* @example-type static
10-
* @component-example
11-
* <swag-paypal-textarea-field label="Name" placeholder="placeholder goes here..."></swag-paypal-textarea-field>
129
*/
13-
Component.extend('swag-paypal-textarea-field', 'sw-textarea-field', {
10+
Component.register('swag-paypal-textarea-field', {
1411
template,
12+
13+
emits: ['update:value'],
14+
15+
props: {
16+
value: {
17+
type: String,
18+
required: false,
19+
default: null,
20+
},
21+
maxLength: {
22+
type: [String, Number],
23+
required: false,
24+
default: null,
25+
},
26+
},
27+
28+
computed: {
29+
allowedLength() {
30+
return this.maxLength ? Number(this.maxLength) : null;
31+
},
32+
33+
currentLength() {
34+
return this.maxLength ? (this.value ?? '').length : null;
35+
},
36+
37+
hintText() {
38+
return this.allowedLength
39+
? `${this.currentLength}/${this.allowedLength}`
40+
: null;
41+
},
42+
},
43+
44+
methods: {
45+
updateValue(value) {
46+
if (this.allowedLength && (value ?? '').length > this.allowedLength) {
47+
value = (value ?? '').substring(0, this.allowedLength);
48+
}
49+
50+
this.$emit('update:value', value);
51+
},
52+
},
1553
});
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
11
{% block sw_block_field %}
2-
<sw-block-field
2+
<sw-textarea-field
33
v-bind="$attrs"
4-
class="sw-field--textarea"
5-
:name="formFieldName"
6-
>
7-
8-
<template #sw-field-input="{identification, helpText, error, disabled, setFocusClass, removeFocusClass }">
9-
<textarea
10-
v-bind="$attrs"
11-
:id="identification"
12-
:name="identification"
13-
:placeholder="placeholder"
14-
:disabled="disabled"
15-
:value="currentValue"
16-
@change="onChange"
17-
@input="onInput"
18-
@focus="setFocusClass"
19-
@blur="removeFocusClass"
20-
/>
21-
</template>
22-
</sw-block-field>
4+
:value="value"
5+
:hint="hintText"
6+
@update:value="updateValue"
7+
/>
238
{% endblock %}

0 commit comments

Comments
 (0)