mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5432] component template and code fixes after testing Angular strict mode (#7118)
* process list fixes * template error fixes * template and code fixes * bug fixes in templates and types * bugs, bugs are everywhere * fix test * test fixes * enable strict templates for extensions lib * enable strict mode for insights lib * enable strict mode for core lib * enable strict mode for content lib * strict mode for process lib * strict mode for process cloud * fix demo shell template issues * fix process cloud types
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
<mat-option
|
||||
*ngFor="let node of previousNodes"
|
||||
(click)="onRoutePathClick(node, $event)"
|
||||
(onSelectionChange)="onRoutePathClick(node, $event)"
|
||||
(onSelectionChange)="onRouteClick(node)"
|
||||
class="adf-breadcrumb-path-option"
|
||||
[disabled]="readOnly"
|
||||
>
|
||||
|
@@ -190,6 +190,10 @@ export class BreadcrumbComponent implements OnInit, OnChanges, OnDestroy {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
this.onRouteClick(route);
|
||||
}
|
||||
|
||||
onRouteClick(route: PathElementEntity) {
|
||||
if (route && !this.readOnly) {
|
||||
this.navigate.emit(route);
|
||||
|
||||
|
@@ -23,7 +23,7 @@
|
||||
<mat-option
|
||||
*ngFor="let node of previousNodes;"
|
||||
(click)="onRoutePathClick(node, $event)"
|
||||
(onSelectionChange)="onRoutePathClick(node, $event)"
|
||||
(onSelectionChange)="onRouteClick(node)"
|
||||
class="adf-dropdown-breadcrumb-path-option"
|
||||
data-automation-class="dropdown-breadcrumb-path-option"
|
||||
[disabled]="readOnly">
|
||||
|
@@ -69,7 +69,7 @@
|
||||
#documentList
|
||||
[adf-highlight]="searchTerm"
|
||||
adf-highlight-selector=".adf-name-location-cell-name"
|
||||
[showHeader]="false"
|
||||
[showHeader]="showHeader"
|
||||
[node]="nodePaging"
|
||||
[preselectNodes]="preselectedNodes"
|
||||
[maxItems]="pageSize"
|
||||
|
@@ -37,7 +37,8 @@ import {
|
||||
FileUploadCompleteEvent,
|
||||
FileUploadDeleteEvent,
|
||||
AppConfigService,
|
||||
DataSorting
|
||||
DataSorting,
|
||||
ShowHeaderMode
|
||||
} from '@alfresco/adf-core';
|
||||
import { FormControl } from '@angular/forms';
|
||||
import { Node, NodePaging, Pagination, SiteEntry, SitePaging, NodeEntry, QueryBody, RequestScope } from '@alfresco/js-api';
|
||||
@@ -212,23 +213,23 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
|
||||
|
||||
/** Emitted when the user has chosen an item. */
|
||||
@Output()
|
||||
select: EventEmitter<Node[]> = new EventEmitter<Node[]>();
|
||||
select = new EventEmitter<Node[]>();
|
||||
|
||||
/** Emitted when the navigation changes. */
|
||||
@Output()
|
||||
navigationChange: EventEmitter<NodeEntryEvent> = new EventEmitter<NodeEntryEvent>();
|
||||
navigationChange = new EventEmitter<NodeEntryEvent>();
|
||||
|
||||
/** Emitted when the select site changes. */
|
||||
@Output()
|
||||
siteChange: EventEmitter<string> = new EventEmitter<string>();
|
||||
siteChange = new EventEmitter<string>();
|
||||
|
||||
/** Emitted when search is running. */
|
||||
@Output()
|
||||
showingSearch: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||
showingSearch = new EventEmitter<boolean>();
|
||||
|
||||
/** Emitted when current folder loaded. */
|
||||
@Output()
|
||||
currentFolder: EventEmitter<Node> = new EventEmitter<Node>();
|
||||
currentFolder = new EventEmitter<Node>();
|
||||
|
||||
/** Emitted when folder loaded. */
|
||||
@Output()
|
||||
@@ -252,6 +253,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit, OnDestroy {
|
||||
breadcrumbFolderTitle: string | null = null;
|
||||
startSiteGuid: string | null = null;
|
||||
hasValidQuery: boolean = false;
|
||||
showHeader = ShowHeaderMode.Never;
|
||||
|
||||
@ViewChild(InfinitePaginationComponent, { static: true })
|
||||
infinitePaginationComponent: InfinitePaginationComponent;
|
||||
|
@@ -63,7 +63,7 @@
|
||||
#datetimePicker
|
||||
(closed)="onDatetimepickerClosed()"
|
||||
[type]="type"
|
||||
timeInterval="1">
|
||||
[timeInterval]="1">
|
||||
</mat-datetimepicker>
|
||||
<input class="adf-share-link__input"
|
||||
#dateTimePickerInput
|
||||
|
@@ -266,7 +266,7 @@ describe('ShareDialogComponent', () => {
|
||||
).toBe('');
|
||||
});
|
||||
|
||||
it('should not allow expiration date action when node has no update permission', () => {
|
||||
it('should not allow expiration date action when node has no update permission', async () => {
|
||||
node.entry.properties['qshare:sharedId'] = 'sharedId';
|
||||
node.entry.allowableOperations = [];
|
||||
|
||||
@@ -276,6 +276,7 @@ describe('ShareDialogComponent', () => {
|
||||
};
|
||||
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
expect(fixture.nativeElement.querySelector('input[formcontrolname="time"]').disabled).toBe(true);
|
||||
expect(fixture.nativeElement.querySelector('.mat-slide-toggle[data-automation-id="adf-expire-toggle"]')
|
||||
|
@@ -10,7 +10,8 @@
|
||||
placeholder="{{ 'CORE.FOLDER_DIALOG.FOLDER_NAME.LABEL' | translate }}"
|
||||
matInput
|
||||
required
|
||||
[formControl]="form.controls['name']"/>
|
||||
[formControlName]="'name'"
|
||||
/>
|
||||
|
||||
<mat-hint *ngIf="form.controls['name'].dirty">
|
||||
<span *ngIf="form.controls['name'].errors?.required">
|
||||
@@ -28,7 +29,8 @@
|
||||
id="adf-folder-title-input"
|
||||
matInput
|
||||
placeholder="{{ 'CORE.FOLDER_DIALOG.FOLDER_TITLE.LABEL' | translate }}"
|
||||
[formControl]="form.controls['title']"/>
|
||||
[formControlName]="'title'"
|
||||
/>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="adf-full-width">
|
||||
@@ -37,7 +39,8 @@
|
||||
matInput
|
||||
placeholder="{{ 'CORE.FOLDER_DIALOG.FOLDER_DESCRIPTION.LABEL' | translate }}"
|
||||
rows="4"
|
||||
[formControl]="form.controls['description']"></textarea>
|
||||
[formControlName]="'description'">
|
||||
</textarea>
|
||||
</mat-form-field>
|
||||
</form>
|
||||
</mat-dialog-content>
|
||||
|
@@ -5,20 +5,20 @@
|
||||
<mat-dialog-content>
|
||||
<br />
|
||||
<form [formGroup]="form" (submit)="submit()">
|
||||
<mat-checkbox data-automation-id="adf-lock-node-checkbox" class="adf-lock-file-name" matTooltip="{{ nodeName }}" [formControl]="form.controls['isLocked']" ngDefaultControl>
|
||||
<mat-checkbox data-automation-id="adf-lock-node-checkbox" class="adf-lock-file-name" matTooltip="{{ nodeName }}" [formControlName]="'isLocked'" ngDefaultControl>
|
||||
{{ 'CORE.FILE_DIALOG.FILE_LOCK_CHECKBOX' | translate }} <strong>"{{ nodeName }}"</strong>
|
||||
</mat-checkbox>
|
||||
|
||||
<br />
|
||||
|
||||
<div *ngIf="form.value.isLocked">
|
||||
<mat-checkbox class="adf-lock-file-name" [formControl]="form.controls['allowOwner']" ngDefaultControl>
|
||||
<mat-checkbox class="adf-lock-file-name" [formControlName]="'allowOwner'" ngDefaultControl>
|
||||
{{ 'CORE.FILE_DIALOG.ALLOW_OTHERS_CHECKBOX' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
<br />
|
||||
|
||||
<mat-checkbox class="adf-lock-file-name" [formControl]="form.controls['isTimeLock']" ngDefaultControl>
|
||||
<mat-checkbox class="adf-lock-file-name" [formControlName]="'isTimeLock'" ngDefaultControl>
|
||||
{{ 'CORE.FILE_DIALOG.TIME_LOCK_CHECKBOX' | translate }}
|
||||
</mat-checkbox>
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
<mat-form-field *ngIf="form.value.isTimeLock">
|
||||
<mat-datetimepicker-toggle [for]="datetimePicker" matSuffix></mat-datetimepicker-toggle>
|
||||
<mat-datetimepicker #datetimePicker type="datetime" openOnFocus="true" timeInterval="1"></mat-datetimepicker>
|
||||
<input matInput [formControl]="form.controls['time']" [matDatetimepicker]="datetimePicker" required autocomplete="false">
|
||||
<mat-datetimepicker #datetimePicker type="datetime" [openOnFocus]="true" [timeInterval]="1"></mat-datetimepicker>
|
||||
<input matInput [formControlName]="'time'" [matDatetimepicker]="datetimePicker" required autocomplete="false">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</form>
|
||||
|
@@ -20,9 +20,9 @@
|
||||
(executeRowAction)="onExecuteRowAction($event)"
|
||||
(rowClick)="onNodeClick($event.value?.node)"
|
||||
(rowDblClick)="onNodeDblClick($event.value?.node)"
|
||||
(row-select)="onNodeSelect($event.detail)"
|
||||
(row-unselect)="onNodeUnselect($event.detail)"
|
||||
(sorting-changed)="onSortingChanged($event)"
|
||||
(row-select)="onNodeSelect($any($event).detail)"
|
||||
(row-unselect)="onNodeUnselect($any($event).detail)"
|
||||
(sorting-changed)="onSortingChanged($any($event))"
|
||||
[class.adf-datatable-gallery-thumbnails]="data.thumbnails">
|
||||
|
||||
<div *ngIf="headerFilters">
|
||||
|
@@ -130,7 +130,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
|
||||
/** Toggles the header */
|
||||
@Input()
|
||||
showHeader: string = ShowHeaderMode.Data;
|
||||
showHeader = ShowHeaderMode.Data;
|
||||
|
||||
/** User interaction for folder navigation or file preview.
|
||||
* Valid values are "click" and "dblclick". Default value: "dblclick"
|
||||
@@ -207,7 +207,7 @@ export class DocumentListComponent implements OnInit, OnChanges, OnDestroy, Afte
|
||||
* docs for more details and usage examples.
|
||||
*/
|
||||
@Input()
|
||||
rowStyle: string;
|
||||
rowStyle: { [key: string]: any; };
|
||||
|
||||
/** The CSS class to apply to every row */
|
||||
@Input()
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<adf-datatable [rows]="selectedMembers"
|
||||
class="adf-datatable-permission"
|
||||
selectionMode="none"
|
||||
stickyHeader="true"
|
||||
[stickyHeader]="true"
|
||||
data-automation-id="adf-user-role-selection-table"
|
||||
*ngIf="selectedMembers.length">
|
||||
<data-columns>
|
||||
@@ -56,7 +56,7 @@
|
||||
</adf-data-column-header>
|
||||
</data-column>
|
||||
|
||||
<data-column class="adf-datatable-cell adf-delete-permission-column" key="" sortable="false">
|
||||
<data-column class="adf-datatable-cell adf-delete-permission-column" key="" [sortable]="false">
|
||||
<ng-template let-entry="$implicit">
|
||||
<button mat-icon-button
|
||||
class="adf-add-member-action"
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<adf-datatable class="adf-datatable-permission"
|
||||
id="adf-permission-display-container"
|
||||
[rows]="permissions"
|
||||
stickyHeader="true"
|
||||
[stickyHeader]="true"
|
||||
[selectionMode]="selectionMode">
|
||||
|
||||
<data-columns>
|
||||
@@ -32,7 +32,7 @@
|
||||
class="adf-ellipsis-cell adf-expand-cell-4"
|
||||
title="PERMISSION_MANAGER.PERMISSION_DISPLAY.ROLE"
|
||||
key="name"
|
||||
sortable="false">
|
||||
[sortable]="false">
|
||||
<ng-template let-entry="$implicit">
|
||||
<adf-user-role-column [readonly]="entry.row.obj.readonly || isReadOnly"
|
||||
[placeholder]="entry.data.getValue(entry.row, entry.col)"
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, ViewEncapsulation } from '@angular/core';
|
||||
import { Node, PermissionElement } from '@alfresco/js-api';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { PermissionDisplayModel } from '../../models/permission.model';
|
||||
import { RoleModel } from '../../models/role.model';
|
||||
|
||||
@@ -55,7 +55,7 @@ export class PermissionContainerComponent implements OnChanges {
|
||||
|
||||
/** Emitted when the permission is updated. */
|
||||
@Output()
|
||||
delete = new EventEmitter<PermissionElement>();
|
||||
delete = new EventEmitter<PermissionDisplayModel>();
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
@Output()
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
<ng-container *ngIf="permissionList.error$ | async">
|
||||
<div class="adf-no-permission__template" id="adf-permission-manager-error">
|
||||
<mat-icon [color]="'error'">error</mat-icon>
|
||||
<mat-icon color="warn">error</mat-icon>
|
||||
<p class="adf-no-permission__template--text">{{ 'PERMISSION_MANAGER.ERROR.NOT-FOUND'| translate }}</p>
|
||||
</div>
|
||||
</ng-container>
|
||||
@@ -95,8 +95,8 @@
|
||||
(update)="updatePermission($event)"
|
||||
(delete)="deletePermission($event)"
|
||||
(updateAll)="updateAllPermission($event)"
|
||||
(row-select)="onSelect($event.detail.selection)"
|
||||
(row-unselect)="onSelect($event.detail.selection)"
|
||||
(row-select)="onSelect($any($event).detail.selection)"
|
||||
(row-unselect)="onSelect($any($event).detail.selection)"
|
||||
[roles]="model.roles">
|
||||
</adf-permission-container>
|
||||
|
||||
|
@@ -141,14 +141,14 @@ export class SearchControlComponent implements OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
onFocus($event): void {
|
||||
this.focusSubject.next($event);
|
||||
onFocus(event: FocusEvent): void {
|
||||
this.focusSubject.next(event);
|
||||
}
|
||||
|
||||
onBlur($event): void {
|
||||
const nextElement: any = this.getNextElementSibling(<Element> $event.target);
|
||||
if (!nextElement && !this.isListElement($event)) {
|
||||
this.focusSubject.next($event);
|
||||
onBlur(event: FocusEvent): void {
|
||||
const nextElement: any = this.getNextElementSibling(<Element> event.target);
|
||||
if (!nextElement && !this.isListElement(event)) {
|
||||
this.focusSubject.next(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,15 +159,15 @@ export class SearchControlComponent implements OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
onRowArrowDown($event: KeyboardEvent): void {
|
||||
const nextElement: any = this.getNextElementSibling(<Element> $event.target);
|
||||
onRowArrowDown(event: Event): void {
|
||||
const nextElement: any = this.getNextElementSibling(<Element> event.target);
|
||||
if (nextElement) {
|
||||
nextElement.focus();
|
||||
}
|
||||
}
|
||||
|
||||
onRowArrowUp($event: KeyboardEvent): void {
|
||||
const previousElement: any = this.getPreviousElementSibling(<Element> $event.target);
|
||||
onRowArrowUp(event: Event): void {
|
||||
const previousElement: any = this.getPreviousElementSibling(<Element> event.target);
|
||||
if (previousElement) {
|
||||
previousElement.focus();
|
||||
} else {
|
||||
@@ -181,8 +181,8 @@ export class SearchControlComponent implements OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
private isListElement($event: any): boolean {
|
||||
return $event.relatedTarget && $event.relatedTarget.children[0] && $event.relatedTarget.children[0].className === 'mat-list-item-content';
|
||||
private isListElement(event: any): boolean {
|
||||
return event.relatedTarget && event.relatedTarget.children[0] && event.relatedTarget.children[0].className === 'mat-list-item-content';
|
||||
}
|
||||
|
||||
private getNextElementSibling(node: Element): Element {
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { FileModel, FileInfo, UploadService, TranslationService } from '@alfresco/adf-core';
|
||||
import { FileModel, FileInfo, UploadService, TranslationService, FileUploadErrorEvent } from '@alfresco/adf-core';
|
||||
import { EventEmitter, Input, Output, OnInit, OnDestroy, NgZone, Directive } from '@angular/core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { UploadFilesEvent } from '../upload-files.event';
|
||||
@@ -67,7 +67,7 @@ export abstract class UploadBase implements OnInit, OnDestroy {
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
@Output()
|
||||
error = new EventEmitter();
|
||||
error = new EventEmitter<FileUploadErrorEvent>();
|
||||
|
||||
/** Emitted when the upload begins. */
|
||||
@Output()
|
||||
|
@@ -11,7 +11,6 @@
|
||||
[attr.aria-label]="(isDialogMinimized ?
|
||||
'ADF_FILE_UPLOAD.ARIA-LABEL.DIALOG_MAXIMIZE':
|
||||
'ADF_FILE_UPLOAD.ARIA-LABEL.DIALOG_MINIMIZE') | translate"
|
||||
color="secondary"
|
||||
[disabled]="isConfirmation"
|
||||
[attr.aria-expanded]="!isDialogMinimized"
|
||||
(click)="toggleMinimized()">
|
||||
@@ -108,7 +107,6 @@
|
||||
<button
|
||||
id="adf-upload-dialog-cancel"
|
||||
[attr.aria-label]="'ADF_FILE_UPLOAD.ARIA-LABEL.CONFIRMATION.CANCEL' | translate"
|
||||
color="secondary"
|
||||
mat-button
|
||||
(click)="cancelAllUploads()"
|
||||
>{{ 'ADF_FILE_UPLOAD.CONFIRMATION.BUTTON.CANCEL' | translate }}</button>
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { SimpleChange } from '@angular/core';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ContentService, UploadService, setupTestBed } from '@alfresco/adf-core';
|
||||
import { ContentService, UploadService, setupTestBed, FileUploadErrorEvent } from '@alfresco/adf-core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { UploadButtonComponent } from './upload-button.component';
|
||||
import { NodeEntry } from '@alfresco/js-api';
|
||||
@@ -377,8 +377,8 @@ describe('UploadButtonComponent', () => {
|
||||
|
||||
spyOn(contentService, 'getNode').and.returnValue(throwError('error'));
|
||||
|
||||
component.error.subscribe((value) => {
|
||||
expect(value).toBe('FILE_UPLOAD.BUTTON.PERMISSION_CHECK_ERROR');
|
||||
component.error.subscribe((value: FileUploadErrorEvent) => {
|
||||
expect(value.error).toBe('FILE_UPLOAD.BUTTON.PERMISSION_CHECK_ERROR');
|
||||
done();
|
||||
});
|
||||
|
||||
|
@@ -138,9 +138,9 @@ export class UploadButtonComponent extends UploadBase implements OnInit, OnChang
|
||||
(res) => this.permissionValue.next(this.nodeHasPermission(res.entry, AllowableOperationsEnum.CREATE)),
|
||||
(error: { error: Error }) => {
|
||||
if (error && error.error) {
|
||||
this.error.emit(error.error.message);
|
||||
this.error.emit({ error: error.error.message } as any);
|
||||
} else {
|
||||
this.error.emit('FILE_UPLOAD.BUTTON.PERMISSION_CHECK_ERROR');
|
||||
this.error.emit({ error: 'FILE_UPLOAD.BUTTON.PERMISSION_CHECK_ERROR'} as any);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<div [adf-file-draggable]="isDroppable()" class="adf-upload-border"
|
||||
(filesDropped)="onFilesDropped($event)"
|
||||
(folderEntityDropped)="onFolderEntityDropped($event)"
|
||||
(upload-files)="onUploadFiles($event)"
|
||||
(upload-files)="onUploadFiles($any($event))"
|
||||
dropzone="" webkitdropzone="*" #droparea>
|
||||
<ng-content></ng-content>
|
||||
</div>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Component, Input, ViewEncapsulation, ViewChild, Output, EventEmitter, OnInit } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { VersionListComponent } from './version-list.component';
|
||||
import { ContentService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { ContentService, AlfrescoApiService, FileUploadErrorEvent } from '@alfresco/adf-core';
|
||||
import { trigger, state, style, animate, transition } from '@angular/animations';
|
||||
|
||||
@Component({
|
||||
@@ -65,19 +65,19 @@ export class VersionManagerComponent implements OnInit {
|
||||
|
||||
/** Emitted when a file is uploaded successfully. */
|
||||
@Output()
|
||||
uploadSuccess: EventEmitter<Node> = new EventEmitter<Node>();
|
||||
uploadSuccess = new EventEmitter<Node>();
|
||||
|
||||
/** Emitted when an error occurs during upload. */
|
||||
@Output()
|
||||
uploadError: EventEmitter<Node> = new EventEmitter<Node>();
|
||||
uploadError = new EventEmitter<FileUploadErrorEvent>();
|
||||
|
||||
/** Emitted when an cancelling during upload. */
|
||||
@Output()
|
||||
uploadCancel: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||
uploadCancel = new EventEmitter<boolean>();
|
||||
|
||||
/** Emitted when viewing a version. */
|
||||
@Output()
|
||||
viewVersion: EventEmitter<string> = new EventEmitter<string>();
|
||||
viewVersion = new EventEmitter<string>();
|
||||
|
||||
@ViewChild('versionList', { static: true })
|
||||
versionListComponent: VersionListComponent;
|
||||
@@ -110,7 +110,7 @@ export class VersionManagerComponent implements OnInit {
|
||||
this.uploadState = 'close';
|
||||
}
|
||||
|
||||
onUploadError(event: any) {
|
||||
onUploadError(event: FileUploadErrorEvent) {
|
||||
this.uploadError.emit(event);
|
||||
}
|
||||
|
||||
|
@@ -79,7 +79,7 @@ describe('VersionUploadComponent', () => {
|
||||
expect(component.disabled).toEqual(false);
|
||||
done();
|
||||
});
|
||||
component.onError(true);
|
||||
component.onError({} as any);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component, Input, ViewEncapsulation, Output, EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { ContentService, FileUploadEvent, UploadService } from '@alfresco/adf-core';
|
||||
import { ContentService, FileUploadErrorEvent, FileUploadEvent, UploadService } from '@alfresco/adf-core';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
||||
@@ -58,7 +58,7 @@ export class VersionUploadComponent implements OnInit, OnDestroy {
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
@Output()
|
||||
error = new EventEmitter();
|
||||
error = new EventEmitter<FileUploadErrorEvent>();
|
||||
|
||||
/** Emitted when an cancelling during upload. */
|
||||
@Output()
|
||||
@@ -114,7 +114,7 @@ export class VersionUploadComponent implements OnInit, OnDestroy {
|
||||
this.success.emit(event);
|
||||
}
|
||||
|
||||
onError(event: any) {
|
||||
onError(event: FileUploadErrorEvent) {
|
||||
this.disabled = false;
|
||||
this.error.emit(event);
|
||||
}
|
||||
|
Reference in New Issue
Block a user