@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 +4 -0
- package/dist/ui/providers.ts +20 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/ui/providers.ts
CHANGED
|
@@ -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: (
|
|
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`
|