From b2c002057e720aef2f37026a13e3a5768779f2ec Mon Sep 17 00:00:00 2001 From: Yura Bondarenko Date: Wed, 23 Jun 2021 11:05:14 +0200 Subject: [PATCH] 80195: Replace input suggestions with collection selector --- .../item-move/item-move.component.html | 23 ++++++++----------- .../item-move/item-move.component.ts | 20 +++------------- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/src/app/+item-page/edit-item-page/item-move/item-move.component.html b/src/app/+item-page/edit-item-page/item-move/item-move.component.html index 74ca9aae4e..f2a420204f 100644 --- a/src/app/+item-page/edit-item-page/item-move/item-move.component.html +++ b/src/app/+item-page/edit-item-page/item-move/item-move.component.html @@ -5,19 +5,16 @@

{{'item.edit.move.description' | translate}}

- - - +
+
{{'dso-selector.placeholder' | translate: { type: 'collection' } }}
+
+ + +
+
+
diff --git a/src/app/+item-page/edit-item-page/item-move/item-move.component.ts b/src/app/+item-page/edit-item-page/item-move/item-move.component.ts index b1ed121b40..2e2d94b80d 100644 --- a/src/app/+item-page/edit-item-page/item-move/item-move.component.ts +++ b/src/app/+item-page/edit-item-page/item-move/item-move.component.ts @@ -53,6 +53,8 @@ export class ItemMoveComponent implements OnInit { */ itemPageRoute$: Observable; + COLLECTIONS = [DSpaceObjectType.COLLECTION]; + constructor(private route: ActivatedRoute, private router: Router, private notificationsService: NotificationsService, @@ -75,14 +77,6 @@ export class ItemMoveComponent implements OnInit { this.loadSuggestions(''); } - /** - * Find suggestions based on entered query - * @param query - Search query - */ - findSuggestions(query): void { - this.loadSuggestions(query); - } - /** * Load all available collections to move the item to. * TODO: When the API support it, only fetch collections where user has ADD rights to. @@ -107,7 +101,7 @@ export class ItemMoveComponent implements OnInit { * Set the collection name and id based on the selected value * @param data - obtained from the ds-input-suggestions component */ - onClick(data: any): void { + selectDso(data: any): void { this.selectedCollection = data; this.selectedCollectionName = data.name; this.canSubmit = true; @@ -137,12 +131,4 @@ export class ItemMoveComponent implements OnInit { } ); } - - /** - * Resets the can submit when the user changes the content of the input field - * @param data - */ - resetCollection(data: any) { - this.canSubmit = false; - } }