mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-8960] Review and apply required inputs where possible (#10554)
This commit is contained in:
committed by
GitHub
parent
0bc422735e
commit
ada55aebc1
@@ -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. */
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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 */
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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<FilterSearch[]> = new EventEmitter();
|
||||
|
||||
isFilterServiceActive: boolean;
|
||||
|
||||
|
||||
private readonly destroyRef = inject(DestroyRef);
|
||||
|
||||
constructor(@Inject(ADF_DOCUMENT_PARENT_COMPONENT) private documentList: any, private searchFilterQueryBuilder: SearchHeaderQueryBuilderService) {
|
||||
|
@@ -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<string>('');
|
||||
@@ -129,5 +120,4 @@ export class LibraryNameColumnComponent implements OnInit {
|
||||
|
||||
return isDuplicate ? `${title} (${id})` : `${title}`;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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<string>('');
|
||||
|
@@ -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<string>('');
|
||||
@@ -82,5 +82,4 @@ export class LibraryStatusColumnComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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 {
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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 */
|
||||
|
@@ -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. */
|
||||
|
@@ -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()
|
||||
|
@@ -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. */
|
||||
|
@@ -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<string> = new Subject<string>();
|
||||
|
||||
|
@@ -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()
|
||||
|
@@ -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 })
|
||||
|
@@ -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 })
|
||||
|
@@ -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. */
|
||||
|
@@ -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 })
|
||||
|
@@ -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. */
|
||||
|
@@ -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 */
|
||||
|
@@ -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;
|
||||
|
||||
/**
|
||||
|
@@ -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. */
|
||||
|
@@ -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) {}
|
||||
|
@@ -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. */
|
||||
|
@@ -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. */
|
||||
|
Reference in New Issue
Block a user