Fix Build Error

This commit is contained in:
Sebastian
2020-08-31 11:31:47 +02:00
parent 891d2723c8
commit d9c25dacf3
7 changed files with 14 additions and 20 deletions

View File

@@ -8,11 +8,9 @@ import {
} from '@angular/core';
import { FormGroup } from '@angular/forms';
import { VATDTO } from '@swagger/oms';
import {
VatTypeToDisplayNamePipe,
VatDtoToVatValuePipe,
VatDtoToVatTypePipe,
} from '../../pipes';
import { VatTypeToDisplayNamePipe } from '../../pipes/vat-type-to-display-name.pipe';
import { VatDtoToVatValuePipe } from '../../pipes/vat-dto-to-vat-value.pipe';
import { VatDtoToVatTypePipe } from '../../pipes/vat-dto-to-vat-type.pipe';
@Component({
selector: 'app-shelf-edit-order-item',
@@ -35,7 +33,7 @@ export class ShelfEditOrderItemComponent implements OnInit, OnChanges {
ngOnChanges({ vatOptions }: SimpleChanges) {
if (this.shouldSetVatOptions(vatOptions.currentValue)) {
this.vatLabelPipe = new VatTypeToDisplayNamePipe(this.vatOptions);
this.vatLabelPipe = new VatTypeToDisplayNamePipe();
}
}

View File

@@ -7,5 +7,4 @@ export * from './processing-status.pipe';
export * from './shelf-pipes.module';
export * from './vat-dto-to-vat-value.pipe';
export * from './vat-dto-to-vat-type.pipe';
export * from './vat-type-to-display-name.pipe';
// end:ng42.barrel

View File

@@ -13,23 +13,23 @@ import { VatDtoToVatTypePipe } from './vat-dto-to-vat-type.pipe';
@NgModule({
imports: [CommonModule],
exports: [
VatTypeToDisplayNamePipe,
ProcessingStatusPipe,
EnvironmentChannelPipe,
GetExtendPickUpOptionsPipe,
PickUpDateOptionsToDisplayValuesPipe,
CreateImageSourceFromEanPipe,
VatDtoToVatValuePipe,
VatTypeToDisplayNamePipe,
VatDtoToVatTypePipe,
],
declarations: [
VatTypeToDisplayNamePipe,
ProcessingStatusPipe,
EnvironmentChannelPipe,
GetExtendPickUpOptionsPipe,
PickUpDateOptionsToDisplayValuesPipe,
CreateImageSourceFromEanPipe,
VatDtoToVatValuePipe,
VatTypeToDisplayNamePipe,
VatDtoToVatTypePipe,
],
providers: [],

View File

@@ -6,15 +6,9 @@ import { VatDtoToVatValuePipe } from './vat-dto-to-vat-value.pipe';
name: 'vatTypeToDisplayName',
})
export class VatTypeToDisplayNamePipe implements PipeTransform {
vatOptions: VATDTO[];
constructor(vatOptions: VATDTO[]) {
this.vatOptions = vatOptions;
}
transform(vatType: number) {
transform(vatType: number, vatOptions: VATDTO[]) {
const match =
this.vatOptions && this.vatOptions.find((vat) => vat.vatType === vatType);
vatOptions && vatOptions.find((vat) => vat.vatType === vatType);
if (match) {
return new VatDtoToVatValuePipe().transform(match);
}

View File

@@ -22,6 +22,8 @@ import {
ShelfCustomerOrderComponent,
ShelfOrderTagComponent,
ShelfPartialCollectionModalComponent,
OrderItemEditComponent,
OrderOverviewEditComponent,
} from './components';
import { ShelfRoutingModule } from './shelf-routing.module';
import { OrderStatusPipe } from '../../pipes/order-status.pipe';
@@ -43,6 +45,8 @@ import { ShelfEditCompartmentModule } from './pages/shelf-edit-compartment';
ShelfPartialCollectionModalComponent,
OrderStatusPipe,
OrderLoadingComponent,
OrderItemEditComponent,
OrderOverviewEditComponent,
],
exports: [ShelfOrderTagComponent],
imports: [

View File

@@ -5,7 +5,7 @@
</label>
<span class="selected isa-font-weight-bold">{{
labelPipe ? labelPipe.transform(value) : value
labelPipe ? labelPipe.transform(value, options) : value
}}</span>
<lib-icon
class="isa-accordion-arrow"

View File

@@ -23,7 +23,7 @@ import { UiDropdownComponent } from '@isa-ui/dropdown';
],
})
export class UiSelectInputComponent implements ControlValueAccessor {
@Input() options: string[] = [];
@Input() public options: string[] = [];
@Input() label = '';
@Input() labelPipe: PipeTransform;
@Input() optionsPipe: PipeTransform;
@@ -48,7 +48,6 @@ export class UiSelectInputComponent implements ControlValueAccessor {
? this.valuePipe.transform(selectedOption)
: selectedOption;
this.onChange(this.value);
console.log({ value: this.value });
dropdown.close();
}