From 828376019c1609fff0f60150321c57ac5a839174 Mon Sep 17 00:00:00 2001 From: DominikIwanek Date: Wed, 15 Jan 2025 14:30:07 +0100 Subject: [PATCH 1/4] Review and apply required inputs where possible --- .../lib/aspect-list/aspect-list.component.ts | 2 +- .../lib/breadcrumb/breadcrumb.component.ts | 15 ++----------- .../categories-management.component.ts | 6 ++++-- .../content-metadata-card.component.ts | 4 ++-- .../content-metadata.component.ts | 4 ++-- .../content-node-selector-panel.component.ts | 2 +- .../filter-header/filter-header.component.ts | 21 ++++--------------- .../library-name-column.component.ts | 14 ++----------- .../library-role-column.component.ts | 12 ++--------- .../library-status-column.component.ts | 3 +-- .../name-column/name-column.component.ts | 14 ++----------- .../trashcan-name-column.component.ts | 4 ++-- .../node-comments/node-comments.component.ts | 2 +- .../add-permission.component.ts | 2 +- .../permission-container.component.ts | 2 +- .../permission-list.component.ts | 2 +- .../search-facet-field.component.ts | 4 ++-- .../search-facet-tabbed-content.component.ts | 2 +- .../search-facet-chip.component.ts | 2 +- .../search-widget-chip.component.ts | 2 +- .../search-filter-container.component.ts | 13 ++---------- .../search-filter-card.component.ts | 2 +- .../tag/tag-actions/tag-actions.component.ts | 14 ++----------- .../tag-node-list/tag-node-list.component.ts | 2 +- .../tags-creator/tags-creator.component.ts | 2 +- .../components/tree-view.component.ts | 4 ++-- .../version-comparison.component.ts | 4 ++-- .../version-manager.component.ts | 6 +++--- .../version-upload.component.ts | 2 +- .../app-details-cloud.component.ts | 4 ++-- .../process-header-cloud.component.ts | 4 ++-- .../components/task-header-cloud.component.ts | 4 ++-- .../create-process-attachment.component.ts | 2 +- .../create-task-attachment.component.ts | 2 +- .../process-attachment-list.component.ts | 4 ++-- .../task-attachment-list.component.ts | 16 +++++++------- .../people-search/people-search.component.ts | 4 ++-- .../process-comments.component.ts | 3 ++- .../process-instance-details.component.ts | 2 +- .../process-instance-header.component.ts | 8 +++---- .../process-instance-tasks.component.ts | 2 +- .../attach-form/attach-form.component.ts | 2 +- .../start-task/start-task.component.ts | 11 ++-------- .../task-details/task-details.component.ts | 2 +- .../task-form/task-form.component.ts | 12 +++++------ .../task-header/task-header.component.ts | 20 +++++++++--------- 46 files changed, 97 insertions(+), 173 deletions(-) diff --git a/lib/content-services/src/lib/aspect-list/aspect-list.component.ts b/lib/content-services/src/lib/aspect-list/aspect-list.component.ts index 6656fc3856a..b802690ff4c 100644 --- a/lib/content-services/src/lib/aspect-list/aspect-list.component.ts +++ b/lib/content-services/src/lib/aspect-list/aspect-list.component.ts @@ -39,7 +39,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; }) export class AspectListComponent implements OnInit { /** Node Id of the node that we want to update */ - @Input() + @Input({ required: true }) nodeId: string = ''; /** List of aspects' ids which should not be displayed. */ diff --git a/lib/content-services/src/lib/breadcrumb/breadcrumb.component.ts b/lib/content-services/src/lib/breadcrumb/breadcrumb.component.ts index 6676f6bd370..44ab23f4750 100644 --- a/lib/content-services/src/lib/breadcrumb/breadcrumb.component.ts +++ b/lib/content-services/src/lib/breadcrumb/breadcrumb.component.ts @@ -15,18 +15,7 @@ * limitations under the License. */ -import { - Component, - DestroyRef, - EventEmitter, - inject, - Input, - OnChanges, - OnInit, - Output, - ViewChild, - ViewEncapsulation -} from '@angular/core'; +import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core'; import { MatSelect, MatSelectModule } from '@angular/material/select'; import { Node, PathElement } from '@alfresco/js-api'; import { DocumentListComponent } from '../document-list/components/document-list.component'; @@ -46,7 +35,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; }) export class BreadcrumbComponent implements OnInit, OnChanges { /** Active node, builds UI based on folderNode.path.elements collection. */ - @Input() + @Input({ required: true }) folderNode: Node = null; /** diff --git a/lib/content-services/src/lib/category/categories-management/categories-management.component.ts b/lib/content-services/src/lib/category/categories-management/categories-management.component.ts index fe448d83084..0a3f53e2330 100644 --- a/lib/content-services/src/lib/category/categories-management/categories-management.component.ts +++ b/lib/content-services/src/lib/category/categories-management/categories-management.component.ts @@ -137,7 +137,7 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy { * In ASSIGN mode we can only assign/unassign categories from existing list. * In CRUD mode we can create categories. */ - @Input() + @Input({ required: true }) managementMode: CategoriesManagementMode; /** ID of a parent category. New categories will be created under this parent */ @@ -180,7 +180,9 @@ export class CategoriesManagementComponent implements OnInit, OnDestroy { ) .subscribe((name: string) => this.onNameControlValueChange(name)); - this.categoryNameControl.statusChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => this.setCategoryNameControlErrorMessageKey()); + this.categoryNameControl.statusChanges + .pipe(takeUntilDestroyed(this.destroyRef)) + .subscribe(() => this.setCategoryNameControlErrorMessageKey()); this.setCategoryNameControlErrorMessageKey(); diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata-card/content-metadata-card.component.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata-card/content-metadata-card.component.ts index af55a615bd4..409d15a9b19 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata-card/content-metadata-card.component.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata-card/content-metadata-card.component.ts @@ -40,7 +40,7 @@ import { TranslateModule } from '@ngx-translate/core'; }) export class ContentMetadataCardComponent implements OnChanges { /** (required) The node entity to fetch metadata about */ - @Input() + @Input({ required: true }) node: Node; /** @@ -68,7 +68,7 @@ export class ContentMetadataCardComponent implements OnChanges { * Name or configuration of the metadata preset, which defines aspects * and their properties. */ - @Input() + @Input({ required: true }) preset: string | PresetConfig; /** diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts index c3acb82a0b7..d94963ba667 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts @@ -86,7 +86,7 @@ enum DefaultPanels { }) export class ContentMetadataComponent implements OnChanges, OnInit { /** (required) The node entity to fetch metadata about */ - @Input() + @Input({ required: true }) node: Node; /** Toggles whether to display empty values in the card view */ @@ -105,7 +105,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit { multi = false; /** Name or configuration of the metadata preset, which defines aspects and their properties */ - @Input() + @Input({ required: true }) preset: string | PresetConfig; /** Toggles whether the metadata properties should be shown */ diff --git a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts index c515c77b323..cb731eb0ec7 100644 --- a/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts +++ b/lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.ts @@ -111,7 +111,7 @@ export class ContentNodeSelectorPanelComponent implements OnInit { restrictRootToCurrentFolderId: boolean = false; /** Node ID of the folder currently listed. */ - @Input() + @Input({ required: true }) currentFolderId: string = null; /** diff --git a/lib/content-services/src/lib/document-list/components/filter-header/filter-header.component.ts b/lib/content-services/src/lib/document-list/components/filter-header/filter-header.component.ts index 9f596fc1f62..b827b205113 100644 --- a/lib/content-services/src/lib/document-list/components/filter-header/filter-header.component.ts +++ b/lib/content-services/src/lib/document-list/components/filter-header/filter-header.component.ts @@ -15,26 +15,13 @@ * limitations under the License. */ -import { - Component, - DestroyRef, - EventEmitter, - Inject, - inject, - Input, - OnChanges, - OnInit, - Output, - SimpleChanges -} from '@angular/core'; +import { Component, DestroyRef, EventEmitter, Inject, inject, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; import { DataSorting, HeaderFilterTemplateDirective, PaginationModel } from '@alfresco/adf-core'; import { SearchHeaderQueryBuilderService } from '../../../search/services/search-header-query-builder.service'; import { FilterSearch } from './../../../search/models/filter-search.interface'; import { ADF_DOCUMENT_PARENT_COMPONENT } from '../document-list.token'; import { CommonModule } from '@angular/common'; -import { - SearchFilterContainerComponent -} from '../../../search/components/search-filter-container/search-filter-container.component'; +import { SearchFilterContainerComponent } from '../../../search/components/search-filter-container/search-filter-container.component'; import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; @Component({ @@ -49,7 +36,7 @@ export class FilterHeaderComponent implements OnInit, OnChanges { value: any = {}; /** The id of the current folder of the document list. */ - @Input() + @Input({ required: true }) currentFolderId: string; /** Emitted when a filter value is selected */ @@ -57,7 +44,7 @@ export class FilterHeaderComponent implements OnInit, OnChanges { filterSelection: EventEmitter = new EventEmitter(); isFilterServiceActive: boolean; - + private readonly destroyRef = inject(DestroyRef); constructor(@Inject(ADF_DOCUMENT_PARENT_COMPONENT) private documentList: any, private searchFilterQueryBuilder: SearchHeaderQueryBuilderService) { diff --git a/lib/content-services/src/lib/document-list/components/library-name-column/library-name-column.component.ts b/lib/content-services/src/lib/document-list/components/library-name-column/library-name-column.component.ts index ed63f70978f..3879a77782a 100644 --- a/lib/content-services/src/lib/document-list/components/library-name-column/library-name-column.component.ts +++ b/lib/content-services/src/lib/document-list/components/library-name-column/library-name-column.component.ts @@ -15,16 +15,7 @@ * limitations under the License. */ -import { - ChangeDetectionStrategy, - Component, - DestroyRef, - ElementRef, - inject, - Input, - OnInit, - ViewEncapsulation -} from '@angular/core'; +import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { NodeEntry, Site } from '@alfresco/js-api'; import { ShareDataRow } from '../../data/share-data-row.model'; import { NodesApiService } from '../../../common/services/nodes-api.service'; @@ -64,7 +55,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; } }) export class LibraryNameColumnComponent implements OnInit { - @Input() + @Input({ required: true }) context: any; displayTooltip$ = new BehaviorSubject(''); @@ -129,5 +120,4 @@ export class LibraryNameColumnComponent implements OnInit { return isDuplicate ? `${title} (${id})` : `${title}`; } - } diff --git a/lib/content-services/src/lib/document-list/components/library-role-column/library-role-column.component.ts b/lib/content-services/src/lib/document-list/components/library-role-column/library-role-column.component.ts index f050ec12699..d683fc55394 100644 --- a/lib/content-services/src/lib/document-list/components/library-role-column/library-role-column.component.ts +++ b/lib/content-services/src/lib/document-list/components/library-role-column/library-role-column.component.ts @@ -15,15 +15,7 @@ * limitations under the License. */ -import { - ChangeDetectionStrategy, - Component, - DestroyRef, - inject, - Input, - OnInit, - ViewEncapsulation -} from '@angular/core'; +import { ChangeDetectionStrategy, Component, DestroyRef, inject, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { BehaviorSubject } from 'rxjs'; import { Site, SiteEntry } from '@alfresco/js-api'; import { ShareDataRow } from '../../data/share-data-row.model'; @@ -46,7 +38,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; host: { class: 'adf-library-role-column adf-datatable-content-cell' } }) export class LibraryRoleColumnComponent implements OnInit { - @Input() + @Input({ required: true }) context: any; displayText$ = new BehaviorSubject(''); diff --git a/lib/content-services/src/lib/document-list/components/library-status-column/library-status-column.component.ts b/lib/content-services/src/lib/document-list/components/library-status-column/library-status-column.component.ts index 3fa3ffae925..096ebfa0e4b 100644 --- a/lib/content-services/src/lib/document-list/components/library-status-column/library-status-column.component.ts +++ b/lib/content-services/src/lib/document-list/components/library-status-column/library-status-column.component.ts @@ -36,7 +36,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; host: { class: 'adf-library-status-column adf-datatable-content-cell' } }) export class LibraryStatusColumnComponent implements OnInit { - @Input() + @Input({ required: true }) context: any; displayText$ = new BehaviorSubject(''); @@ -82,5 +82,4 @@ export class LibraryStatusColumnComponent implements OnInit { } } } - } diff --git a/lib/content-services/src/lib/document-list/components/name-column/name-column.component.ts b/lib/content-services/src/lib/document-list/components/name-column/name-column.component.ts index 665a43d833b..6488c709bf6 100644 --- a/lib/content-services/src/lib/document-list/components/name-column/name-column.component.ts +++ b/lib/content-services/src/lib/document-list/components/name-column/name-column.component.ts @@ -15,16 +15,7 @@ * limitations under the License. */ -import { - ChangeDetectionStrategy, - Component, - DestroyRef, - ElementRef, - inject, - Input, - OnInit, - ViewEncapsulation -} from '@angular/core'; +import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, inject, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { NodeEntry } from '@alfresco/js-api'; import { BehaviorSubject } from 'rxjs'; import { NodesApiService } from '../../../common/services/nodes-api.service'; @@ -62,7 +53,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; host: { class: 'adf-datatable-content-cell adf-datatable-link adf-name-column' } }) export class NameColumnComponent implements OnInit { - @Input() + @Input({ required: true }) context: any; @Input() @@ -110,5 +101,4 @@ export class NameColumnComponent implements OnInit { }) ); } - } diff --git a/lib/content-services/src/lib/document-list/components/trashcan-name-column/trashcan-name-column.component.ts b/lib/content-services/src/lib/document-list/components/trashcan-name-column/trashcan-name-column.component.ts index 0a32fe2e773..a9e04e2a5c7 100644 --- a/lib/content-services/src/lib/document-list/components/trashcan-name-column/trashcan-name-column.component.ts +++ b/lib/content-services/src/lib/document-list/components/trashcan-name-column/trashcan-name-column.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ChangeDetectionStrategy, ViewEncapsulation, OnInit, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { NodeEntry } from '@alfresco/js-api'; import { ShareDataRow } from '../../data/share-data-row.model'; import { CommonModule } from '@angular/common'; @@ -38,7 +38,7 @@ import { NodeNameTooltipPipe } from '../../../pipes/node-name-tooltip.pipe'; host: { class: 'adf-datatable-content-cell adf-trashcan-name-column' } }) export class TrashcanNameColumnComponent implements OnInit { - @Input() + @Input({ required: true }) context: any; isLibrary = false; diff --git a/lib/content-services/src/lib/node-comments/node-comments.component.ts b/lib/content-services/src/lib/node-comments/node-comments.component.ts index 9fdad0be057..bd2274ed3ed 100644 --- a/lib/content-services/src/lib/node-comments/node-comments.component.ts +++ b/lib/content-services/src/lib/node-comments/node-comments.component.ts @@ -34,7 +34,7 @@ import { NodeCommentsService } from './services/node-comments.service'; }) export class NodeCommentsComponent { /** nodeId of the document that has comments */ - @Input() + @Input({ required: true }) nodeId: string; /** make the comments component readOnly */ diff --git a/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission.component.ts b/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission.component.ts index a8cc22d676c..c13ca3d4524 100644 --- a/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/add-permission/add-permission.component.ts @@ -39,7 +39,7 @@ import { TranslateModule } from '@ngx-translate/core'; */ export class AddPermissionComponent implements OnInit { /** ID of the target node. */ - @Input() + @Input({ required: true }) nodeId: string; /** Emitted when the node is updated successfully. */ diff --git a/lib/content-services/src/lib/permission-manager/components/permission-container/permission-container.component.ts b/lib/content-services/src/lib/permission-manager/components/permission-container/permission-container.component.ts index 7aac542a2f3..e555a1c973d 100644 --- a/lib/content-services/src/lib/permission-manager/components/permission-container/permission-container.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/permission-container/permission-container.component.ts @@ -60,7 +60,7 @@ import { UserRoleColumnComponent } from '../user-role-column/user-role-column.co encapsulation: ViewEncapsulation.None }) export class PermissionContainerComponent implements OnChanges { - @Input() + @Input({ required: true }) node: Node; @Input() diff --git a/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts b/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts index 0a949c59a6f..61818335e17 100644 --- a/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts +++ b/lib/content-services/src/lib/permission-manager/components/permission-list/permission-list.component.ts @@ -52,7 +52,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; }) export class PermissionListComponent implements OnInit { /** ID of the node whose permissions you want to show. */ - @Input() + @Input({ required: true }) nodeId: string; /** Emitted when the permission is updated. */ diff --git a/lib/content-services/src/lib/search/components/search-facet-field/search-facet-field.component.ts b/lib/content-services/src/lib/search/components/search-facet-field/search-facet-field.component.ts index 6c95ba696f5..f158f52f928 100644 --- a/lib/content-services/src/lib/search/components/search-facet-field/search-facet-field.component.ts +++ b/lib/content-services/src/lib/search/components/search-facet-field/search-facet-field.component.ts @@ -45,8 +45,8 @@ export class SearchFacetFieldComponent implements FacetWidget { private searchFacetFiltersService = inject(SearchFacetFiltersService); private translationService = inject(TranslationService); - @Input() - field!: FacetField; + @Input({ required: true }) + field: FacetField; displayValue$: Subject = new Subject(); diff --git a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.ts b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.ts index 17655eab825..9614121bcbd 100644 --- a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.ts +++ b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip-tabbed/search-facet-tabbed-content.component.ts @@ -41,7 +41,7 @@ export class SearchFacetTabbedContentComponent implements OnInit, OnChanges, Fac private translationService = inject(TranslationService); private searchFacetFiltersService = inject(SearchFacetFiltersService); - @Input() + @Input({ required: true }) tabbedFacet: TabbedFacetField; @Input() diff --git a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip/search-facet-chip.component.ts b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip/search-facet-chip.component.ts index 4ecd28fe812..41f46d7f0c2 100644 --- a/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip/search-facet-chip.component.ts +++ b/lib/content-services/src/lib/search/components/search-filter-chips/search-facet-chip/search-facet-chip.component.ts @@ -45,7 +45,7 @@ import { MatButtonModule } from '@angular/material/button'; encapsulation: ViewEncapsulation.None }) export class SearchFacetChipComponent { - @Input() + @Input({ required: true }) field: FacetField; @ViewChild('menuContainer', { static: false }) diff --git a/lib/content-services/src/lib/search/components/search-filter-chips/search-widget-chip/search-widget-chip.component.ts b/lib/content-services/src/lib/search/components/search-filter-chips/search-widget-chip/search-widget-chip.component.ts index e049b300100..08a50e51792 100644 --- a/lib/content-services/src/lib/search/components/search-filter-chips/search-widget-chip/search-widget-chip.component.ts +++ b/lib/content-services/src/lib/search/components/search-filter-chips/search-widget-chip/search-widget-chip.component.ts @@ -52,7 +52,7 @@ import { first } from 'rxjs/operators'; encapsulation: ViewEncapsulation.None }) export class SearchWidgetChipComponent implements AfterViewInit { - @Input() + @Input({ required: true }) category: SearchCategory; @ViewChild('menuContainer', { static: false }) diff --git a/lib/content-services/src/lib/search/components/search-filter-container/search-filter-container.component.ts b/lib/content-services/src/lib/search/components/search-filter-container/search-filter-container.component.ts index 223c373c869..479f42d911b 100644 --- a/lib/content-services/src/lib/search/components/search-filter-container/search-filter-container.component.ts +++ b/lib/content-services/src/lib/search/components/search-filter-container/search-filter-container.component.ts @@ -15,16 +15,7 @@ * limitations under the License. */ -import { - Component, - ElementRef, - EventEmitter, - Input, - OnInit, - Output, - ViewChild, - ViewEncapsulation -} from '@angular/core'; +import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core'; import { ConfigurableFocusTrap, ConfigurableFocusTrapFactory } from '@angular/cdk/a11y'; import { DataColumn, IconComponent, TranslationService } from '@alfresco/adf-core'; import { SearchWidgetContainerComponent } from '../search-widget-container/search-widget-container.component'; @@ -57,7 +48,7 @@ import { MatDialogModule } from '@angular/material/dialog'; }) export class SearchFilterContainerComponent implements OnInit { /** The column the filter will be applied on. */ - @Input() + @Input({ required: true }) col: DataColumn; /** The column the filter will be applied on. */ diff --git a/lib/content-services/src/lib/search/components/search-filter/search-filter-card/search-filter-card.component.ts b/lib/content-services/src/lib/search/components/search-filter/search-filter-card/search-filter-card.component.ts index 36c6526a434..c13c82534b0 100644 --- a/lib/content-services/src/lib/search/components/search-filter/search-filter-card/search-filter-card.component.ts +++ b/lib/content-services/src/lib/search/components/search-filter/search-filter-card/search-filter-card.component.ts @@ -30,7 +30,7 @@ import { MatButtonModule } from '@angular/material/button'; encapsulation: ViewEncapsulation.None }) export class SearchFilterCardComponent { - @Input() + @Input({ required: true }) category: SearchCategory; @ViewChild(SearchWidgetContainerComponent, { static: false }) diff --git a/lib/content-services/src/lib/tag/tag-actions/tag-actions.component.ts b/lib/content-services/src/lib/tag/tag-actions/tag-actions.component.ts index 3da853279a4..91cbe1fc8ee 100644 --- a/lib/content-services/src/lib/tag/tag-actions/tag-actions.component.ts +++ b/lib/content-services/src/lib/tag/tag-actions/tag-actions.component.ts @@ -16,17 +16,7 @@ */ import { TranslationService } from '@alfresco/adf-core'; -import { - Component, - DestroyRef, - EventEmitter, - inject, - Input, - OnChanges, - OnInit, - Output, - ViewEncapsulation -} from '@angular/core'; +import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, ViewEncapsulation } from '@angular/core'; import { TagService } from '../services/tag.service'; import { TagPaging } from '@alfresco/js-api'; import { CommonModule } from '@angular/common'; @@ -55,7 +45,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; }) export class TagActionsComponent implements OnChanges, OnInit { /** The identifier of a node. */ - @Input() + @Input({ required: true }) nodeId: string; /** Emitted when a tag is added successfully. */ diff --git a/lib/content-services/src/lib/tag/tag-node-list/tag-node-list.component.ts b/lib/content-services/src/lib/tag/tag-node-list/tag-node-list.component.ts index 54e3fba6a3f..96cafd822dc 100644 --- a/lib/content-services/src/lib/tag/tag-node-list/tag-node-list.component.ts +++ b/lib/content-services/src/lib/tag/tag-node-list/tag-node-list.component.ts @@ -35,7 +35,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; }) export class TagNodeListComponent implements OnChanges, OnInit { /** The identifier of a node. */ - @Input() + @Input({ required: true }) nodeId: string; /** Show delete button */ diff --git a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts index 63b0b8180c5..507e5f7607d 100644 --- a/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts +++ b/lib/content-services/src/lib/tag/tags-creator/tags-creator.component.ts @@ -88,7 +88,7 @@ export class TagsCreatorComponent implements OnInit, OnDestroy { * In Create mode we can't select existing tags, we can only create them. * In Create and Assign mode we can both - create tags and select existing tags. */ - @Input() + @Input({ required: true }) mode: TagsCreatorMode; /** diff --git a/lib/content-services/src/lib/tree-view/components/tree-view.component.ts b/lib/content-services/src/lib/tree-view/components/tree-view.component.ts index 7214b91745f..e5d830b8546 100644 --- a/lib/content-services/src/lib/tree-view/components/tree-view.component.ts +++ b/lib/content-services/src/lib/tree-view/components/tree-view.component.ts @@ -16,7 +16,7 @@ */ import { FlatTreeControl } from '@angular/cdk/tree'; -import { Component, Input, OnChanges, SimpleChanges, Output, EventEmitter } from '@angular/core'; +import { Component, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; import { TreeBaseNode } from '../models/tree-view.model'; import { TreeViewDataSource } from '../data/tree-view-datasource'; import { TreeViewService } from '../services/tree-view.service'; @@ -36,7 +36,7 @@ import { TranslateModule } from '@ngx-translate/core'; }) export class TreeViewComponent implements OnChanges { /** Identifier of the node to display. */ - @Input() + @Input({ required: true }) nodeId: string; /** Emitted when a node in the tree view is clicked. */ diff --git a/lib/content-services/src/lib/version-manager/version-comparison.component.ts b/lib/content-services/src/lib/version-manager/version-comparison.component.ts index 059474ec37d..91e5f979f56 100644 --- a/lib/content-services/src/lib/version-manager/version-comparison.component.ts +++ b/lib/content-services/src/lib/version-manager/version-comparison.component.ts @@ -31,11 +31,11 @@ import { TranslateModule } from '@ngx-translate/core'; }) export class VersionComparisonComponent { /** Target node. */ - @Input() + @Input({ required: true }) node: Node; /** New file for updating current version. */ - @Input() + @Input({ required: true }) newFileVersion: File; constructor(public thumbnailService: ThumbnailService) {} diff --git a/lib/content-services/src/lib/version-manager/version-manager.component.ts b/lib/content-services/src/lib/version-manager/version-manager.component.ts index e9393581cac..a3d44a91676 100644 --- a/lib/content-services/src/lib/version-manager/version-manager.component.ts +++ b/lib/content-services/src/lib/version-manager/version-manager.component.ts @@ -15,10 +15,10 @@ * limitations under the License. */ -import { Component, Input, ViewEncapsulation, ViewChild, Output, EventEmitter, OnInit } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output, ViewChild, ViewEncapsulation } from '@angular/core'; import { Node } from '@alfresco/js-api'; import { VersionListComponent } from './version-list.component'; -import { trigger, state, style, animate, transition } from '@angular/animations'; +import { animate, state, style, transition, trigger } from '@angular/animations'; import { ContentService } from '../common/services/content.service'; import { NodesApiService } from '../common/services/nodes-api.service'; import { FileUploadErrorEvent } from '../common/events/file.event'; @@ -46,7 +46,7 @@ import { TranslateModule } from '@ngx-translate/core'; }) export class VersionManagerComponent implements OnInit { /** Target node to manage version history. */ - @Input() + @Input({ required: true }) node: Node; /** New file for updating current version. */ diff --git a/lib/content-services/src/lib/version-manager/version-upload.component.ts b/lib/content-services/src/lib/version-manager/version-upload.component.ts index 4d5da1dd399..3e7cedb299d 100644 --- a/lib/content-services/src/lib/version-manager/version-upload.component.ts +++ b/lib/content-services/src/lib/version-manager/version-upload.component.ts @@ -57,7 +57,7 @@ export class VersionUploadComponent implements OnInit { minorVersion = '1.1'; /** The target node. */ - @Input() + @Input({ required: true }) node: Node; /** New file for updating current version. */ diff --git a/lib/process-services-cloud/src/lib/app/components/app-details-cloud/app-details-cloud.component.ts b/lib/process-services-cloud/src/lib/app/components/app-details-cloud/app-details-cloud.component.ts index 70f50642e80..80d71ac0b9e 100644 --- a/lib/process-services-cloud/src/lib/app/components/app-details-cloud/app-details-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/app/components/app-details-cloud/app-details-cloud.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, Input, Output, EventEmitter, ViewEncapsulation } from '@angular/core'; +import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; import { ApplicationInstanceModel, DEFAULT_APP_INSTANCE_ICON, DEFAULT_APP_INSTANCE_THEME } from '../../models/application-instance.model'; import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; @@ -31,7 +31,7 @@ import { MatCardModule } from '@angular/material/card'; encapsulation: ViewEncapsulation.None }) export class AppDetailsCloudComponent { - @Input() + @Input({ required: true }) applicationInstance: ApplicationInstanceModel; @Output() diff --git a/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.ts b/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.ts index 768280ec7da..bd77f6efbd6 100644 --- a/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/process/process-header/components/process-header-cloud.component.ts @@ -42,11 +42,11 @@ import { NgIf } from '@angular/common'; }) export class ProcessHeaderCloudComponent implements OnChanges, OnInit { /** (Required) The name of the application. */ - @Input() + @Input({ required: true }) appName: string = ''; /** (Required) The id of the process instance. */ - @Input() + @Input({ required: true }) processInstanceId: string; /** Gets emitted each time a new process instance details are loaded. */ diff --git a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts index b957e1cf1cc..1987995e97b 100644 --- a/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/task/task-header/components/task-header-cloud.component.ts @@ -50,11 +50,11 @@ import { MatCardModule } from '@angular/material/card'; }) export class TaskHeaderCloudComponent implements OnInit, OnChanges { /** (Required) The name of the application. */ - @Input() + @Input({ required: true }) appName: string = ''; /** (Required) The id of the task. */ - @Input() + @Input({ required: true }) taskId: string; /** Show/Hide the task title */ diff --git a/lib/process-services/src/lib/attachment/create-process-attachment/create-process-attachment.component.ts b/lib/process-services/src/lib/attachment/create-process-attachment/create-process-attachment.component.ts index 16a761379d1..70f4b74f316 100644 --- a/lib/process-services/src/lib/attachment/create-process-attachment/create-process-attachment.component.ts +++ b/lib/process-services/src/lib/attachment/create-process-attachment/create-process-attachment.component.ts @@ -34,7 +34,7 @@ export class CreateProcessAttachmentComponent implements OnChanges { private processContentService = inject(ProcessContentService); /** (required) The ID of the process instance to display. */ - @Input() + @Input({ required: true }) processInstanceId: string; /** diff --git a/lib/process-services/src/lib/attachment/create-task-attachment/create-task-attachment.component.ts b/lib/process-services/src/lib/attachment/create-task-attachment/create-task-attachment.component.ts index 9fc8a9b3193..c038f92eadf 100644 --- a/lib/process-services/src/lib/attachment/create-task-attachment/create-task-attachment.component.ts +++ b/lib/process-services/src/lib/attachment/create-task-attachment/create-task-attachment.component.ts @@ -34,7 +34,7 @@ export class AttachmentComponent implements OnChanges { private processContentService = inject(ProcessContentService); /** (required) The numeric ID of the task to display. */ - @Input() + @Input({ required: true }) taskId: string; /** diff --git a/lib/process-services/src/lib/attachment/process-attachment-list/process-attachment-list.component.ts b/lib/process-services/src/lib/attachment/process-attachment-list/process-attachment-list.component.ts index 6567480a7ae..f61f4945cec 100644 --- a/lib/process-services/src/lib/attachment/process-attachment-list/process-attachment-list.component.ts +++ b/lib/process-services/src/lib/attachment/process-attachment-list/process-attachment-list.component.ts @@ -27,8 +27,8 @@ import { } from '@alfresco/adf-core'; import { AfterContentInit, - ContentChild, Component, + ContentChild, EventEmitter, Input, NgZone, @@ -65,7 +65,7 @@ export class ProcessAttachmentListComponent implements OnChanges, AfterContentIn emptyTemplate: EmptyListComponent; /** (**required**) The ID of the process instance to display. */ - @Input() + @Input({ required: true }) processInstanceId: string; /** Disable/Enable read-only mode for attachment list. */ diff --git a/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.ts b/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.ts index 9f06815456c..57fc5940f35 100644 --- a/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.ts +++ b/lib/process-services/src/lib/attachment/task-attachment-list/task-attachment-list.component.ts @@ -16,20 +16,20 @@ */ import { - ThumbnailService, - EmptyListComponent, - DownloadService, + DataColumnComponent, + DataColumnListComponent, DataTableComponent, + DownloadService, + EmptyListComponent, EmptyListHeaderDirective, - DataColumnListComponent, - DataColumnComponent, LoadingContentTemplateDirective, - NoContentTemplateDirective + NoContentTemplateDirective, + ThumbnailService } from '@alfresco/adf-core'; import { AfterContentInit, - ContentChild, Component, + ContentChild, EventEmitter, Input, NgZone, @@ -68,7 +68,7 @@ export class TaskAttachmentListComponent implements OnChanges, AfterContentInit emptyTemplate: EmptyListComponent; /** (**required**) The ID of the task to display. */ - @Input() + @Input({ required: true }) taskId: string; /** Disable/Enable read only mode for attachment list. */ diff --git a/lib/process-services/src/lib/people/components/people-search/people-search.component.ts b/lib/process-services/src/lib/people/components/people-search/people-search.component.ts index fda65311019..bdbce2afb30 100644 --- a/lib/process-services/src/lib/people/components/people-search/people-search.component.ts +++ b/lib/process-services/src/lib/people/components/people-search/people-search.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, EventEmitter, OnInit, Input, Output, ViewEncapsulation } from '@angular/core'; +import { Component, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core'; import { Observable } from 'rxjs'; import { PerformSearchCallback } from '../../interfaces/perform-search-callback.interface'; import { map } from 'rxjs/operators'; @@ -44,7 +44,7 @@ export class PeopleSearchComponent implements OnInit { actionLabel?: string; /** Parameters for displaying the list. */ - @Input() + @Input({ required: true }) results: Observable; /** Emitted when a search is performed with a new keyword. */ diff --git a/lib/process-services/src/lib/process-comments/process-comments.component.ts b/lib/process-services/src/lib/process-comments/process-comments.component.ts index 68daa60ffa3..27be2f85cfb 100644 --- a/lib/process-services/src/lib/process-comments/process-comments.component.ts +++ b/lib/process-services/src/lib/process-comments/process-comments.component.ts @@ -19,6 +19,7 @@ import { ADF_COMMENTS_SERVICE, CommentsComponent } from '@alfresco/adf-core'; import { CommentProcessService } from './services/comment-process.service'; import { Component, Input, ViewEncapsulation } from '@angular/core'; import { CommonModule } from '@angular/common'; + @Component({ selector: 'adf-process-instance-comments', standalone: true, @@ -35,7 +36,7 @@ import { CommonModule } from '@angular/common'; }) export class ProcessCommentsComponent { /** (**required**) The numeric ID of the process instance to display comments for. */ - @Input() + @Input({ required: true }) processInstanceId: string; /** Should the comments be read-only? */ diff --git a/lib/process-services/src/lib/process-list/components/process-instance-details/process-instance-details.component.ts b/lib/process-services/src/lib/process-list/components/process-instance-details/process-instance-details.component.ts index ac6a681abaa..9f61fee8907 100644 --- a/lib/process-services/src/lib/process-list/components/process-instance-details/process-instance-details.component.ts +++ b/lib/process-services/src/lib/process-list/components/process-instance-details/process-instance-details.component.ts @@ -44,7 +44,7 @@ import { ProcessCommentsComponent } from '../../../process-comments'; }) export class ProcessInstanceDetailsComponent implements OnChanges { /** (required) The numeric ID of the process instance to display. */ - @Input() + @Input({ required: true }) processInstanceId: string; @ViewChild('processInstanceHeader') diff --git a/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.ts b/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.ts index 7d58787c57d..9ac67338758 100644 --- a/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.ts +++ b/lib/process-services/src/lib/process-list/components/process-instance-header/process-instance-header.component.ts @@ -17,12 +17,12 @@ import { AppConfigService, + CardViewBaseItemModel, + CardViewComponent, CardViewDateItemModel, CardViewItem, - CardViewBaseItemModel, CardViewTextItemModel, - TranslationService, - CardViewComponent + TranslationService } from '@alfresco/adf-core'; import { Component, Input, OnChanges } from '@angular/core'; import { ProcessInstanceRepresentation } from '@alfresco/js-api'; @@ -38,7 +38,7 @@ import { MatCardModule } from '@angular/material/card'; }) export class ProcessInstanceHeaderComponent implements OnChanges { /** (**required**) Full details of the process instance to display information about. */ - @Input() + @Input({ required: true }) processInstance: ProcessInstanceRepresentation; properties: CardViewItem[]; diff --git a/lib/process-services/src/lib/process-list/components/process-instance-tasks/process-instance-tasks.component.ts b/lib/process-services/src/lib/process-list/components/process-instance-tasks/process-instance-tasks.component.ts index 6dcea875cb7..4dc5a29b18e 100644 --- a/lib/process-services/src/lib/process-list/components/process-instance-tasks/process-instance-tasks.component.ts +++ b/lib/process-services/src/lib/process-list/components/process-instance-tasks/process-instance-tasks.component.ts @@ -40,7 +40,7 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; }) export class ProcessInstanceTasksComponent implements OnInit, OnChanges { /** The ID of the process instance to display tasks for. */ - @Input() + @Input({ required: true }) processInstanceDetails: ProcessInstanceRepresentation; /** diff --git a/lib/process-services/src/lib/task-list/components/attach-form/attach-form.component.ts b/lib/process-services/src/lib/task-list/components/attach-form/attach-form.component.ts index b762d98b7e9..3f92691e972 100644 --- a/lib/process-services/src/lib/task-list/components/attach-form/attach-form.component.ts +++ b/lib/process-services/src/lib/task-list/components/attach-form/attach-form.component.ts @@ -38,7 +38,7 @@ import { FormComponent } from '../../../form'; }) export class AttachFormComponent implements OnInit, OnChanges { /** Id of the task. */ - @Input() + @Input({ required: true }) taskId: any; /** Identifier of the form to attach. */ diff --git a/lib/process-services/src/lib/task-list/components/start-task/start-task.component.ts b/lib/process-services/src/lib/task-list/components/start-task/start-task.component.ts index bce075898ea..855ed124b51 100644 --- a/lib/process-services/src/lib/task-list/components/start-task/start-task.component.ts +++ b/lib/process-services/src/lib/task-list/components/start-task/start-task.component.ts @@ -22,14 +22,7 @@ import { EMPTY, Observable } from 'rxjs'; import { Form } from '../../models/form.model'; import { TaskListService } from '../../services/tasklist.service'; import { defaultIfEmpty, switchMap } from 'rxjs/operators'; -import { - AbstractControl, - ReactiveFormsModule, - UntypedFormBuilder, - UntypedFormControl, - UntypedFormGroup, - Validators -} from '@angular/forms'; +import { AbstractControl, ReactiveFormsModule, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms'; import { isValid } from 'date-fns'; import { TaskRepresentation } from '@alfresco/js-api'; import { CommonModule } from '@angular/common'; @@ -73,7 +66,7 @@ const MAX_LENGTH = 255; }) export class StartTaskComponent implements OnInit { /** (required) The id of the app. */ - @Input() + @Input({ required: true }) appId: number; /** Default Task Name. */ diff --git a/lib/process-services/src/lib/task-list/components/task-details/task-details.component.ts b/lib/process-services/src/lib/task-list/components/task-details/task-details.component.ts index 1e60c5070b7..73219ad8092 100644 --- a/lib/process-services/src/lib/task-list/components/task-details/task-details.component.ts +++ b/lib/process-services/src/lib/task-list/components/task-details/task-details.component.ts @@ -96,7 +96,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges { taskFormComponent: TaskFormComponent; /** (**required**) The id of the task whose details we are asking for. */ - @Input() + @Input({ required: true }) taskId: string; /** Automatically renders the next task when the current one is completed. */ diff --git a/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts b/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts index 000e241ff05..cee504180f7 100644 --- a/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts +++ b/lib/process-services/src/lib/task-list/components/task-form/task-form.component.ts @@ -15,15 +15,15 @@ * limitations under the License. */ -import { Component, OnInit, Input, Output, EventEmitter, SimpleChanges, ViewEncapsulation, OnChanges, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation } from '@angular/core'; import { - FormModel, ContentLinkModel, + EmptyContentComponent, + FormFieldModel, FormFieldValidator, + FormModel, FormOutcomeEvent, - TranslationService, - FormFieldModel, - EmptyContentComponent + TranslationService } from '@alfresco/adf-core'; import { TaskListService } from '../../services/tasklist.service'; import { TaskRepresentation, UserRepresentation } from '@alfresco/js-api'; @@ -61,7 +61,7 @@ import { FormComponent, FormCustomOutcomesComponent } from '../../../form'; }) export class TaskFormComponent implements OnInit, OnChanges { /** (**required**) The id of the task whose details we are asking for. */ - @Input() + @Input({ required: true }) taskId: string; /** Toggles rendering of the form title. */ diff --git a/lib/process-services/src/lib/task-list/components/task-header/task-header.component.ts b/lib/process-services/src/lib/task-list/components/task-header/task-header.component.ts index b021f4c1f28..671d9c0cd73 100644 --- a/lib/process-services/src/lib/task-list/components/task-header/task-header.component.ts +++ b/lib/process-services/src/lib/task-list/components/task-header/task-header.component.ts @@ -15,20 +15,20 @@ * limitations under the License. */ -import { Component, EventEmitter, DestroyRef, Input, OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation, inject } from '@angular/core'; +import { Component, DestroyRef, EventEmitter, inject, Input, OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation } from '@angular/core'; import { - CardViewDateItemModel, - CardViewMapItemModel, - CardViewTextItemModel, - CardViewBaseItemModel, - TranslationService, AppConfigService, + CardViewBaseItemModel, + CardViewComponent, + CardViewDateItemModel, CardViewIntItemModel, CardViewItemLengthValidator, - CardViewComponent, - CardViewUpdateService, + CardViewMapItemModel, CardViewSelectItemModel, - CardViewSelectItemOption + CardViewSelectItemOption, + CardViewTextItemModel, + CardViewUpdateService, + TranslationService } from '@alfresco/adf-core'; import { PeopleProcessService } from '../../../services/people-process.service'; import { TaskDescriptionValidator } from '../../validators/task-description.validator'; @@ -57,7 +57,7 @@ export class TaskHeaderComponent implements OnChanges, OnInit { formName: string = null; /** (required) Details related to the task. */ - @Input() + @Input({ required: true }) taskDetails: TaskRepresentation; /** Toggles display of the claim/release button. */ From 4e647871589e17ecd8e97b211712ebf5d84b60bb Mon Sep 17 00:00:00 2001 From: DominikIwanek Date: Thu, 16 Jan 2025 12:07:28 +0100 Subject: [PATCH 2/4] Review and apply required inputs where possible --- .../about-extension-list/about-extension-list.component.ts | 4 ++-- .../about-license-list/about-license-list.component.ts | 4 ++-- .../lib/about/about-module-list/module-list.component.ts | 4 ++-- .../src/lib/about/about-package/package-list.component.ts | 4 ++-- .../about/about-status-list/about-status-list.component.ts | 4 ++-- .../card-view/components/card-view/card-view.component.ts | 2 +- .../src/lib/comments/comment-list/comment-list.component.ts | 4 ++-- .../columns-selector/columns-selector.component.ts | 2 +- .../components/datatable-cell/datatable-cell.component.ts | 6 +++--- .../components/datatable-row/datatable-row.component.ts | 4 ++-- .../src/lib/datatable/data-column/data-column.component.ts | 2 +- .../lib/dynamic-chip-list/dynamic-chip-list.component.ts | 2 +- lib/core/src/lib/form/components/form-renderer.component.ts | 2 +- .../inplace-form-input/inplace-form-input.component.ts | 2 +- .../pdf-viewer-thumbnails.component.ts | 2 +- 15 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/core/src/lib/about/about-extension-list/about-extension-list.component.ts b/lib/core/src/lib/about/about-extension-list/about-extension-list.component.ts index 2ec2936acaa..4a2c2374544 100644 --- a/lib/core/src/lib/about/about-extension-list/about-extension-list.component.ts +++ b/lib/core/src/lib/about/about-extension-list/about-extension-list.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; import { ExtensionRef } from '@alfresco/adf-extensions'; import { CommonModule } from '@angular/common'; import { MatTableModule } from '@angular/material/table'; @@ -45,6 +45,6 @@ export class AboutExtensionListComponent { displayedColumns = this.columns.map((x) => x.columnDef); - @Input() + @Input({ required: true }) data: Array = []; } diff --git a/lib/core/src/lib/about/about-license-list/about-license-list.component.ts b/lib/core/src/lib/about/about-license-list/about-license-list.component.ts index 1a387c3b226..0f196103e79 100644 --- a/lib/core/src/lib/about/about-license-list/about-license-list.component.ts +++ b/lib/core/src/lib/about/about-license-list/about-license-list.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; import { LicenseData } from '../interfaces'; import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; @@ -46,6 +46,6 @@ export class AboutLicenseListComponent { displayedColumns = this.columns.map((x) => x.columnDef); - @Input() + @Input({ required: true }) data: LicenseData[] = []; } diff --git a/lib/core/src/lib/about/about-module-list/module-list.component.ts b/lib/core/src/lib/about/about-module-list/module-list.component.ts index 4a5efc0fa5d..eef5388d1e9 100644 --- a/lib/core/src/lib/about/about-module-list/module-list.component.ts +++ b/lib/core/src/lib/about/about-module-list/module-list.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; import { MatTableModule } from '@angular/material/table'; @@ -49,6 +49,6 @@ export class ModuleListComponent { displayedColumns = this.columns.map((x) => x.columnDef); - @Input() + @Input({ required: true }) data: Array = []; } diff --git a/lib/core/src/lib/about/about-package/package-list.component.ts b/lib/core/src/lib/about/about-package/package-list.component.ts index 42f2dfab875..f569e1f55c4 100644 --- a/lib/core/src/lib/about/about-package/package-list.component.ts +++ b/lib/core/src/lib/about/about-package/package-list.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ChangeDetectionStrategy, Input, OnInit } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { PackageInfo } from '../interfaces'; import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; @@ -48,7 +48,7 @@ export class PackageListComponent implements OnInit { displayedColumns = this.columns.map((x) => x.columnDef); - @Input() + @Input({ required: true }) data: Array = []; ngOnInit() { diff --git a/lib/core/src/lib/about/about-status-list/about-status-list.component.ts b/lib/core/src/lib/about/about-status-list/about-status-list.component.ts index 8b075b7fbcb..5a2c98fff36 100644 --- a/lib/core/src/lib/about/about-status-list/about-status-list.component.ts +++ b/lib/core/src/lib/about/about-status-list/about-status-list.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ViewEncapsulation, ChangeDetectionStrategy, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@angular/core'; import { StatusData } from '../interfaces'; import { CommonModule } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; @@ -45,6 +45,6 @@ export class AboutStatusListComponent { displayedColumns = this.columns.map((x) => x.columnDef); - @Input() + @Input({ required: true }) data: StatusData[] = []; } diff --git a/lib/core/src/lib/card-view/components/card-view/card-view.component.ts b/lib/core/src/lib/card-view/components/card-view/card-view.component.ts index b01baa39d2f..c572fc7cd04 100644 --- a/lib/core/src/lib/card-view/components/card-view/card-view.component.ts +++ b/lib/core/src/lib/card-view/components/card-view/card-view.component.ts @@ -31,7 +31,7 @@ import { CardViewItemDispatcherComponent } from '../card-view-item-dispatcher/ca }) export class CardViewComponent { /** (**required**) Items to show in the card view. */ - @Input() + @Input({ required: true }) properties: CardViewItem[]; /** Toggles whether or not the items can be edited. */ diff --git a/lib/core/src/lib/comments/comment-list/comment-list.component.ts b/lib/core/src/lib/comments/comment-list/comment-list.component.ts index 7b9a09429f8..83e22d882bd 100644 --- a/lib/core/src/lib/comments/comment-list/comment-list.component.ts +++ b/lib/core/src/lib/comments/comment-list/comment-list.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, EventEmitter, Input, Output, ViewEncapsulation, inject } from '@angular/core'; +import { Component, EventEmitter, inject, Input, Output, ViewEncapsulation } from '@angular/core'; import { CommentModel } from '../../models/comment.model'; import { CommentsService } from '../interfaces/comments-service.interface'; import { ADF_COMMENTS_SERVICE } from '../interfaces/comments.token'; @@ -35,7 +35,7 @@ import { TranslateModule } from '@ngx-translate/core'; }) export class CommentListComponent { /** The comments data used to populate the list. */ - @Input() + @Input({ required: true }) comments: CommentModel[]; /** Emitted when the user clicks on one of the comment rows. */ diff --git a/lib/core/src/lib/datatable/components/columns-selector/columns-selector.component.ts b/lib/core/src/lib/datatable/components/columns-selector/columns-selector.component.ts index 49bc661e53b..2317f4f6fa6 100644 --- a/lib/core/src/lib/datatable/components/columns-selector/columns-selector.component.ts +++ b/lib/core/src/lib/datatable/components/columns-selector/columns-selector.component.ts @@ -50,7 +50,7 @@ export class ColumnsSelectorComponent implements OnInit { @Input() columns: DataColumn[] = []; - @Input() + @Input({ required: true }) mainMenuTrigger: MatMenuTrigger; @Input() diff --git a/lib/core/src/lib/datatable/components/datatable-cell/datatable-cell.component.ts b/lib/core/src/lib/datatable/components/datatable-cell/datatable-cell.component.ts index 2396bb777ed..68978e52813 100644 --- a/lib/core/src/lib/datatable/components/datatable-cell/datatable-cell.component.ts +++ b/lib/core/src/lib/datatable/components/datatable-cell/datatable-cell.component.ts @@ -54,15 +54,15 @@ import { TruncatePipe } from '../../../pipes/truncate.pipe'; }) export class DataTableCellComponent implements OnInit { /** Data table adapter instance. */ - @Input() + @Input({ required: true }) data: DataTableAdapter; /** Data that defines the column. */ - @Input() + @Input({ required: true }) column: DataColumn; /** Data that defines the row. */ - @Input() + @Input({ required: true }) row: DataRow; /** Enables/disables a Clipboard directive to allow copying of the cell's content. */ diff --git a/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts b/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts index 600025c7933..5cd5ed70f12 100644 --- a/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts +++ b/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts @@ -15,7 +15,7 @@ * limitations under the License. */ -import { Component, ViewEncapsulation, ElementRef, Input, HostBinding, HostListener, Output, EventEmitter } from '@angular/core'; +import { Component, ElementRef, EventEmitter, HostBinding, HostListener, Input, Output, ViewEncapsulation } from '@angular/core'; import { FocusableOption } from '@angular/cdk/a11y'; import { DataRow } from '../../data/data-row.model'; @@ -31,7 +31,7 @@ import { DataRow } from '../../data/data-row.model'; } }) export class DataTableRowComponent implements FocusableOption { - @Input() row: DataRow; + @Input({ required: true }) row: DataRow; @Input() disabled = false; diff --git a/lib/core/src/lib/datatable/data-column/data-column.component.ts b/lib/core/src/lib/datatable/data-column/data-column.component.ts index 39a7eb0a968..afd12d55194 100644 --- a/lib/core/src/lib/datatable/data-column/data-column.component.ts +++ b/lib/core/src/lib/datatable/data-column/data-column.component.ts @@ -35,7 +35,7 @@ export class DataColumnComponent implements OnInit { * Data source key. Can be either a column/property key like `title` * or a property path like `createdBy.name`. */ - @Input() + @Input({ required: true }) key: string; /** You can specify any custom data which can be used by any specific feature */ diff --git a/lib/core/src/lib/dynamic-chip-list/dynamic-chip-list.component.ts b/lib/core/src/lib/dynamic-chip-list/dynamic-chip-list.component.ts index 160fb68c917..30a1d0a5f09 100644 --- a/lib/core/src/lib/dynamic-chip-list/dynamic-chip-list.component.ts +++ b/lib/core/src/lib/dynamic-chip-list/dynamic-chip-list.component.ts @@ -58,7 +58,7 @@ export class DynamicChipListComponent implements OnChanges, OnInit, AfterViewIni pagination: Pagination; /** List of chips to display. */ - @Input() + @Input({ required: true }) chips: Chip[]; /** Show delete button. */ diff --git a/lib/core/src/lib/form/components/form-renderer.component.ts b/lib/core/src/lib/form/components/form-renderer.component.ts index 63c5146c84e..4b8525cc9b0 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.ts +++ b/lib/core/src/lib/form/components/form-renderer.component.ts @@ -68,7 +68,7 @@ export class FormRendererComponent implements OnInit, OnDestroy { @Input() showDebugButton: boolean = false; - @Input() + @Input({ required: true }) formDefinition: FormModel; @Input() diff --git a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts index 1c2cac9315d..c5cb7ebbc0b 100644 --- a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts +++ b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts @@ -30,6 +30,6 @@ import { MatInputModule } from '@angular/material/input'; encapsulation: ViewEncapsulation.None }) export class InplaceFormInputComponent { - @Input() + @Input({ required: true }) control: UntypedFormControl; } diff --git a/lib/core/src/lib/viewer/components/pdf-viewer-thumbnails/pdf-viewer-thumbnails.component.ts b/lib/core/src/lib/viewer/components/pdf-viewer-thumbnails/pdf-viewer-thumbnails.component.ts index eef96cb05ac..765a8b77181 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer-thumbnails/pdf-viewer-thumbnails.component.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer-thumbnails/pdf-viewer-thumbnails.component.ts @@ -48,7 +48,7 @@ import { PdfThumbComponent } from '../pdf-viewer-thumb/pdf-viewer-thumb.componen encapsulation: ViewEncapsulation.None }) export class PdfThumbListComponent implements OnInit, AfterViewInit, OnDestroy { - @Input() pdfViewer: any; + @Input({ required: true }) pdfViewer: any; @Output() close = new EventEmitter(); From 013401081b9d3e38b88d998ac6704acf98ddd820 Mon Sep 17 00:00:00 2001 From: DominikIwanek Date: Thu, 16 Jan 2025 12:13:39 +0100 Subject: [PATCH 3/4] Review and apply required inputs where possible --- .../components/datatable-row/datatable-row.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts b/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts index 5cd5ed70f12..580ada61d5a 100644 --- a/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts +++ b/lib/core/src/lib/datatable/components/datatable-row/datatable-row.component.ts @@ -31,7 +31,7 @@ import { DataRow } from '../../data/data-row.model'; } }) export class DataTableRowComponent implements FocusableOption { - @Input({ required: true }) row: DataRow; + @Input() row: DataRow; @Input() disabled = false; From 6d03616548cd2a6ea7942ae5a524d0dad491a214 Mon Sep 17 00:00:00 2001 From: DominikIwanek Date: Thu, 16 Jan 2025 12:23:08 +0100 Subject: [PATCH 4/4] Review and apply required inputs where possible --- lib/core/src/lib/about/about-package/package-list.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/src/lib/about/about-package/package-list.component.ts b/lib/core/src/lib/about/about-package/package-list.component.ts index f569e1f55c4..24bac688376 100644 --- a/lib/core/src/lib/about/about-package/package-list.component.ts +++ b/lib/core/src/lib/about/about-package/package-list.component.ts @@ -48,7 +48,7 @@ export class PackageListComponent implements OnInit { displayedColumns = this.columns.map((x) => x.columnDef); - @Input({ required: true }) + @Input() data: Array = []; ngOnInit() {