@pinelab/vendure-plugin-qls-fulfillment 2.2.1 → 2.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.3.0 (2026-08-05)
2
+
3
+ - Extra prompt before adding an additional EAN
4
+
1
5
  # 2.2.1 (2026-07-15)
2
6
 
3
7
  - Emit `StockMovementEvent` with corresponding `StockAdjustment` whenever a QLS webhook updates stock of a variant.
@@ -4,7 +4,7 @@ import {
4
4
  ModalService,
5
5
  } from '@vendure/admin-ui/core';
6
6
  import { firstValueFrom, of } from 'rxjs';
7
- import { map, catchError } from 'rxjs/operators';
7
+ import { map, catchError, take } from 'rxjs/operators';
8
8
  import gql from 'graphql-tag';
9
9
 
10
10
  export default [
@@ -188,12 +188,30 @@ export default [
188
188
  locationId: 'product-variant-detail',
189
189
  icon: 'resistor',
190
190
  requiresPermission: ['QLSFullSync'],
191
- onClick: (_, { route, dataService, notificationService }) => {
191
+ onClick: async (
192
+ _,
193
+ { route, dataService, notificationService, entity$ }
194
+ ) => {
192
195
  const ean = window.prompt('Enter additional EAN to add to QLS:');
193
196
  if (!ean) {
194
197
  return;
195
198
  }
196
199
  const variantId = route.snapshot.params.id;
200
+ try {
201
+ const variant = await firstValueFrom(entity$.pipe(take(1)));
202
+ const confirmed = window.confirm(
203
+ `Wil je EAN "${ean}" toevoegen aan "${variant?.name}"?`
204
+ );
205
+ if (!confirmed) {
206
+ return;
207
+ }
208
+ } catch (err) {
209
+ notificationService.notify({
210
+ message: (err as any).message,
211
+ type: 'error',
212
+ });
213
+ return;
214
+ }
197
215
  dataService
198
216
  .mutate(
199
217
  gql`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pinelab/vendure-plugin-qls-fulfillment",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Vendure plugin to fulfill orders via QLS.",
5
5
  "keywords": [
6
6
  "fulfillment",