[ACS-5088] Replaced function calls in templates with variable references (#3227)

* [ACS-5088] Replaced method calls in templates with variables

* [ACS-5088] Replaced method calls in templates with variables

* [ACS-5088] Replaced method calls for *ngIf and *ngFor with variables - Batch 1 (WIP)

* [ACS-5088] Replaced method calls for *ngIf and *ngFor with variables - Batch 2 (WIP)

* [ACS-5088] Replaced instances of $any with cast pipe. Replaced other instances of method calls in templates with variables

* [ACS-5088] Resolved test cases

* [ACS-5088] Resolved test cases in aca-content library

* [ACS-5088] Resolved test cases in aca-shared library

* [ACS-5088] Resolved test cases in aca-folder-rules library

* [ACS-5088] Reverted usage of cast pipe to $any()

* [ACS-5088] Fixed incorrect revert

* [ACS-5088] Resolved code review findings - shortened expressions and made onDestroy subjects use void instead of boolean

* [ACS-5088] Resolved code review findings - changed parameter name in sort function

* [ACS-5088] Resolved code review findings - added 'void' type to onDestroy subjects

* [ACS-5088] Upgraded eslint version to 8.41.0. Added "@angular-eslint/template/no-call-expression" rule to prevent function calls in templates unless needed (reports warnings)

* [ACS-5088] Resolved typo in ToggleFavoriteComponent
This commit is contained in:
swapnil-verma-gl
2023-06-06 14:02:19 +05:30
committed by GitHub
parent e9dce5f65a
commit d125fe5ff9
52 changed files with 314 additions and 297 deletions

View File

@@ -1,4 +1,4 @@
<h2 mat-dialog-title [innerHTML]="title()"></h2>
<h2 mat-dialog-title [innerHTML]="title"></h2>
<div mat-dialog-content>
<form [formGroup]="form" novalidate>
<mat-form-field class="adf-full-width">

View File

@@ -45,6 +45,8 @@ import { MatButtonModule } from '@angular/material/button';
export class CreateFromTemplateDialogComponent implements OnInit {
public form: UntypedFormGroup;
title = '';
constructor(
private translationService: TranslationService,
private store: Store<AppStore>,
@@ -59,6 +61,11 @@ export class CreateFromTemplateDialogComponent implements OnInit {
title: [this.data.properties ? this.data.properties['cm:title'] : '', Validators.maxLength(256)],
description: [this.data.properties ? this.data.properties['cm:description'] : '', Validators.maxLength(512)]
});
this.title = this.translationService.instant(
this.data.isFolder ? 'NODE_FROM_TEMPLATE.FOLDER_DIALOG_TITLE' : 'NODE_FROM_TEMPLATE.FILE_DIALOG_TITLE',
{ template: this.data.name }
);
}
onSubmit() {
@@ -73,14 +80,6 @@ export class CreateFromTemplateDialogComponent implements OnInit {
this.store.dispatch(new CreateFromTemplate(data));
}
title(): string {
if (this.data.isFolder) {
return this.translationService.instant('NODE_FROM_TEMPLATE.FOLDER_DIALOG_TITLE', { template: this.data.name });
}
return this.translationService.instant('NODE_FROM_TEMPLATE.FILE_DIALOG_TITLE', { template: this.data.name });
}
close() {
this.dialogRef.close();
}