mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
pre angular 15 cleanup (#8961)
* pre angular 15 cleanup * [ci:force] update test * [ci:force] various updates as per migration * [ci:force] port more changes * [ci:force] migrate tests * [ci:force] migrate formatting * migrate changes * rollback storybook
This commit is contained in:
@@ -4,10 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
|
||||
"rules": {
|
||||
"prefer-arrow/prefer-arrow-functions": "off",
|
||||
"@typescript-eslint/no-var-requires": "off",
|
||||
@@ -41,8 +38,7 @@
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||
"rules": {
|
||||
}
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -4,10 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
|
||||
"rules": {
|
||||
"jsdoc/newline-after-description": "warn",
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
@@ -27,24 +24,15 @@
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": [
|
||||
"adf",
|
||||
"app"
|
||||
],
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": [
|
||||
"element",
|
||||
"attribute"
|
||||
],
|
||||
"prefix": [
|
||||
"adf",
|
||||
"app"
|
||||
],
|
||||
"type": ["element", "attribute"],
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
|
@@ -3,13 +3,7 @@ const rootMain = require('../../../.storybook/main');
|
||||
module.exports = {
|
||||
...rootMain,
|
||||
core: { ...rootMain.core, builder: 'webpack5' },
|
||||
stories: [
|
||||
...rootMain.stories,
|
||||
'../**/*.stories.@(js|jsx|ts|tsx)'
|
||||
],
|
||||
staticDirs: [
|
||||
...rootMain.staticDirs,
|
||||
{ from: __dirname + '/../src/lib/i18n', to: 'assets/adf-content-services/i18n' }
|
||||
],
|
||||
stories: [...rootMain.stories, '../**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
staticDirs: [...rootMain.staticDirs, { from: __dirname + '/../src/lib/i18n', to: 'assets/adf-content-services/i18n' }],
|
||||
addons: [...rootMain.addons]
|
||||
};
|
||||
|
@@ -504,12 +504,16 @@ describe('CategoriesManagementComponent', () => {
|
||||
describe('Errors', () => {
|
||||
it('should display validation error when searching for empty category', fakeAsync(() => {
|
||||
typeCategory(' ');
|
||||
component.categoryNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(getFirstError()).toBe('CATEGORIES_MANAGEMENT.ERRORS.EMPTY_CATEGORY');
|
||||
}));
|
||||
|
||||
it('should show error for required', fakeAsync(() => {
|
||||
typeCategory('');
|
||||
component.categoryNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(getFirstError()).toBe('CATEGORIES_MANAGEMENT.ERRORS.REQUIRED');
|
||||
}));
|
||||
@@ -534,6 +538,7 @@ describe('CategoriesManagementComponent', () => {
|
||||
it('should show error for required when not typed anything and blur input', fakeAsync(() => {
|
||||
typeCategory('');
|
||||
getCategoryControlInput().blur();
|
||||
component.categoryNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
|
||||
expect(getFirstError()).toBe('CATEGORIES_MANAGEMENT.ERRORS.REQUIRED');
|
||||
|
@@ -116,7 +116,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
||||
displayCategories = false;
|
||||
|
||||
private _assignedTags: string[] = [];
|
||||
private assignedTagsEntries: TagEntry[];
|
||||
private assignedTagsEntries: TagEntry[] = [];
|
||||
private _editable = false;
|
||||
private _tagsCreatorMode = TagsCreatorMode.CREATE_AND_ASSIGN;
|
||||
private _tags: string[] = [];
|
||||
@@ -318,7 +318,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this._saving = false;
|
||||
return of(null);
|
||||
}))
|
||||
.subscribe((result) => {
|
||||
.subscribe((result: any) => {
|
||||
if (result) {
|
||||
this.updateUndefinedNodeProperties(result.updatedNode);
|
||||
if (this.hasContentTypeChanged(this.changedProperties)) {
|
||||
|
@@ -80,7 +80,7 @@ describe('PropertyDescriptorLoaderService', () => {
|
||||
expect(data['exif:exif']).toBe(exifResponse);
|
||||
expect(data['cm:content']).toBe(contentResponse);
|
||||
},
|
||||
complete: done
|
||||
complete: () => done()
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -296,7 +296,7 @@ describe('ContentNodeSelectorComponent', () => {
|
||||
const adfUploadButton = fixture.debugElement.query(By.css('adf-upload-button'));
|
||||
|
||||
expect(adfUploadButton).not.toBeNull();
|
||||
expect(adfUploadButton.nativeElement.innerText).toEqual('file_uploadFORM.FIELD.UPLOAD');
|
||||
expect(adfUploadButton.nativeElement.textContent).toEqual('file_uploadFORM.FIELD.UPLOAD');
|
||||
});
|
||||
|
||||
it('should be able to disable UploadButton if showingSearch set to true', () => {
|
||||
|
@@ -31,7 +31,7 @@
|
||||
[style.display]="isExpiryDateToggleChecked ? 'block' : 'none'"
|
||||
data-automation-id="adf-slide-toggle-checked"
|
||||
class="adf-share-link__date-time-container">
|
||||
<mat-form-field class="adf-full-width adf-float-label" floatLabel='never'>
|
||||
<mat-form-field class="adf-full-width adf-float-label">
|
||||
<mat-label>{{ 'SHARE.EXPIRATION-PLACEHOLDER' | translate }}</mat-label>
|
||||
<mat-datepicker-toggle
|
||||
[disabled]="time.disabled"
|
||||
@@ -74,7 +74,6 @@
|
||||
</div>
|
||||
<mat-form-field
|
||||
class="adf-full-width adf-float-label"
|
||||
floatLabel='never'
|
||||
[ngClass]="isLinkWithExpiryDate? 'adf-share-link__border-color' : ''">
|
||||
<input
|
||||
#sharedLinkInput
|
||||
|
@@ -18,13 +18,7 @@
|
||||
import { Component, Inject, OnInit, ViewEncapsulation, ViewChild, OnDestroy } from '@angular/core';
|
||||
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
|
||||
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
|
||||
import {
|
||||
UntypedFormGroup,
|
||||
UntypedFormControl,
|
||||
AbstractControl,
|
||||
Validators,
|
||||
ValidationErrors
|
||||
} from '@angular/forms';
|
||||
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { Subject } from 'rxjs';
|
||||
import { ContentService } from '../common/services/content.service';
|
||||
import { SharedLinksApiService } from './services/shared-links-api.service';
|
||||
@@ -44,9 +38,8 @@ type DatePickerType = 'date' | 'time' | 'month' | 'datetime';
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
private minDateValidator = (control: AbstractControl): ValidationErrors | null => {
|
||||
return isBefore(endOfDay(new Date(control.value)), this.minDate) ? {invalidDate: true} : null;
|
||||
};
|
||||
private minDateValidator = (control: AbstractControl): any =>
|
||||
isBefore(endOfDay(new Date(control.value)), this.minDate) ? { invalidDate: true } : null;
|
||||
|
||||
minDate = add(new Date(), { days: 1 });
|
||||
sharedId: string;
|
||||
@@ -55,9 +48,9 @@ export class ShareDialogComponent implements OnInit, OnDestroy {
|
||||
isFileShared = false;
|
||||
isDisabled = false;
|
||||
isLinkWithExpiryDate = false;
|
||||
form: UntypedFormGroup = new UntypedFormGroup({
|
||||
sharedUrl: new UntypedFormControl(''),
|
||||
time: new UntypedFormControl({value: '', disabled: true}, [Validators.required, this.minDateValidator])
|
||||
form: FormGroup = new FormGroup({
|
||||
sharedUrl: new FormControl(''),
|
||||
time: new FormControl({ value: '', disabled: true }, [Validators.required, this.minDateValidator])
|
||||
});
|
||||
type: DatePickerType = 'date';
|
||||
maxDebounceTime = 500;
|
||||
|
@@ -161,7 +161,7 @@ describe('Confirm Dialog Component', () => {
|
||||
By.css('[data-automation-id="adf-confirm-dialog-confirm-all"]')
|
||||
);
|
||||
expect(thirdOptionElement).not.toBeNull();
|
||||
expect(thirdOptionElement.nativeElement.innerText).toBe('YES ALL');
|
||||
expect(thirdOptionElement.nativeElement.innerText.toUpperCase()).toBe('YES ALL');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@@ -341,7 +341,7 @@ describe('DocumentList', () => {
|
||||
documentList.executeContentAction(node, action);
|
||||
|
||||
expect(action.execute).not.toHaveBeenCalled();
|
||||
deleteObservable.next();
|
||||
deleteObservable.next(undefined);
|
||||
expect(action.execute).toHaveBeenCalledWith(node);
|
||||
});
|
||||
|
||||
|
@@ -21,7 +21,7 @@ import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatOptionModule, MatRippleModule } from '@angular/material/core';
|
||||
import { MatRippleModule, MatOptionModule } from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { MatExpansionModule } from '@angular/material/expansion';
|
||||
|
@@ -83,7 +83,7 @@ describe('AddPermissionDialog', () => {
|
||||
it('should show the INJECTED title', () => {
|
||||
const titleElement = fixture.debugElement.query(By.css('#add-permission-dialog-title'));
|
||||
expect(titleElement).not.toBeNull();
|
||||
expect(titleElement.nativeElement.innerText).toBe('dead or alive you are coming with me');
|
||||
expect(titleElement.nativeElement.innerText.trim()).toBe('dead or alive you are coming with me');
|
||||
});
|
||||
|
||||
it('should close the dialog when close button is clicked', () => {
|
||||
@@ -128,7 +128,7 @@ describe('AddPermissionDialog', () => {
|
||||
await fixture.whenStable();
|
||||
|
||||
const selectBox = fixture.debugElement.query(By.css(('[id="adf-select-role-permission"] .mat-select-trigger')));
|
||||
selectBox.triggerEventHandler('click', null);
|
||||
selectBox.nativeElement.dispatchEvent(new Event('click'));
|
||||
fixture.detectChanges();
|
||||
|
||||
const options = fixture.debugElement.queryAll(By.css('mat-option'));
|
||||
@@ -171,7 +171,7 @@ describe('AddPermissionDialog', () => {
|
||||
await fixture.whenStable();
|
||||
|
||||
const selectBox = fixture.debugElement.query(By.css(('[id="adf-bulk-select-role-permission"] .mat-select-trigger')));
|
||||
selectBox.triggerEventHandler('click', null);
|
||||
selectBox.nativeElement.dispatchEvent(new Event('click'));
|
||||
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
@@ -213,7 +213,7 @@ describe('AddPermissionDialog', () => {
|
||||
await fixture.whenStable();
|
||||
|
||||
const selectBox = fixture.debugElement.query(By.css(('[id="adf-select-role-permission"] .mat-select-trigger')));
|
||||
selectBox.triggerEventHandler('click', null);
|
||||
selectBox.nativeElement.dispatchEvent(new Event('click'));
|
||||
|
||||
fixture.detectChanges();
|
||||
await fixture.whenStable();
|
||||
|
@@ -41,7 +41,7 @@
|
||||
<mat-list-option id="adf-add-permission-group-everyone"
|
||||
class="adf-list-option-item"
|
||||
#eveyone
|
||||
disableRipple
|
||||
[disableRipple]="true"
|
||||
[value]="EVERYONE">
|
||||
<adf-user-icon-column [node]="EVERYONE" id="add-group-icon" [selected]="eveyone.selected"></adf-user-icon-column>
|
||||
<p class="adf-result-name">
|
||||
@@ -50,7 +50,7 @@
|
||||
</mat-list-option>
|
||||
|
||||
<mat-list-option *ngFor="let item of data?.list?.entries; let idx = index"
|
||||
disableRipple
|
||||
[disableRipple]="true"
|
||||
[value]="item"
|
||||
class="adf-list-option-item"
|
||||
id="result_option_{{idx}}"
|
||||
|
@@ -82,7 +82,7 @@ export class PermissionListService {
|
||||
|
||||
toggleInherited(change: MatSlideToggleChange) {
|
||||
if (this.contentService.hasAllowableOperations(this.node, AllowableOperationsEnum.UPDATEPERMISSIONS)) {
|
||||
let updateLocalPermission$ = of(null);
|
||||
let updateLocalPermission$: Observable<Node> = of(null);
|
||||
const nodeBody = {
|
||||
permissions: {
|
||||
isInheritanceEnabled: !this.node.permissions.isInheritanceEnabled
|
||||
|
@@ -72,7 +72,7 @@ export class PopOverDirective implements OnInit, OnDestroy, AfterViewInit {
|
||||
ngOnDestroy(): void {
|
||||
this.element.nativeElement.removeEventListener('keydown', this.preventDefaultForEnter);
|
||||
this.detachOverlay();
|
||||
this.destroy$.next();
|
||||
this.destroy$.next(undefined);
|
||||
this.destroy$.complete();
|
||||
}
|
||||
|
||||
|
@@ -422,7 +422,7 @@ export class SearchFacetFiltersService implements OnDestroy {
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.onDestroy$.next();
|
||||
this.onDestroy$.next(undefined);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
|
@@ -90,7 +90,7 @@ describe('TagService', () => {
|
||||
});
|
||||
|
||||
describe('createTags', () => {
|
||||
it('should call createTags on tagsApi', () => {
|
||||
it('should call createTags on tagsApi', (done) => {
|
||||
spyOn(service.tagsApi, 'createTags').and.returnValue(Promise.resolve([]));
|
||||
const tag1 = new TagBody();
|
||||
tag1.tag = 'Some tag 1';
|
||||
@@ -98,7 +98,9 @@ describe('TagService', () => {
|
||||
tag2.tag = 'Some tag 2';
|
||||
const tags = [tag1, tag2];
|
||||
service.createTags(tags);
|
||||
|
||||
expect(service.tagsApi.createTags).toHaveBeenCalledWith(tags);
|
||||
done();
|
||||
});
|
||||
|
||||
it('should emit refresh when tags creation is success', fakeAsync(() => {
|
||||
|
@@ -381,12 +381,15 @@ describe('TagsCreatorComponent', () => {
|
||||
|
||||
it('should show error for only spaces', fakeAsync(() => {
|
||||
typeTag(' ');
|
||||
component.tagNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
const error = getFirstError();
|
||||
expect(error).toBe('TAG.TAGS_CREATOR.ERRORS.EMPTY_TAG');
|
||||
}));
|
||||
|
||||
it('should show error for only spaces if tags are changed', fakeAsync(() => {
|
||||
typeTag(' ');
|
||||
component.tagNameControl.markAsTouched();
|
||||
component.tags = ['new tag 1', 'new tag 2'];
|
||||
fixture.detectChanges();
|
||||
expect(getFirstError()).toBe('TAG.TAGS_CREATOR.ERRORS.EMPTY_TAG');
|
||||
@@ -394,12 +397,15 @@ describe('TagsCreatorComponent', () => {
|
||||
|
||||
it('should show error for required', fakeAsync(() => {
|
||||
typeTag('');
|
||||
component.tagNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
const error = getFirstError();
|
||||
expect(error).toBe('TAG.TAGS_CREATOR.ERRORS.REQUIRED');
|
||||
}));
|
||||
|
||||
it('should not show error for required if tags are changed', fakeAsync(() => {
|
||||
typeTag('');
|
||||
component.tagNameControl.markAsTouched();
|
||||
component.tags = ['new tag 1', 'new tag 2'];
|
||||
fixture.detectChanges();
|
||||
expect(getFirstError()).toBeUndefined();
|
||||
@@ -443,10 +449,7 @@ describe('TagsCreatorComponent', () => {
|
||||
|
||||
it('should error for required when not typed anything and blur input', fakeAsync(() => {
|
||||
component.tagNameControlVisible = true;
|
||||
fixture.detectChanges();
|
||||
tick(100);
|
||||
|
||||
getNameInput().blur();
|
||||
component.tagNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
|
||||
const error = getFirstError();
|
||||
@@ -600,6 +603,8 @@ describe('TagsCreatorComponent', () => {
|
||||
);
|
||||
|
||||
typeTag('Tag');
|
||||
component.tagNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
|
||||
const tagElements = getExistingTags();
|
||||
expect(tagElements).toEqual([tag1, tag2]);
|
||||
@@ -782,6 +787,8 @@ describe('TagsCreatorComponent', () => {
|
||||
|
||||
it('should be displayed when existing tags are loading', fakeAsync(() => {
|
||||
typeTag('tag', 0);
|
||||
component.tagNameControl.markAsTouched();
|
||||
fixture.detectChanges();
|
||||
|
||||
const spinner = getSpinner();
|
||||
expect(spinner).toBeTruthy();
|
||||
|
@@ -104,9 +104,9 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
|
||||
if (this.filesUploadingList.length && !this.isDialogActive) {
|
||||
this.isDialogActive = true;
|
||||
this.dialogActive.next();
|
||||
this.dialogActive.next(undefined);
|
||||
} else {
|
||||
this.dialogActive.next();
|
||||
this.dialogActive.next(undefined);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -159,7 +159,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
this.isConfirmation = !this.isConfirmation;
|
||||
|
||||
if (!this.isConfirmation) {
|
||||
this.dialogActive.next();
|
||||
this.dialogActive.next(undefined);
|
||||
}
|
||||
|
||||
if (this.isDialogMinimized) {
|
||||
@@ -172,7 +172,7 @@ export class FileUploadingDialogComponent implements OnInit, OnDestroy {
|
||||
*/
|
||||
cancelAllUploads() {
|
||||
this.toggleConfirmation();
|
||||
this.dialogActive.next();
|
||||
this.dialogActive.next(undefined);
|
||||
this.uploadList.cancelAllFiles();
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ import { DiscoveryApiService } from '../common/services/discovery-api.service';
|
||||
export class VersionCompatibilityService {
|
||||
private acsVersion: VersionInfo;
|
||||
|
||||
acsVersionInitialized$ = new ReplaySubject();
|
||||
acsVersionInitialized$ = new ReplaySubject<void>();
|
||||
|
||||
constructor(private discoveryApiService: DiscoveryApiService) {
|
||||
this.discoveryApiService.ecmProductInfo$
|
||||
@@ -37,7 +37,7 @@ export class VersionCompatibilityService {
|
||||
|
||||
private initializeAcsVersion(acsVersion: VersionInfo) {
|
||||
this.acsVersion = acsVersion;
|
||||
this.acsVersionInitialized$.next();
|
||||
this.acsVersionInitialized$.next(undefined);
|
||||
}
|
||||
|
||||
getAcsVersion(): VersionInfo {
|
||||
|
@@ -75,7 +75,7 @@ describe('VersionUploadComponent', () => {
|
||||
expect(component.disabled).toEqual(true);
|
||||
});
|
||||
|
||||
uploadService.fileUploadStarting.next();
|
||||
uploadService.fileUploadStarting.next(undefined);
|
||||
});
|
||||
|
||||
it('should enable upload button on error', () => {
|
||||
|
@@ -36,7 +36,7 @@ export class VersionUploadComponent implements OnInit, OnDestroy {
|
||||
comment: string;
|
||||
uploadVersion: boolean = false;
|
||||
disabled: boolean = false;
|
||||
onDestroy$ = new Subject();
|
||||
onDestroy$ = new Subject<void>();
|
||||
majorVersion = '2.0';
|
||||
minorVersion = '1.1';
|
||||
|
||||
@@ -133,7 +133,7 @@ export class VersionUploadComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.onDestroy$.next();
|
||||
this.onDestroy$.next(undefined);
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
|
@@ -170,7 +170,7 @@ export class AlfrescoViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
/** Emitted when the shared link used is not valid. */
|
||||
@Output()
|
||||
invalidSharedLink = new EventEmitter();
|
||||
invalidSharedLink = new EventEmitter<void>();
|
||||
|
||||
/** Emitted when user clicks 'Navigate Before' ("<") button. */
|
||||
@Output()
|
||||
@@ -272,7 +272,7 @@ export class AlfrescoViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
await this.setUpSharedLinkFile(sharedLinkEntry);
|
||||
} catch (error) {
|
||||
this.logService.error('This sharedLink does not exist');
|
||||
this.invalidSharedLink.next();
|
||||
this.invalidSharedLink.next(undefined);
|
||||
this.mimeType = 'invalid-link';
|
||||
this.urlFileContent = 'invalid-file';
|
||||
}
|
||||
|
@@ -4,10 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
|
||||
"rules": {
|
||||
"jsdoc/newline-after-description": "warn",
|
||||
"@typescript-eslint/naming-convention": "off",
|
||||
@@ -28,24 +25,15 @@
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": [
|
||||
"adf",
|
||||
"app"
|
||||
],
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": [
|
||||
"element",
|
||||
"attribute"
|
||||
],
|
||||
"prefix": [
|
||||
"adf",
|
||||
"app"
|
||||
],
|
||||
"type": ["element", "attribute"],
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
|
@@ -42,7 +42,7 @@ export class OIDCAuthenticationService extends BaseAuthenticationService {
|
||||
this.oauthService.events.pipe(
|
||||
filter((event)=> event.type === 'token_received')
|
||||
).subscribe(()=>{
|
||||
this.onLogin.next();
|
||||
this.onLogin.next({});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -264,7 +264,7 @@ export class SearchTextInputComponent implements OnInit, OnDestroy {
|
||||
|
||||
toggleSearchBar() {
|
||||
if (this.toggleSearch) {
|
||||
this.toggleSearch.next();
|
||||
this.toggleSearch.next({});
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -254,9 +254,9 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
if (this.loadingTask) {
|
||||
this.pdfjsWorkerDestroy$.next();
|
||||
this.pdfjsWorkerDestroy$.next(true);
|
||||
}
|
||||
this.onDestroy$.next();
|
||||
this.onDestroy$.next(true);
|
||||
this.pdfjsWorkerDestroy$.complete();
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
@@ -4,10 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
|
||||
"rules": {
|
||||
"no-underscore-dangle": ["error", { "allowAfterThis": true }],
|
||||
|
||||
@@ -15,24 +12,15 @@
|
||||
"error",
|
||||
{
|
||||
"type": "element",
|
||||
"prefix": [
|
||||
"adf",
|
||||
"app"
|
||||
],
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
"@angular-eslint/directive-selector": [
|
||||
"error",
|
||||
{
|
||||
"type": [
|
||||
"element",
|
||||
"attribute"
|
||||
],
|
||||
"prefix": [
|
||||
"adf",
|
||||
"app"
|
||||
],
|
||||
"type": ["element", "attribute"],
|
||||
"prefix": ["adf", "app"],
|
||||
"style": "kebab-case"
|
||||
}
|
||||
],
|
||||
|
@@ -138,7 +138,7 @@ export class TaskCloudService extends BaseCloudService implements TaskCloudServi
|
||||
|
||||
return this.post(queryUrl).pipe(
|
||||
map((res: any) => {
|
||||
this.dataChangesDetected$.next();
|
||||
this.dataChangesDetected$.next(res);
|
||||
return res.entry;
|
||||
})
|
||||
);
|
||||
@@ -161,7 +161,7 @@ export class TaskCloudService extends BaseCloudService implements TaskCloudServi
|
||||
|
||||
return this.post(queryUrl).pipe(
|
||||
map((res: any) => {
|
||||
this.dataChangesDetected$.next();
|
||||
this.dataChangesDetected$.next(res);
|
||||
return res.entry;
|
||||
})
|
||||
);
|
||||
|
@@ -4,10 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
|
||||
"rules": {
|
||||
"jsdoc/newline-after-description": "warn",
|
||||
"@typescript-eslint/naming-convention": "warn",
|
||||
|
@@ -45,10 +45,10 @@ const fakePngAnswer = new RelatedContentRepresentation({
|
||||
thumbnailStatus: 'queued'
|
||||
});
|
||||
|
||||
const fakeJpgAnswer = {
|
||||
const fakeJpgAnswer = new RelatedContentRepresentation({
|
||||
id: 1156,
|
||||
name: 'a_jpg_file.jpg',
|
||||
created: '2017-07-25T17:17:37.118Z',
|
||||
created: new Date('2017-07-25T17:17:37.118Z'),
|
||||
createdBy: {id: 1001, firstName: 'Admin', lastName: 'admin', email: 'admin'},
|
||||
relatedContent: false,
|
||||
contentAvailable: true,
|
||||
@@ -57,7 +57,7 @@ const fakeJpgAnswer = {
|
||||
simpleType: 'image',
|
||||
previewStatus: 'queued',
|
||||
thumbnailStatus: 'queued'
|
||||
};
|
||||
});
|
||||
|
||||
describe('UploadWidgetComponent', () => {
|
||||
|
||||
@@ -191,7 +191,7 @@ describe('UploadWidgetComponent', () => {
|
||||
});
|
||||
|
||||
it('should show the list file after upload a new content', async () => {
|
||||
spyOn(contentService, 'createTemporaryRawRelatedContent').and.returnValue(of(fakePngAnswer));
|
||||
spyOn(contentService, 'createTemporaryRawRelatedContent').and.returnValues(of(fakePngAnswer), of(fakeJpgAnswer));
|
||||
|
||||
uploadWidgetComponent.field.params.multiple = false;
|
||||
|
||||
@@ -207,17 +207,7 @@ describe('UploadWidgetComponent', () => {
|
||||
});
|
||||
|
||||
it('should update the form after deleted a file', async () => {
|
||||
spyOn(contentService, 'createTemporaryRawRelatedContent').and.callFake((file: any) => {
|
||||
if (file.name === 'file-fake.png') {
|
||||
return of(fakePngAnswer);
|
||||
}
|
||||
|
||||
if (file.name === 'file-fake.jpg') {
|
||||
return of(fakeJpgAnswer);
|
||||
}
|
||||
|
||||
return of(null);
|
||||
});
|
||||
spyOn(contentService, 'createTemporaryRawRelatedContent').and.returnValues(of(fakePngAnswer), of(fakeJpgAnswer));
|
||||
|
||||
uploadWidgetComponent.field.params.multiple = true;
|
||||
|
||||
|
@@ -52,6 +52,7 @@ describe('ProcessInstanceDetailsComponent', () => {
|
||||
const commentService = fixture.debugElement.injector.get(CommentProcessService);
|
||||
|
||||
getProcessSpy = spyOn(service, 'getProcess').and.returnValue(of(exampleProcess));
|
||||
spyOn(service, 'getProcessTasks').and.returnValue(of());
|
||||
spyOn(commentService, 'get').and.returnValue(of(mockProcessInstanceComments));
|
||||
});
|
||||
|
||||
|
@@ -22,7 +22,7 @@ import {
|
||||
import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation, OnDestroy } from '@angular/core';
|
||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
||||
import moment, { Moment } from 'moment';
|
||||
import { Observable, of, Subject } from 'rxjs';
|
||||
import { EMPTY, Observable, Subject } from 'rxjs';
|
||||
import { Form } from '../models/form.model';
|
||||
import { TaskDetailsModel } from '../models/task-details.model';
|
||||
import { TaskListService } from './../services/tasklist.service';
|
||||
@@ -226,7 +226,7 @@ export class StartTaskComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private attachForm(taskId: string, formKey: string): Observable<any> {
|
||||
let response = of();
|
||||
let response: any = EMPTY;
|
||||
if (taskId && formKey) {
|
||||
response = this.taskService.attachFormToATask(taskId, parseInt(formKey, 10));
|
||||
}
|
||||
@@ -234,7 +234,7 @@ export class StartTaskComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
private assignTaskByUserId(taskId: string, userId: any): Observable<any> {
|
||||
let response = of();
|
||||
let response: any = EMPTY;
|
||||
if (taskId && userId) {
|
||||
response = this.taskService.assignTaskByUserId(taskId, userId);
|
||||
}
|
||||
|
@@ -67,6 +67,7 @@ describe('TaskDetailsComponent', () => {
|
||||
let component: TaskDetailsComponent;
|
||||
let fixture: ComponentFixture<TaskDetailsComponent>;
|
||||
let getTaskDetailsSpy: jasmine.Spy;
|
||||
let getCommentsSpy: jasmine.Spy;
|
||||
let getTasksSpy: jasmine.Spy;
|
||||
let assignTaskSpy: jasmine.Spy;
|
||||
let logService: LogService;
|
||||
@@ -101,7 +102,7 @@ describe('TaskDetailsComponent', () => {
|
||||
assignTaskSpy = spyOn(taskListService, 'assignTask').and.returnValue(of(fakeTaskAssignResponse));
|
||||
taskCommentsService = TestBed.inject(TaskCommentsService);
|
||||
|
||||
spyOn(taskCommentsService, 'get').and.returnValue(of([
|
||||
getCommentsSpy = spyOn(taskCommentsService, 'get').and.returnValue(of([
|
||||
new CommentModel({ message: 'Test1', created: new Date(), createdBy: new User({ firstName: 'Admin', lastName: 'User' }) }),
|
||||
new CommentModel({ message: 'Test2', created: new Date(), createdBy: new User({ firstName: 'Admin', lastName: 'User' }) }),
|
||||
new CommentModel({ message: 'Test3', created: new Date(), createdBy: new User({ firstName: 'Admin', lastName: 'User' }) })
|
||||
@@ -114,6 +115,7 @@ describe('TaskDetailsComponent', () => {
|
||||
|
||||
afterEach(() => {
|
||||
getTaskDetailsSpy.calls.reset();
|
||||
getCommentsSpy.calls.reset();
|
||||
fixture.destroy();
|
||||
});
|
||||
|
||||
|
@@ -4,10 +4,7 @@
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"extends": [
|
||||
"plugin:@nrwl/nx/angular",
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"extends": ["plugin:@nrwl/nx/angular", "plugin:@angular-eslint/template/process-inline-templates"],
|
||||
"rules": {
|
||||
"@angular-eslint/component-selector": [
|
||||
"error",
|
||||
@@ -64,8 +61,7 @@
|
||||
{
|
||||
"files": ["*.html"],
|
||||
"extends": ["plugin:@nrwl/nx/angular-template"],
|
||||
"rules": {
|
||||
}
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -37,14 +37,7 @@
|
||||
"@alfresco/js-api": ["node_modules/@alfresco/js-api"]
|
||||
}
|
||||
},
|
||||
"exclude": [
|
||||
"lib/config",
|
||||
"integration",
|
||||
"scripts",
|
||||
"assets",
|
||||
"tools",
|
||||
"node_modules"
|
||||
],
|
||||
"exclude": ["lib/config", "integration", "scripts", "assets", "tools", "node_modules"],
|
||||
"angularCompilerOptions": {
|
||||
"fullTemplateTypeCheck": true,
|
||||
"strictInjectionParameters": true,
|
||||
|
Reference in New Issue
Block a user