[ACS-8960] Review and apply required inputs where possible (#10554)

This commit is contained in:
dominikiwanekhyland
2025-01-17 13:15:25 +01:00
committed by GitHub
parent 0bc422735e
commit ada55aebc1
61 changed files with 121 additions and 197 deletions

View File

@@ -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<ExtensionRef> = [];
}

View File

@@ -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[] = [];
}

View File

@@ -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<ModuleInfo> = [];
}

View File

@@ -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';

View File

@@ -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[] = [];
}

View File

@@ -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. */

View File

@@ -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. */

View File

@@ -50,7 +50,7 @@ export class ColumnsSelectorComponent implements OnInit {
@Input()
columns: DataColumn[] = [];
@Input()
@Input({ required: true })
mainMenuTrigger: MatMenuTrigger;
@Input()

View File

@@ -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. */

View File

@@ -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';

View File

@@ -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 */

View File

@@ -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. */

View File

@@ -68,7 +68,7 @@ export class FormRendererComponent<T> implements OnInit, OnDestroy {
@Input()
showDebugButton: boolean = false;
@Input()
@Input({ required: true })
formDefinition: FormModel;
@Input()

View File

@@ -30,6 +30,6 @@ import { MatInputModule } from '@angular/material/input';
encapsulation: ViewEncapsulation.None
})
export class InplaceFormInputComponent {
@Input()
@Input({ required: true })
control: UntypedFormControl;
}

View File

@@ -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<void>();