mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
[AAE-3110] Move upload button inside the node selector dialog (#5901)
* Open select dialog on all types, fetch destination folder from a relative path * Dialog UI refactor, multiple upload from local * Fix document list should automatically reload after upload * Remove not used ViewChild * Fix imports, read destination folder from form field * support different alias * Remove not needed property, reuse selection mode * Remove unused methods * Fix unit tests * * Added unit tests * Fixed failing unit tests * * Added unit for upload button * Skipped failing e2e * * Removed process-storage related code * * Removed unncessory model and code * * * Removed contentHost from formCloud model * * Skiped content-services e2e * Skip failing process e2e related to attachment Co-authored-by: sivakumar414ram <siva.kumar@muraai.com> Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com>
This commit is contained in:
@@ -17,9 +17,10 @@
|
||||
|
||||
import { Component, Inject, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { TranslationService, NotificationService } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
||||
import { NodeEntryEvent } from '../document-list/components/node.event';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-content-node-selector',
|
||||
@@ -28,17 +29,19 @@ import { ContentNodeSelectorComponentData } from './content-node-selector.compon
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ContentNodeSelectorComponent {
|
||||
|
||||
title: string;
|
||||
action: string;
|
||||
buttonActionName: string;
|
||||
chosenNode: Node[];
|
||||
currentDirectoryId: string;
|
||||
|
||||
constructor(private translation: TranslationService,
|
||||
private notificationService: NotificationService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: ContentNodeSelectorComponentData) {
|
||||
this.action = data.actionName ? data.actionName.toUpperCase() : 'CHOOSE';
|
||||
this.buttonActionName = `NODE_SELECTOR.${this.action}`;
|
||||
this.title = data.title;
|
||||
this.currentDirectoryId = data.currentFolderId;
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -49,14 +52,14 @@ export class ContentNodeSelectorComponent {
|
||||
this.chosenNode = nodeList;
|
||||
}
|
||||
|
||||
hasNodeSelected(): boolean {
|
||||
return this.chosenNode?.length > 0;
|
||||
}
|
||||
|
||||
onSiteChange(siteTitle: string) {
|
||||
this.updateTitle(siteTitle);
|
||||
}
|
||||
|
||||
onNavigationChange(pathElement: NodeEntryEvent) {
|
||||
this.currentDirectoryId = pathElement.value.id;
|
||||
}
|
||||
|
||||
onClick(): void {
|
||||
this.data.select.next(this.chosenNode);
|
||||
this.data.select.complete();
|
||||
@@ -71,4 +74,12 @@ export class ContentNodeSelectorComponent {
|
||||
getTitleTranslation(action: string, name: string): string {
|
||||
return this.translation.instant(`NODE_SELECTOR.${action}_ITEM`, { name: this.translation.instant(name) });
|
||||
}
|
||||
|
||||
isMultipleSelection(): boolean {
|
||||
return this.data.selectionMode === 'multiple';
|
||||
}
|
||||
|
||||
onError(error) {
|
||||
this.notificationService.showError(error);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user