mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-3543] Attach button enabled only when all files uploaded (#6731)
* [AAE-3543] Attach button enabled only when all files uploaded * [AAE-3543] Add unit tests * [AAE-3543] Corrected name of unit test * [AAE-3543] Merged isQueueFinishedUploading() with isUploading() * [AAE-3543] Added spacing to unit tests
This commit is contained in:
@@ -80,7 +80,7 @@
|
||||
</button>
|
||||
|
||||
<button mat-button
|
||||
[disabled]="!hasNodeSelected()"
|
||||
[disabled]="isChooseButtonDisabled()"
|
||||
class="adf-choose-action"
|
||||
(click)="onClick()"
|
||||
data-automation-id="content-node-selector-actions-choose">{{ buttonActionName | translate }}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
import { TranslationService, NotificationService, AllowableOperationsEnum, ContentService } from '@alfresco/adf-core';
|
||||
import { TranslationService, NotificationService, AllowableOperationsEnum, ContentService, UploadService } from '@alfresco/adf-core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
|
||||
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
||||
@@ -44,6 +44,7 @@ export class ContentNodeSelectorComponent implements OnInit {
|
||||
constructor(private translation: TranslationService,
|
||||
private contentService: ContentService,
|
||||
private notificationService: NotificationService,
|
||||
private uploadService: UploadService,
|
||||
private dialog: MatDialogRef<ContentNodeSelectorComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: ContentNodeSelectorComponentData) {
|
||||
this.action = data.actionName ? data.actionName.toUpperCase() : 'CHOOSE';
|
||||
@@ -107,6 +108,10 @@ export class ContentNodeSelectorComponent implements OnInit {
|
||||
this.notificationService.showError(error);
|
||||
}
|
||||
|
||||
isChooseButtonDisabled(): boolean {
|
||||
return this.uploadService.isUploading() || !this.hasNodeSelected();
|
||||
}
|
||||
|
||||
hasNodeSelected(): boolean {
|
||||
return this.chosenNode?.length > 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user