Skip to content

Commit

Permalink
chore(admin-ui): Clean up circular import issues
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jan 25, 2024
1 parent 01f9d44 commit 2bef6ca
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
ModifyOrderInput,
OrderDetailFragment,
OrderLineInput,
ProductSelectorSearchQuery,
} from '@vendure/admin-ui/core';
import { ProductSelectorItem } from '../components/order-editor/order-editor.component';

export interface OrderSnapshot {
totalWithTax: number;
Expand All @@ -14,6 +14,8 @@ export interface OrderSnapshot {
lines: OrderDetailFragment['lines'];
}

export type ProductSelectorItem = ProductSelectorSearchQuery['search']['items'][number];

export interface AddedLine {
id: string;
featuredAsset?: ProductSelectorItem['productAsset'] | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
OrderAddressFragment,
OrderDetailFragment,
OrderDetailQueryDocument,
ProductSelectorSearchQuery,
SortOrder,
SurchargeInput,
transformRelationCustomFieldInputs,
Expand All @@ -30,16 +29,19 @@ import { assertNever, notNullOrUndefined } from '@vendure/common/lib/shared-util
import { simpleDeepClone } from '@vendure/common/lib/simple-deep-clone';
import { EMPTY, Observable, of } from 'rxjs';
import { mapTo, shareReplay, switchMap, take, takeUntil } from 'rxjs/operators';
import { AddedLine, ModifyOrderData, OrderSnapshot } from '../../common/modify-order-types';
import {
AddedLine,
ModifyOrderData,
OrderSnapshot,
ProductSelectorItem,
} from '../../common/modify-order-types';

import { OrderTransitionService } from '../../providers/order-transition.service';
import {
OrderEditResultType,
OrderEditsPreviewDialogComponent,
} from '../order-edits-preview-dialog/order-edits-preview-dialog.component';

export type ProductSelectorItem = ProductSelectorSearchQuery['search']['items'][number];

@Component({
selector: 'vdr-order-editor',
templateUrl: './order-editor.component.html',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { OrderEditorComponent } from '@vendure/admin-ui/order';
import { notNullOrUndefined } from '@vendure/common/lib/shared-utils';
import type { OrderEditorComponent } from '../order-editor/order-editor.component';
import { AddedLine, ModifyOrderData, OrderSnapshot } from '../../common/modify-order-types';

@Component({
Expand Down
2 changes: 2 additions & 0 deletions packages/admin-ui/src/lib/order/src/order.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { OrderStateSelectDialogComponent } from './components/order-state-select
import { OrderTableComponent } from './components/order-table/order-table.component';
import { PaymentDetailComponent } from './components/payment-detail/payment-detail.component';
import { PaymentStateLabelComponent } from './components/payment-state-label/payment-state-label.component';
import { RefundDetailComponent } from './components/refund-detail/refund-detail.component';
import { RefundOrderDialogComponent } from './components/refund-order-dialog/refund-order-dialog.component';
import { RefundStateLabelComponent } from './components/refund-state-label/refund-state-label.component';
import { SelectAddressDialogComponent } from './components/select-address-dialog/select-address-dialog.component';
Expand Down Expand Up @@ -102,6 +103,7 @@ import { OrderModificationSummaryComponent } from './components/order-modificati
OrderTotalColumnComponent,
PaymentForRefundSelectorComponent,
OrderModificationSummaryComponent,
RefundDetailComponent,
],
exports: [OrderCustomFieldsCardComponent],
})
Expand Down
7 changes: 5 additions & 2 deletions packages/admin-ui/src/lib/order/src/public_api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// This file was generated by the build-public-api.ts script
export * from './common/get-refundable-payments';
export * from './common/modify-order-types';
export * from './components/add-manual-payment-dialog/add-manual-payment-dialog.component';
export * from './components/cancel-order-dialog/cancel-order-dialog.component';
export * from './components/coupon-code-selector/coupon-code-selector.component';
Expand All @@ -20,6 +22,7 @@ export * from './components/order-edits-preview-dialog/order-edits-preview-dialo
export * from './components/order-history/order-history-entry-host.component';
export * from './components/order-history/order-history.component';
export * from './components/order-list/order-list.component';
export * from './components/order-modification-summary/order-modification-summary.component';
export * from './components/order-payment-card/order-payment-card.component';
export * from './components/order-process-graph/constants';
export * from './components/order-process-graph/order-process-edge.component';
Expand All @@ -30,7 +33,9 @@ export * from './components/order-process-graph-dialog/order-process-graph-dialo
export * from './components/order-state-select-dialog/order-state-select-dialog.component';
export * from './components/order-table/order-table.component';
export * from './components/payment-detail/payment-detail.component';
export * from './components/payment-for-refund-selector/payment-for-refund-selector.component';
export * from './components/payment-state-label/payment-state-label.component';
export * from './components/refund-detail/refund-detail.component';
export * from './components/refund-order-dialog/refund-order-dialog.component';
export * from './components/refund-state-label/refund-state-label.component';
export * from './components/select-address-dialog/select-address-dialog.component';
Expand All @@ -45,5 +50,3 @@ export * from './order.module';
export * from './order.routes';
export * from './providers/order-transition.service';
export * from './providers/routing/order.guard';
export { AddedLine } from './common/modify-order-types';
export { ModifyOrderData } from './common/modify-order-types';

0 comments on commit 2bef6ca

Please sign in to comment.