From cc852026d559a0b0979488384266ce0c70477a2b Mon Sep 17 00:00:00 2001 From: Drayke Date: Mon, 26 Feb 2024 14:40:08 +0100 Subject: [PATCH] feat(admin-ui): Export AssetsComponent as a Shared Component (#2695) Co-authored-by: Kevin Closes #2637 --- .../admin-ui/src/lib/catalog/src/catalog.module.ts | 2 -- packages/admin-ui/src/lib/catalog/src/public_api.ts | 1 - packages/admin-ui/src/lib/core/src/public_api.ts | 2 ++ .../shared}/components/assets/assets.component.html | 0 .../shared}/components/assets/assets.component.scss | 0 .../src/shared}/components/assets/assets.component.ts | 11 ++++------- .../admin-ui/src/lib/core/src/shared/shared.module.ts | 2 ++ 7 files changed, 8 insertions(+), 10 deletions(-) rename packages/admin-ui/src/lib/{catalog/src => core/src/shared}/components/assets/assets.component.html (100%) rename packages/admin-ui/src/lib/{catalog/src => core/src/shared}/components/assets/assets.component.scss (100%) rename packages/admin-ui/src/lib/{catalog/src => core/src/shared}/components/assets/assets.component.ts (90%) diff --git a/packages/admin-ui/src/lib/catalog/src/catalog.module.ts b/packages/admin-ui/src/lib/catalog/src/catalog.module.ts index 7ebbe8b7f5..c94b58f03d 100644 --- a/packages/admin-ui/src/lib/catalog/src/catalog.module.ts +++ b/packages/admin-ui/src/lib/catalog/src/catalog.module.ts @@ -17,7 +17,6 @@ import { createRoutes } from './catalog.routes'; import { ApplyFacetDialogComponent } from './components/apply-facet-dialog/apply-facet-dialog.component'; import { AssetDetailComponent } from './components/asset-detail/asset-detail.component'; import { AssetListComponent } from './components/asset-list/asset-list.component'; -import { AssetsComponent } from './components/assets/assets.component'; import { AssignProductsToChannelDialogComponent } from './components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component'; import { BulkAddFacetValuesDialogComponent } from './components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component'; import { CollectionContentsComponent } from './components/collection-contents/collection-contents.component'; @@ -76,7 +75,6 @@ const CATALOG_COMPONENTS = [ GenerateProductVariantsComponent, ApplyFacetDialogComponent, AssetListComponent, - AssetsComponent, VariantPriceDetailComponent, CollectionListComponent, CollectionDetailComponent, diff --git a/packages/admin-ui/src/lib/catalog/src/public_api.ts b/packages/admin-ui/src/lib/catalog/src/public_api.ts index 76115e3118..5fdc2378bc 100644 --- a/packages/admin-ui/src/lib/catalog/src/public_api.ts +++ b/packages/admin-ui/src/lib/catalog/src/public_api.ts @@ -4,7 +4,6 @@ export * from './catalog.routes'; export * from './components/apply-facet-dialog/apply-facet-dialog.component'; export * from './components/asset-detail/asset-detail.component'; export * from './components/asset-list/asset-list.component'; -export * from './components/assets/assets.component'; export * from './components/assign-products-to-channel-dialog/assign-products-to-channel-dialog.component'; export * from './components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.component'; export * from './components/bulk-add-facet-values-dialog/bulk-add-facet-values-dialog.graphql'; diff --git a/packages/admin-ui/src/lib/core/src/public_api.ts b/packages/admin-ui/src/lib/core/src/public_api.ts index 0d33c245b8..e0fa24b88d 100644 --- a/packages/admin-ui/src/lib/core/src/public_api.ts +++ b/packages/admin-ui/src/lib/core/src/public_api.ts @@ -72,6 +72,7 @@ export * from './data/query-result'; export * from './data/server-config'; export * from './data/utils/add-custom-fields'; export * from './data/utils/get-server-location'; +export * from './data/utils/is-entity-create-or-update-mutation'; export * from './data/utils/remove-readonly-custom-fields'; export * from './data/utils/transform-relation-custom-field-inputs'; export * from './extension/add-action-bar-item'; @@ -134,6 +135,7 @@ export * from './shared/components/asset-preview/asset-preview.component'; export * from './shared/components/asset-preview-dialog/asset-preview-dialog.component'; export * from './shared/components/asset-preview-links/asset-preview-links.component'; export * from './shared/components/asset-search-input/asset-search-input.component'; +export * from './shared/components/assets/assets.component'; export * from './shared/components/assign-to-channel-dialog/assign-to-channel-dialog.component'; export * from './shared/components/bulk-action-menu/bulk-action-menu.component'; export * from './shared/components/card/card.component'; diff --git a/packages/admin-ui/src/lib/catalog/src/components/assets/assets.component.html b/packages/admin-ui/src/lib/core/src/shared/components/assets/assets.component.html similarity index 100% rename from packages/admin-ui/src/lib/catalog/src/components/assets/assets.component.html rename to packages/admin-ui/src/lib/core/src/shared/components/assets/assets.component.html diff --git a/packages/admin-ui/src/lib/catalog/src/components/assets/assets.component.scss b/packages/admin-ui/src/lib/core/src/shared/components/assets/assets.component.scss similarity index 100% rename from packages/admin-ui/src/lib/catalog/src/components/assets/assets.component.scss rename to packages/admin-ui/src/lib/core/src/shared/components/assets/assets.component.scss diff --git a/packages/admin-ui/src/lib/catalog/src/components/assets/assets.component.ts b/packages/admin-ui/src/lib/core/src/shared/components/assets/assets.component.ts similarity index 90% rename from packages/admin-ui/src/lib/catalog/src/components/assets/assets.component.ts rename to packages/admin-ui/src/lib/core/src/shared/components/assets/assets.component.ts index 8881830854..8e4711f4fa 100644 --- a/packages/admin-ui/src/lib/catalog/src/components/assets/assets.component.ts +++ b/packages/admin-ui/src/lib/core/src/shared/components/assets/assets.component.ts @@ -8,14 +8,11 @@ import { Input, Output, } from '@angular/core'; -import { - Asset, - AssetPickerDialogComponent, - AssetPreviewDialogComponent, - ModalService, - Permission, -} from '@vendure/admin-ui/core'; import { unique } from '@vendure/common/lib/unique'; +import { Asset, Permission } from '../../../common/generated-types'; +import { ModalService } from '../../../providers/modal/modal.service'; +import { AssetPickerDialogComponent } from '../asset-picker-dialog/asset-picker-dialog.component'; +import { AssetPreviewDialogComponent } from '../asset-preview-dialog/asset-preview-dialog.component'; export interface AssetChange { assets: Asset[]; diff --git a/packages/admin-ui/src/lib/core/src/shared/shared.module.ts b/packages/admin-ui/src/lib/core/src/shared/shared.module.ts index 9ca91622c4..8b2e6f694d 100644 --- a/packages/admin-ui/src/lib/core/src/shared/shared.module.ts +++ b/packages/admin-ui/src/lib/core/src/shared/shared.module.ts @@ -30,6 +30,7 @@ import { AssetPickerDialogComponent } from './components/asset-picker-dialog/ass import { AssetPreviewDialogComponent } from './components/asset-preview-dialog/asset-preview-dialog.component'; import { AssetPreviewLinksComponent } from './components/asset-preview-links/asset-preview-links.component'; import { AssetPreviewComponent } from './components/asset-preview/asset-preview.component'; +import { AssetsComponent } from './components/assets/assets.component'; import { AssetSearchInputComponent } from './components/asset-search-input/asset-search-input.component'; import { AssignToChannelDialogComponent } from './components/assign-to-channel-dialog/assign-to-channel-dialog.component'; import { BulkActionMenuComponent } from './components/bulk-action-menu/bulk-action-menu.component'; @@ -192,6 +193,7 @@ const DECLARATIONS = [ ActionBarComponent, ActionBarLeftComponent, ActionBarRightComponent, + AssetsComponent, AssetPreviewComponent, AssetPreviewDialogComponent, AssetSearchInputComponent,