View | Details | Raw Unified | Return to bug 38010
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorDetails.vue (-1 / +5 lines)
Lines 195-205 export default { Link Here
195
            if (!this.vendor.aliases) {
195
            if (!this.vendor.aliases) {
196
                this.vendor.aliases = [];
196
                this.vendor.aliases = [];
197
            }
197
            }
198
            if (!this.newAlias) return;
198
            this.vendor.aliases.push({ alias: this.newAlias });
199
            this.vendor.aliases.push({ alias: this.newAlias });
199
            this.newAlias = "";
200
            this.newAlias = "";
200
        },
201
        },
201
        removeAlias(e) {
202
        removeAlias(e) {
202
            this.vendor.aliases.splice(this.vendor.aliases.indexOf(e.alias), 1);
203
            const aliasIndex = this.vendor.aliases
204
                .map(e => e.alias)
205
                .indexOf(e.alias);
206
            this.vendor.aliases.splice(aliasIndex, 1);
203
        },
207
        },
204
    },
208
    },
205
    components: {
209
    components: {
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorFormAdd.vue (-6 / +21 lines)
Lines 114-126 export default { Link Here
114
            delete vendor.physical;
114
            delete vendor.physical;
115
            delete vendor.subscriptions_count;
115
            delete vendor.subscriptions_count;
116
116
117
            vendor.contacts = vendor.contacts.map(
117
            vendor.contacts = this.checkContactOrInterface(
118
                ({ id, booksellerid, ...requiredProperties }) =>
118
                vendor.contacts.map(
119
                    requiredProperties
119
                    ({ id, booksellerid, ...requiredProperties }) =>
120
                        requiredProperties
121
                )
120
            );
122
            );
121
            vendor.interfaces = vendor.interfaces.map(
123
            vendor.interfaces = this.checkContactOrInterface(
122
                ({ interface_id, vendor_id, ...requiredProperties }) =>
124
                vendor.interfaces.map(
123
                    requiredProperties
125
                    ({ interface_id, vendor_id, ...requiredProperties }) =>
126
                        requiredProperties
127
                )
124
            );
128
            );
125
129
126
            const client = APIClient.acquisition;
130
            const client = APIClient.acquisition;
Lines 142-147 export default { Link Here
142
                );
146
                );
143
            }
147
            }
144
        },
148
        },
149
        checkContactOrInterface(array) {
150
            return array.reduce((acc, curr) => {
151
                const atLeastOneFieldFilled = Object.keys(curr).some(
152
                    key => curr[key]
153
                );
154
                if (atLeastOneFieldFilled) {
155
                    acc.push(curr);
156
                }
157
                return acc;
158
            }, []);
159
        },
145
    },
160
    },
146
    components: {
161
    components: {
147
        ButtonSubmit,
162
        ButtonSubmit,
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorInterfaces.vue (-4 / +4 lines)
Lines 58-67 Link Here
58
        >
58
        >
59
            <legend>
59
            <legend>
60
                {{ $__("Interface details") }}
60
                {{ $__("Interface details") }}
61
                <a href="#" @click.prevent="deleteInterface(i)"
62
                    ><i class="fa fa-trash"></i>
63
                    {{ $__("Remove this interface") }}</a
64
                >
65
            </legend>
61
            </legend>
66
            <ol>
62
            <ol>
67
                <li>
63
                <li>
Lines 131-136 Link Here
131
                    />
127
                    />
132
                </li>
128
                </li>
133
            </ol>
129
            </ol>
130
            <span class="btn btn-default" @click.prevent="deleteContact(i)"
131
                ><font-awesome-icon icon="trash" />
132
                {{ $__("Delete interface") }}</span
133
            >
134
        </fieldset>
134
        </fieldset>
135
        <span class="btn btn-default" @click="addInterface"
135
        <span class="btn btn-default" @click="addInterface"
136
            ><font-awesome-icon icon="plus" />
136
            ><font-awesome-icon icon="plus" />
(-)a/koha-tmpl/intranet-tmpl/prog/js/vue/components/Vendors/VendorOrderingInformation.vue (-3 / +4 lines)
Lines 186-192 Link Here
186
            <li>
186
            <li>
187
                <label for="discount">{{ $__("Discount") }}: </label>
187
                <label for="discount">{{ $__("Discount") }}: </label>
188
                <input
188
                <input
189
                    type="number"
189
                    type="text"
190
                    inputmode="numeric"
190
                    size="6"
191
                    size="6"
191
                    id="discount"
192
                    id="discount"
192
                    name="discount"
193
                    name="discount"
Lines 197-203 Link Here
197
            <li>
198
            <li>
198
                <label for="deliverytime">{{ $__("Delivery time") }}: </label>
199
                <label for="deliverytime">{{ $__("Delivery time") }}: </label>
199
                <input
200
                <input
200
                    type="number"
201
                    type="text"
202
                    inputmode="numeric"
201
                    size="6"
203
                    size="6"
202
                    id="deliverytime"
204
                    id="deliverytime"
203
                    name="deliverytime"
205
                    name="deliverytime"
204
- 

Return to bug 38010