mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5146] Upgrade to Angular 10 (#5834)
* remove useless module * upgrade to angular 8 * upgrade material to v8 * upgrade adf libs * migrate demo shell to v8 * upgrade to angular 9 * upgrade material to v9 * remove hammer * upgrade nx * upgrade datetime picker * upgrade flex layout * update core api * remove entry components * code fixes * upgrade testbed usage * code fixes * remove unnecessary core-js from tests * upgrade CLI * ts config fixes * fix builds * fix testing config * compile fixes * fix demo shell dev setup * fix core tests * fix card view import * upgrade nx * disable smart builds for now * remove fdescribe * restore smart builds * fix issues * unify tsconfigs and fix newly found issues * fix configuration and cleanup package scripts * improved production build from the same config * use ADF libs directly instead of node_modules * disable smart build * single app configuration (angular) * fix core build * fix build scripts * lint fixes * fix linting setup * fix linting rules * various fixes * disable affected libs for unit tests * cleanup insights package.json * simplify smart-build * fix content tests * fix tests * test fixes * fix tests * fix test * fix tests * disable AppExtensionsModule (monaco example) * remove monaco extension module * upgrade bundle check rules * fix insights tests and karma config * fix protractor config * e2e workaround * upgrade puppeteer and split linting and build * reusable resources config * update protractor config * fix after rebase * fix protractor config * fix e2e tsconfig * update e2e setup * Save demoshell artifact on S3 and remove travis cache * Push the libs on S3 and fetch before releasing it * Add deps * Add dependencies among libs and run only affected unit test and build * fix the travis stage name * fix after renaming dev to demoshell * force the order of the projects * remove unused dependencies * fix content e2e script * exit codes fix * add extra exit codes to core e2e * postinstall hook and package cleanup * cleanup packages * remove deprecated code and dependency on router * improve bundle analyzer script * minor code fixes * update spec * fix code after rebase * upgrade protractor after rebase * fix e2e mapping lib * Update tsconfig.e2e.json * update e2e tsconfig * fix angular config * fix protractor runs * cache dist folder for libs * update material selectors for dropdowns * selector fixes * remove duplicated e2e that have unit tests already * fix login selector * fix e2e * fix test * fix import issues * fix selector * cleanup old monaco extension files * cleanup demo shell login * add protractor max retries * disable customisations of protractor * fix login validation * fix after rebase * fix after rebase, disable latest versions of libs * Hide the report tab and rollback the localstorage * rename protractor config back to js * restore lint as part of build * cleanup code * do not copy anything to node_modules on dist test * fix unit tests * config fixes * fix code * fix code after rebase * fix tests * remove existing words from spellcheck * remove useless directive decorators * update package.json after rebase * add js-api back * code fixes * add missing export * update configs * fix code * try fix the sso login test * fix * remove puppeteer unit * fix e2e script * fix * make provider easy * fix routes module before upgrade * fix unit tests * upgrade angular cli * upgrade to angular 10 Co-authored-by: maurizio vitale <maurizio.vitale@alfresco.com> Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com> Co-authored-by: Eugenio Romano <eromano@users.noreply.github.com>
This commit is contained in:
@@ -1,15 +1,11 @@
|
||||
// Karma configuration file, see link for more information
|
||||
// https://karma-runner.github.io/1.0/config/configuration-file.html
|
||||
process.env.CHROME_BIN = require('puppeteer').executablePath();
|
||||
|
||||
module.exports = function (config) {
|
||||
config.set({
|
||||
basePath: '../../',
|
||||
files: [
|
||||
{ pattern: 'node_modules/core-js/client/core.js', included: true, watched: false },
|
||||
{ pattern: 'node_modules/tslib/tslib.js', included: true, watched: false },
|
||||
{ pattern: 'node_modules/hammerjs/hammer.min.js', included: true, watched: false },
|
||||
{ pattern: 'node_modules/hammerjs/hammer.min.js.map', included: false, watched: false },
|
||||
|
||||
// pdf-js
|
||||
{ pattern: 'node_modules/pdfjs-dist/build/pdf.js', included: true, watched: false },
|
||||
|
@@ -7,21 +7,11 @@
|
||||
"umdModuleIds": {
|
||||
"@alfresco/js-api": "@alfresco/js-api",
|
||||
"minimatch": "minimatch",
|
||||
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
|
||||
"@angular/material": "@angular/material",
|
||||
"@mat-datetimepicker": "@mat-datetimepicker",
|
||||
"@angular/flex-layout": "@angular/flex-layout",
|
||||
"@alfresco/adf-core": "@alfresco/adf-core",
|
||||
"@alfresco/adf-content-services": "@alfresco/adf-content-services",
|
||||
"@angular/material-moment-adapter": "@angular/material-moment-adapter",
|
||||
"@angular/animations": "@angular/animations",
|
||||
"@angular/cdk/platform": "@angular/cdk/platform",
|
||||
"@angular/material/core": "@angular/material/core",
|
||||
"moment": "moment",
|
||||
"moment-es6": "moment-es6",
|
||||
"moment/src/moment": "moment/src/moment",
|
||||
"@ngx-translate/core": "@ngx-translate/core",
|
||||
"rxjs": "rxjs"
|
||||
"@ngx-translate/core": "@ngx-translate/core"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,28 +12,18 @@
|
||||
"url": "https://github.com/Alfresco/alfresco-ng2-components/issues"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@angular/animations": ">=7.0.3",
|
||||
"@angular/cdk": ">=7.0.3",
|
||||
"@angular/common": ">=7.0.3",
|
||||
"@angular/compiler": ">=7.0.3",
|
||||
"@angular/core": ">=7.0.3",
|
||||
"@angular/flex-layout": ">=7.0.0-beta.19",
|
||||
"@angular/forms": ">=7.0.3",
|
||||
"@angular/material": ">=7.0.3",
|
||||
"@angular/material-moment-adapter": ">=7.0.3",
|
||||
"@angular/platform-browser": ">=7.0.3",
|
||||
"@angular/platform-browser-dynamic": ">=7.0.3",
|
||||
"@angular/router": ">=7.0.3",
|
||||
"@alfresco/js-api": "3.9.0",
|
||||
"rxjs": ">=6.2.2",
|
||||
"@alfresco/adf-core": "3.9.0",
|
||||
"@alfresco/adf-content-services": "3.9.0",
|
||||
"@ngx-translate/core": ">=11.0.0",
|
||||
"core-js": ">=2.5.4",
|
||||
"hammerjs": ">=2.0.8",
|
||||
"moment": ">=2.22.2",
|
||||
"reflect-metadata": ">=0.1.10",
|
||||
"zone.js": ">=0.8.26"
|
||||
"@angular/cdk": ">=9.2.4",
|
||||
"@angular/common": ">=9.1.9",
|
||||
"@angular/core": ">=9.1.9",
|
||||
"@angular/flex-layout": ">=9.0.0-beta.31",
|
||||
"@angular/forms": ">=9.1.9",
|
||||
"@angular/material": ">=9.2.4",
|
||||
"@angular/router": ">=9.1.9",
|
||||
"@alfresco/js-api": ">=3.8.0",
|
||||
"@alfresco/adf-core": ">=3.8.0",
|
||||
"@alfresco/adf-content-services": ">=3.8.0",
|
||||
"@ngx-translate/core": ">=12.1.2",
|
||||
"moment": ">=2.22.2"
|
||||
},
|
||||
"keywords": [
|
||||
"process-services",
|
||||
|
@@ -59,7 +59,7 @@ describe('AppsListComponent', () => {
|
||||
component = fixture.componentInstance;
|
||||
debugElement = fixture.debugElement;
|
||||
|
||||
service = TestBed.get(AppsProcessService);
|
||||
service = TestBed.inject(AppsProcessService);
|
||||
getAppsSpy = spyOn(service, 'getDeployedApplications').and.returnValue(of(deployedApps));
|
||||
});
|
||||
|
||||
|
@@ -38,9 +38,6 @@ import { SelectAppsDialogComponent } from './select-apps-dialog.component';
|
||||
exports: [
|
||||
AppsListComponent,
|
||||
SelectAppsDialogComponent
|
||||
],
|
||||
entryComponents: [
|
||||
SelectAppsDialogComponent
|
||||
]
|
||||
})
|
||||
export class AppsListModule {
|
||||
|
@@ -88,7 +88,7 @@ describe('Select app dialog', () => {
|
||||
fixture = TestBed.createComponent(DialogSelectAppTestComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
service = TestBed.get(AppsProcessService);
|
||||
service = TestBed.inject(AppsProcessService);
|
||||
|
||||
spyOn(service, 'getDeployedApplications').and.returnValue(
|
||||
of(deployedApps)
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { AppsProcessService } from '@alfresco/adf-core';
|
||||
import { Component, Inject } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material';
|
||||
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-select-apps-dialog',
|
||||
|
@@ -49,7 +49,7 @@ describe('TaskAttachmentList', () => {
|
||||
fixture = TestBed.createComponent(TaskAttachmentListComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
service = TestBed.get(ProcessContentService);
|
||||
service = TestBed.inject(ProcessContentService);
|
||||
|
||||
mockAttachment = {
|
||||
size: 2,
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { ContentModule, ContentNodeSelectorPanelComponent } from '@alfresco/adf-content-services';
|
||||
import { EventEmitter } from '@angular/core';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, Inject, ViewEncapsulation, ViewChild } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material';
|
||||
import { MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
import { ExternalAlfrescoApiService, AlfrescoApiService, LoginDialogPanelComponent, SearchService, TranslationService, AuthenticationService, SitesService } from '@alfresco/adf-core';
|
||||
import { AttachFileWidgetDialogComponentData } from './attach-file-widget-dialog-component.interface';
|
||||
import { DocumentListService, ContentNodeSelectorService } from '@alfresco/adf-content-services';
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { AttachFileWidgetDialogService } from './attach-file-widget-dialog.service';
|
||||
import { Subject, of } from 'rxjs';
|
||||
import { setupTestBed } from '@alfresco/adf-core';
|
||||
@@ -37,8 +37,8 @@ describe('AttachFileWidgetDialogService', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
service = TestBed.get(AttachFileWidgetDialogService);
|
||||
materialDialog = TestBed.get(MatDialog);
|
||||
service = TestBed.inject(AttachFileWidgetDialogService);
|
||||
materialDialog = TestBed.inject(MatDialog);
|
||||
spyOnDialogOpen = spyOn(materialDialog, 'open').and.returnValue({
|
||||
afterOpen: () => of({}),
|
||||
afterClosed: () => of({}),
|
||||
|
@@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { EventEmitter, Injectable, Output } from '@angular/core';
|
||||
import { TranslationService } from '@alfresco/adf-core';
|
||||
import { Subject, Observable } from 'rxjs';
|
||||
@@ -26,6 +26,7 @@ import { AttachFileWidgetDialogComponent } from './attach-file-widget-dialog.com
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
// tslint:disable-next-line: directive-class-suffix
|
||||
export class AttachFileWidgetDialogService {
|
||||
|
||||
/** Emitted when an error occurs. */
|
||||
|
@@ -143,11 +143,11 @@ describe('AttachFileWidgetComponent', () => {
|
||||
fixture = TestBed.createComponent(AttachFileWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
activitiContentService = TestBed.get(ActivitiContentService);
|
||||
contentNodeDialogService = TestBed.get(ContentNodeDialogService);
|
||||
processContentService = TestBed.get(ProcessContentService);
|
||||
downloadService = TestBed.get(DownloadService);
|
||||
formService = TestBed.get(FormService);
|
||||
activitiContentService = TestBed.inject(ActivitiContentService);
|
||||
contentNodeDialogService = TestBed.inject(ContentNodeDialogService);
|
||||
processContentService = TestBed.inject(ProcessContentService);
|
||||
downloadService = TestBed.inject(DownloadService);
|
||||
formService = TestBed.inject(FormService);
|
||||
}));
|
||||
|
||||
afterEach(() => {
|
||||
@@ -172,7 +172,7 @@ describe('AttachFileWidgetComponent', () => {
|
||||
});
|
||||
}));
|
||||
|
||||
it('should show up all the repository option on menu list', async() => {
|
||||
it('should show up all the repository option on menu list', async(done) => {
|
||||
widget.field = new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.UPLOAD,
|
||||
value: []
|
||||
@@ -181,29 +181,31 @@ describe('AttachFileWidgetComponent', () => {
|
||||
widget.field.params = <FormFieldMetadata> allSourceParams;
|
||||
spyOn(activitiContentService, 'getAlfrescoRepositories').and.returnValue(of(fakeRepositoryListAnswer));
|
||||
fixture.detectChanges();
|
||||
fixture.whenRenderingDone().then(() => {
|
||||
const attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach');
|
||||
expect(attachButton).not.toBeNull();
|
||||
attachButton.click();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
const localFileOption = fixture.debugElement.queryAll(By.css('#attach-local-file'));
|
||||
const fakeRepoOption1 = fixture.debugElement.queryAll(By.css('#attach-SHAREME'));
|
||||
const fakeRepoOption2 = fixture.debugElement.queryAll(By.css('#attach-GOKUSHARE'));
|
||||
await fixture.whenRenderingDone();
|
||||
|
||||
expect(localFileOption.length).toEqual(1);
|
||||
expect(localFileOption[0]).not.toBeNull();
|
||||
const attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach');
|
||||
expect(attachButton).not.toBeNull();
|
||||
attachButton.click();
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
expect(fakeRepoOption1.length).toEqual(1);
|
||||
expect(fakeRepoOption1[0]).not.toBeNull();
|
||||
const localFileOption = fixture.debugElement.queryAll(By.css('#attach-local-file'));
|
||||
const fakeRepoOption1 = fixture.debugElement.queryAll(By.css('#attach-SHAREME'));
|
||||
const fakeRepoOption2 = fixture.debugElement.queryAll(By.css('#attach-GOKUSHARE'));
|
||||
|
||||
expect(fakeRepoOption2.length).toEqual(1);
|
||||
expect(fakeRepoOption2[0]).not.toBeNull();
|
||||
});
|
||||
});
|
||||
expect(localFileOption.length).toEqual(1);
|
||||
expect(localFileOption[0]).not.toBeNull();
|
||||
|
||||
expect(fakeRepoOption1.length).toEqual(1);
|
||||
expect(fakeRepoOption1[0]).not.toBeNull();
|
||||
|
||||
expect(fakeRepoOption2.length).toEqual(1);
|
||||
expect(fakeRepoOption2[0]).not.toBeNull();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it ('should show only remote repos when just link to files is true', async () => {
|
||||
it ('should show only remote repos when just link to files is true', async (done) => {
|
||||
widget.field = new FormFieldModel(new FormModel(), {
|
||||
type: FormFieldTypes.UPLOAD,
|
||||
value: []
|
||||
@@ -212,25 +214,28 @@ describe('AttachFileWidgetComponent', () => {
|
||||
widget.field.params = <FormFieldMetadata> allSourceParamsWithLinkEnabled;
|
||||
spyOn(activitiContentService, 'getAlfrescoRepositories').and.returnValue(of(fakeRepositoryListAnswer));
|
||||
fixture.detectChanges();
|
||||
fixture.whenRenderingDone().then(() => {
|
||||
const attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach');
|
||||
expect(attachButton).not.toBeNull();
|
||||
attachButton.click();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
const localFileOption = fixture.debugElement.queryAll(By.css('#attach-local-file'));
|
||||
const fakeRepoOption1 = fixture.debugElement.queryAll(By.css('#attach-SHAREME'));
|
||||
const fakeRepoOption2 = fixture.debugElement.queryAll(By.css('#attach-GOKUSHARE'));
|
||||
await fixture.whenRenderingDone();
|
||||
|
||||
expect(localFileOption.length).toEqual(0);
|
||||
const attachButton: HTMLButtonElement = element.querySelector('#attach-file-attach');
|
||||
expect(attachButton).not.toBeNull();
|
||||
attachButton.click();
|
||||
|
||||
expect(fakeRepoOption1.length).toEqual(1);
|
||||
expect(fakeRepoOption1[0]).not.toBeNull();
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
||||
expect(fakeRepoOption2.length).toEqual(1);
|
||||
expect(fakeRepoOption2[0]).not.toBeNull();
|
||||
});
|
||||
});
|
||||
const localFileOption = fixture.debugElement.queryAll(By.css('#attach-local-file'));
|
||||
const fakeRepoOption1 = fixture.debugElement.queryAll(By.css('#attach-SHAREME'));
|
||||
const fakeRepoOption2 = fixture.debugElement.queryAll(By.css('#attach-GOKUSHARE'));
|
||||
|
||||
expect(localFileOption.length).toEqual(0);
|
||||
|
||||
expect(fakeRepoOption1.length).toEqual(1);
|
||||
expect(fakeRepoOption1[0]).not.toBeNull();
|
||||
|
||||
expect(fakeRepoOption2.length).toEqual(1);
|
||||
expect(fakeRepoOption2[0]).not.toBeNull();
|
||||
|
||||
done();
|
||||
});
|
||||
|
||||
it('should isLink property of the selected node become true when the widget has link enabled', async (done) => {
|
||||
|
@@ -65,8 +65,8 @@ describe('AttachFolderWidgetComponent', () => {
|
||||
fixture = TestBed.createComponent(AttachFolderWidgetComponent);
|
||||
widget = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
contentNodeDialogService = TestBed.get(ContentNodeDialogService);
|
||||
nodeService = TestBed.get(NodesApiService);
|
||||
contentNodeDialogService = TestBed.inject(ContentNodeDialogService);
|
||||
nodeService = TestBed.inject(NodesApiService);
|
||||
}));
|
||||
|
||||
afterEach(() => {
|
||||
|
@@ -30,11 +30,6 @@ import { AttachFileWidgetDialogComponent } from './attach-file-widget-dialog.com
|
||||
ContentNodeSelectorModule,
|
||||
MaterialModule
|
||||
],
|
||||
entryComponents: [
|
||||
AttachFileWidgetComponent,
|
||||
AttachFolderWidgetComponent,
|
||||
AttachFileWidgetDialogComponent
|
||||
],
|
||||
declarations: [
|
||||
AttachFileWidgetComponent,
|
||||
AttachFolderWidgetComponent,
|
||||
|
@@ -47,8 +47,7 @@ describe('FormComponent', () => {
|
||||
|
||||
@NgModule({
|
||||
declarations: [CustomWidget],
|
||||
exports: [CustomWidget],
|
||||
entryComponents: [CustomWidget]
|
||||
exports: [CustomWidget]
|
||||
})
|
||||
class CustomUploadModule {}
|
||||
|
||||
@@ -64,7 +63,7 @@ describe('FormComponent', () => {
|
||||
const resolver = formRenderingService.getComponentTypeResolver(type);
|
||||
const widgetType = resolver(null);
|
||||
|
||||
const factoryResolver: ComponentFactoryResolver = TestBed.get(ComponentFactoryResolver);
|
||||
const factoryResolver: ComponentFactoryResolver = TestBed.inject(ComponentFactoryResolver);
|
||||
const factory = factoryResolver.resolveComponentFactory(widgetType);
|
||||
const componentRef = factory.create(injector);
|
||||
|
||||
@@ -72,12 +71,12 @@ describe('FormComponent', () => {
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
visibilityService = TestBed.get(WidgetVisibilityService);
|
||||
visibilityService = TestBed.inject(WidgetVisibilityService);
|
||||
spyOn(visibilityService, 'refreshVisibility').and.stub();
|
||||
|
||||
formService = TestBed.get(FormService);
|
||||
nodeService = TestBed.get(NodeService);
|
||||
formRenderingService = TestBed.get(ProcessFormRenderingService);
|
||||
formService = TestBed.inject(FormService);
|
||||
nodeService = TestBed.inject(NodeService);
|
||||
formRenderingService = TestBed.inject(ProcessFormRenderingService);
|
||||
|
||||
fixture = TestBed.createComponent(FormComponent);
|
||||
formComponent = fixture.componentInstance;
|
||||
@@ -1032,7 +1031,7 @@ describe('FormComponent', () => {
|
||||
|
||||
class FormWithCustomOutComesComponent {
|
||||
|
||||
@ViewChild('adfForm')
|
||||
@ViewChild('adfForm', { static: true })
|
||||
adfForm: FormComponent;
|
||||
|
||||
onCustomButtonOneClick() { }
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA, SimpleChange } from '@angular/core';
|
||||
import { of } from 'rxjs';
|
||||
|
||||
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
|
||||
import { By } from '@angular/platform-browser';
|
||||
|
||||
import { formDefinitionDropdownField, formDefinitionTwoTextFields,
|
||||
@@ -29,22 +29,14 @@ import { FormComponent } from './form.component';
|
||||
import { ProcessTestingModule } from '../testing/process.testing.module';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
/** Duration of the select opening animation. */
|
||||
const SELECT_OPEN_ANIMATION = 200;
|
||||
|
||||
/** Duration of the select closing animation and the timeout interval for the backdrop. */
|
||||
const SELECT_CLOSE_ANIMATION = 500;
|
||||
|
||||
describe('FormComponent UI and visibility', () => {
|
||||
let component: FormComponent;
|
||||
let service: FormService;
|
||||
let fixture: ComponentFixture<FormComponent>;
|
||||
|
||||
function openSelect() {
|
||||
let trigger: HTMLElement;
|
||||
trigger = fixture.debugElement.query(By.css('[class="mat-select-trigger"]')).nativeElement;
|
||||
trigger.click();
|
||||
fixture.detectChanges();
|
||||
const dropdown = fixture.debugElement.nativeElement.querySelector('.mat-select-trigger');
|
||||
dropdown.click();
|
||||
}
|
||||
|
||||
setupTestBed({
|
||||
@@ -58,7 +50,7 @@ describe('FormComponent UI and visibility', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(FormComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = TestBed.get(FormService);
|
||||
service = TestBed.inject(FormService);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
@@ -124,7 +116,7 @@ describe('FormComponent UI and visibility', () => {
|
||||
expect(lastNameEl).toBeDefined();
|
||||
});
|
||||
|
||||
it('should display dropdown field', fakeAsync(() => {
|
||||
it('should display dropdown field', async(() => {
|
||||
spyOn(service, 'getTask').and.returnValue(of({}));
|
||||
spyOn(service, 'getTaskForm').and.returnValue(of(formDefinitionDropdownField));
|
||||
|
||||
@@ -133,24 +125,27 @@ describe('FormComponent UI and visibility', () => {
|
||||
fixture.detectChanges();
|
||||
|
||||
openSelect();
|
||||
tick(SELECT_OPEN_ANIMATION);
|
||||
|
||||
const dropdown = fixture.debugElement.queryAll(By.css('#country'));
|
||||
expect(dropdown).toBeDefined();
|
||||
expect(dropdown).not.toBeNull();
|
||||
const options = fixture.debugElement.queryAll(By.css('mat-option'));
|
||||
const optOne = options[1];
|
||||
const optTwo = options[2];
|
||||
const optThree = options[3];
|
||||
|
||||
expect(optOne.nativeElement.innerText.trim()).toEqual('united kingdom');
|
||||
expect(optTwo.nativeElement.innerText.trim()).toEqual('italy');
|
||||
expect(optThree.nativeElement.innerText.trim()).toEqual('france');
|
||||
|
||||
optTwo.nativeElement.click();
|
||||
fixture.detectChanges();
|
||||
expect(dropdown[0].nativeElement.innerText.trim()).toEqual('italy');
|
||||
tick(SELECT_CLOSE_ANIMATION);
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
const options = fixture.debugElement.queryAll(By.css('.mat-option-text'));
|
||||
|
||||
const optOne = options[1];
|
||||
const optTwo = options[2];
|
||||
const optThree = options[3];
|
||||
|
||||
expect(optOne.nativeElement.innerText.trim()).toEqual('united kingdom');
|
||||
expect(optTwo.nativeElement.innerText.trim()).toEqual('italy');
|
||||
expect(optThree.nativeElement.innerText.trim()).toEqual('france');
|
||||
|
||||
optTwo.nativeElement.click();
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
const dropdown = fixture.debugElement.queryAll(By.css('#country'));
|
||||
expect(dropdown[0].nativeElement.innerText.trim()).toEqual('italy');
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
describe('Visibility conditions', () => {
|
||||
@@ -214,24 +209,22 @@ describe('FormComponent UI and visibility', () => {
|
||||
});
|
||||
|
||||
describe('Readonly Form', () => {
|
||||
it('should display two text fields readonly', () => {
|
||||
it('should display two text fields readonly', async(() => {
|
||||
spyOn(service, 'getTask').and.returnValue(of({}));
|
||||
spyOn(service, 'getTaskForm').and.returnValue(of(formReadonlyTwoTextFields));
|
||||
|
||||
const change = new SimpleChange(null, 1, true);
|
||||
component.ngOnChanges({ 'taskId': change });
|
||||
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
const firstNameEl = fixture.debugElement.query(By.css('#firstname'));
|
||||
expect(firstNameEl.nativeElement.value).toEqual('fakeFirstName');
|
||||
|
||||
const firstNameEl = fixture.debugElement.query(By.css('#firstname'));
|
||||
expect(firstNameEl).not.toBeNull();
|
||||
expect(firstNameEl).toBeDefined();
|
||||
expect(firstNameEl.nativeElement.value).toEqual('fakeFirstName');
|
||||
|
||||
const lastNameEl = fixture.debugElement.query(By.css('#lastname'));
|
||||
expect(lastNameEl).not.toBeNull();
|
||||
expect(lastNameEl).toBeDefined();
|
||||
expect(lastNameEl.nativeElement.value).toEqual('fakeLastName');
|
||||
});
|
||||
const lastNameEl = fixture.debugElement.query(By.css('#lastname'));
|
||||
expect(lastNameEl.nativeElement.value).toEqual('fakeLastName');
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -51,9 +51,9 @@ describe('StartFormComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(StartFormComponent);
|
||||
component = fixture.componentInstance;
|
||||
formService = TestBed.get(FormService);
|
||||
visibilityService = TestBed.get(WidgetVisibilityService);
|
||||
translate = TestBed.get(TranslateService);
|
||||
formService = TestBed.inject(FormService);
|
||||
visibilityService = TestBed.inject(WidgetVisibilityService);
|
||||
translate = TestBed.inject(TranslateService);
|
||||
|
||||
getStartFormSpy = spyOn(formService, 'getStartFormDefinition').and.returnValue(of({
|
||||
processDefinitionName: 'my:process'
|
||||
|
@@ -71,7 +71,7 @@ export class StartFormComponent extends FormComponent implements OnChanges, OnIn
|
||||
@Output()
|
||||
formContentClicked: EventEmitter<ContentLinkModel> = new EventEmitter<ContentLinkModel>();
|
||||
|
||||
@ViewChild('outcomesContainer', {})
|
||||
@ViewChild('outcomesContainer')
|
||||
outcomesContainer: ElementRef = null;
|
||||
|
||||
constructor(formService: FormService, visibilityService: WidgetVisibilityService) {
|
||||
|
@@ -16,29 +16,44 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import {
|
||||
MAT_LABEL_GLOBAL_OPTIONS, MatAutocompleteModule, MatButtonModule, MatCardModule, MatCheckboxModule,
|
||||
MatChipsModule, MatDatepickerModule, MatDialogModule, MatGridListModule, MatIconModule,
|
||||
MatInputModule, MatListModule, MatNativeDateModule, MatOptionModule, MatProgressSpinnerModule, MatRadioModule,
|
||||
MatRippleModule, MatSelectModule, MatSlideToggleModule, MatTableModule, MatTabsModule,
|
||||
MatTooltipModule, MatMenuModule
|
||||
} from '@angular/material';
|
||||
|
||||
export function modules() {
|
||||
return [
|
||||
MatAutocompleteModule, MatButtonModule, MatCardModule, MatDialogModule,
|
||||
MatCheckboxModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule,
|
||||
MatListModule, MatOptionModule, MatRadioModule, MatSelectModule, MatSlideToggleModule, MatTableModule,
|
||||
MatTabsModule, MatProgressSpinnerModule, MatNativeDateModule, MatRippleModule, MatTooltipModule,
|
||||
MatChipsModule, MatMenuModule
|
||||
];
|
||||
}
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MAT_LABEL_GLOBAL_OPTIONS, MatNativeDateModule, MatOptionModule, MatRippleModule } from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatGridListModule } from '@angular/material/grid-list';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
||||
import { MatRadioModule } from '@angular/material/radio';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
|
||||
@NgModule({
|
||||
providers: [
|
||||
{provide: MAT_LABEL_GLOBAL_OPTIONS, useValue: { float: 'never' }}
|
||||
],
|
||||
imports: modules(),
|
||||
exports: modules()
|
||||
imports: [
|
||||
MatAutocompleteModule, MatButtonModule, MatCardModule, MatDialogModule,
|
||||
MatCheckboxModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule,
|
||||
MatListModule, MatOptionModule, MatRadioModule, MatSelectModule, MatSlideToggleModule, MatTableModule,
|
||||
MatTabsModule, MatProgressSpinnerModule, MatNativeDateModule, MatRippleModule, MatTooltipModule,
|
||||
MatChipsModule, MatMenuModule
|
||||
],
|
||||
exports: [
|
||||
MatAutocompleteModule, MatButtonModule, MatCardModule, MatDialogModule,
|
||||
MatCheckboxModule, MatDatepickerModule, MatGridListModule, MatIconModule, MatInputModule,
|
||||
MatListModule, MatOptionModule, MatRadioModule, MatSelectModule, MatSlideToggleModule, MatTableModule,
|
||||
MatTabsModule, MatProgressSpinnerModule, MatNativeDateModule, MatRippleModule, MatTooltipModule,
|
||||
MatChipsModule, MatMenuModule
|
||||
]
|
||||
})
|
||||
export class MaterialModule {}
|
||||
|
@@ -30,7 +30,7 @@ export class PeopleListComponent implements AfterContentInit {
|
||||
@ContentChild(DataColumnListComponent)
|
||||
columnList: DataColumnListComponent;
|
||||
|
||||
@ViewChild('dataTable')
|
||||
@ViewChild('dataTable', { static: true })
|
||||
peopleDataTable: DataTableComponent;
|
||||
|
||||
/** The array of user data used to populate the people list. */
|
||||
|
@@ -54,7 +54,7 @@ describe('PeopleSelectorComponent', () => {
|
||||
});
|
||||
|
||||
it('should call the PeopleProcessService\'s getWorkflowUsers method on search', () => {
|
||||
const peopleProcessService = TestBed.get(PeopleProcessService);
|
||||
const peopleProcessService = TestBed.inject(PeopleProcessService);
|
||||
spyOn(peopleProcessService, 'getWorkflowUsers').and.returnValue(of([]));
|
||||
|
||||
component.performSearch('Chloe Price');
|
||||
@@ -63,8 +63,8 @@ describe('PeopleSelectorComponent', () => {
|
||||
});
|
||||
|
||||
it('should log error on getWorkflowUsers error', () => {
|
||||
const peopleProcessService = TestBed.get(PeopleProcessService);
|
||||
const logService = TestBed.get(LogService);
|
||||
const peopleProcessService = TestBed.inject(PeopleProcessService);
|
||||
const logService = TestBed.inject(LogService);
|
||||
spyOn(peopleProcessService, 'getWorkflowUsers').and.returnValue(throwError(new Error()));
|
||||
spyOn(logService, 'error');
|
||||
|
||||
|
@@ -42,7 +42,7 @@ export class PeopleSelectorComponent {
|
||||
@Output()
|
||||
peopleIdChange: EventEmitter<number>;
|
||||
|
||||
@ViewChild('peopleSearchField')
|
||||
@ViewChild('peopleSearchField', { static: true })
|
||||
searchFieldComponent: PeopleSearchFieldComponent;
|
||||
|
||||
performSearch: PerformSearchCallback;
|
||||
|
@@ -53,7 +53,7 @@ describe('PeopleComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
logService = TestBed.get(LogService);
|
||||
logService = TestBed.inject(LogService);
|
||||
fixture = TestBed.createComponent(PeopleComponent);
|
||||
activitiPeopleComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
@@ -20,5 +20,6 @@ import { Directive } from '@angular/core';
|
||||
/**
|
||||
* Directive selectors without adf- prefix will be deprecated on 3.0.0
|
||||
*/
|
||||
// tslint:disable-next-line: directive-selector
|
||||
@Directive({ selector: 'adf-people-search-action-label, people-search-action-label' })
|
||||
export class PeopleSearchActionLabelDirective { }
|
||||
|
@@ -20,5 +20,6 @@ import { Directive } from '@angular/core';
|
||||
/**
|
||||
* Directive selectors without adf- prefix will be deprecated on 3.0.0
|
||||
*/
|
||||
// tslint:disable-next-line: directive-selector
|
||||
@Directive({ selector: '[adf-people-search-title]' })
|
||||
export class PeopleSearchTitleDirective { }
|
||||
|
@@ -45,7 +45,7 @@ describe('ProcessNamePipe', () => {
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
const localizedDatePipe = TestBed.get(LocalizedDatePipe);
|
||||
const localizedDatePipe = TestBed.inject(LocalizedDatePipe);
|
||||
processNamePipe = new ProcessNamePipe(localizedDatePipe);
|
||||
}));
|
||||
|
||||
|
@@ -44,7 +44,7 @@ describe('ProcessCommentsComponent', () => {
|
||||
|
||||
fixture = TestBed.createComponent(ProcessCommentsComponent);
|
||||
component = fixture.componentInstance;
|
||||
commentProcessService = TestBed.get(CommentProcessService);
|
||||
commentProcessService = TestBed.inject(CommentProcessService);
|
||||
|
||||
getCommentsSpy = spyOn(commentProcessService, 'getProcessInstanceComments').and.returnValue(of(mockProcessInstanceComments));
|
||||
});
|
||||
|
@@ -83,7 +83,7 @@ describe('ProcessAuditDirective', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(BasicButtonComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = TestBed.get(ProcessService);
|
||||
service = TestBed.inject(ProcessService);
|
||||
});
|
||||
|
||||
afterEach(() => fixture.destroy());
|
||||
@@ -109,7 +109,7 @@ describe('ProcessAuditDirective', () => {
|
||||
it('should download the audit in PDF format (default mode)', fakeAsync(() => {
|
||||
component.fileName = 'FakeAuditName';
|
||||
component.download = true;
|
||||
const downloadService = TestBed.get(DownloadService);
|
||||
const downloadService = TestBed.inject(DownloadService);
|
||||
spyOn(service, 'fetchProcessAuditPdfById').and.returnValue(of(blob));
|
||||
spyOn(downloadService, 'downloadBlob').and.stub();
|
||||
|
||||
|
@@ -25,6 +25,7 @@ const JSON_FORMAT: string = 'json';
|
||||
const PDF_FORMAT: string = 'pdf';
|
||||
|
||||
@Directive({
|
||||
// tslint:disable-next-line: directive-selector
|
||||
selector: 'button[adf-process-audit]',
|
||||
host: {
|
||||
'role': 'button',
|
||||
|
@@ -69,8 +69,8 @@ describe('ProcessFiltersComponent', () => {
|
||||
})
|
||||
]);
|
||||
|
||||
processFilterService = TestBed.get(ProcessFilterService);
|
||||
appsProcessService = TestBed.get(AppsProcessService);
|
||||
processFilterService = TestBed.inject(ProcessFilterService);
|
||||
appsProcessService = TestBed.inject(AppsProcessService);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
|
@@ -42,7 +42,7 @@ describe('ProcessInstanceHeaderComponent', () => {
|
||||
|
||||
component.processInstance = new ProcessInstance(exampleProcess);
|
||||
|
||||
appConfigService = TestBed.get(AppConfigService);
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
appConfigService.config['adf-process-instance-header'] = {};
|
||||
});
|
||||
|
||||
|
@@ -50,7 +50,7 @@ describe('ProcessInstanceTasksComponent', () => {
|
||||
|
||||
fixture = TestBed.createComponent(ProcessInstanceTasksComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = TestBed.get(ProcessService);
|
||||
service = TestBed.inject(ProcessService);
|
||||
|
||||
spyOn(service, 'getProcessTasks').and.returnValue(of([new TaskDetailsModel(taskDetailsMock)]));
|
||||
});
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { LogService } from '@alfresco/adf-core';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild, OnDestroy } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Observable, Observer, Subject } from 'rxjs';
|
||||
import { TaskDetailsEvent, TaskDetailsModel } from '../../task-list';
|
||||
import { ProcessInstance } from '../models/process-instance.model';
|
||||
|
@@ -60,8 +60,8 @@ describe('ProcessInstanceListComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(ProcessInstanceListComponent);
|
||||
component = fixture.componentInstance;
|
||||
appConfig = TestBed.get(AppConfigService);
|
||||
service = TestBed.get(ProcessService);
|
||||
appConfig = TestBed.inject(AppConfigService);
|
||||
service = TestBed.inject(ProcessService);
|
||||
|
||||
getProcessInstancesSpy = spyOn(service, 'getProcessInstances').and.returnValue(of(fakeProcessInstance));
|
||||
appConfig.config['adf-process-list'] = {
|
||||
@@ -527,7 +527,7 @@ describe('Process List: Custom EmptyTemplateComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(EmptyTemplateComponent);
|
||||
processService = TestBed.get(ProcessService);
|
||||
processService = TestBed.inject(ProcessService);
|
||||
spyOn(processService, 'getProcessInstances').and.returnValue(of(fakeProcessInstancesEmpty));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
@@ -631,7 +631,7 @@ describe('ProcessListContextMenuComponent', () => {
|
||||
fixture = TestBed.createComponent(ProcessListContextMenuComponent);
|
||||
customComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
processService = TestBed.get(ProcessService);
|
||||
processService = TestBed.inject(ProcessService);
|
||||
customComponent.appId = 12345;
|
||||
spyOn(processService, 'getProcesses').and.returnValue(of(fakeProcessInstance));
|
||||
fixture.detectChanges();
|
||||
|
@@ -19,8 +19,7 @@ import { DebugElement, SimpleChange } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { ActivitiContentService, AppConfigService, FormService, setupTestBed, AppsProcessService } from '@alfresco/adf-core';
|
||||
import { of, throwError } from 'rxjs';
|
||||
import { MatSelectChange } from '@angular/material';
|
||||
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { ProcessInstanceVariable } from '../models/process-instance-variable.model';
|
||||
import { ProcessService } from '../services/process.service';
|
||||
import {
|
||||
@@ -72,13 +71,13 @@ describe('StartFormComponent', () => {
|
||||
};
|
||||
|
||||
beforeEach(() => {
|
||||
appConfig = TestBed.get(AppConfigService);
|
||||
activitiContentService = TestBed.get(ActivitiContentService);
|
||||
appConfig = TestBed.inject(AppConfigService);
|
||||
activitiContentService = TestBed.inject(ActivitiContentService);
|
||||
fixture = TestBed.createComponent(StartProcessInstanceComponent);
|
||||
component = fixture.componentInstance;
|
||||
processService = TestBed.get(ProcessService);
|
||||
formService = TestBed.get(FormService);
|
||||
appsProcessService = TestBed.get(AppsProcessService);
|
||||
processService = TestBed.inject(ProcessService);
|
||||
formService = TestBed.inject(FormService);
|
||||
appsProcessService = TestBed.inject(AppsProcessService);
|
||||
|
||||
getDefinitionsSpy = spyOn(processService, 'getProcessDefinitions').and.returnValue(of(testMultipleProcessDefs));
|
||||
startProcessSpy = spyOn(processService, 'startProcess').and.returnValue(of(newProcess));
|
||||
|
@@ -33,7 +33,8 @@ import { ProcessService } from './../services/process.service';
|
||||
import { FormControl, Validators, AbstractControl } from '@angular/forms';
|
||||
import { Observable, Subject, forkJoin } from 'rxjs';
|
||||
import { map, takeUntil } from 'rxjs/operators';
|
||||
import { MatAutocompleteTrigger, MatSelectChange } from '@angular/material';
|
||||
import { MatAutocompleteTrigger } from '@angular/material/autocomplete';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { StartFormComponent } from '../../form';
|
||||
import { MinimalNode, RelatedContentRepresentation } from '@alfresco/js-api';
|
||||
import { AppDefinitionRepresentationModel } from '../../task-list';
|
||||
|
@@ -73,7 +73,7 @@ import { ProcessServicesPipeModule } from './pipes/process-services-pipe.module'
|
||||
]
|
||||
})
|
||||
export class ProcessModule {
|
||||
static forRoot(): ModuleWithProviders {
|
||||
static forRoot(): ModuleWithProviders<ProcessModule> {
|
||||
return {
|
||||
ngModule: ProcessModule,
|
||||
providers: [
|
||||
@@ -91,7 +91,7 @@ export class ProcessModule {
|
||||
};
|
||||
}
|
||||
|
||||
static forChild(): ModuleWithProviders {
|
||||
static forChild(): ModuleWithProviders<ProcessModule> {
|
||||
return {
|
||||
ngModule: ProcessModule
|
||||
};
|
||||
|
@@ -41,7 +41,7 @@ describe('AttachFormComponent', () => {
|
||||
fixture = TestBed.createComponent(AttachFormComponent);
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
taskService = TestBed.get(TaskListService);
|
||||
taskService = TestBed.inject(TaskListService);
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
|
@@ -41,7 +41,7 @@ describe('ChecklistComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(async(() => {
|
||||
service = TestBed.get(TaskListService);
|
||||
service = TestBed.inject(TaskListService);
|
||||
spyOn(service, 'getTaskChecklist').and.returnValue(of([{
|
||||
id: 'fake-check-changed-id',
|
||||
name: 'fake-check-changed-name'
|
||||
|
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
|
||||
@@ -55,7 +55,7 @@ export class ChecklistComponent implements OnChanges {
|
||||
@Output()
|
||||
error: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
@ViewChild('dialog')
|
||||
@ViewChild('dialog', { static: true })
|
||||
addNewDialog: any;
|
||||
|
||||
taskName: string;
|
||||
|
@@ -27,6 +27,7 @@ import { TaskDetailsComponent } from './task-details.component';
|
||||
* Directive selectors without adf- prefix will be deprecated on 3.0.0
|
||||
*/
|
||||
@Directive({
|
||||
// tslint:disable-next-line: directive-selector
|
||||
selector: 'adf-no-task-details-template, no-task-details-template'
|
||||
})
|
||||
export class NoTaskDetailsTemplateDirective implements AfterContentInit {
|
||||
|
@@ -61,8 +61,8 @@ describe('StartTaskComponent', () => {
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
||||
service = TestBed.get(TaskListService);
|
||||
logService = TestBed.get(LogService);
|
||||
service = TestBed.inject(TaskListService);
|
||||
logService = TestBed.inject(LogService);
|
||||
|
||||
getFormListSpy = spyOn(service, 'getFormList').and.returnValue(new Observable((observer) => {
|
||||
observer.next(fakeForms$);
|
||||
|
@@ -86,7 +86,7 @@ describe('TaskAuditDirective', () => {
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(BasicButtonComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = TestBed.get(TaskListService);
|
||||
service = TestBed.inject(TaskListService);
|
||||
|
||||
jasmine.Ajax.install();
|
||||
}));
|
||||
|
@@ -25,6 +25,7 @@ const JSON_FORMAT: string = 'json';
|
||||
const PDF_FORMAT: string = 'pdf';
|
||||
|
||||
@Directive({
|
||||
// tslint:disable-next-line: directive-selector
|
||||
selector: 'button[adf-task-audit]',
|
||||
host: {
|
||||
'role': 'button',
|
||||
|
@@ -73,15 +73,15 @@ describe('TaskDetailsComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
logService = TestBed.get(LogService);
|
||||
logService = TestBed.inject(LogService);
|
||||
|
||||
const userService: BpmUserService = TestBed.get(BpmUserService);
|
||||
const userService: BpmUserService = TestBed.inject(BpmUserService);
|
||||
spyOn(userService, 'getCurrentUserInfo').and.returnValue(of({}));
|
||||
|
||||
service = TestBed.get(TaskListService);
|
||||
service = TestBed.inject(TaskListService);
|
||||
spyOn(service, 'getTaskChecklist').and.returnValue(of(noDataMock));
|
||||
|
||||
formService = TestBed.get(FormService);
|
||||
formService = TestBed.inject(FormService);
|
||||
|
||||
getTaskDetailsSpy = spyOn(service, 'getTaskDetails').and.returnValue(of(taskDetailsMock));
|
||||
spyOn(formService, 'getTaskForm').and.returnValue(of(taskFormMock));
|
||||
@@ -90,9 +90,9 @@ describe('TaskDetailsComponent', () => {
|
||||
|
||||
getTasksSpy = spyOn(service, 'getTasks').and.returnValue(of(tasksMock));
|
||||
assignTaskSpy = spyOn(service, 'assignTask').and.returnValue(of(fakeUser));
|
||||
commentProcessService = TestBed.get(CommentProcessService);
|
||||
commentProcessService = TestBed.inject(CommentProcessService);
|
||||
|
||||
authService = TestBed.get(AuthenticationService);
|
||||
authService = TestBed.inject(AuthenticationService);
|
||||
spyOn(authService, 'getBpmLoggedUser').and.returnValue(of({ email: 'fake-email' }));
|
||||
|
||||
spyOn(commentProcessService, 'getTaskComments').and.returnValue(of([
|
||||
@@ -102,7 +102,7 @@ describe('TaskDetailsComponent', () => {
|
||||
]));
|
||||
|
||||
fixture = TestBed.createComponent(TaskDetailsComponent);
|
||||
peopleProcessService = TestBed.get(PeopleProcessService);
|
||||
peopleProcessService = TestBed.inject(PeopleProcessService);
|
||||
component = fixture.componentInstance;
|
||||
});
|
||||
|
||||
|
@@ -80,15 +80,15 @@ describe('TaskFiltersComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
const appConfig: AppConfigService = TestBed.get(AppConfigService);
|
||||
const appConfig: AppConfigService = TestBed.inject(AppConfigService);
|
||||
appConfig.config.bpmHost = 'http://localhost:9876/bpm';
|
||||
|
||||
fixture = TestBed.createComponent(TaskFiltersComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
taskListService = TestBed.get(TaskListService);
|
||||
taskFilterService = TestBed.get(TaskFilterService);
|
||||
appsProcessService = TestBed.get(AppsProcessService);
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
taskFilterService = TestBed.inject(TaskFilterService);
|
||||
appsProcessService = TestBed.inject(AppsProcessService);
|
||||
});
|
||||
|
||||
it('should emit an error with a bad response', (done) => {
|
||||
|
@@ -51,7 +51,7 @@ describe('ClaimTaskDirective', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
taskListService = TestBed.get(TaskListService);
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -72,15 +72,15 @@ describe('TaskFormComponent', () => {
|
||||
component = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
|
||||
taskListService = TestBed.get(TaskListService);
|
||||
formService = TestBed.get(FormService);
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
formService = TestBed.inject(FormService);
|
||||
|
||||
getTaskDetailsSpy = spyOn(taskListService, 'getTaskDetails').and.returnValue(of(taskDetailsMock));
|
||||
completeTaskSpy = spyOn(taskListService, 'completeTask').and.returnValue(of({}));
|
||||
spyOn(formService, 'getTaskForm').and.returnValue(of(taskFormMock));
|
||||
taskDetailsMock.processDefinitionId = null;
|
||||
spyOn(formService, 'getTask').and.returnValue(of(taskDetailsMock));
|
||||
authService = TestBed.get(AuthenticationService);
|
||||
authService = TestBed.inject(AuthenticationService);
|
||||
getBpmLoggedUserSpy = spyOn(authService, 'getBpmLoggedUser').and.returnValue(of({ id: 1001, email: 'fake-email@gmail.com' }));
|
||||
});
|
||||
|
||||
|
@@ -51,7 +51,7 @@ describe('UnclaimTaskDirective', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
taskListService = TestBed.get(TaskListService);
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -66,11 +66,11 @@ describe('TaskHeaderComponent', () => {
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(TaskHeaderComponent);
|
||||
component = fixture.componentInstance;
|
||||
service = TestBed.get(TaskListService);
|
||||
userBpmService = TestBed.get(BpmUserService);
|
||||
service = TestBed.inject(TaskListService);
|
||||
userBpmService = TestBed.inject(BpmUserService);
|
||||
spyOn(userBpmService, 'getCurrentUserInfo').and.returnValue(of(fakeBpmAssignedUser));
|
||||
component.taskDetails = new TaskDetailsModel(taskDetailsMock);
|
||||
appConfigService = TestBed.get(AppConfigService);
|
||||
appConfigService = TestBed.inject(AppConfigService);
|
||||
});
|
||||
|
||||
it('should render empty component if no task details provided', async(() => {
|
||||
|
@@ -47,12 +47,12 @@ describe('TaskListComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
appConfig = TestBed.get(AppConfigService);
|
||||
appConfig = TestBed.inject(AppConfigService);
|
||||
appConfig.config.bpmHost = 'http://localhost:9876/bpm';
|
||||
|
||||
fixture = TestBed.createComponent(TaskListComponent);
|
||||
component = fixture.componentInstance;
|
||||
taskListService = TestBed.get(TaskListService);
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
|
||||
appConfig.config = Object.assign(appConfig.config, {
|
||||
'adf-task-list': {
|
||||
@@ -584,7 +584,7 @@ describe('TaskListComponent', () => {
|
||||
component.ngOnChanges({ 'sort': state });
|
||||
fixture.detectChanges();
|
||||
|
||||
const selectAllCheckbox = fixture.nativeElement.querySelector('div[class*="adf-datatable-cell-header adf-datatable-checkbox"] div[class="mat-checkbox-inner-container"]');
|
||||
const selectAllCheckbox = fixture.nativeElement.querySelector('div[class*="adf-datatable-cell-header adf-datatable-checkbox"] .mat-checkbox-inner-container');
|
||||
selectAllCheckbox.click();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
@@ -607,8 +607,8 @@ describe('TaskListComponent', () => {
|
||||
component.ngOnChanges({ 'sort': state });
|
||||
fixture.detectChanges();
|
||||
|
||||
const selectTask1 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-0"] div[class="mat-checkbox-inner-container"]');
|
||||
const selectTask2 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-1"] div[class="mat-checkbox-inner-container"]');
|
||||
const selectTask1 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-0"] .mat-checkbox-inner-container');
|
||||
const selectTask2 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-1"] .mat-checkbox-inner-container');
|
||||
selectTask1.click();
|
||||
selectTask1.click();
|
||||
selectTask2.click();
|
||||
@@ -641,8 +641,8 @@ describe('TaskListComponent', () => {
|
||||
component.ngOnChanges({ 'sort': state });
|
||||
fixture.detectChanges();
|
||||
|
||||
const selectTask1 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-0"] div[class="mat-checkbox-inner-container"]');
|
||||
const selectTask2 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-1"] div[class="mat-checkbox-inner-container"]');
|
||||
const selectTask1 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-0"] .mat-checkbox-inner-container');
|
||||
const selectTask2 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-1"] .mat-checkbox-inner-container');
|
||||
selectTask1.click();
|
||||
selectTask1.click();
|
||||
selectTask2.click();
|
||||
@@ -683,8 +683,8 @@ describe('TaskListComponent', () => {
|
||||
component.ngOnChanges({ 'sort': state });
|
||||
fixture.detectChanges();
|
||||
|
||||
const selectTask1 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-0"] div[class="mat-checkbox-inner-container"]');
|
||||
const selectTask2 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-1"] div[class="mat-checkbox-inner-container"]');
|
||||
const selectTask1 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-0"] .mat-checkbox-inner-container');
|
||||
const selectTask2 = fixture.nativeElement.querySelector('[data-automation-id="datatable-row-1"] .mat-checkbox-inner-container');
|
||||
selectTask1.click();
|
||||
selectTask1.click();
|
||||
selectTask2.click();
|
||||
@@ -809,8 +809,8 @@ describe('Task List: Custom EmptyTemplateComponent', () => {
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
translateService = TestBed.get(TranslateService);
|
||||
taskListService = TestBed.get(TaskListService);
|
||||
translateService = TestBed.inject(TranslateService);
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
spyOn(translateService, 'get').and.callFake((key) => {
|
||||
return of(key);
|
||||
});
|
||||
@@ -916,7 +916,7 @@ describe('TaskListContextMenuComponent', () => {
|
||||
fixture = TestBed.createComponent(TaskListContextMenuComponent);
|
||||
customComponent = fixture.componentInstance;
|
||||
element = fixture.nativeElement;
|
||||
taskListService = TestBed.get(TaskListService);
|
||||
taskListService = TestBed.inject(TaskListService);
|
||||
spyOn(taskListService, 'findTasksByState').and.returnValues(of(fakeGlobalTask));
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
@@ -26,4 +26,6 @@ export * from './lib/form/index';
|
||||
export * from './lib/pipes/process-name.pipe';
|
||||
export * from './lib/pipes/process-services-pipe.module';
|
||||
|
||||
export * from './lib/pipes/process-name.pipe';
|
||||
export * from './lib/pipes/process-services-pipe.module';
|
||||
export * from './lib/process.module';
|
||||
|
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import 'core-js/es7/reflect';
|
||||
import 'zone.js/dist/zone';
|
||||
import 'zone.js/dist/zone-testing';
|
||||
import { getTestBed } from '@angular/core/testing';
|
||||
|
@@ -2,6 +2,15 @@
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../dist/process-services/",
|
||||
"baseUrl": "src"
|
||||
"baseUrl": "src",
|
||||
"types": [],
|
||||
"paths": {
|
||||
"@alfresco/adf-extensions": ["../../dist/extensions"],
|
||||
"@alfresco/adf-extensions/*": ["../../dist/extensions/*"],
|
||||
"@alfresco/adf-core": ["../../dist/core"],
|
||||
"@alfresco/adf-core/*": ["../../dist/core/*"],
|
||||
"@alfresco/adf-content-services": ["../../dist/content-services"],
|
||||
"@alfresco/adf-content-services/*": ["../../dist/content-services/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
6
lib/process-services/tsconfig.lib.prod.json
Normal file
6
lib/process-services/tsconfig.lib.prod.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.lib.json",
|
||||
"angularCompilerOptions": {
|
||||
"enableIvy": false
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user