[ACS-5991] ESLint fixes and code quality improvements (#8893)

* prefer-optional-chain: core

* prefer-optional-chain: content, fix typings

* prefer-optional-chain: process, fix typings

* prefer-optional-chain: process-cloud, fix typings, fix ts configs and eslint

* [ci: force] sonar errors fixes, insights lib

* [ci:force] fix security issues

* [ci:force] fix metadata e2e bug, js assignment bugs

* [ci:force] fix lint issue

* [ci:force] fix tests
This commit is contained in:
Denys Vuika
2023-09-18 09:42:16 +01:00
committed by GitHub
parent 99f591ed67
commit a1dd270c5d
203 changed files with 4155 additions and 4960 deletions

View File

@@ -29,7 +29,6 @@ import { share, takeUntil } from 'rxjs/operators';
host: { class: 'adf-process-instance-comments' }
})
export class ProcessCommentsComponent implements OnChanges, OnDestroy {
/** (**required**) The numeric ID of the process instance to display comments for. */
@Input()
processInstanceId: string;
@@ -42,7 +41,7 @@ export class ProcessCommentsComponent implements OnChanges, OnDestroy {
@Output()
error: EventEmitter<any> = new EventEmitter<any>();
comments: CommentModel [] = [];
comments: CommentModel[] = [];
comment$: Observable<CommentModel>;
message: string;
beingAdded: boolean = false;
@@ -51,10 +50,8 @@ export class ProcessCommentsComponent implements OnChanges, OnDestroy {
private onDestroy$ = new Subject<boolean>();
constructor(private commentProcessService: CommentProcessService) {
this.comment$ = new Observable<CommentModel>(observer => this.commentObserver = observer).pipe(share());
this.comment$
.pipe(takeUntil(this.onDestroy$))
.subscribe(comment => this.comments.push(comment));
this.comment$ = new Observable<CommentModel>((observer) => (this.commentObserver = observer)).pipe(share());
this.comment$.pipe(takeUntil(this.onDestroy$)).subscribe((comment) => this.comments.push(comment));
}
ngOnDestroy() {
@@ -74,21 +71,19 @@ export class ProcessCommentsComponent implements OnChanges, OnDestroy {
}
add(): void {
if (this.message && this.message.trim() && !this.beingAdded) {
if (this.message?.trim() && !this.beingAdded) {
this.beingAdded = true;
this.commentProcessService.add(this.processInstanceId, this.message)
.subscribe(
(res: CommentModel) => {
this.comments.unshift(res);
this.message = '';
this.beingAdded = false;
},
(err) => {
this.error.emit(err);
this.beingAdded = false;
}
);
this.commentProcessService.add(this.processInstanceId, this.message).subscribe(
(res: CommentModel) => {
this.comments.unshift(res);
this.message = '';
this.beingAdded = false;
},
(err) => {
this.error.emit(err);
this.beingAdded = false;
}
);
}
}