@colijnit/transaction 12.1.43 → 12.1.45

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.
@@ -65,7 +65,7 @@ import { ResolveHeaderPendingReasonRequest } from '@colijnit/transactionapi/buil
65
65
  import { DocDeliveryBatch } from '@colijnit/transactionapi/build/model/doc-delivery-batch.bo';
66
66
  import { NULL_CUSTOMER_FULL_OBJECT, NULL_RELATION_OBJECT } from '@colijnit/transactionapi/build/model/nul-relation-object';
67
67
  import { RelationKind } from '@colijnit/transactionapi/build/enum/relation-kind.enum';
68
- import { FormMasterService, CoDialogModule, ButtonModule, CollapsibleModule, InputCheckboxModule, InputTextModule, InputComboBoxModule, FormModule, InputRadioButtonModule, IconModule, InputListboxModule, DropDownModule, ClickoutsideModule, InputTextComponent, InputSearchModule, InputDatePickerComponent, InputDatePickerModule, InputNumberPickerModule, PriceDisplayPipeModule, Carousel3dModule, InputTextareaComponent, InputTextareaModule, CoDialogPromptModule, MultiSelectListModule, PopupModule, CoSidebarModule, CoGridModule, CoRichTextEditorModule, CarouselModule, ColumnAlign, SimpleGridColumnDirective, SimpleGridModule, GridToolbarButtonModule, InputDateRangePickerModule, CoOrientation, CoDirection, FilterItemModule, PaginationModule, PaginationBarModule, IconCollapseHandleModule } from '@colijnit/corecomponents_v12';
68
+ import { FormMasterService, CoDialogModule, ButtonModule, CollapsibleModule, InputCheckboxModule, InputTextModule, InputComboBoxModule, FormModule, InputRadioButtonModule, IconModule, InputListboxModule, DropDownModule, ClickoutsideModule, InputTextComponent, InputSearchModule, InputDatePickerComponent, InputDatePickerModule, InputNumberPickerModule, PriceDisplayPipeModule, Carousel3dModule, InputTextareaComponent, InputTextareaModule, CoDialogPromptModule, MultiSelectListModule, PopupModule, CoSidebarModule, CoGridModule, CoRichTextEditorModule, CarouselModule, ColumnAlign, SimpleGridColumnDirective, SimpleGridModule, GridToolbarButtonModule, CoOrientation, CoDirection, InputDateRangePickerModule, FilterItemModule, PaginationModule, PaginationBarModule, IconCollapseHandleModule } from '@colijnit/corecomponents_v12';
69
69
  import { FlexModule } from '@angular/flex-layout';
70
70
  import { AddressType } from '@colijnit/transactionapi/build/enum/address-type.enum';
71
71
  import { trigger, state, style, transition, animate } from '@angular/animations';
@@ -5015,10 +5015,9 @@ class PendingReasonService {
5015
5015
  switch (operationStatus.pendingReasonType) {
5016
5016
  case PendingReasonType.ABORTED:
5017
5017
  case PendingReasonType.CANCELLED:
5018
- if (operationStatus.pendingReason === 'USER_DECISION') {
5019
- yield this._cancelArticle(operationStatus.uuid);
5020
- }
5021
- else {
5018
+ if (operationStatus.pendingReason !== 'USER_DECISION') {
5019
+ // await this._cancelArticle(operationStatus.uuid);
5020
+ // } else {
5022
5021
  this._showReasonDialog(operationStatus.pendingReason);
5023
5022
  }
5024
5023
  return false;
@@ -5493,7 +5492,10 @@ class TransactionService extends PendingReasonService {
5493
5492
  else {
5494
5493
  this.relation = yield this.connector.updateCustomer(this.relation);
5495
5494
  }
5496
- return yield this.addRelationToTransaction(this.relation.relationId);
5495
+ if (!this.currentTransaction.transactionInfo.relation) {
5496
+ return yield this.addRelationToTransaction(this.relation.relationId);
5497
+ }
5498
+ return true;
5497
5499
  });
5498
5500
  }
5499
5501
  getSequenceValue() {
@@ -15639,11 +15641,149 @@ var SearchViewMode;
15639
15641
  SearchViewMode[SearchViewMode["SideBar"] = 1] = "SideBar";
15640
15642
  })(SearchViewMode || (SearchViewMode = {}));
15641
15643
 
15644
+ var SearchBarViewMode;
15645
+ (function (SearchBarViewMode) {
15646
+ SearchBarViewMode[SearchBarViewMode["Expanded"] = 0] = "Expanded";
15647
+ SearchBarViewMode[SearchBarViewMode["Collapsed"] = 1] = "Collapsed";
15648
+ })(SearchBarViewMode || (SearchBarViewMode = {}));
15649
+ class TransactionSearchComponent {
15650
+ constructor(transactionSearchService) {
15651
+ this.transactionSearchService = transactionSearchService;
15652
+ this.searchViewModes = SearchViewMode;
15653
+ this.orientations = CoOrientation;
15654
+ this.directionRight = CoDirection.Right;
15655
+ this.transactionClick = new EventEmitter();
15656
+ this.searchViewModeChange = new EventEmitter();
15657
+ }
15658
+ set transactionType(value) {
15659
+ this._transactionType = value;
15660
+ this.transactionSearchService.transactionType = this._transactionType;
15661
+ }
15662
+ get transactionType() {
15663
+ return this._transactionType;
15664
+ }
15665
+ showClass() {
15666
+ return true;
15667
+ }
15668
+ onTransactionClick(transaction) {
15669
+ if (this.transactionSearchService.activeSearchViewMode === this.searchViewModes.FullScreen) {
15670
+ this.collapseSearchBar();
15671
+ }
15672
+ this._scrollToTop();
15673
+ this.transactionClick.emit(transaction);
15674
+ }
15675
+ onSearchViewResizeClick() {
15676
+ if (this.transactionSearchService.activeSearchViewMode === this.searchViewModes.SideBar) {
15677
+ this.transactionSearchService.activeSearchViewMode = this.searchViewModes.FullScreen;
15678
+ }
15679
+ else {
15680
+ this.transactionSearchService.activeSearchViewMode = this.searchViewModes.SideBar;
15681
+ }
15682
+ this.searchViewModeChange.emit(this.transactionSearchService.activeSearchViewMode);
15683
+ }
15684
+ onSideCollapseHandleClick() {
15685
+ this.toggleSearchBar();
15686
+ }
15687
+ toggleSearchBar() {
15688
+ if (this.transactionSearchService.collapsed || this.transactionSearchService.fullscreen) {
15689
+ this.expandSearchBar();
15690
+ }
15691
+ else {
15692
+ this.collapseSearchBar();
15693
+ }
15694
+ }
15695
+ collapseSearchBar() {
15696
+ this.transactionSearchService.activeSearchViewMode = this.searchViewModes.SideBar;
15697
+ this.transactionSearchService.activeSearchBarViewMode = SearchBarViewMode.Collapsed;
15698
+ this.searchViewModeChange.emit(this.searchViewModes.SideBar);
15699
+ }
15700
+ expandSearchBar() {
15701
+ this.transactionSearchService.activeSearchViewMode = this.searchViewModes.SideBar;
15702
+ this.transactionSearchService.activeSearchBarViewMode = SearchBarViewMode.Expanded;
15703
+ this.searchViewModeChange.emit(this.searchViewModes.SideBar);
15704
+ }
15705
+ calculateClasses() {
15706
+ return {
15707
+ 'fullscreen': this.transactionSearchService.fullscreen,
15708
+ 'sidebar': !this.transactionSearchService.fullscreen,
15709
+ 'collapsed': this.transactionSearchService.collapsed,
15710
+ 'expanded': !this.transactionSearchService.collapsed,
15711
+ };
15712
+ }
15713
+ _scrollToTop() {
15714
+ window.scrollTo({ top: 0, behavior: 'smooth' });
15715
+ }
15716
+ }
15717
+ TransactionSearchComponent.decorators = [
15718
+ { type: Component, args: [{
15719
+ selector: 'co-transaction-search',
15720
+ template: `
15721
+ <div class="transaction-search-main-wrapper">
15722
+ <div class="transaction-search-wrapper"
15723
+ [ngClass]="calculateClasses()">
15724
+ <div class="transaction-filter-wrapper narrow-scrollbar"
15725
+ [ngClass]="calculateClasses()"
15726
+ *ngIf="transactionSearchService.showFilterSidebar" @showHideFilterSidebar>
15727
+ <co-transaction-filter
15728
+ [transactionType]="transactionType"
15729
+ [activeSearchViewMode]="transactionSearchService.activeSearchViewMode"
15730
+ (closeButtonClick)="transactionSearchService.handleHideFilter()"
15731
+ (resetFilterClick)="transactionSearchService.handleResetFilter()"></co-transaction-filter>
15732
+ </div>
15733
+ <div class="transaction-search-result-wrapper"
15734
+ [class.fullscreen]="transactionSearchService.fullscreen"
15735
+ [class.sidebar]="!transactionSearchService.fullscreen"
15736
+ [class.collapsed]="transactionSearchService.collapsed"
15737
+ [class.expanded]="!transactionSearchService.collapsed"
15738
+ >
15739
+ <co-transaction-search-result
15740
+ [transactionType]="transactionType"
15741
+ [activeSearchViewMode]="transactionSearchService.activeSearchViewMode"
15742
+ (filterClick)="transactionSearchService.toggleFilter()"
15743
+ (transactionClick)="onTransactionClick($event)"
15744
+ (resizeClick)="onSearchViewResizeClick()"
15745
+ (closeClick)="collapseSearchBar()"
15746
+ ></co-transaction-search-result>
15747
+ </div>
15748
+ </div>
15749
+ <div class="transaction-search-content-wrapper"
15750
+ [class.fullscreen]="transactionSearchService.fullscreen"
15751
+ [class.sidebar]="!transactionSearchService.fullscreen"
15752
+ [class.collapsed]="transactionSearchService.collapsed"
15753
+ [class.expanded]="!transactionSearchService.collapsed"
15754
+ >
15755
+ <ng-content></ng-content>
15756
+ </div>
15757
+ </div>
15758
+ `,
15759
+ animations: [
15760
+ trigger("showHideFilterSidebar", [
15761
+ state("void", style({ transform: 'translateX(-100%)' })),
15762
+ state("*", style({ transform: 'translateX(0)' })),
15763
+ transition("void <=> *", animate("200ms ease-in-out"))
15764
+ ])
15765
+ ],
15766
+ encapsulation: ViewEncapsulation.None
15767
+ },] }
15768
+ ];
15769
+ TransactionSearchComponent.ctorParameters = () => [
15770
+ { type: TransactionSearchService }
15771
+ ];
15772
+ TransactionSearchComponent.propDecorators = {
15773
+ transactionType: [{ type: Input }],
15774
+ transactionClick: [{ type: Output }],
15775
+ searchViewModeChange: [{ type: Output }],
15776
+ showClass: [{ type: HostBinding, args: ["class.co-transaction-search",] }]
15777
+ };
15778
+
15642
15779
  class TransactionSearchService {
15643
15780
  constructor(_transactionService) {
15644
15781
  this._transactionService = _transactionService;
15645
15782
  this.searchRequest = new TransactionSearchViewRequest();
15646
15783
  this.previousSearchRequest = new TransactionSearchViewRequest();
15784
+ this.activeSearchViewMode = SearchViewMode.FullScreen;
15785
+ this.activeSearchBarViewMode = SearchBarViewMode.Expanded;
15786
+ this.showFilterSidebar = false;
15647
15787
  this.transactions = [];
15648
15788
  this.labelBasedOnTransactionType = new Map([
15649
15789
  [TransactionKind.SalesOrder, "SALESORDERS"],
@@ -15703,6 +15843,25 @@ class TransactionSearchService {
15703
15843
  isNewGeneralSearch() {
15704
15844
  return this.previousSearchRequest && this.previousSearchRequest.general !== this.searchRequest.general;
15705
15845
  }
15846
+ get fullscreen() {
15847
+ return this.activeSearchViewMode === SearchViewMode.FullScreen;
15848
+ }
15849
+ get collapsed() {
15850
+ return this.activeSearchBarViewMode === SearchBarViewMode.Collapsed;
15851
+ }
15852
+ toggleFilter() {
15853
+ this.showFilterSidebar = !this.showFilterSidebar;
15854
+ }
15855
+ handleHideFilter() {
15856
+ this.showFilterSidebar = false;
15857
+ }
15858
+ handleResetFilter() {
15859
+ this.resetFilters();
15860
+ this.showFilterSidebar = false;
15861
+ setTimeout(() => {
15862
+ this.showFilterSidebar = true;
15863
+ }, 10);
15864
+ }
15706
15865
  }
15707
15866
  TransactionSearchService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TransactionSearchService_Factory() { return new TransactionSearchService(i0.ɵɵinject(TransactionService)); }, token: TransactionSearchService, providedIn: "root" });
15708
15867
  TransactionSearchService.decorators = [
@@ -18034,163 +18193,6 @@ ShoppingCartModule.decorators = [
18034
18193
  },] }
18035
18194
  ];
18036
18195
 
18037
- var SearchBarViewMode;
18038
- (function (SearchBarViewMode) {
18039
- SearchBarViewMode[SearchBarViewMode["Expanded"] = 0] = "Expanded";
18040
- SearchBarViewMode[SearchBarViewMode["Collapsed"] = 1] = "Collapsed";
18041
- })(SearchBarViewMode || (SearchBarViewMode = {}));
18042
- class TransactionSearchComponent {
18043
- constructor(_transactionSearchService) {
18044
- this._transactionSearchService = _transactionSearchService;
18045
- this.searchViewModes = SearchViewMode;
18046
- this.orientations = CoOrientation;
18047
- this.directionRight = CoDirection.Right;
18048
- this.activeSearchViewMode = SearchViewMode.FullScreen;
18049
- this.activeSearchBarViewMode = SearchBarViewMode.Expanded;
18050
- this.showFilterSidebar = false;
18051
- this.transactionClick = new EventEmitter();
18052
- this.searchViewModeChange = new EventEmitter();
18053
- }
18054
- set transactionType(value) {
18055
- this._transactionType = value;
18056
- this._transactionSearchService.transactionType = this._transactionType;
18057
- }
18058
- get transactionType() {
18059
- return this._transactionType;
18060
- }
18061
- showClass() {
18062
- return true;
18063
- }
18064
- get fullscreen() {
18065
- return this.activeSearchViewMode === SearchViewMode.FullScreen;
18066
- }
18067
- get collapsed() {
18068
- return this.activeSearchBarViewMode === SearchBarViewMode.Collapsed;
18069
- }
18070
- toggleFilter() {
18071
- this.showFilterSidebar = !this.showFilterSidebar;
18072
- }
18073
- handleHideFilter() {
18074
- this.showFilterSidebar = false;
18075
- }
18076
- handleResetFilter() {
18077
- this._transactionSearchService.resetFilters();
18078
- this.showFilterSidebar = false;
18079
- setTimeout(() => {
18080
- this.showFilterSidebar = true;
18081
- }, 10);
18082
- }
18083
- onTransactionClick(transaction) {
18084
- if (this.activeSearchViewMode === this.searchViewModes.FullScreen) {
18085
- this.collapseSearchBar();
18086
- }
18087
- this._scrollToTop();
18088
- this.transactionClick.emit(transaction);
18089
- }
18090
- onSearchViewResizeClick() {
18091
- if (this.activeSearchViewMode === this.searchViewModes.SideBar) {
18092
- this.activeSearchViewMode = this.searchViewModes.FullScreen;
18093
- }
18094
- else {
18095
- this.activeSearchViewMode = this.searchViewModes.SideBar;
18096
- }
18097
- this.searchViewModeChange.emit(this.activeSearchViewMode);
18098
- }
18099
- onSideCollapseHandleClick() {
18100
- this.toggleSearchBar();
18101
- }
18102
- toggleSearchBar() {
18103
- if (this.collapsed || this.fullscreen) {
18104
- this.expandSearchBar();
18105
- }
18106
- else {
18107
- this.collapseSearchBar();
18108
- }
18109
- }
18110
- collapseSearchBar() {
18111
- this.activeSearchViewMode = this.searchViewModes.SideBar;
18112
- this.activeSearchBarViewMode = SearchBarViewMode.Collapsed;
18113
- this.searchViewModeChange.emit(this.activeSearchViewMode);
18114
- }
18115
- expandSearchBar() {
18116
- this.activeSearchViewMode = this.searchViewModes.SideBar;
18117
- this.activeSearchBarViewMode = SearchBarViewMode.Expanded;
18118
- this.searchViewModeChange.emit(this.activeSearchViewMode);
18119
- }
18120
- calculateClasses() {
18121
- return {
18122
- 'fullscreen': this.fullscreen,
18123
- 'sidebar': !this.fullscreen,
18124
- 'collapsed': this.collapsed,
18125
- 'expanded': !this.collapsed,
18126
- };
18127
- }
18128
- _scrollToTop() {
18129
- window.scrollTo({ top: 0, behavior: 'smooth' });
18130
- }
18131
- }
18132
- TransactionSearchComponent.decorators = [
18133
- { type: Component, args: [{
18134
- selector: 'co-transaction-search',
18135
- template: `
18136
- <div class="transaction-search-main-wrapper">
18137
- <div class="transaction-search-wrapper"
18138
- [ngClass]="calculateClasses()">
18139
- <div class="transaction-filter-wrapper narrow-scrollbar"
18140
- [ngClass]="calculateClasses()"
18141
- *ngIf="showFilterSidebar" @showHideFilterSidebar>
18142
- <co-transaction-filter
18143
- [transactionType]="transactionType"
18144
- [activeSearchViewMode]="activeSearchViewMode"
18145
- (closeButtonClick)="handleHideFilter()"
18146
- (resetFilterClick)="handleResetFilter()"></co-transaction-filter>
18147
- </div>
18148
- <div class="transaction-search-result-wrapper"
18149
- [class.fullscreen]="fullscreen"
18150
- [class.sidebar]="!fullscreen"
18151
- [class.collapsed]="collapsed"
18152
- [class.expanded]="!collapsed"
18153
- >
18154
- <co-transaction-search-result
18155
- [transactionType]="transactionType"
18156
- [activeSearchViewMode]="activeSearchViewMode"
18157
- (filterClick)="toggleFilter()"
18158
- (transactionClick)="onTransactionClick($event)"
18159
- (resizeClick)="onSearchViewResizeClick()"
18160
- (closeClick)="collapseSearchBar()"
18161
- ></co-transaction-search-result>
18162
- </div>
18163
- </div>
18164
- <div class="transaction-search-content-wrapper"
18165
- [class.fullscreen]="fullscreen"
18166
- [class.sidebar]="!fullscreen"
18167
- [class.collapsed]="collapsed"
18168
- [class.expanded]="!collapsed"
18169
- >
18170
- <ng-content></ng-content>
18171
- </div>
18172
- </div>
18173
- `,
18174
- animations: [
18175
- trigger("showHideFilterSidebar", [
18176
- state("void", style({ transform: 'translateX(-100%)' })),
18177
- state("*", style({ transform: 'translateX(0)' })),
18178
- transition("void <=> *", animate("200ms ease-in-out"))
18179
- ])
18180
- ],
18181
- encapsulation: ViewEncapsulation.None
18182
- },] }
18183
- ];
18184
- TransactionSearchComponent.ctorParameters = () => [
18185
- { type: TransactionSearchService }
18186
- ];
18187
- TransactionSearchComponent.propDecorators = {
18188
- transactionType: [{ type: Input }],
18189
- transactionClick: [{ type: Output }],
18190
- searchViewModeChange: [{ type: Output }],
18191
- showClass: [{ type: HostBinding, args: ["class.co-transaction-search",] }]
18192
- };
18193
-
18194
18196
  class TransactionFilterComponent {
18195
18197
  constructor(_mappingService, _compFactoryResolver, appRef, injector, searchService) {
18196
18198
  this._mappingService = _mappingService;