mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-09-17 14:21:29 +00:00
Fixing unit test after last rebase + lint
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
<mat-form-field [floatLabel]="'auto'" [attr.data-automation-id]="processFilterProperty.key">
|
<mat-form-field floatLabel="auto" [attr.data-automation-id]="processFilterProperty.key">
|
||||||
|
<mat-label>{{ processFilterProperty.label | translate }}</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
placeholder="{{ processFilterProperty.label | translate }}"
|
placeholder="{{ processFilterProperty.label | translate }}"
|
||||||
[value]="type"
|
[value]="type"
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<ng-container *ngIf="isDateRangeType()">
|
<ng-container *ngIf="isDateRangeType()">
|
||||||
<mat-form-field [floatLabel]="'auto'" class="adf-cloud-date-range-picker">
|
<mat-form-field floatLabel="auto" class="adf-cloud-date-range-picker">
|
||||||
<mat-label>{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE_TITLE' | translate }}</mat-label>
|
<mat-label>{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.DATE_RANGE_TITLE' | translate }}</mat-label>
|
||||||
<mat-date-range-input [formGroup]="dateRangeForm" [rangePicker]="picker">
|
<mat-date-range-input [formGroup]="dateRangeForm" [rangePicker]="picker">
|
||||||
<input matStartDate formControlName="from" placeholder="{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.START_DATE' | translate }}">
|
<input matStartDate formControlName="from" placeholder="{{ 'ADF_CLOUD_EDIT_PROCESS_FILTER.LABEL.START_DATE' | translate }}">
|
||||||
|
@@ -27,9 +27,14 @@ import { ProcessContentService } from '../form/services/process-content.service'
|
|||||||
import { HarnessLoader } from '@angular/cdk/testing';
|
import { HarnessLoader } from '@angular/cdk/testing';
|
||||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||||
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
||||||
|
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||||
|
import { MatMenuModule } from '@angular/material/menu';
|
||||||
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
import { AlfrescoApiService, AlfrescoApiServiceMock } from '@alfresco/adf-core';
|
||||||
|
|
||||||
describe('TaskAttachmentList', () => {
|
describe('TaskAttachmentList', () => {
|
||||||
|
|
||||||
let component: TaskAttachmentListComponent;
|
let component: TaskAttachmentListComponent;
|
||||||
let fixture: ComponentFixture<TaskAttachmentListComponent>;
|
let fixture: ComponentFixture<TaskAttachmentListComponent>;
|
||||||
let service: ProcessContentService;
|
let service: ProcessContentService;
|
||||||
@@ -44,15 +49,13 @@ describe('TaskAttachmentList', () => {
|
|||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [
|
||||||
TranslateModule.forRoot(),
|
TranslateModule.forRoot(),
|
||||||
HttpClientModule,
|
HttpClientTestingModule,
|
||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
MatProgressSpinnerModule,
|
MatProgressSpinnerModule,
|
||||||
MatTooltipModule
|
MatTooltipModule
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }]
|
||||||
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock }
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(TaskAttachmentListComponent);
|
fixture = TestBed.createComponent(TaskAttachmentListComponent);
|
||||||
component = fixture.componentInstance;
|
component = fixture.componentInstance;
|
||||||
@@ -129,12 +132,14 @@ describe('TaskAttachmentList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should show the empty default message when has no custom template', async () => {
|
it('should show the empty default message when has no custom template', async () => {
|
||||||
getTaskRelatedContentSpy.and.returnValue(of({
|
getTaskRelatedContentSpy.and.returnValue(
|
||||||
|
of({
|
||||||
size: 0,
|
size: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
start: 0,
|
start: 0,
|
||||||
data: []
|
data: []
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
const change = new SimpleChange(null, '123', true);
|
const change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ taskId: change });
|
component.ngOnChanges({ taskId: change });
|
||||||
component.hasCustomTemplate = false;
|
component.hasCustomTemplate = false;
|
||||||
@@ -186,12 +191,14 @@ describe('TaskAttachmentList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should show the empty list component when the attachments list is empty', async () => {
|
it('should show the empty list component when the attachments list is empty', async () => {
|
||||||
getTaskRelatedContentSpy.and.returnValue(of({
|
getTaskRelatedContentSpy.and.returnValue(
|
||||||
|
of({
|
||||||
size: 0,
|
size: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
start: 0,
|
start: 0,
|
||||||
data: []
|
data: []
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
const change = new SimpleChange(null, '123', true);
|
const change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ taskId: change });
|
component.ngOnChanges({ taskId: change });
|
||||||
|
|
||||||
@@ -202,19 +209,23 @@ describe('TaskAttachmentList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should show the empty list component when the attachments list is empty for completed task', async () => {
|
it('should show the empty list component when the attachments list is empty for completed task', async () => {
|
||||||
getTaskRelatedContentSpy.and.returnValue(of({
|
getTaskRelatedContentSpy.and.returnValue(
|
||||||
|
of({
|
||||||
size: 0,
|
size: 0,
|
||||||
total: 0,
|
total: 0,
|
||||||
start: 0,
|
start: 0,
|
||||||
data: []
|
data: []
|
||||||
}));
|
})
|
||||||
|
);
|
||||||
const change = new SimpleChange(null, '123', true);
|
const change = new SimpleChange(null, '123', true);
|
||||||
component.ngOnChanges({ taskId: change });
|
component.ngOnChanges({ taskId: change });
|
||||||
component.disabled = true;
|
component.disabled = true;
|
||||||
|
|
||||||
fixture.whenStable().then(() => {
|
fixture.whenStable().then(() => {
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
expect(fixture.nativeElement.querySelector('div[adf-empty-list-header]').innerText.trim()).toEqual('ADF_TASK_LIST.ATTACHMENT.EMPTY.HEADER');
|
expect(fixture.nativeElement.querySelector('div[adf-empty-list-header]').innerText.trim()).toEqual(
|
||||||
|
'ADF_TASK_LIST.ATTACHMENT.EMPTY.HEADER'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -235,7 +246,6 @@ describe('TaskAttachmentList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('change detection', () => {
|
describe('change detection', () => {
|
||||||
|
|
||||||
let change: SimpleChange;
|
let change: SimpleChange;
|
||||||
let nullChange: SimpleChange;
|
let nullChange: SimpleChange;
|
||||||
|
|
||||||
@@ -269,7 +279,6 @@ describe('TaskAttachmentList', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Delete attachments', () => {
|
describe('Delete attachments', () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.taskId = '123';
|
component.taskId = '123';
|
||||||
fixture.whenStable();
|
fixture.whenStable();
|
||||||
@@ -295,18 +304,14 @@ describe('TaskAttachmentList', () => {
|
|||||||
</adf-task-attachment-list>
|
</adf-task-attachment-list>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
class CustomEmptyTemplateComponent {
|
class CustomEmptyTemplateComponent {}
|
||||||
}
|
|
||||||
|
|
||||||
describe('Custom CustomEmptyTemplateComponent', () => {
|
describe('Custom CustomEmptyTemplateComponent', () => {
|
||||||
let fixture: ComponentFixture<CustomEmptyTemplateComponent>;
|
let fixture: ComponentFixture<CustomEmptyTemplateComponent>;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [TranslateModule.forRoot(), ProcessTestingModule],
|
||||||
TranslateModule.forRoot(),
|
|
||||||
ProcessTestingModule
|
|
||||||
],
|
|
||||||
declarations: [CustomEmptyTemplateComponent],
|
declarations: [CustomEmptyTemplateComponent],
|
||||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||||
});
|
});
|
||||||
|
@@ -17,7 +17,21 @@
|
|||||||
|
|
||||||
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, fakeAsync, TestBed } from '@angular/core/testing';
|
||||||
import { Observable, of } from 'rxjs';
|
import { Observable, of } from 'rxjs';
|
||||||
import { FormService, ContainerModel, FormFieldTypes, FormFieldOption, FormFieldModel, FormModel, CoreTestingModule } from '@alfresco/adf-core';
|
import {
|
||||||
|
FormService,
|
||||||
|
ContainerModel,
|
||||||
|
FormFieldTypes,
|
||||||
|
FormFieldOption,
|
||||||
|
FormFieldModel,
|
||||||
|
FormModel,
|
||||||
|
ErrorWidgetComponent,
|
||||||
|
TranslationMock,
|
||||||
|
AlfrescoApiServiceMock,
|
||||||
|
AppConfigServiceMock,
|
||||||
|
AppConfigService,
|
||||||
|
AlfrescoApiService,
|
||||||
|
TranslationService
|
||||||
|
} from '@alfresco/adf-core';
|
||||||
import { RadioButtonsWidgetComponent } from './radio-buttons.widget';
|
import { RadioButtonsWidgetComponent } from './radio-buttons.widget';
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
import { MatRadioModule } from '@angular/material/radio';
|
import { MatRadioModule } from '@angular/material/radio';
|
||||||
@@ -29,6 +43,9 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
|||||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||||
import { MatRadioButtonHarness, MatRadioGroupHarness } from '@angular/material/radio/testing';
|
import { MatRadioButtonHarness, MatRadioGroupHarness } from '@angular/material/radio/testing';
|
||||||
import { MatTooltipHarness } from '@angular/material/tooltip/testing';
|
import { MatTooltipHarness } from '@angular/material/tooltip/testing';
|
||||||
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||||
|
import { MatButtonModule } from '@angular/material/button';
|
||||||
|
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||||
|
|
||||||
describe('RadioButtonsWidgetComponent', () => {
|
describe('RadioButtonsWidgetComponent', () => {
|
||||||
let formService: FormService;
|
let formService: FormService;
|
||||||
|
@@ -10,6 +10,7 @@
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
<div class="adf-start-process-definition-container">
|
<div class="adf-start-process-definition-container">
|
||||||
<mat-form-field *ngIf="showSelectApplicationDropdown" [floatLabel]="'always'" class="adf-start-process-app-list">
|
<mat-form-field *ngIf="showSelectApplicationDropdown" [floatLabel]="'always'" class="adf-start-process-app-list">
|
||||||
|
<mat-label>{{ 'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.SELECT_APPLICATION' | translate }}</mat-label>
|
||||||
<mat-select
|
<mat-select
|
||||||
placeholder="{{ 'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.SELECT_APPLICATION' | translate }}"
|
placeholder="{{ 'ADF_PROCESS_LIST.START_PROCESS.FORM.LABEL.SELECT_APPLICATION' | translate }}"
|
||||||
(selectionChange)="onAppSelectionChange($event)"
|
(selectionChange)="onAppSelectionChange($event)"
|
||||||
|
@@ -34,6 +34,13 @@ import { HarnessLoader } from '@angular/cdk/testing';
|
|||||||
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
|
import { MatFormFieldHarness } from '@angular/material/form-field/testing';
|
||||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||||
import { MatAutocompleteHarness } from '@angular/material/autocomplete/testing';
|
import { MatAutocompleteHarness } from '@angular/material/autocomplete/testing';
|
||||||
|
import { FormModule } from '../../form';
|
||||||
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
|
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||||
|
import { MatInputModule } from '@angular/material/input';
|
||||||
|
import { MatIconModule } from '@angular/material/icon';
|
||||||
|
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||||
|
|
||||||
describe('StartProcessComponent', () => {
|
describe('StartProcessComponent', () => {
|
||||||
let appConfig: AppConfigService;
|
let appConfig: AppConfigService;
|
||||||
@@ -62,15 +69,18 @@ describe('StartProcessComponent', () => {
|
|||||||
MatInputModule,
|
MatInputModule,
|
||||||
MatIconModule,
|
MatIconModule,
|
||||||
MatSelectModule,
|
MatSelectModule,
|
||||||
MatAutocompleteModule],
|
MatAutocompleteModule
|
||||||
|
],
|
||||||
declarations: [StartProcessInstanceComponent],
|
declarations: [StartProcessInstanceComponent],
|
||||||
providers:[ ProcessNamePipe,
|
providers: [
|
||||||
|
ProcessNamePipe,
|
||||||
LocalizedDatePipe,
|
LocalizedDatePipe,
|
||||||
ActivitiContentService,
|
ActivitiContentService,
|
||||||
ProcessService,
|
ProcessService,
|
||||||
AppsProcessService,
|
AppsProcessService,
|
||||||
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
{ provide: AppConfigService, useClass: AppConfigServiceMock },
|
||||||
{ provide: TranslationService, useClass: TranslationMock } ]
|
{ provide: TranslationService, useClass: TranslationMock }
|
||||||
|
]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -194,7 +204,9 @@ describe('StartProcessComponent', () => {
|
|||||||
component.processDefinitionInput.setValue('My Default Name');
|
component.processDefinitionInput.setValue('My Default Name');
|
||||||
component.processNameInput.setValue('claim');
|
component.processNameInput.setValue('claim');
|
||||||
|
|
||||||
const inputLabels = await loader.getAllHarnesses(MatFormFieldHarness.with({ ancestor: '.adf-start-process', selector: '.adf-process-input-container' }));
|
const inputLabels = await loader.getAllHarnesses(
|
||||||
|
MatFormFieldHarness.with({ ancestor: '.adf-start-process', selector: '.adf-process-input-container' })
|
||||||
|
);
|
||||||
expect(inputLabels.length).toBe(2);
|
expect(inputLabels.length).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -18,22 +18,30 @@
|
|||||||
import { Component, SimpleChange, ViewChild, OnInit, Output, EventEmitter, SimpleChanges } from '@angular/core';
|
import { Component, SimpleChange, ViewChild, OnInit, Output, EventEmitter, SimpleChanges } from '@angular/core';
|
||||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { By } from '@angular/platform-browser';
|
import { By } from '@angular/platform-browser';
|
||||||
import { AppConfigService, DataRowEvent, ObjectDataRow, DataCellEvent, ObjectDataColumn, DataTableModule, AppConfigServiceMock, AlfrescoApiServiceMock, AlfrescoApiService } from '@alfresco/adf-core';
|
import {
|
||||||
|
AppConfigService,
|
||||||
|
DataRowEvent,
|
||||||
|
ObjectDataRow,
|
||||||
|
DataCellEvent,
|
||||||
|
ObjectDataColumn,
|
||||||
|
DataTableModule,
|
||||||
|
AppConfigServiceMock,
|
||||||
|
AlfrescoApiServiceMock,
|
||||||
|
AlfrescoApiService
|
||||||
|
} from '@alfresco/adf-core';
|
||||||
import { TaskListService } from '../services/tasklist.service';
|
import { TaskListService } from '../services/tasklist.service';
|
||||||
import { TaskListComponent } from './task-list.component';
|
import { TaskListComponent } from './task-list.component';
|
||||||
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
import { ProcessTestingModule } from '../../testing/process.testing.module';
|
||||||
import {
|
import { fakeGlobalTask, fakeEmptyTask, paginatedTask, fakeColumnSchema, fakeCustomSchema } from '../../mock';
|
||||||
fakeGlobalTask,
|
|
||||||
fakeEmptyTask,
|
|
||||||
paginatedTask,
|
|
||||||
fakeColumnSchema, fakeCustomSchema
|
|
||||||
} from '../../mock';
|
|
||||||
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
||||||
import { of, Subject } from 'rxjs';
|
import { of, Subject } from 'rxjs';
|
||||||
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
|
||||||
import { HarnessLoader } from '@angular/cdk/testing';
|
import { HarnessLoader } from '@angular/cdk/testing';
|
||||||
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
import { MatCheckboxHarness } from '@angular/material/checkbox/testing';
|
||||||
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
import { MatMenuItemHarness } from '@angular/material/menu/testing';
|
||||||
|
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||||
|
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
import { HttpClientTestingModule } from '@angular/common/http/testing';
|
||||||
|
|
||||||
declare let jasmine: any;
|
declare let jasmine: any;
|
||||||
|
|
||||||
@@ -99,13 +107,7 @@ describe('TaskListComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [TranslateModule.forRoot(), DataTableModule, NoopAnimationsModule, MatProgressSpinnerModule, HttpClientTestingModule],
|
||||||
TranslateModule.forRoot(),
|
|
||||||
DataTableModule,
|
|
||||||
NoopAnimationsModule,
|
|
||||||
MatProgressSpinnerModule,
|
|
||||||
HttpClientTestingModule
|
|
||||||
],
|
|
||||||
declarations: [TaskListComponent],
|
declarations: [TaskListComponent],
|
||||||
providers: [
|
providers: [
|
||||||
TaskListService,
|
TaskListService,
|
||||||
@@ -198,7 +200,7 @@ describe('TaskListComponent', () => {
|
|||||||
expect(component.rows[0]['assignee'].id).toEqual(2);
|
expect(component.rows[0]['assignee'].id).toEqual(2);
|
||||||
expect(component.rows[0]['assignee'].firstName).toEqual('firstNameFake1');
|
expect(component.rows[0]['assignee'].firstName).toEqual('firstNameFake1');
|
||||||
expect(component.rows[0]['assignee'].lastName).toEqual('lastNameFake1');
|
expect(component.rows[0]['assignee'].lastName).toEqual('lastNameFake1');
|
||||||
expect(component.rows[0][('assignee')].email).toEqual('emailFake1');
|
expect(component.rows[0]['assignee'].email).toEqual('emailFake1');
|
||||||
expect(component.rows[0]['created'].toISOString()).toEqual('2017-03-01T12:25:17.189Z');
|
expect(component.rows[0]['created'].toISOString()).toEqual('2017-03-01T12:25:17.189Z');
|
||||||
expect(component.rows[0]['dueDate'].toISOString()).toEqual('2017-04-02T12:25:17.189Z');
|
expect(component.rows[0]['dueDate'].toISOString()).toEqual('2017-04-02T12:25:17.189Z');
|
||||||
expect(component.rows[0]['endDate'].toISOString()).toEqual('2017-05-03T12:25:31.129Z');
|
expect(component.rows[0]['endDate'].toISOString()).toEqual('2017-05-03T12:25:31.129Z');
|
||||||
@@ -341,7 +343,6 @@ describe('TaskListComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('component changes', () => {
|
describe('component changes', () => {
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
component.rows = fakeGlobalTask.data;
|
component.rows = fakeGlobalTask.data;
|
||||||
fixture.detectChanges();
|
fixture.detectChanges();
|
||||||
@@ -647,8 +648,7 @@ describe('TaskListComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: ` <adf-tasklist #taskList>
|
||||||
<adf-tasklist #taskList>
|
|
||||||
<data-columns>
|
<data-columns>
|
||||||
<data-column key="name" title="ADF_TASK_LIST.PROPERTIES.NAME" class="full-width name-column" [order]="3"></data-column>
|
<data-column key="name" title="ADF_TASK_LIST.PROPERTIES.NAME" class="full-width name-column" [order]="3"></data-column>
|
||||||
<data-column key="created" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="hidden"></data-column>
|
<data-column key="created" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="hidden"></data-column>
|
||||||
@@ -660,9 +660,7 @@ describe('TaskListComponent', () => {
|
|||||||
</data-columns>
|
</data-columns>
|
||||||
</adf-tasklist>`
|
</adf-tasklist>`
|
||||||
})
|
})
|
||||||
|
|
||||||
class CustomTaskListComponent {
|
class CustomTaskListComponent {
|
||||||
|
|
||||||
@ViewChild(TaskListComponent)
|
@ViewChild(TaskListComponent)
|
||||||
taskList: TaskListComponent;
|
taskList: TaskListComponent;
|
||||||
}
|
}
|
||||||
@@ -673,10 +671,7 @@ describe('CustomTaskListComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [TranslateModule.forRoot(), ProcessTestingModule],
|
||||||
TranslateModule.forRoot(),
|
|
||||||
ProcessTestingModule
|
|
||||||
],
|
|
||||||
declarations: [CustomTaskListComponent]
|
declarations: [CustomTaskListComponent]
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(CustomTaskListComponent);
|
fixture = TestBed.createComponent(CustomTaskListComponent);
|
||||||
@@ -707,8 +702,7 @@ describe('CustomTaskListComponent', () => {
|
|||||||
</adf-tasklist>
|
</adf-tasklist>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
class EmptyTemplateComponent {
|
class EmptyTemplateComponent {}
|
||||||
}
|
|
||||||
|
|
||||||
describe('Task List: Custom EmptyTemplateComponent', () => {
|
describe('Task List: Custom EmptyTemplateComponent', () => {
|
||||||
let fixture: ComponentFixture<EmptyTemplateComponent>;
|
let fixture: ComponentFixture<EmptyTemplateComponent>;
|
||||||
@@ -717,10 +711,7 @@ describe('Task List: Custom EmptyTemplateComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [TranslateModule.forRoot(), ProcessTestingModule],
|
||||||
TranslateModule.forRoot(),
|
|
||||||
ProcessTestingModule
|
|
||||||
],
|
|
||||||
declarations: [EmptyTemplateComponent]
|
declarations: [EmptyTemplateComponent]
|
||||||
});
|
});
|
||||||
translateService = TestBed.inject(TranslateService);
|
translateService = TestBed.inject(TranslateService);
|
||||||
@@ -746,11 +737,7 @@ describe('Task List: Custom EmptyTemplateComponent', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
template: `
|
template: ` <adf-tasklist [showContextMenu]="true" (showRowContextMenu)="onShowRowContextMenu($event)" #taskList>
|
||||||
<adf-tasklist
|
|
||||||
[showContextMenu]="true"
|
|
||||||
(showRowContextMenu)="onShowRowContextMenu($event)"
|
|
||||||
#taskList>
|
|
||||||
<data-columns>
|
<data-columns>
|
||||||
<data-column key="name" title="ADF_TASK_LIST.PROPERTIES.NAME" class="full-width name-column"></data-column>
|
<data-column key="name" title="ADF_TASK_LIST.PROPERTIES.NAME" class="full-width name-column"></data-column>
|
||||||
<data-column key="created" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="hidden"></data-column>
|
<data-column key="created" title="ADF_TASK_LIST.PROPERTIES.CREATED" class="hidden"></data-column>
|
||||||
@@ -762,9 +749,7 @@ describe('Task List: Custom EmptyTemplateComponent', () => {
|
|||||||
</data-columns>
|
</data-columns>
|
||||||
</adf-tasklist>`
|
</adf-tasklist>`
|
||||||
})
|
})
|
||||||
|
|
||||||
class TaskListContextMenuComponent implements OnInit {
|
class TaskListContextMenuComponent implements OnInit {
|
||||||
|
|
||||||
@Output()
|
@Output()
|
||||||
contextAction = new EventEmitter<any>();
|
contextAction = new EventEmitter<any>();
|
||||||
private performAction$ = new Subject<any>();
|
private performAction$ = new Subject<any>();
|
||||||
@@ -777,8 +762,7 @@ class TaskListContextMenuComponent implements OnInit {
|
|||||||
event.value.actions = [
|
event.value.actions = [
|
||||||
{
|
{
|
||||||
data: event.value.row['obj'],
|
data: event.value.row['obj'],
|
||||||
model:
|
model: {
|
||||||
{
|
|
||||||
key: 'taskDetails',
|
key: 'taskDetails',
|
||||||
icon: 'open',
|
icon: 'open',
|
||||||
title: 'View Task Details',
|
title: 'View Task Details',
|
||||||
@@ -788,8 +772,7 @@ class TaskListContextMenuComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
data: event.value.row['obj'],
|
data: event.value.row['obj'],
|
||||||
model:
|
model: {
|
||||||
{
|
|
||||||
key: 'cancel',
|
key: 'cancel',
|
||||||
icon: 'open',
|
icon: 'open',
|
||||||
title: 'Cancel Process',
|
title: 'Cancel Process',
|
||||||
@@ -801,8 +784,7 @@ class TaskListContextMenuComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
performContextActions() {
|
performContextActions() {
|
||||||
this.performAction$
|
this.performAction$.subscribe((action: any) => {
|
||||||
.subscribe((action: any) => {
|
|
||||||
this.contextAction.emit(action.data);
|
this.contextAction.emit(action.data);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -817,14 +799,8 @@ describe('TaskListContextMenuComponent', () => {
|
|||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
imports: [
|
imports: [TranslateModule.forRoot(), MatProgressSpinnerModule, ProcessTestingModule],
|
||||||
TranslateModule.forRoot(),
|
declarations: [TaskListContextMenuComponent]
|
||||||
MatProgressSpinnerModule,
|
|
||||||
ProcessTestingModule
|
|
||||||
],
|
|
||||||
declarations: [
|
|
||||||
TaskListContextMenuComponent
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
fixture = TestBed.createComponent(TaskListContextMenuComponent);
|
fixture = TestBed.createComponent(TaskListContextMenuComponent);
|
||||||
customComponent = fixture.componentInstance;
|
customComponent = fixture.componentInstance;
|
||||||
|
14043
package-lock.json
generated
14043
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -93,6 +93,7 @@
|
|||||||
"zone.js": "~0.11.4"
|
"zone.js": "~0.11.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@alfresco/eslint-plugin-eslint-angular": "file:lib/eslint-angular",
|
||||||
"@angular-devkit/architect": "^0.1502.10",
|
"@angular-devkit/architect": "^0.1502.10",
|
||||||
"@angular-devkit/build-angular": "15.2.10",
|
"@angular-devkit/build-angular": "15.2.10",
|
||||||
"@angular-devkit/core": "15.2.10",
|
"@angular-devkit/core": "15.2.10",
|
||||||
@@ -109,9 +110,6 @@
|
|||||||
"@editorjs/list": "1.9.0",
|
"@editorjs/list": "1.9.0",
|
||||||
"@editorjs/marker": "1.4.0",
|
"@editorjs/marker": "1.4.0",
|
||||||
"@editorjs/underline": "1.1.0",
|
"@editorjs/underline": "1.1.0",
|
||||||
"editorjs-text-color-plugin": "2.0.4",
|
|
||||||
"editorjs-html": "3.4.3",
|
|
||||||
"editorjs-paragraph-with-alignment": "3.0.0",
|
|
||||||
"@quanzo/change-font-size": "1.0.0",
|
"@quanzo/change-font-size": "1.0.0",
|
||||||
"@nrwl/angular": "15.9.3",
|
"@nrwl/angular": "15.9.3",
|
||||||
"@nrwl/cli": "15.9.3",
|
"@nrwl/cli": "15.9.3",
|
||||||
|
Reference in New Issue
Block a user