Minor code and style fixes (#5398)

* type fixes

* import fixes

* fix typos

* fix warning for private props that init in ctor only

* typing fixes

* typing fixes

* style cleanup

* fix test template
This commit is contained in:
Denys Vuika
2020-02-09 22:03:32 +00:00
committed by GitHub
parent 3459c98bd0
commit a0926a38d8
74 changed files with 171 additions and 71 deletions

View File

@@ -34,7 +34,8 @@ import {
FormFieldValidator,
FormValues,
FormModel,
AppConfigService
AppConfigService,
ContentLinkModel
} from '@alfresco/adf-core';
import { FormCloudService } from '../services/form-cloud.service';
import { TaskVariableCloud } from '../models/task-variable-cloud.model';
@@ -101,7 +102,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
/** Emitted when form content is clicked. */
@Output()
formContentClicked = new EventEmitter<string>();
formContentClicked = new EventEmitter<ContentLinkModel>();
protected subscriptions: Subscription[] = [];
nodeId: string;
@@ -119,7 +120,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
this.formService.formContentClicked
.pipe(takeUntil(this.onDestroy$))
.subscribe((content: any) => {
.subscribe((content) => {
this.formContentClicked.emit(content);
});
this.formRenderingService.setComponentTypeResolver('upload', () => AttachFileCloudWidgetComponent, true);

View File

@@ -88,7 +88,7 @@ export class AttachFileCloudWidgetComponent extends UploadCloudWidgetComponent
this.onFileChanged(event);
}
onRemoveAttachFile(file: File | RelatedContentRepresentation) {
onRemoveAttachFile(file: File | RelatedContentRepresentation | Node) {
this.removeFile(file);
}

View File

@@ -28,7 +28,7 @@
}
&-menu-list {
padding-top: 0px!important;
padding-top: 0 !important;
}
}
}

View File

@@ -25,6 +25,7 @@ import { fakeGlobalTask, fakeCustomSchema } from '../mock/fakeTaskResponseMock';
import { of } from 'rxjs';
import { ProcessServiceCloudTestingModule } from '../../../testing/process-service-cloud.testing.module';
import { TaskListCloudModule } from '../task-list-cloud.module';
import { Person } from '@alfresco/js-api';
@Component({
template: `
@@ -34,7 +35,7 @@ import { TaskListCloudModule } from '../task-list-cloud.module';
<data-column key="created" title="ADF_CLOUD_TASK_LIST.PROPERTIES.CREATED" class="adf-hidden"></data-column>
<data-column key="startedBy" title="ADF_CLOUD_TASK_LIST.PROPERTIES.CREATED" class="adf-desktop-only dw-dt-col-3 adf-ellipsis-cell">
<ng-template let-entry="$implicit">
<div>{{getFullName(entry.row.obj.startedBy)}}</div>
<div>{{getFullName(entry.row?.obj?.startedBy)}}</div>
</ng-template>
</data-column>
</data-columns>
@@ -43,7 +44,11 @@ import { TaskListCloudModule } from '../task-list-cloud.module';
class CustomTaskListComponent {
@ViewChild(TaskListCloudComponent)
taskList: TaskListCloudComponent;
}
getFullName(person: Person): string {
return `${person.firstName} ${person.lastName}`;
}
}
@Component({
template: `
<adf-tasklist>