mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-09 18:02:54 +00:00
[ACS-12728] Added move action for breadcrumbs
This commit is contained in:
@@ -446,6 +446,7 @@
|
||||
"NODE_MOVE": {
|
||||
"SINGULAR": "Moved {{ success }} item.",
|
||||
"PLURAL": "Moved {{ success }} items.",
|
||||
"GENERAL": "Moved item",
|
||||
"PARTIAL": {
|
||||
"SINGULAR": "Partially moved {{ partially }} item.",
|
||||
"PLURAL": "Partially moved {{ partially }} items.",
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
[folderNode]="node"
|
||||
[selectedRowItemsCount]="selectedRowItemsCount" [maxItems]="isSmallScreen ? 1 : 0"
|
||||
(navigate)="onBreadcrumbNavigate($event)"
|
||||
(breadcrumbPathElementsChange)="breadcrumbPathNames = $event"/>
|
||||
(breadcrumbPathElementsChange)="breadcrumbPathNames = $event"
|
||||
(dropped)="onBreadcrumbDrop($event)"/>
|
||||
<aca-toolbar [items]="actions" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,6 +26,8 @@ import {
|
||||
CustomEmptyContentTemplateDirective,
|
||||
DataColumnComponent,
|
||||
DataColumnListComponent,
|
||||
DataRow,
|
||||
NotificationService,
|
||||
PaginationComponent,
|
||||
ShowHeaderMode
|
||||
} from '@alfresco/adf-core';
|
||||
@@ -56,12 +58,13 @@ import {
|
||||
} from '@alfresco/adf-content-services';
|
||||
import { DocumentListPresetRef, DynamicColumnComponent } from '@alfresco/adf-extensions';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslatePipe } from '@ngx-translate/core';
|
||||
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
|
||||
import { DocumentListDirective } from '../../directives/document-list.directive';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { extractFiltersFromEncodedQuery } from '../../utils/aca-search-utils';
|
||||
import { CdkDragDrop } from '@angular/cdk/drag-drop';
|
||||
|
||||
@Component({
|
||||
imports: [
|
||||
@@ -92,8 +95,10 @@ import { extractFiltersFromEncodedQuery } from '../../utils/aca-search-utils';
|
||||
export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
private readonly contentApi = inject(ContentApiService);
|
||||
private readonly nodeActionsService = inject(NodeActionsService);
|
||||
private readonly notificationService = inject(NotificationService);
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
private readonly queryBuilderService = inject(SearchHeaderQueryBuilderService);
|
||||
private readonly translateService = inject(TranslateService);
|
||||
|
||||
isValidPath = true;
|
||||
isAdmin = false;
|
||||
@@ -419,4 +424,14 @@ export class FilesComponent extends PageComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onBreadcrumbDrop(event: CdkDragDrop<PathElement, PathElement, DataRow>) {
|
||||
this.documentListService.moveNode(event.item.data.id, event.container.id).subscribe({
|
||||
next: () => {
|
||||
this.documentListService.reload();
|
||||
this.notificationService.showInfo(this.translateService.instant('APP.MESSAGES.INFO.NODE_MOVE.GENERAL'));
|
||||
},
|
||||
error: () => this.notificationService.showError(this.translateService.instant('APP.MESSAGES.ERRORS.NODE_MOVE'))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user