mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[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:
@@ -47,7 +47,7 @@
|
||||
</span>
|
||||
|
||||
<span class="mat-input-element">
|
||||
{{ getVisibilityLabel(form.controls.visibility.value) | translate }}
|
||||
{{ visibilityLabel | translate }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -92,15 +92,12 @@ export class LibraryMetadataFormComponent implements OnInit, OnChanges, OnDestro
|
||||
});
|
||||
|
||||
matcher = new InstantErrorStateMatcher();
|
||||
canUpdateLibrary = false;
|
||||
visibilityLabel = '';
|
||||
|
||||
onDestroy$: Subject<boolean> = new Subject<boolean>();
|
||||
|
||||
constructor(private alfrescoApiService: AlfrescoApiService, protected store: Store<AppStore>) {}
|
||||
|
||||
get canUpdateLibrary() {
|
||||
return this.node && this.node.entry && this.node.entry.role === 'SiteManager';
|
||||
}
|
||||
|
||||
getVisibilityLabel(value: string) {
|
||||
return this.libraryType.find((type) => type.value === value).label;
|
||||
}
|
||||
@@ -136,6 +133,8 @@ export class LibraryMetadataFormComponent implements OnInit, OnChanges, OnDestro
|
||||
this.libraryTitleExists = false;
|
||||
}
|
||||
});
|
||||
this.canUpdateLibrary = this.node?.entry?.role === 'SiteManager';
|
||||
this.visibilityLabel = this.libraryType.find((type) => type.value === this.form.controls['visibility'].value).label;
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
Reference in New Issue
Block a user