diff --git a/admin-ui/src/app/catalog/components/collection-list/collection-list.component.html b/admin-ui/src/app/catalog/components/collection-list/collection-list.component.html index 234c39f548..77f48cb966 100644 --- a/admin-ui/src/app/catalog/components/collection-list/collection-list.component.html +++ b/admin-ui/src/app/catalog/components/collection-list/collection-list.component.html @@ -11,6 +11,7 @@ [collections]="items$ | async | paginate: (paginationConfig$ | async) || {}" [activeCollectionId]="activeCollectionId$ | async" (rearrange)="onRearrange($event)" + (deleteCollection)="deleteCollection($event)" >
diff --git a/admin-ui/src/app/catalog/components/collection-list/collection-list.component.ts b/admin-ui/src/app/catalog/components/collection-list/collection-list.component.ts index 85cef57276..e3eff14f16 100644 --- a/admin-ui/src/app/catalog/components/collection-list/collection-list.component.ts +++ b/admin-ui/src/app/catalog/components/collection-list/collection-list.component.ts @@ -1,14 +1,15 @@ import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { PaginationInstance } from 'ngx-pagination'; -import { combineLatest, Observable } from 'rxjs'; -import { distinctUntilChanged, map } from 'rxjs/operators'; +import { combineLatest, EMPTY, Observable } from 'rxjs'; +import { distinctUntilChanged, map, switchMap } from 'rxjs/operators'; import { BaseListComponent } from '../../../common/base-list.component'; import { GetCollectionList } from '../../../common/generated-types'; import { _ } from '../../../core/providers/i18n/mark-for-extraction'; import { NotificationService } from '../../../core/providers/notification/notification.service'; import { DataService } from '../../../data/providers/data.service'; +import { ModalService } from '../../../shared/providers/modal/modal.service'; import { RearrangeEvent } from '../collection-tree/collection-tree.component'; @Component({ @@ -27,6 +28,7 @@ export class CollectionListComponent constructor( private dataService: DataService, private notificationService: NotificationService, + private modalService: ModalService, router: Router, route: ActivatedRoute, ) { @@ -72,6 +74,33 @@ export class CollectionListComponent }); } + deleteCollection(id: string) { + this.modalService + .dialog({ + title: _('catalog.confirm-delete-collection'), + buttons: [ + { type: 'seconday', label: _('common.cancel') }, + { type: 'danger', label: _('common.delete'), returnValue: true }, + ], + }) + .pipe( + switchMap(response => (response ? this.dataService.collection.deleteCollection(id) : EMPTY)), + ) + .subscribe( + () => { + this.notificationService.success(_('common.notify-delete-success'), { + entity: 'ProductVariant', + }); + this.refresh(); + }, + err => { + this.notificationService.error(_('common.notify-delete-error'), { + entity: 'ProductVariant', + }); + }, + ); + } + closeContents() { const params = { ...this.route.snapshot.params }; delete params.contents; diff --git a/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.html b/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.html index a4b4bf011b..2e9c993cba 100644 --- a/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.html +++ b/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.html @@ -80,6 +80,11 @@ {{ item.path }} + +
diff --git a/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.ts b/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.ts index e73f9d353c..f45b87188f 100644 --- a/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.ts +++ b/admin-ui/src/app/catalog/components/collection-tree/collection-tree-node.component.ts @@ -83,4 +83,8 @@ export class CollectionTreeNodeComponent implements OnInit { drop(event: CdkDragDrop>) { this.root.onDrop(event); } + + delete(id: string) { + this.root.onDelete(id); + } } diff --git a/admin-ui/src/app/catalog/components/collection-tree/collection-tree.component.ts b/admin-ui/src/app/catalog/components/collection-tree/collection-tree.component.ts index eec6943fee..b74cbee2ac 100644 --- a/admin-ui/src/app/catalog/components/collection-tree/collection-tree.component.ts +++ b/admin-ui/src/app/catalog/components/collection-tree/collection-tree.component.ts @@ -25,6 +25,7 @@ export class CollectionTreeComponent implements OnChanges { @Input() collections: Collection.Fragment[]; @Input() activeCollectionId: string; @Output() rearrange = new EventEmitter(); + @Output() deleteCollection = new EventEmitter(); collectionTree: RootNode; ngOnChanges(changes: SimpleChanges) { @@ -51,6 +52,10 @@ export class CollectionTreeComponent implements OnChanges { this.rearrange.emit(event); } + onDelete(id: string) { + this.deleteCollection.emit(id); + } + private isRootNode(node: T | RootNode): node is RootNode { return !node.hasOwnProperty('parent'); } diff --git a/admin-ui/src/app/catalog/components/facet-list/facet-list.component.html b/admin-ui/src/app/catalog/components/facet-list/facet-list.component.html index 026f7fc4f6..185d774b6e 100644 --- a/admin-ui/src/app/catalog/components/facet-list/facet-list.component.html +++ b/admin-ui/src/app/catalog/components/facet-list/facet-list.component.html @@ -26,7 +26,7 @@ {{ facet.name }} + {{ 'common.delete' | translate }} diff --git a/admin-ui/src/app/catalog/components/product-list/product-list.component.html b/admin-ui/src/app/catalog/components/product-list/product-list.component.html index 70c1c34ae1..007ee252a0 100644 --- a/admin-ui/src/app/catalog/components/product-list/product-list.component.html +++ b/admin-ui/src/app/catalog/components/product-list/product-list.component.html @@ -82,6 +82,7 @@ (click)="deleteProduct(result.productId)" vdrDropdownItem > + {{ 'common.delete' | translate }} diff --git a/admin-ui/src/app/common/generated-types.ts b/admin-ui/src/app/common/generated-types.ts index a3ef6e1903..f0749b4ac0 100644 --- a/admin-ui/src/app/common/generated-types.ts +++ b/admin-ui/src/app/common/generated-types.ts @@ -1545,26 +1545,44 @@ export type MoveCollectionInput = { export type Mutation = { __typename?: 'Mutation', - /** Create a new Administrator */ - createAdministrator: Administrator, - /** Update an existing Administrator */ - updateAdministrator: Administrator, - /** Assign a Role to an Administrator */ - assignRoleToAdministrator: Administrator, /** Create a new Asset */ createAssets: Array, + login: LoginResult, + logout: Scalars['Boolean'], /** Create a new Collection */ createCollection: Collection, /** Update an existing Collection */ updateCollection: Collection, + /** Delete a Collection */ + deleteCollection: DeletionResponse, /** Move a Collection to a different parent or index */ moveCollection: Collection, /** Create a new Channel */ createChannel: Channel, /** Update an existing Channel */ updateChannel: Channel, - login: LoginResult, - logout: Scalars['Boolean'], + /** Create a new Administrator */ + createAdministrator: Administrator, + /** Update an existing Administrator */ + updateAdministrator: Administrator, + /** Assign a Role to an Administrator */ + assignRoleToAdministrator: Administrator, + /** Create a new CustomerGroup */ + createCustomerGroup: CustomerGroup, + /** Update an existing CustomerGroup */ + updateCustomerGroup: CustomerGroup, + /** Add Customers to a CustomerGroup */ + addCustomersToGroup: CustomerGroup, + /** Remove Customers from a CustomerGroup */ + removeCustomersFromGroup: CustomerGroup, + /** Create a new Country */ + createCountry: Country, + /** Update an existing Country */ + updateCountry: Country, + /** Delete a Country */ + deleteCountry: DeletionResponse, + importProducts?: Maybe, + updateGlobalSettings: GlobalSettings, /** Create a new Customer. If a password is provided, a new User will also be created an linked to the Customer. */ createCustomer: Customer, /** Update an existing Customer */ @@ -1577,12 +1595,6 @@ export type Mutation = { updateCustomerAddress: Address, /** Update an existing Address */ deleteCustomerAddress: Scalars['Boolean'], - /** Create a new Country */ - createCountry: Country, - /** Update an existing Country */ - updateCountry: Country, - /** Delete a Country */ - deleteCountry: DeletionResponse, /** Create a new Facet */ createFacet: Facet, /** Update an existing Facet */ @@ -1595,16 +1607,13 @@ export type Mutation = { updateFacetValues: Array, /** Delete one or more FacetValues */ deleteFacetValues: Array, - /** Create a new CustomerGroup */ - createCustomerGroup: CustomerGroup, - /** Update an existing CustomerGroup */ - updateCustomerGroup: CustomerGroup, - /** Add Customers to a CustomerGroup */ - addCustomersToGroup: CustomerGroup, - /** Remove Customers from a CustomerGroup */ - removeCustomersFromGroup: CustomerGroup, - updateGlobalSettings: GlobalSettings, - importProducts?: Maybe, + settlePayment: Payment, + fulfillOrder: Fulfillment, + cancelOrder: Order, + refundOrder: Refund, + settleRefund: Refund, + addNoteToOrder: Order, + reindex: JobInfo, /** Update an existing PaymentMethod */ updatePaymentMethod: PaymentMethod, /** Create a new ProductOptionGroup */ @@ -1615,12 +1624,6 @@ export type Mutation = { createProductOption: ProductOption, /** Create a new ProductOption within a ProductOptionGroup */ updateProductOption: ProductOption, - settlePayment: Payment, - fulfillOrder: Fulfillment, - cancelOrder: Order, - refundOrder: Refund, - settleRefund: Refund, - addNoteToOrder: Order, /** Create a new Product */ createProduct: Product, /** Update an existing Product */ @@ -1637,22 +1640,17 @@ export type Mutation = { updateProductVariants: Array>, /** Delete a ProductVariant */ deleteProductVariant: DeletionResponse, - createPromotion: Promotion, - updatePromotion: Promotion, - deletePromotion: DeletionResponse, - reindex: JobInfo, - /** Create a new ShippingMethod */ - createShippingMethod: ShippingMethod, - /** Update an existing ShippingMethod */ - updateShippingMethod: ShippingMethod, - /** Create a new TaxRate */ - createTaxRate: TaxRate, - /** Update an existing TaxRate */ - updateTaxRate: TaxRate, /** Create a new Role */ createRole: Role, /** Update an existing Role */ updateRole: Role, + /** Create a new ShippingMethod */ + createShippingMethod: ShippingMethod, + /** Update an existing ShippingMethod */ + updateShippingMethod: ShippingMethod, + createPromotion: Promotion, + updatePromotion: Promotion, + deletePromotion: DeletionResponse, /** Create a new TaxCategory */ createTaxCategory: TaxCategory, /** Update an existing TaxCategory */ @@ -1667,6 +1665,10 @@ export type Mutation = { addMembersToZone: Zone, /** Remove members from a Zone */ removeMembersFromZone: Zone, + /** Create a new TaxRate */ + createTaxRate: TaxRate, + /** Update an existing TaxRate */ + updateTaxRate: TaxRate, requestStarted: Scalars['Int'], requestCompleted: Scalars['Int'], setAsLoggedIn: UserStatus, @@ -1675,6 +1677,48 @@ export type Mutation = { }; +export type MutationCreateAssetsArgs = { + input: Array +}; + + +export type MutationLoginArgs = { + username: Scalars['String'], + password: Scalars['String'], + rememberMe?: Maybe +}; + + +export type MutationCreateCollectionArgs = { + input: CreateCollectionInput +}; + + +export type MutationUpdateCollectionArgs = { + input: UpdateCollectionInput +}; + + +export type MutationDeleteCollectionArgs = { + id: Scalars['ID'] +}; + + +export type MutationMoveCollectionArgs = { + input: MoveCollectionInput +}; + + +export type MutationCreateChannelArgs = { + input: CreateChannelInput +}; + + +export type MutationUpdateChannelArgs = { + input: UpdateChannelInput +}; + + export type MutationCreateAdministratorArgs = { input: CreateAdministratorInput }; @@ -1691,40 +1735,50 @@ export type MutationAssignRoleToAdministratorArgs = { }; -export type MutationCreateAssetsArgs = { - input: Array +export type MutationCreateCustomerGroupArgs = { + input: CreateCustomerGroupInput }; -export type MutationCreateCollectionArgs = { - input: CreateCollectionInput +export type MutationUpdateCustomerGroupArgs = { + input: UpdateCustomerGroupInput }; -export type MutationUpdateCollectionArgs = { - input: UpdateCollectionInput +export type MutationAddCustomersToGroupArgs = { + customerGroupId: Scalars['ID'], + customerIds: Array }; -export type MutationMoveCollectionArgs = { - input: MoveCollectionInput +export type MutationRemoveCustomersFromGroupArgs = { + customerGroupId: Scalars['ID'], + customerIds: Array }; -export type MutationCreateChannelArgs = { - input: CreateChannelInput +export type MutationCreateCountryArgs = { + input: CreateCountryInput }; -export type MutationUpdateChannelArgs = { - input: UpdateChannelInput +export type MutationUpdateCountryArgs = { + input: UpdateCountryInput }; -export type MutationLoginArgs = { - username: Scalars['String'], - password: Scalars['String'], - rememberMe?: Maybe +export type MutationDeleteCountryArgs = { + id: Scalars['ID'] +}; + + +export type MutationImportProductsArgs = { + csvFile: Scalars['Upload'] +}; + + +export type MutationUpdateGlobalSettingsArgs = { + input: UpdateGlobalSettingsInput }; @@ -1760,21 +1814,6 @@ export type MutationDeleteCustomerAddressArgs = { }; -export type MutationCreateCountryArgs = { - input: CreateCountryInput -}; - - -export type MutationUpdateCountryArgs = { - input: UpdateCountryInput -}; - - -export type MutationDeleteCountryArgs = { - id: Scalars['ID'] -}; - - export type MutationCreateFacetArgs = { input: CreateFacetInput }; @@ -1807,35 +1846,33 @@ export type MutationDeleteFacetValuesArgs = { }; -export type MutationCreateCustomerGroupArgs = { - input: CreateCustomerGroupInput +export type MutationSettlePaymentArgs = { + id: Scalars['ID'] }; -export type MutationUpdateCustomerGroupArgs = { - input: UpdateCustomerGroupInput +export type MutationFulfillOrderArgs = { + input: FulfillOrderInput }; -export type MutationAddCustomersToGroupArgs = { - customerGroupId: Scalars['ID'], - customerIds: Array +export type MutationCancelOrderArgs = { + input: CancelOrderInput }; -export type MutationRemoveCustomersFromGroupArgs = { - customerGroupId: Scalars['ID'], - customerIds: Array +export type MutationRefundOrderArgs = { + input: RefundOrderInput }; -export type MutationUpdateGlobalSettingsArgs = { - input: UpdateGlobalSettingsInput +export type MutationSettleRefundArgs = { + input: SettleRefundInput }; -export type MutationImportProductsArgs = { - csvFile: Scalars['Upload'] +export type MutationAddNoteToOrderArgs = { + input: AddNoteToOrderInput }; @@ -1864,36 +1901,6 @@ export type MutationUpdateProductOptionArgs = { }; -export type MutationSettlePaymentArgs = { - id: Scalars['ID'] -}; - - -export type MutationFulfillOrderArgs = { - input: FulfillOrderInput -}; - - -export type MutationCancelOrderArgs = { - input: CancelOrderInput -}; - - -export type MutationRefundOrderArgs = { - input: RefundOrderInput -}; - - -export type MutationSettleRefundArgs = { - input: SettleRefundInput -}; - - -export type MutationAddNoteToOrderArgs = { - input: AddNoteToOrderInput -}; - - export type MutationCreateProductArgs = { input: CreateProductInput }; @@ -1936,18 +1943,13 @@ export type MutationDeleteProductVariantArgs = { }; -export type MutationCreatePromotionArgs = { - input: CreatePromotionInput -}; - - -export type MutationUpdatePromotionArgs = { - input: UpdatePromotionInput +export type MutationCreateRoleArgs = { + input: CreateRoleInput }; -export type MutationDeletePromotionArgs = { - id: Scalars['ID'] +export type MutationUpdateRoleArgs = { + input: UpdateRoleInput }; @@ -1961,23 +1963,18 @@ export type MutationUpdateShippingMethodArgs = { }; -export type MutationCreateTaxRateArgs = { - input: CreateTaxRateInput -}; - - -export type MutationUpdateTaxRateArgs = { - input: UpdateTaxRateInput +export type MutationCreatePromotionArgs = { + input: CreatePromotionInput }; -export type MutationCreateRoleArgs = { - input: CreateRoleInput +export type MutationUpdatePromotionArgs = { + input: UpdatePromotionInput }; -export type MutationUpdateRoleArgs = { - input: UpdateRoleInput +export type MutationDeletePromotionArgs = { + id: Scalars['ID'] }; @@ -2018,6 +2015,16 @@ export type MutationRemoveMembersFromZoneArgs = { }; +export type MutationCreateTaxRateArgs = { + input: CreateTaxRateInput +}; + + +export type MutationUpdateTaxRateArgs = { + input: UpdateTaxRateInput +}; + + export type MutationSetAsLoggedInArgs = { username: Scalars['String'], loginTime: Scalars['String'] @@ -2529,69 +2536,59 @@ export type PromotionSortParameter = { export type Query = { __typename?: 'Query', - administrators: AdministratorList, - administrator?: Maybe, assets: AssetList, asset?: Maybe, + me?: Maybe, collections: CollectionList, collection?: Maybe, collectionFilters: Array, channels: Array, channel?: Maybe, activeChannel: Channel, - me?: Maybe, - customers: CustomerList, - customer?: Maybe, + administrators: AdministratorList, + administrator?: Maybe, + customerGroups: Array, + customerGroup?: Maybe, countries: CountryList, country?: Maybe, + globalSettings: GlobalSettings, + customers: CustomerList, + customer?: Maybe, facets: FacetList, facet?: Maybe, - customerGroups: Array, - customerGroup?: Maybe, - globalSettings: GlobalSettings, job?: Maybe, jobs: Array, + order?: Maybe, + orders: OrderList, + search: SearchResponse, paymentMethods: PaymentMethodList, paymentMethod?: Maybe, productOptionGroups: Array, productOptionGroup?: Maybe, - order?: Maybe, - orders: OrderList, products: ProductList, /** Get a Product either by id or slug. If neither id nor slug is speicified, an error will result. */ product?: Maybe, - promotion?: Maybe, - promotions: PromotionList, - adjustmentOperations: AdjustmentOperations, - search: SearchResponse, + roles: RoleList, + role?: Maybe, shippingMethods: ShippingMethodList, shippingMethod?: Maybe, shippingEligibilityCheckers: Array, shippingCalculators: Array, - taxRates: TaxRateList, - taxRate?: Maybe, - roles: RoleList, - role?: Maybe, + promotion?: Maybe, + promotions: PromotionList, + adjustmentOperations: AdjustmentOperations, taxCategories: Array, taxCategory?: Maybe, zones: Array, zone?: Maybe, + taxRates: TaxRateList, + taxRate?: Maybe, networkStatus: NetworkStatus, userStatus: UserStatus, uiState: UiState, }; -export type QueryAdministratorsArgs = { - options?: Maybe -}; - - -export type QueryAdministratorArgs = { - id: Scalars['ID'] -}; - - export type QueryAssetsArgs = { options?: Maybe }; @@ -2619,12 +2616,17 @@ export type QueryChannelArgs = { }; -export type QueryCustomersArgs = { - options?: Maybe +export type QueryAdministratorsArgs = { + options?: Maybe }; -export type QueryCustomerArgs = { +export type QueryAdministratorArgs = { + id: Scalars['ID'] +}; + + +export type QueryCustomerGroupArgs = { id: Scalars['ID'] }; @@ -2639,6 +2641,16 @@ export type QueryCountryArgs = { }; +export type QueryCustomersArgs = { + options?: Maybe +}; + + +export type QueryCustomerArgs = { + id: Scalars['ID'] +}; + + export type QueryFacetsArgs = { languageCode?: Maybe, options?: Maybe @@ -2651,11 +2663,6 @@ export type QueryFacetArgs = { }; -export type QueryCustomerGroupArgs = { - id: Scalars['ID'] -}; - - export type QueryJobArgs = { jobId: Scalars['String'] }; @@ -2666,6 +2673,21 @@ export type QueryJobsArgs = { }; +export type QueryOrderArgs = { + id: Scalars['ID'] +}; + + +export type QueryOrdersArgs = { + options?: Maybe +}; + + +export type QuerySearchArgs = { + input: SearchInput +}; + + export type QueryPaymentMethodsArgs = { options?: Maybe }; @@ -2688,16 +2710,6 @@ export type QueryProductOptionGroupArgs = { }; -export type QueryOrderArgs = { - id: Scalars['ID'] -}; - - -export type QueryOrdersArgs = { - options?: Maybe -}; - - export type QueryProductsArgs = { languageCode?: Maybe, options?: Maybe @@ -2711,18 +2723,13 @@ export type QueryProductArgs = { }; -export type QueryPromotionArgs = { - id: Scalars['ID'] -}; - - -export type QueryPromotionsArgs = { - options?: Maybe +export type QueryRolesArgs = { + options?: Maybe }; -export type QuerySearchArgs = { - input: SearchInput +export type QueryRoleArgs = { + id: Scalars['ID'] }; @@ -2736,32 +2743,32 @@ export type QueryShippingMethodArgs = { }; -export type QueryTaxRatesArgs = { - options?: Maybe +export type QueryPromotionArgs = { + id: Scalars['ID'] }; -export type QueryTaxRateArgs = { - id: Scalars['ID'] +export type QueryPromotionsArgs = { + options?: Maybe }; -export type QueryRolesArgs = { - options?: Maybe +export type QueryTaxCategoryArgs = { + id: Scalars['ID'] }; -export type QueryRoleArgs = { +export type QueryZoneArgs = { id: Scalars['ID'] }; -export type QueryTaxCategoryArgs = { - id: Scalars['ID'] +export type QueryTaxRatesArgs = { + options?: Maybe }; -export type QueryZoneArgs = { +export type QueryTaxRateArgs = { id: Scalars['ID'] }; @@ -3461,6 +3468,13 @@ export type MoveCollectionMutationVariables = { export type MoveCollectionMutation = ({ __typename?: 'Mutation' } & { moveCollection: ({ __typename?: 'Collection' } & CollectionFragment) }); +export type DeleteCollectionMutationVariables = { + id: Scalars['ID'] +}; + + +export type DeleteCollectionMutation = ({ __typename?: 'Mutation' } & { deleteCollection: ({ __typename?: 'DeletionResponse' } & Pick) }); + export type GetCollectionContentsQueryVariables = { id: Scalars['ID'], options?: Maybe @@ -4277,6 +4291,12 @@ export namespace MoveCollection { export type MoveCollection = CollectionFragment; } +export namespace DeleteCollection { + export type Variables = DeleteCollectionMutationVariables; + export type Mutation = DeleteCollectionMutation; + export type DeleteCollection = DeleteCollectionMutation['deleteCollection']; +} + export namespace GetCollectionContents { export type Variables = GetCollectionContentsQueryVariables; export type Query = GetCollectionContentsQuery; diff --git a/admin-ui/src/app/data/definitions/collection-definitions.ts b/admin-ui/src/app/data/definitions/collection-definitions.ts index b32406207e..ac300f3409 100644 --- a/admin-ui/src/app/data/definitions/collection-definitions.ts +++ b/admin-ui/src/app/data/definitions/collection-definitions.ts @@ -104,6 +104,15 @@ export const MOVE_COLLECTION = gql` ${COLLECTION_FRAGMENT} `; +export const DELETE_COLLECTION = gql` + mutation DeleteCollection($id: ID!) { + deleteCollection(id: $id) { + result + message + } + } +`; + export const GET_COLLECTION_CONTENTS = gql` query GetCollectionContents($id: ID!, $options: ProductVariantListOptions) { collection(id: $id) { diff --git a/admin-ui/src/app/data/providers/collection-data.service.ts b/admin-ui/src/app/data/providers/collection-data.service.ts index 695b99d35a..c2b3b25440 100644 --- a/admin-ui/src/app/data/providers/collection-data.service.ts +++ b/admin-ui/src/app/data/providers/collection-data.service.ts @@ -6,6 +6,7 @@ import { CollectionFilterParameter, CreateCollection, CreateCollectionInput, + DeleteCollection, GetCollection, GetCollectionContents, GetCollectionFilters, @@ -18,6 +19,7 @@ import { import { getDefaultLanguage } from '../../common/utilities/get-default-language'; import { CREATE_COLLECTION, + DELETE_COLLECTION, GET_COLLECTION, GET_COLLECTION_CONTENTS, GET_COLLECTION_FILTERS, @@ -100,6 +102,15 @@ export class CollectionDataService { ); } + deleteCollection(id: string) { + return this.baseDataService.mutate( + DELETE_COLLECTION, + { + id, + }, + ); + } + getCollectionContents(id: string, take: number = 10, skip: number = 0, filterTerm?: string) { const filter = filterTerm ? ({ name: { contains: filterTerm } } as CollectionFilterParameter) diff --git a/admin-ui/src/i18n-messages/en.json b/admin-ui/src/i18n-messages/en.json index 4b4b8fc943..ffe4301b21 100644 --- a/admin-ui/src/i18n-messages/en.json +++ b/admin-ui/src/i18n-messages/en.json @@ -29,6 +29,7 @@ "add-option": "Add option", "assets-selected-count": "{ count } assets selected", "collection-contents": "Collection contents", + "confirm-delete-collection": "Delete collection?", "confirm-delete-country": "Delete country?", "confirm-delete-facet": "Delete facet?", "confirm-delete-facet-value": "Delete facet value?", @@ -515,4 +516,4 @@ "update": "Update", "zone": "Zone" } -} +} \ No newline at end of file