@vendure/admin-ui 1.0.2 → 1.0.3

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.
@@ -2,7 +2,7 @@ import { Component, ChangeDetectionStrategy, ChangeDetectorRef, EventEmitter, In
2
2
  import { FormGroup, FormControl, Validators, FormBuilder, FormArray } from '@angular/forms';
3
3
  import { DataService, I18nService, configurableDefinitionToInstance, GlobalFlag, configurableOperationValueIsValid, toConfigurableOperationInput, HistoryEntryType, SortOrder, ModalService, NotificationService, ServerConfigService, BaseDetailComponent, EditNoteDialogComponent, BaseListComponent, LocalStorageService, AdjustmentType, BaseEntityResolver, createResolveData, CanDeactivateDetailGuard, detailBreadcrumb, SharedModule } from '@vendure/admin-ui/core';
4
4
  import { marker } from '@biesbjerg/ngx-translate-extract-marker';
5
- import { isObject, summate, notNullOrUndefined, assertNever } from '@vendure/common/lib/shared-utils';
5
+ import { isObject, summate, assertNever, notNullOrUndefined } from '@vendure/common/lib/shared-utils';
6
6
  import { Router, ActivatedRoute, RouterModule } from '@angular/router';
7
7
  import { EMPTY, Subject, of, merge, BehaviorSubject } from 'rxjs';
8
8
  import { switchMap, catchError, retryWhen, delay, take, map, startWith, mapTo, takeUntil, shareReplay, distinctUntilChanged, filter, debounceTime, tap } from 'rxjs/operators';
@@ -1029,15 +1029,28 @@ class OrderDetailComponent extends BaseDetailComponent {
1029
1029
  }), switchMap(result => this.refetchOrder(result).pipe(mapTo(result))))
1030
1030
  .subscribe(result => {
1031
1031
  if (result) {
1032
- switch (result.addFulfillmentToOrder.__typename) {
1032
+ const { addFulfillmentToOrder } = result;
1033
+ switch (addFulfillmentToOrder.__typename) {
1033
1034
  case 'Fulfillment':
1034
1035
  this.notificationService.success(marker('order.create-fulfillment-success'));
1035
1036
  break;
1036
1037
  case 'EmptyOrderLineSelectionError':
1037
1038
  case 'InsufficientStockOnHandError':
1038
1039
  case 'ItemsAlreadyFulfilledError':
1039
- this.notificationService.error(result.addFulfillmentToOrder.message);
1040
+ case 'InvalidFulfillmentHandlerError':
1041
+ this.notificationService.error(addFulfillmentToOrder.message);
1040
1042
  break;
1043
+ case 'FulfillmentStateTransitionError':
1044
+ this.notificationService.error(addFulfillmentToOrder.transitionError);
1045
+ break;
1046
+ case 'CreateFulfillmentError':
1047
+ this.notificationService.error(addFulfillmentToOrder.fulfillmentHandlerError);
1048
+ break;
1049
+ case undefined:
1050
+ this.notificationService.error(JSON.stringify(addFulfillmentToOrder));
1051
+ break;
1052
+ default:
1053
+ assertNever(addFulfillmentToOrder);
1041
1054
  }
1042
1055
  }
1043
1056
  });